LL(2) always factorable to LL(1)?

"Andrew M. Duncan" <aduncan@cs.ucsb.edu>
17 Jan 1998 00:05:35 -0500

          From comp.compilers

Related articles
LL(2) always factorable to LL(1)? aduncan@cs.ucsb.edu (Andrew M. Duncan) (1998-01-17)
Re: LL(2) always factorable to LL(1)? clark@quarry.zk3.dec.com (Chris Clark USG) (1998-01-20)
Re: LL(2) always factorable to LL(1)? bill@amber.ssd.csd.harris.com (1998-01-21)
Re: LL(2) always factorable to LL(1)? mickunas@cs.uiuc.edu (1998-01-23)
Re: LL(2) always factorable to LL(1)? cfc@world.std.com (Chris F Clark) (1998-01-23)
Re: LL(2) always factorable to LL(1)? parrt@magelang.com (Terence Parr) (1998-01-23)
Re: LL(2) always factorable to LL(1)? thetick@magelang.com (Scott Stanchfield) (1998-01-24)
[1 later articles]
| List of all articles for this month |

From: "Andrew M. Duncan" <aduncan@cs.ucsb.edu>
Newsgroups: comp.compilers
Date: 17 Jan 1998 00:05:35 -0500
Organization: University of California
Keywords: parse, LL(1), question

All:


I'm TA-ing a compilers course, and am looking for some good examples
of (for example) languages that are intrinsically LL(0,1,2) and same
for LR. It's clear that some languages can be expressed in an LL(2)
grammar, but the grammar can be further factored. For example:


        S -> id "=" Expr | id "(" Params ")"


is LL(2) but can be factored to


        S -> id rest
        rest -> "=" E | "(" Params ")"


Is this always possible?


Other useful things would be: an example of a trivial LL/LR(1) lauguage
and a simple addition that forces it to be (intrinsically) LL/LR(2). Or
a language that lives in the difference between LR(1) and LL(1). Any
suggestions?


Andrew Duncan
http://www.cs.ucsb.edu/~aduncan
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.