linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] DTC: Minor grammar rule shuffle.
@ 2007-10-22 21:59 Jon Loeliger
  2007-10-23  0:35 ` David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Loeliger @ 2007-10-22 21:59 UTC (permalink / raw)
  To: linuxppc-dev

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-23  0:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-22 21:59 [PATCH] DTC: Minor grammar rule shuffle Jon Loeliger
2007-10-23  0:35 ` David Gibson

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).