[antlr-interest] Changing/affecting the Lexer from the Parser?

Juancarlo Añez apalala at gmail.com
Wed Nov 7 13:04:44 PST 2012


In the Natural programming language it is possible to have "based" array
indexing. With a declaration like this:

2 ARR(1:5)

Array indexes must be of the form:

   ARR(1.2:4)

Alas, 1.2 is a floating point number everywhere else!

Other possibilities are ARR(1.#I:#J), ARR(#I.2:4), in which .2 is a valid
floating point number, but 1. isn't.

Is it possible to affect the lexer with variables in the rules that parse
the indexing? Or does the lexer tokenize all the input before the parser
starts?

TIA!

-- 
Juancarlo *Añez*


More information about the antlr-interest mailing list