Re: How can I access the character index of my source file using grammer file?
Tuesday, November 13, 2001 07:13 PM
One way is to implement your own input stream and to override all the read() methods (much like FilterInputStream).
You can supply an instance of this stream to the lexer's constructor.
Note that overriding consume() in the lexer is not good because the lexer can backtrack.