Browse Source

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>
main
Jon Loeliger 17 years ago
parent
commit
5641289a46
  1. 62
      dtc-parser.y

62
dtc-parser.y

@ -87,13 +87,13 @@ sourcefile: @@ -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: @@ -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: @@ -165,7 +165,11 @@ propdata:
;

propdataprefix:
propdata ','
/* empty */
{
$$ = empty_data;
}
| propdata ','
{
$$ = $1;
}
@ -173,10 +177,6 @@ propdataprefix: @@ -173,10 +177,6 @@ propdataprefix:
{
$$ = data_add_label($1, $2);
}
| /* empty */
{
$$ = empty_data;
}
;

opt_cell_base:
@ -188,7 +188,11 @@ 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: @@ -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: @@ -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: @@ -252,13 +252,13 @@ nodename:
;

label:
DT_LABEL
/* empty */
{
$$ = $1;
$$ = NULL;
}
| /* empty */
| DT_LABEL
{
$$ = NULL;
$$ = $1;
}
;


Loading…
Cancel
Save