[antlr-interest] java grammar problems

Charles Zhang zhangcharles at yahoo.com
Fri Sep 26 10:27:40 PDT 2003


Hi, Jim, thanks for the response. My tree walker fails
for the following code:
interface I{
   interface InnerI 
   {
   }
}
The interfaceBlock rule of the java.tree.g does not
contain a typedefinition. It shouldn't anyways. It
should just contain a interfaceDefinition. But I'm not
a grammar expert and scared of making changes. Could
you show me how to solve this problem? 
Thanks.

Charles
--- Jim O'Connor <Jim.O'Connor at microfocus.com> wrote:
>  Can you give a short example of what doesn't work?
>   Have you tried putting a printf in the tree
> grammar?
> 
> 
> typeDefinition
> : #(CLASS_DEF modifiers IDENT extendsClause
> implementsClause objBlock )
>   #(INTERFACE_DEF modifiers IDENT extendsClause
> interfaceBlock )
>      System.out.println("Interface Definition " +
> #IDENT.getText());}
> 	;
>   
> typeDefinition is called recursively by a few
> different rules.  Unless you
> have an example of an inner function that sidesteps
> this grammar, the
> interface definition should come through here.  
> 
> Let me know.
> Jim
> 
> 
> -----Original Message-----
> From: zhangcharles
> To: antlr-interest at yahoogroups.com
> Sent: 9/21/03 6:33 PM
> Subject: [antlr-interest] java grammar problems
> 
> I posted this a month ago. I think it got lost in
> the message pond.
> 
> ------------------------------------- 
> Hi, the current java.tree.g grammar doesn't seem to
> take inner 
> interface definition into consideration. Any advices
> of how to add 
> it since I'm not a grammar expert. Thanks a lot.
> 
> Charles
> 
> 
> 
>  
> 
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/ 
> 
> 
> 
>
________________________________________________________________________
> This e-mail has been scanned for viruses by MCI's
> Internet Managed
> Scanning Services - powered by MessageLabs. For
> further information
> visit http://www.mci.com
>
________________________________________________________________________


=====
Yawn !!

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list