Hi,
I am writing a lexer specification that looks for some tokens in text. I
also need to get the text between the tokens.
Currently, what I see in the examples is something like this:
<YYINITIAL> . { out.append(yytext()); }
The problem with this is that it handles every character separately, and I
would like to get all of them at once.
Is it possible to get the unmatched characters in the same way a sax parser
returns characters, something like:
(char[] ch, int start, int length)
In this case my code receives a character array with indexes to the start
and end. Those are currently private variables (zz prefix) so I don't want
to use them if there is a better alternative.
regexp such as .* will probably match the tokens as well.
Thanks for any help!
|