[antlr-interest] Fundamental question on lexer rule ordering

John B. Brodie jbb at acm.org
Tue Feb 27 14:32:44 PST 2007


Greetings!

>I must be missing something fundamental on lexer rule ordering, because I 
>keep running into the same problem over and over: re-ordering rules 
>changes the lexer from "working" to "failing", and I don't understand why.

Is your Lexer in a separate .g file from your Parser (I seem to
remember seeing an importvocab in one of your earlier parser
postings)?

If so, are you sure you are re-building the Parser after each change
to the Lexer. Re-ordering the Lexer rules will change the Token Types
assigned by the Lexer and thus the Parser needs to be rebuilt in order
to adapt to those new assignments.


Hope this helps...
   -jbb


More information about the antlr-interest mailing list