[antlr-interest] v3: strange debugging message in new java.g grammar

Dieter Frej dieter_frej at gmx.net
Thu Jul 20 14:42:22 PDT 2006


Hi Ter,

> By default ANTLR does not send the exceptions back out...it tries to  
> recover.  Override reportError and recover if you want; also can set  
> trycatchclause action I think it is.
is there somewhere a list of all available grammar options and all
availabe action stuff? That would make development easier...


>> I got the following in my err.txt and I have no idea where this came
>> from because it does not look like an exception (they should all be
>> handled).
>>
>> /home/db/jck/JCK-compiler-15a/tests/lang/FP/fpl001/fpl00101m8/ 
>> fpl00101m8.java
>> [compilationUnit, typeDeclaration, classOrInterfaceDeclaration,  
>> classDeclaration, normalClassDeclaration, classBody,  
>> classBodyDeclaration, memberDecl]: line
>>  20:18 decision=<<132:1: memberDecl :  ( ( 
>> genericMethodOrConstructorDecl )=>  genericMethodOrConstructorDecl | ( 
>> methodDeclaration )=>  methodDeclaration | (
>> fieldDeclaration )=> fieldDeclaration | ( 'void' Identifier  
>> voidMethodDeclaratorRest )=> 'void' Identifier  
>> voidMethodDeclaratorRest | ( Identifier construct
>> orDeclaratorRest )=> Identifier constructorDeclaratorRest |  ( 
>> interfaceDeclaration )=> interfaceDeclaration |  classDeclaration );>> 
>> state 15 (decision=36) n
>> o viable alt; token=[@106,466:468='int',<59>,20:18]
>> [compilationUnit, typeDeclaration, classOrInterfaceDeclaration,  
>> classDeclaration, normalClassDeclaration, classBody,  
>> classBodyDeclaration, memberDecl, const
>> ructorDeclaratorRest, formalParameters]: line 20:53 mismatched  token: 
>> [@119,501:508='strictfp',<54>,20:53]; expecting type ')'
>> ---------------
>> Any comments on this?
> 
> 
> That says that in formalParameters, it didn't like strictfp.   
> Hmm...must be a bug in the spec.  I did this:
> 
> formalParameterDecls
>         :       'final'? annotations? type formalParameterDeclsRest?
>         ;
> 
> seems like strictfp, a modifier, needs to be in there.  Maybe I  
> simplified.  what's at line 20, char 53?
oh, well, it was to late when I sent that email. Line 20 is

public static int run(String argv[], PrintStream strictfp) {

so it should fail because strictfp is a reserved keyword which is not
allowed as name...

- Didi


More information about the antlr-interest mailing list