[antlr-interest] Mutual left recursive problem

foxterri foxterri foxterri2 at hotmail.com
Thu Mar 25 01:19:14 PDT 2010


Hi

I have this left recursive problem which i cannot figure out how to solve and ANTLR WORKS cannot recognize the left recursive problem.
Is there any way to fix this?


methodInvocation
    :    methodName LPAREN argumentList? RPAREN
    |    primary DOT IDENT LPAREN argumentList? RPAREN
    |    SUPER DOT IDENT LPAREN argumentList? RPAREN
    ;
    
fieldAccess
    :    primary DOT IDENT
    |    SUPER DOT IDENT
    ;
    
primary
    :    primaryNoNewArray
    |    arrayCreationExpression
    ;
    
primaryNoNewArray
    :    literal
    |    THIS
    |    LPAREN expression RPAREN
    |    classInstanceCreationExpression
    |    fieldAccess
    |    methodInvocation
    |    arrayAccess
    ;

arrayAccess
    :    expressionName LBRACK expression RBRACK
    |    primaryNoNewArray LBRACK expression RBRACK
    ;     

Thanks for any help,

Glen
 		 	   		  
_________________________________________________________________
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_1


More information about the antlr-interest mailing list