[antlr-interest] MismatchedTokenException and how to find errors in ANTLRWorks

Thomas Brandon tbrandonau at gmail.com
Tue Feb 12 21:55:52 PST 2008


On Feb 13, 2008 12:42 PM, Darien Hager <darien.hager at etelos-inc.com> wrote:
>
> > Perhaps literals could be allowed in the parser but only to refer to
> tokens defined in the lexer, generating an error otherwise. That should
> alleviate many (if not all) of the issues while still allowing the stylistic
> choice some seem to want.
> >
>
> That makes sense to me. Parser-literals would mainly be a way to avoid
> remembering the token name and/or for readability.
>
> Although... could this cause problems with the tokenVocabulary option?
> Suppose someone wants to extend and build upon an existing (read-only) lexer
> grammar, but cannot define new literals in the parser.
>
You can't do that now. The only time you can define literals in the
parser is in a combined grammar, if you share a lexer between multiple
parsers you have to move all literals to the lexer (one of the other
reasons I avoid defining literals in the parser).

Tom.
>
> --
> Darien Hager
> Developer
> Etelos, Inc.
> darien at etelos.com
>
> http://www.etelos.com
> "Revolutionizing the way applications are developed, distributed and
> consumed."
>
> This e-mail message, including attachments, may contain confidential
> information for the sole use of the intended recipient(s). If you are not
> the intended recipient, then this is notice that any use, disclosure,
> dissemination, distribution or copying is strictly prohibited. If you have
> received this message in error please contact the sender by reply mail and
> destroy all copies of the original message.


More information about the antlr-interest mailing list