Go to file
David Gibson 7c44c2f9cb dtc: Fix some lexical problems with references
The recent change to the lexer to only recognize property and node
names in the appropriate context removed a number of lexical warts in
our language that would have gotten ugly as we add expression support
and so forth.

But there's one nasty one remaining: references can contain a full
path, including the various problematic node name characters (',', '+'
and '-', for example).  This would cause trouble with expressions, and
it also causes trouble with the patch I'm working on to allow
expanding references to paths rather than phandles.  This patch
therefore reworks the lexer to mitigate these problems.

	- References to labels cause no problems.  These are now
recognized separately from references to full paths.  No syntax change
here.

	- References to full paths, including problematic characters
are allowed by "quoting" the path with braces
e.g. &{/pci@10000/somedevice@3,8000}.  The braces protect any internal
problematic characters from being confused with operators or whatever.

	- For compatibility with existing dts files, in v0 dts files
we allow bare references to paths as before &/foo/bar/whatever - but
*only* if the path contains no troublesome characters.  Specifically
only [a-zA-Z0-9_@/] are allowed.

This is an incompatible change to the dts-v1 format, but since AFAIK
no-one has yet switched to dts-v1 files, I think we can get away with
it.  Better to make the transition when people to convert to v1, and
get rid of the problematic old syntax.

Strictly speaking, it's also an incompatible change to the v0 format,
since some path references that were allowed before are no longer
allowed.  I suspect no-one has been using the no-longer-supported
forms (certainly none of the kernel dts files will cause trouble).
We might need to think about this harder, though.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-11-28 13:51:38 -06:00
Documentation dtc: Whitespace cleanup 2007-09-18 09:43:26 -05:00
libfdt Fix whitespace in libfdt/fdt.h 2007-11-28 09:44:27 -06:00
scripts Add DTC release version information. 2007-07-07 13:52:25 -05:00
tests dtc: Fix some lexical problems with references 2007-11-28 13:51:38 -06:00
.gitignore Merge libfdt into dtc. 2007-06-14 15:05:55 +10:00
GPL dtc: Remove redundant copy of the GPL 2007-06-25 21:43:11 -05:00
Makefile dtc: Add missing dependencies for tests 2007-11-13 07:33:01 -06:00
Makefile.dtc dtc: Move tree checking code to checks.c 2007-11-01 08:03:37 -05:00
TODO Update TODO 2005-10-19 16:29:52 +10:00
checks.c dtc: Merge refs and labels into single "markers" list (v2) 2007-11-26 16:00:19 -06:00
comment-test.dts Initial label support. Also switch to glr-parser mode and get rid of 2005-06-16 14:36:37 +10:00
data.c dtc: Merge refs and labels into single "markers" list (v2) 2007-11-26 16:00:19 -06:00
dtc-lexer.l dtc: Fix some lexical problems with references 2007-11-28 13:51:38 -06:00
dtc-parser.y dtc: Merge refs and labels into single "markers" list (v2) 2007-11-26 16:00:19 -06:00
dtc.c dtc: Flexible tree checking infrastructure (v2) 2007-11-26 16:00:08 -06:00
dtc.h dtc: Merge refs and labels into single "markers" list (v2) 2007-11-26 16:00:19 -06:00
flattree.c dtc: Merge refs and labels into single "markers" list (v2) 2007-11-26 16:00:19 -06:00
fstree.c dtc: Whitespace cleanup 2007-09-18 09:43:26 -05:00
ftdump.c dtc: Use libfdt/fdt.h instead of flat_dt.h 2007-09-27 08:21:18 -05:00
livetree.c dtc: Flexible tree checking infrastructure (v2) 2007-11-26 16:00:08 -06:00
srcpos.c DTC: Add support for a C-like #include "file" mechanism. 2007-03-26 08:36:07 -05:00
srcpos.h dtc: move declaration of yyerror 2007-07-07 10:07:27 -05:00
treesource.c dtc: Merge refs and labels into single "markers" list (v2) 2007-11-26 16:00:19 -06:00