[antlr-interest] grammar ambiguity

jbb at acm.org jbb at acm.org
Wed Dec 18 14:07:01 PST 2002


How 'bout:

class FooParser extends Parser;
//options {k = 4;}
id3DList: id3D (COMMA id3D)*;
id2DList: id2D (COMMA id2D)*;
id3D: ID ( DOT ID ( DOT ID )? )?;
id2D: ID ( DOT ID )?;

class FooLexer extends Lexer;
options {k = 2;}
ID: ( 'a'..'z' )+;
COMMA:',';
DOT:'.';


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list