linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Jon Loeliger <jdl@jdl.com>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH] DTC:  Remove the need for the GLR Parser.
Date: Mon, 22 Oct 2007 16:13:54 -0500	[thread overview]
Message-ID: <E1Ik4aw-0007ud-Lu@jdl.com> (raw)

Previously, there were a few shift/reduce and reduce/reduce
errors in the grammar that were being handled by the not-so-popular
GLR Parser technique.

Flip a right-recursive stack-abusing rule into a left-recursive
stack-friendly rule and clear up three messes in one shot: No more
conflicts, no need for the GLR parser, and friendlier stackness.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
---
 Makefile     |    1 -
 dtc-parser.y |    5 ++---
 2 files changed, 2 insertions(+), 4 deletions(-)

Both "make check" and the "compare all old and new DTB kernel files"
tests are happy with this change.


diff --git a/Makefile b/Makefile
index d7d1af5..84f0efe 100644
--- a/Makefile
+++ b/Makefile
@@ -207,7 +207,6 @@ clean: libfdt_clean tests_clean
 
 %.tab.c %.tab.h %.output: %.y
 	@$(VECHO) BISON $@
-	@$(VECHO) ---- Expect 2 s/r and 2 r/r. ----
 	$(BISON) -d $<
 
 FORCE:
diff --git a/dtc-parser.y b/dtc-parser.y
index 4698793..0d140e5 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -18,7 +18,6 @@
  *                                                                   USA
  */
 
-%glr-parser
 %locations
 
 %{
@@ -123,9 +122,9 @@ nodedef:
 	;
 
 proplist:
-	  propdef proplist
+	  proplist propdef
 		{
-			$$ = chain_property($1, $2);
+			$$ = chain_property($2, $1);
 		}
 	| /* empty */
 		{
-- 
1.5.3.1.139.g9346b

             reply	other threads:[~2007-10-22 21:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-22 21:13 Jon Loeliger [this message]
2007-10-23  2:54 ` [PATCH] DTC: Remove the need for the GLR Parser David Gibson
2007-10-23 14:24   ` Jon Loeliger
2007-10-23 14:41     ` Segher Boessenkool
2007-10-23 14:49       ` Jon Loeliger
2007-10-23 23:41         ` David Gibson
2007-10-23 23:37       ` David Gibson
2007-10-23 16:07     ` Jon Loeliger
2007-10-23 23:44       ` David Gibson
2007-10-24  1:11     ` 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=E1Ik4aw-0007ud-Lu@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).