[antlr-interest] Test the lexer
pink at odahoda.de
Sat Feb 17 05:04:12 PST 2007
Richard Hu wrote:
> Is it possible to test the lexer without testing the parser? I would like
> to send some stream into the lexer and see tokens being generate. But all
> the test samples I've seen include parser.
Just create the Lexer and call its nextToken() method to get one Token after
the other and test if the tokens match your expectations.
If you need a explicit example, you'd have to tell us which ANTLR version
(2.x or 3) and which target language you are using.
Email: pink at odahoda dot de
More information about the antlr-interest