> allows a clean compile but the ANTLR book indicates ANTLR should try to
> match in the order listed.

Hard to say without looking at the full grammar file, but you could try to 
separate
the lexer and parser grammars into two files, then use "option 
{filter=true;}" in
the lexer grammar.  (The option seems to only work if you make two 
grammars.)
That generates a lexer that uses a rule order priority, which is what you 
mention.
By default, Antlr does not generate this kind of lexer since the filter-type 
lexer
has its problems (See The Definitive ANTLR Reference).  Also, when 
separating
the parser and lexer grammars, it seems Antlr has a problem keeping the two 
token lists
in synch.  You can fix this with a hack: declare all tokens, with the same 
exact order,
in the two grammars.  Not sure why,

Ken

 


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to