Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compilers > Re: Method for ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 2343 of 2425
Post > Topic >>

Re: Method for state reduction in LALR(1) parsers?

by "Paul B Mann" <paul@[EMAIL PROTECTED] > Feb 27, 2008 at 11:53 PM

> I'm searching for a way to minimize the states of a LALR(1) parser.
> My thought of minimizing the states of a LALR(1) parser has been: What
> if the parser performs a shift and a reduce in one single step?

This is well documented in the book, "Compiler Construction" by Goos and
Waite, published about 1985, by Springer Verlag.

This is the technique used in the LR parser generator, LRGen at
http://lrgen.com

The book says that by introducing SHIFT-REDUCE actions, you can
eliminate about 30% of the states.  This will work fine for all states
that have only one reduce action.  States that have more than one
reduce action, cannot be removed, however.

The GOTO action is usually a positive number in the parser tables and the
SHIFT-REDUCE number is a negative number.   It does increase the
speed of the parsers, while reducing the size of the tables.


Paul B Mann




 2 Posts in Topic:
Method for state reduction in LALR(1) parsers?
"mailings@[EMAIL PRO  2008-02-28 00:49:39 
Re: Method for state reduction in LALR(1) parsers?
"Paul B Mann" &  2008-02-27 23:53:21 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 8:47:50 CDT 2008.