[antlr-interest] Trouble with spaces

Jason Doege jdoege at gmail.com
Mon Apr 4 08:18:28 PDT 2011


Hi All,

I am (we are) having a bit of trouble with spaces in a grammar.

What should be parseable is:

Alias b = in[4] {}

But what the generated parser seems to require to parse correctly is:

Alias b = in[4] { }

Here is the production that is supposed to parse it:

alias_def                : 'Alias' alias_name '=' concat_hier_data_signal (
                             ';' |
                             ('{' ('RefEnum' enum_name ';')* '}' )
                           ) ;

Do you have any idea why a space is required between the '{'  '}' ?

To the best of my knowledge, I have no token that specifies '{}' in the
grammar.

Any suggestions would be welcome.

We are using the latest and greatest ANTLR.

--Jason Doege
jdoege at gmail.com


More information about the antlr-interest mailing list