[antlr-interest] Newbie: NoViableAltException
rbuck at verisign.com
Tue Jul 24 16:02:10 PDT 2007
I have no clue what you just said below. So let me start from the
All I want to do is define a simple recursive grammar for a set-tuple
syntax that has input streams like:
: L_PAREN tuple_declaration EQUALS ( tuple_value | set )
: L_CURLY tuple ( COMMA tuple )*
: tuple_key ( AT_SIGN set )?
: ( PCHAR )*
Goal: I need to be able to extract the tuple key-names and the values.
If the value is complex (starts and ends with curly-braces), I need to
handle those differently by constructing references to child nodes in a
tree-structure of sorts. Sets are always on the right hand side.
So is this part correct, or not?
> -----Original Message-----
> From: antlr-interest-bounces at antlr.org
> [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Diehl,
> Matthew J
> Sent: Tuesday, July 24, 2007 5:09 PM
> To: antlr-interest at antlr.org
> Subject: Re: [antlr-interest] Newbie: NoViableAltException
> You're mixing your lexer and parser rules. IDENT is eating
> up all of the UNRESERVED whenever there's more than one,
> PCHAR if there's only one. Then you're saying that 'bar',
> which is more than one UNRESERVED, so it is the token IDENT,
> needs to be a bunch of PCHARs, but the PCHARs have already
> been turned in to the token IDENT.
More information about the antlr-interest