[antlr-interest] probably too obvious to see it - plz help

tdjastrzebski tdjastrzebski at yahoo.com
Thu Jul 31 16:14:02 PDT 2003


I ma probably too tireed to see it. Why following two lexer rules 
cause nondeterminism (k=2).

Identifier
	: ('a'..'z')+
	;
StringLiteral
	: ('n')? '\'' (~'\'')* '\''
	;

StringLiteral rule is supposed to match unicode strings like: 
n'blabla'

Thanks in advance.
Tom Jastrzebski

full test grammar:

options {
	language = "Java";
}

class TestParser extends Parser;
options {
	k = 2;
}

expression
	: (Identifier | StringLiteral) EOF
	;

class TestLexer extends Lexer;
options {
    k = 2;
}

Identifier
	: ('a'..'z')+
	;

StringLiteral
	: ('n')? '\'' (~'\'')* '\''
	;


 

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




More information about the antlr-interest mailing list