platform_external_dtc/tests
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
..
base01.asm Add some initial test cases. 2007-02-15 11:02:44 -06:00
base01.cmd Add some initial test cases. 2007-02-15 11:02:44 -06:00
base01.dts Add some initial test cases. 2007-02-15 11:02:44 -06:00
base01.stderr Add some initial test cases. 2007-02-15 11:02:44 -06:00
del_node.c libfdt: Abolish _typed() variants, add _cell() variants 2007-11-20 09:00:37 -06:00
del_property.c libfdt: Abolish _typed() variants, add _cell() variants 2007-11-20 09:00:37 -06:00
dtbs_equal_ordered.c libfdt: Abolish fdt_offset_ptr_typed() 2007-11-20 09:01:29 -06:00
dtc-checkfails.sh dtc: Add testcases for tree checks 2007-11-20 09:03:51 -06:00
dtc.sh dtc: Add testcases for tree checks 2007-11-20 09:03:51 -06:00
dumptrees.c Merge libfdt into dtc. 2007-06-14 15:05:55 +10:00
dup-nodename.dts dtc: Add testcases for tree checks 2007-11-20 09:03:51 -06:00
dup-phandle.dts dtc: Add testcases for tree checks 2007-11-20 09:03:51 -06:00
dup-propname.dts dtc: Add testcases for tree checks 2007-11-20 09:03:51 -06:00
empty.dts Add missing file. 2005-07-04 13:51:09 +10:00
escapes.dts dtc: Improve -Odts output 2007-10-17 07:14:38 -05:00
find_property.c libfdt: Abolish _typed() variants, add _cell() variants 2007-11-20 09:00:37 -06:00
get_mem_rsv.c dtc: Restore missing code for testcases 2007-10-17 07:09:59 -05:00
get_name.c Appease the printf() format $Gods with a correct type. 2007-10-23 09:43:14 -05:00
get_path.c libfdt: Make unit address optional for finding nodes 2007-10-15 08:27:24 -05:00
get_phandle.c libfdt: Add phandle related functions 2007-11-13 07:40:06 -06:00
getprop.c libfdt: Abolish _typed() variants, add _cell() variants 2007-11-20 09:00:37 -06:00
label01.dts dtc: Make -Idts -Odts preserve property-internal labels 2007-11-08 09:02:49 -06:00
Makefile.tests dtc: Add valgrind support to testsuite 2007-11-26 15:57:58 -06:00
mangle-layout.c dtc: Remove leftover debugging printf() from mangle-layout 2007-10-30 07:46:19 -05:00
mangle-layout.supp dtc: Add valgrind support to testsuite 2007-11-26 15:57:58 -06:00
minusone-phandle.dts dtc: Add testcases for tree checks 2007-11-20 09:03:51 -06:00
move_and_save.c Merge libfdt into dtc. 2007-06-14 15:05:55 +10:00
node_check_compatible.c dtc: Restore missing code for testcases 2007-10-17 07:09:59 -05:00
node_offset_by_compatible.c libfdt: Add functions for handling the "compatible" property 2007-10-16 07:41:37 -05:00
node_offset_by_phandle.c libfdt: Add phandle related functions 2007-11-13 07:40:06 -06:00
node_offset_by_prop_value.c libfdt: Abolish _typed() variants, add _cell() variants 2007-11-20 09:00:37 -06:00
nonexist-label-ref.dts dtc: Flexible tree checking infrastructure (v2) 2007-11-26 16:00:08 -06:00
nonexist-node-ref.dts dtc: Fix some lexical problems with references 2007-11-28 13:51:38 -06:00
nop_node.c libfdt: Abolish _typed() variants, add _cell() variants 2007-11-20 09:00:37 -06:00
nop_property.c libfdt: Abolish _typed() variants, add _cell() variants 2007-11-20 09:00:37 -06:00
notfound.c libfdt: Make unit address optional for finding nodes 2007-10-15 08:27:24 -05:00
open_pack.c Merge libfdt into dtc. 2007-06-14 15:05:55 +10:00
open_pack.supp dtc: Add valgrind support to testsuite 2007-11-26 15:57:58 -06:00
parent_offset.c libfdt: Make unit address optional for finding nodes 2007-10-15 08:27:24 -05:00
path_offset.c libfdt: Abolish fdt_offset_ptr_typed() 2007-11-20 09:01:29 -06:00
references.c dtc: Add testcase for dtc references 2007-11-13 07:40:11 -06:00
references.dts dtc: Fix some lexical problems with references 2007-11-28 13:51:38 -06:00
references_dts0.dts dtc: Fix some lexical problems with references 2007-11-28 13:51:38 -06:00
root_node.c libfdt: Abolish fdt_offset_ptr_typed() 2007-11-20 09:01:29 -06:00
run_tests.sh dtc: Fix some lexical problems with references 2007-11-28 13:51:38 -06:00
rw_tree1.c libfdt: Abolish _typed() variants, add _cell() variants 2007-11-20 09:00:37 -06:00
setprop.c libfdt: Abolish _typed() variants, add _cell() variants 2007-11-20 09:00:37 -06:00
setprop_inplace.c libfdt: Abolish _typed() variants, add _cell() variants 2007-11-20 09:00:37 -06:00
string_escapes.c dtc: Improve -Odts output 2007-10-17 07:14:38 -05:00
subnode_offset.c libfdt: Abolish fdt_offset_ptr_typed() 2007-11-20 09:01:29 -06:00
supernode_atdepth_offset.c libfdt: Make unit address optional for finding nodes 2007-10-15 08:27:24 -05:00
sw_tree1.c libfdt: Abolish _typed() variants, add _cell() variants 2007-11-20 09:00:37 -06:00
test01.asm Add some initial test cases. 2007-02-15 11:02:44 -06:00
test01.dts Add some initial test cases. 2007-02-15 11:02:44 -06:00
test01.stderr Add some initial test cases. 2007-02-15 11:02:44 -06:00
test_kernel_dts Add a script that compares an "old" and "new" dtc results. 2007-11-20 09:14:03 -06:00
test_tree1.dts libfdt: Add phandle related functions 2007-11-13 07:40:06 -06:00
test_tree1_dts0.dts libfdt: Add phandle related functions 2007-11-13 07:40:06 -06:00
testdata.h libfdt: Abolish _typed() variants, add _cell() variants 2007-11-20 09:00:37 -06:00
tests.h libfdt: Abolish _typed() variants, add _cell() variants 2007-11-20 09:00:37 -06:00
tests.sh dtc: Add testcases for tree checks 2007-11-20 09:03:51 -06:00
testutils.c libfdt: Handle v16 and re-ordered trees for r/w 2007-11-01 08:03:31 -05:00
trees.S libfdt: Abolish _typed() variants, add _cell() variants 2007-11-20 09:00:37 -06:00
truncated_property.c dtc: Optimise by default, fix warnings thus uncovered 2007-08-31 08:34:18 -05:00
zero-phandle.dts dtc: Add testcases for tree checks 2007-11-20 09:03:51 -06:00