diff options
author | Jon Loeliger <jdl@freescale.com> | 2007-10-23 09:28:54 -0500 |
---|---|---|
committer | Jon Loeliger <jdl@freescale.com> | 2007-10-23 09:35:36 -0500 |
commit | 5641289a4647db43c0fdccee25da020ca04d03ad (patch) | |
tree | 483cfa0bd2bd10f725bfef908eab449656a8b859 /dtc-parser.y | |
parent | 30807ca1ce48ac578ec5f00c47065c875c530608 (diff) | |
download | dtc-5641289a4647db43c0fdccee25da020ca04d03ad.tar.gz |
DTC: Minor grammar rule shuffle.
I like to see the basis cases established early in
the rule sets, so place "empty" reduction first.
Purely cosmetic.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'dtc-parser.y')
-rw-r--r-- | dtc-parser.y | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/dtc-parser.y b/dtc-parser.y index 4698793..8e6ed64 100644 --- a/dtc-parser.y +++ b/dtc-parser.y @@ -87,13 +87,13 @@ sourcefile: ; memreserves: - memreserve memreserves + /* empty */ { - $$ = chain_reserve_entry($1, $2); + $$ = NULL; } - | /* empty */ + | memreserve memreserves { - $$ = NULL; + $$ = chain_reserve_entry($1, $2); } ; @@ -123,13 +123,13 @@ nodedef: ; proplist: - propdef proplist + /* empty */ { - $$ = chain_property($1, $2); + $$ = NULL; } - | /* empty */ + | propdef proplist { - $$ = NULL; + $$ = chain_property($1, $2); } ; @@ -165,7 +165,11 @@ propdata: ; propdataprefix: - propdata ',' + /* empty */ + { + $$ = empty_data; + } + | propdata ',' { $$ = $1; } @@ -173,10 +177,6 @@ propdataprefix: { $$ = data_add_label($1, $2); } - | /* empty */ - { - $$ = empty_data; - } ; opt_cell_base: @@ -188,7 +188,11 @@ opt_cell_base: ; celllist: - celllist opt_cell_base DT_CELL + /* empty */ + { + $$ = empty_data; + } + | celllist opt_cell_base DT_CELL { $$ = data_append_cell($1, cell_from_string($3, $2)); @@ -201,14 +205,14 @@ celllist: { $$ = data_add_label($1, $2); } - | /* empty */ - { - $$ = empty_data; - } ; bytestring: - bytestring DT_BYTE + /* empty */ + { + $$ = empty_data; + } + | bytestring DT_BYTE { $$ = data_append_byte($1, $2); } @@ -216,20 +220,16 @@ bytestring: { $$ = data_add_label($1, $2); } - | /* empty */ - { - $$ = empty_data; - } ; subnodes: - subnode subnodes + /* empty */ { - $$ = chain_node($1, $2); + $$ = NULL; } - | /* empty */ + | subnode subnodes { - $$ = NULL; + $$ = chain_node($1, $2); } ; @@ -252,13 +252,13 @@ nodename: ; label: - DT_LABEL + /* empty */ { - $$ = $1; + $$ = NULL; } - | /* empty */ + | DT_LABEL { - $$ = NULL; + $$ = $1; } ; |