[antlr-interest] help

John B. Brodie jbb at acm.org
Wed Jun 1 18:51:20 PDT 2011


Greetings!

On Wed, 2011-06-01 at 18:20 -0700, Omar Mohssen wrote:
> 
> hello
> i have a problem using the grammar "ANSI C ANTLR v3 grammar" (on the link 
> http://www.antlr.org/grammar/1153358328744/C.g) 
> the problem is that i couldn't find the start state from which i start the 
> interpreter to test examples like
> void main(){
> 
> }
> or any other simple examples ..
> actually i don't know if this is exactly the problem i have the latest version 
> of antlrworks i am getting "FailedPredicateException..." 
> I appreciate any help 
> thanks in advance                
> 

I do not use ANTLRWorks so my advice may be bogus....

Do not use the ANTLRWorks Interpreter -- it does not handle grammars
with predicates (and also apparently has other issues...)

Looks like the start symbol is translation_unit but that determination
is only after a very brief scan of the grammar (apparently, no rule
mentions EOF so it is kinda hard to tell...)

Hope this helps...
   -jbb




More information about the antlr-interest mailing list