[antlr-interest] More ANTLR meta-syntax questions
Sinan
sinan.karasu at boeing.com
Wed May 15 09:32:21 PDT 2002
Terence Parr wrote:
>
[...]
>
> I got really pissed off the other day when i was updating the Java
> grammar--I wanted full LL(k) rather than my approx decisions...almost
> made me take a week off to go implement it! ;)
>
> Ter
We need a list of things that will piss you off. ;-)
Anyway, an obvious answer to Parser/Lexer separation is
the statement :
rule1: "k" "e" "y" "w" "o" "r" "d" another_rule ; // requires k=8 ( or
7)
and
rule2: Keyword another_rule ; // requires k=1
Now if your rules are such that moving from rule1 yo rule2 is simply
moving the
keyword to the lexer, then obviously a k=8 lookahead is the same for
parser and lexer.
However with many keywords, it quickly gets out of hand ( if not for the
computer,
at least for the human ....)...
Sinan
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list