[antlr-interest] Isn't the lexer supposed to break out from a rule upon EOF?
Ric Klaren
klaren at cs.utwente.nl
Fri Apr 23 05:49:30 PDT 2004
On Fri, Apr 23, 2004 at 09:47:41AM -0300, Rodrigo B. de Oliveira wrote:
> SL_COMMENT:
> "#"! (~('\r'|'\n')!)*
> { $setType(Token.SKIP); }
> ;
>
> The lexer refuses to return a token when it encounters an EOF inside the
> inverted rule,
> in other words, lexing a string like "#foo" would never return while lexing
> something like "#foo\n" will.
>
> Is this the expected behaviour?
You have EOF in your charVocabulary? (E.g. -1 0xFFFF or whatever notation?)
If you have it is the behaviour you specified. If you don't there's
something else wrong.
Cheers,
Ric
--
-----+++++*****************************************************+++++++++-------
---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893722 ----
-----+++++*****************************************************+++++++++-------
Innovation makes enemies of all those who prospered under the old
regime, and only lukewarm support is forthcoming from those who would
prosper under the new. --- Niccolò Machiavelli
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list