[antlr-interest] question on simple grammar for tick format to decimal conversion

Monty Zukowski monty at codetransform.com
Thu Dec 1 09:29:21 PST 2005


For more information on filtering token streams, see my article "Using a
Parser as a TokenFilter" http://codetransform.com/filterexample.html
It's overkill for what you're doing, but has the basic concepts in there.

Monty

Micheal J wrote:
>>Can you please tell me more about the Fancy option - are you 
>>saying that I need to implement a TokenStream which will do 
>>this toggling after hitting the MINUS ?
> 
> 
> Yes. After seeing a NUM MINUS sequence you may set a flag then if the next
> token is NUM break up into digits. 
> 
> And then use it in your code. 
> - You create your lexer. 
> - Create the filter TokenStream to reads from your lexer. 
> - Create the parser to read from your filter.
> - Use parser.
> 
> 
> Cheers,
> 
> Micheal
> 
> 
> 
> 



More information about the antlr-interest mailing list