[antlr-interest] Syntax error in action: What is wrong with my syntax?

Bryan Ewbank ewbank at gmail.com
Wed Mar 1 13:10:42 PST 2006


Action is missing commas in tree subexpressions after [TEST1] and
[TEST2].  I seem to recall getting bit by this because my hardcopy of
the manual was scrambled due to font problems.

I find it very handy to spread out the grammar file vertically (see
below) so that the file/line localizes the error...

On 2/28/06, Mark Felzer <mark.felzer at gmail.com> wrote:
> For some reason I keep getting a syntax error, what is wrong with
> this syntax?
>
> typeDefinition:
>         ID EQUAL! type
>         { #typeDefinition=
>               #([TYPE_DEFINITION,"TypeDefinition"],
>                   ID,
>                   ([TEST1] ID),
>                   ([TEST2] type) );
>         }
>         ;
>
> grammer.txt:55:53: Syntax error in action:
> grammer.txt:55:53: expecting ')', found 'I'
> Exiting due to errors.


More information about the antlr-interest mailing list