[antlr-interest] lexer: display all rules matched
antlr at mirality.co.nz
Tue Aug 28 13:13:08 PDT 2007
At 01:58 29/08/2007, Edwards, Waverly wrote:
>Is there a way to inspect what lexer rules have been matched or
>inspect the token buffer?
>What I'm trying to do is to setup test(s) to ensure that every
>keyword is matched and that no rule conflicts with another.
>I have just short of 550 lexical rules just for keywords alone
>(originally I thought it was just a couple hundred).
For the purposes of tests, just create an instance of the lexer
and ask it for all the tokens. (Exactly how you do this depends
on your target language.)
There's no need to create a parser if all you want to do is to
validate the output of the lexer against a "known good" or
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the antlr-interest