Re: LL(2)


Subject: Re: LL(2)
From: Karl Lieberherr (lieber@ccs.neu.edu)
Date: Fri Mar 01 2002 - 10:52:41 EST


To give you more examples and some help:
Have you ever seen a class dictionary for Java?

Here is one:

http://www.ccs.neu.edu/research/demeter/sources/DemeterJava/examples/j-Java11/program.cd

and it contains many examples of lookahead, e.g.

SquareBrackets ~ {*lookahead*(@2@) SquareBracket} .

PrimarySuffix :
    *lookahead*(@2@) dotThis |
    dotClass |
    *lookahead*(@3@) dotAlloc.

The places where you can use lookahead are defined in the class
dictionary for class dictionaries.

The class dictionary for Java achieves something similar to your
class dictionary for the project:

The sentence:

ClassGraph cg = new ClassGraph(cg_default, "from A to B");

is common to both.

An alternative to using lookahead > 1 is to make the class dictionary LL(1).
Both solutions are good.

-- Karl



This archive was generated by hypermail 2b28 : Fri Mar 01 2002 - 10:52:43 EST