From: Jon Loeliger <jdl@jdl.com>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH] DTC: Minor grammar rule shuffle.
Date: Mon, 22 Oct 2007 16:59:45 -0500 [thread overview]
Message-ID: <E1Ik5JJ-0000Cp-KT@jdl.com> (raw)
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>
---
dtc-parser.y | 62 +++++++++++++++++++++++++++++-----------------------------
1 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/dtc-parser.y b/dtc-parser.y
index 0d140e5..c213526 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -86,13 +86,13 @@ sourcefile:
;
memreserves:
- memreserve memreserves
+ /* empty */
{
- $$ = chain_reserve_entry($1, $2);
+ $$ = NULL;
}
- | /* empty */
+ | memreserve memreserves
{
- $$ = NULL;
+ $$ = chain_reserve_entry($1, $2);
}
;
@@ -122,13 +122,13 @@ nodedef:
;
proplist:
- proplist propdef
+ /* empty */
{
- $$ = chain_property($2, $1);
+ $$ = NULL;
}
- | /* empty */
+ | proplist propdef
{
- $$ = NULL;
+ $$ = chain_property($2, $1);
}
;
@@ -164,7 +164,11 @@ propdata:
;
propdataprefix:
- propdata ','
+ /* empty */
+ {
+ $$ = empty_data;
+ }
+ | propdata ','
{
$$ = $1;
}
@@ -172,10 +176,6 @@ propdataprefix:
{
$$ = data_add_label($1, $2);
}
- | /* empty */
- {
- $$ = empty_data;
- }
;
opt_cell_base:
@@ -187,7 +187,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));
@@ -200,14 +204,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);
}
@@ -215,20 +219,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);
}
;
@@ -251,13 +251,13 @@ nodename:
;
label:
- DT_LABEL
+ /* empty */
{
- $$ = $1;
+ $$ = NULL;
}
- | /* empty */
+ | DT_LABEL
{
- $$ = NULL;
+ $$ = $1;
}
;
--
1.5.3.1.139.g9346b
next reply other threads:[~2007-10-22 21:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-22 21:59 Jon Loeliger [this message]
2007-10-23 0:35 ` [PATCH] DTC: Minor grammar rule shuffle David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1Ik5JJ-0000Cp-KT@jdl.com \
--to=jdl@jdl.com \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).