[antlr-interest] Re: Recommendation for Lexer

Micheal J open.zone at virgin.net
Wed Feb 8 22:56:03 PST 2006


> JFlex looks good at the moment. It doesn't impose any class 
> inheritance on you and the generated lexer is completely 
> standalone, so it should be easy to integrate with ANTLR. 

Have a look at our KSCParse sample on the ANTLR site. It's for C# targets
but includes a CsFlex (Jflex for C#) lexer that demonstrates ANTLR
integration [with Jflex-style lexers]. 

Although you don't *need* it, Kunle also added an ANTLR mode to CsFlex
(patch code in the CsFlex site on SourceForge) that you could port to Jflex
[and submit to the Jflex project if you desire] to make ANTLR integration
even easier.

> Plus it brings native support for the issues I have. The only 
> thing I'm missing is a deeper control about what parts of the 
> token end up in the tokens text, but maybe I've just not 
> found that yet.

The sample should help in that regard too. You get to decide what is in the
tokens you return (or perhaps I haven't quite appreciated the complexity of
your lexer).

Cheers,

Micheal



More information about the antlr-interest mailing list