[antlr-interest] Writing lexer for controlled english

Terence Parr parrt at jguru.com
Fri Feb 7 12:54:52 PST 2003


On Friday, February 7, 2003, at 06:43 AM, unmesh joshi wrote:

> Hi,
>
> I want to write a lexer for a controlled english parser. Instead of 
> hand coding the TokenManager I think its better if I can have token 
> definition like
>
> ANYTOKEN which is not KEYWORD and SPACES, COMMENTS etc.
>
> And then write lexer action to match the word in the dictionaty.

Just make an ID rule that tests a dictionary to see if it's a keyword 
etc...

Ter
--
Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org
Lecturer in Comp. Sci., University of San Francisco


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list