[antlr-interest] Tokens vs. Characters in Lexer/MismatchedTokenException

Terence Parr parrt at cs.usfca.edu
Sun Jan 18 12:55:46 PST 2009


On Jan 18, 2009, at 12:38 PM, Rick Mann wrote:

> As I'm working on my language target, I see that Lexer.match(int c) in
> the Java target can create a MismatchedTokenException(), passing c in
> to its constructor.

weird. in the Java version, it treats it as a token type.

> The exception class seems to treat that int as a token. I wouldn't
> have thought Tokens and Characters to be interchangeable. What am I
> missing?

if that were the case, it wouldn't compile. Are you sure that it is  
treating it as a token?

Ter


More information about the antlr-interest mailing list