[antlr-interest] Why this grammar doesn't work?

Cristian Peraferrer corellian.c at gmail.com
Tue Oct 23 08:12:17 PDT 2007


Hi, I've picked up a part of my grammar to ask you what I am doing wrong:

grammar Test1;

options {k = 2; backtrack = true; memoize=true; output = AST; ASTLabelType =
CommonTree;}

type    :    primitiveType ('[' ']')* ;
primitiveType
    :    'bool'
        |    'char'
        |    'short'
        |    'int'
        |    'long'
        |    'float'
        |    'double'
    ;

I test it in ANTLRWorks interpreter, and gives me a
"FailedPredicateException(type,{synpred1}?)"

Anyone can explain why it occurs? and how I can solve it?

Thanks in advance,

Cris

-- 
GPG Key-ID: 0x564903FA - JID: corellian at swissjabber.ch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20071023/995ea00b/attachment.html 


More information about the antlr-interest mailing list