Re: LL(1) grammar and LL(2) grammar

"Olaf Stoyke" <os@cs.tu-berlin.de>
21 Oct 1998 01:29:00 -0400

          From comp.compilers

Related articles
LL(1) grammar and LL(2) grammar felixmish@usa.net (Felix Mish) (1998-10-17)
Re: LL(1) grammar and LL(2) grammar tc@charlie.cns.iit.edu (Thomas W. Christopher) (1998-10-18)
Re: LL(1) grammar and LL(2) grammar os@cs.tu-berlin.de (Olaf Stoyke) (1998-10-21)
Re: LL(1) grammar and LL(2) grammar mravirala@my-dejanews.com (1998-10-21)
| List of all articles for this month |

From: "Olaf Stoyke" <os@cs.tu-berlin.de>
Newsgroups: comp.compilers
Date: 21 Oct 1998 01:29:00 -0400
Organization: Compilers Central
References: 98-10-097
Keywords: LL(1)

> Hello everyone,
> I have such a production which is obviously not a
> LL(1) gramar.


    factor:
                    TOK_ID ( "\(" parameters "\)" | "\[" expression "\]" )
                | TOK_NUM
                | "\(" expression "\)"
                | TOK_NOT factor


> But is it possible to make a LL(1) grammar that accepts the same
> language?




    The modification above should work if TOK_NUM, TOK_ID, "\(",
    and TOK_NOT use different token codes.
        TOK_ID ( ... ) looks like what is called 'designator' in
    the Oberon-2 (and probably in Modula-2 as well). This became
    a grammar rule of its own with all possible selectors: "(...)",
    "[...]", "." and "^", I think.


        Regards, Olaf


Post a followup to this message

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