* [PATCH 1/4] DTC: Reformat grammar rules to not mix language syntax and yacc syntax.
@ 2007-10-19 17:42 Jon Loeliger
2007-10-20 7:12 ` David Gibson
0 siblings, 1 reply; 3+ messages in thread
From: Jon Loeliger @ 2007-10-19 17:42 UTC (permalink / raw)
To: linuxppc-dev
Use consistent indenting on all rule actions.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
---
No functional changes!
dtc-parser.y | 152 +++++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 118 insertions(+), 34 deletions(-)
diff --git a/dtc-parser.y b/dtc-parser.y
index 54fd787..4698793 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -79,103 +79,187 @@ extern struct boot_info *the_boot_info;
%%
-sourcefile: memreserves devicetree {
+sourcefile:
+ memreserves devicetree
+ {
the_boot_info = build_boot_info($1, $2);
}
;
-memreserves: memreserve memreserves {
+memreserves:
+ memreserve memreserves
+ {
$$ = chain_reserve_entry($1, $2);
}
- | /* empty */ {
+ | /* empty */
+ {
$$ = NULL;
}
;
-memreserve: label DT_MEMRESERVE DT_ADDR DT_ADDR ';' {
+memreserve:
+ label DT_MEMRESERVE DT_ADDR DT_ADDR ';'
+ {
$$ = build_reserve_entry($3, $4, $1);
}
- | label DT_MEMRESERVE DT_ADDR '-' DT_ADDR ';' {
+ | label DT_MEMRESERVE DT_ADDR '-' DT_ADDR ';'
+ {
$$ = build_reserve_entry($3, $5 - $3 + 1, $1);
}
;
-devicetree: '/' nodedef {
+devicetree:
+ '/' nodedef
+ {
$$ = name_node($2, "", NULL);
}
;
-nodedef: '{' proplist subnodes '}' ';' {
+nodedef:
+ '{' proplist subnodes '}' ';'
+ {
$$ = build_node($2, $3);
}
;
-proplist: propdef proplist {
+proplist:
+ propdef proplist
+ {
$$ = chain_property($1, $2);
}
- | /* empty */ {
+ | /* empty */
+ {
$$ = NULL;
}
;
-propdef: label DT_PROPNAME '=' propdata ';' {
+propdef:
+ label DT_PROPNAME '=' propdata ';'
+ {
$$ = build_property($2, $4, $1);
}
- | label DT_PROPNAME ';' {
+ | label DT_PROPNAME ';'
+ {
$$ = build_property($2, empty_data, $1);
}
;
-propdata: propdataprefix DT_STRING { $$ = data_merge($1, $2); }
- | propdataprefix '<' celllist '>' {
- $$ = data_merge(data_append_align($1, sizeof(cell_t)), $3);
+propdata:
+ propdataprefix DT_STRING
+ {
+ $$ = data_merge($1, $2);
+ }
+ | propdataprefix '<' celllist '>'
+ {
+ $$ = data_merge(data_append_align($1,
+ sizeof(cell_t)), $3);
+ }
+ | propdataprefix '[' bytestring ']'
+ {
+ $$ = data_merge($1, $3);
+ }
+ | propdata DT_LABEL
+ {
+ $$ = data_add_label($1, $2);
}
- | propdataprefix '[' bytestring ']' { $$ = data_merge($1, $3); }
- | propdata DT_LABEL { $$ = data_add_label($1, $2); }
;
-propdataprefix: propdata ',' { $$ = $1; }
- | propdataprefix DT_LABEL { $$ = data_add_label($1, $2); }
- | /* empty */ { $$ = empty_data; }
+propdataprefix:
+ propdata ','
+ {
+ $$ = $1;
+ }
+ | propdataprefix DT_LABEL
+ {
+ $$ = data_add_label($1, $2);
+ }
+ | /* empty */
+ {
+ $$ = empty_data;
+ }
;
opt_cell_base:
/* empty */
- { $$ = 16; }
+ {
+ $$ = 16;
+ }
| DT_BASE
;
-celllist: celllist opt_cell_base DT_CELL {
+celllist:
+ celllist opt_cell_base DT_CELL
+ {
$$ = data_append_cell($1,
cell_from_string($3, $2));
}
- | celllist DT_REF {
+ | celllist DT_REF
+ {
$$ = data_append_cell(data_add_fixup($1, $2), -1);
}
- | celllist DT_LABEL { $$ = data_add_label($1, $2); }
- | /* empty */ { $$ = empty_data; }
+ | celllist DT_LABEL
+ {
+ $$ = data_add_label($1, $2);
+ }
+ | /* empty */
+ {
+ $$ = empty_data;
+ }
;
-bytestring: bytestring DT_BYTE { $$ = data_append_byte($1, $2); }
- | bytestring DT_LABEL { $$ = data_add_label($1, $2); }
- | /* empty */ { $$ = empty_data; }
+bytestring:
+ bytestring DT_BYTE
+ {
+ $$ = data_append_byte($1, $2);
+ }
+ | bytestring DT_LABEL
+ {
+ $$ = data_add_label($1, $2);
+ }
+ | /* empty */
+ {
+ $$ = empty_data;
+ }
;
-subnodes: subnode subnodes {
+subnodes:
+ subnode subnodes
+ {
$$ = chain_node($1, $2);
}
- | /* empty */ { $$ = NULL; }
+ | /* empty */
+ {
+ $$ = NULL;
+ }
;
-subnode: label nodename nodedef { $$ = name_node($3, $2, $1); }
+subnode:
+ label nodename nodedef
+ {
+ $$ = name_node($3, $2, $1);
+ }
;
-nodename: DT_NODENAME { $$ = $1; }
- | DT_PROPNAME { $$ = $1; }
+nodename:
+ DT_NODENAME
+ {
+ $$ = $1;
+ }
+ | DT_PROPNAME
+ {
+ $$ = $1;
+ }
;
-label: DT_LABEL { $$ = $1; }
- | /* empty */ { $$ = NULL; }
+label:
+ DT_LABEL
+ {
+ $$ = $1;
+ }
+ | /* empty */
+ {
+ $$ = NULL;
+ }
;
%%
--
1.5.3.1.139.g9346b
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/4] DTC: Reformat grammar rules to not mix language syntax and yacc syntax.
2007-10-19 17:42 [PATCH 1/4] DTC: Reformat grammar rules to not mix language syntax and yacc syntax Jon Loeliger
@ 2007-10-20 7:12 ` David Gibson
2007-10-22 16:41 ` Jon Loeliger
0 siblings, 1 reply; 3+ messages in thread
From: David Gibson @ 2007-10-20 7:12 UTC (permalink / raw)
To: Jon Loeliger; +Cc: linuxppc-dev
On Fri, Oct 19, 2007 at 12:42:32PM -0500, Jon Loeliger wrote:
>
> Use consistent indenting on all rule actions.
>
> Signed-off-by: Jon Loeliger <jdl@freescale.com>
Meh, I kind of did it that way to keep the simple rules less bulky,
but I don't really care much either way.
Acked-by: David Gibson <david@gibson.dropbear.id.au>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/4] DTC: Reformat grammar rules to not mix language syntax and yacc syntax.
2007-10-20 7:12 ` David Gibson
@ 2007-10-22 16:41 ` Jon Loeliger
0 siblings, 0 replies; 3+ messages in thread
From: Jon Loeliger @ 2007-10-22 16:41 UTC (permalink / raw)
To: David Gibson; +Cc: linuxppc-dev
So, like, the other day David Gibson mumbled:
> On Fri, Oct 19, 2007 at 12:42:32PM -0500, Jon Loeliger wrote:
> >
> > Use consistent indenting on all rule actions.
> >
> > Signed-off-by: Jon Loeliger <jdl@freescale.com>
>
> Meh, I kind of did it that way to keep the simple rules less bulky,
> but I don't really care much either way.
>
> Acked-by: David Gibson <david@gibson.dropbear.id.au>
Cool. Thanks. Applied.
jdl
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-10-22 16:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-19 17:42 [PATCH 1/4] DTC: Reformat grammar rules to not mix language syntax and yacc syntax Jon Loeliger
2007-10-20 7:12 ` David Gibson
2007-10-22 16:41 ` Jon Loeliger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).