[antlr-interest] How can I work around approximate LALL limitation?
Pete Forman
pete.forman at westerngeco.com
Tue Nov 12 03:56:45 PST 2002
At 2002-11-11 09:40 -0500, Case, Scott wrote:
>Maybe try this -
>table:
> (INTEGER
> ( (SPACE INTEGER)=> SPACE INTEGER
> | (SPACE NEWLINE)=> SPACE
> )*
> NEWLINE)+
> ;
Yes, that works thank you.
One of the syntactic predicates can be removed.
class ExampleParser extends Parser;
options { k = 2;}
table
: ( INTEGER
( (SPACE NEWLINE) => SPACE
| SPACE INTEGER
)*
NEWLINE
)+
;
[The original desired syntax was
table: (INTEGER (SPACE INTEGER)* (SPACE)? NEWLINE)+;]
--
Pete Forman -./\.- Disclaimer: This post is originated
WesternGeco -./\.- by myself and does not represent
pete.forman at westerngeco.com -./\.- opinion of Schlumberger, Baker
http://petef.port5.com -./\.- Hughes or their divisions.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list