Related articles |
---|
number LR(1) vs LALR(1) Itemsets for a grammar alpanadubey1@yahoo.co.in (2003-11-11) |
Re: number LR(1) vs LALR(1) Itemsets for a grammar mike.spencer@earthlink.net (Mike Spencer) (2003-11-18) |
From: | Mike Spencer <mike.spencer@earthlink.net> |
Newsgroups: | comp.compilers |
Date: | 18 Nov 2003 18:53:23 -0500 |
Organization: | Compilers Central |
References: | 03-11-051 |
Keywords: | LALR, LR(1) |
Posted-Date: | 18 Nov 2003 18:53:23 EST |
Alpana wrote:
> I have implemented a LR(1) parse
> table generator. Which, when executed for a C grammar gave me around
> 2350 LR(1) itemsets. There is no way to check this number except doing
> manually which is again not feasible. Does anybody has LR(1) parser
> generator??
You can try Basil: http://www.lazycplusplus.com/basil
It is an LR(1) parser generator, though by default it will generate
extra states only as needed. It will generate a default action in a
state for the most common reduction, and it will merge two states if
the set of actions (shifts and reductions) are the same for the two
states and for all transitions. Option -nda will prevent default
actions and so you should end up with all the LR(1) states.
I'll try it on your C grammar if you like; I too would be interested to
see if our numbers match.
Mike
Return to the
comp.compilers page.
Search the
comp.compilers archives again.