[antlr-interest] newbie left-recursive problem

ali azimi aliaazimi at yahoo.com
Thu Jul 5 07:19:53 PDT 2007


Hi,
   
  I have read some articles about left-recursive problem and managed to understand the nature of the problem. However I can not remedy the problem I am facing in my grammar. I am hoping you can help me. 
   
  You can see left-recursive problems in the followings. how can I remedy them?
  variable:fieldmodify|elementmodify|variableidentifier 
 ;
  elementmodify
 :variable'('expression(','expression)*')'
 ;
  fieldmodify
 :variable'!'fieldname
 ;
  expression 
 :literalidentifier|synonymidentifier|variableidentifier|fieldextract|elementextract|infixexpression|parenthesisexpression
 |operatorapplication|valuemake|imperativeoperator|conditionalexpression|forallname|spellingexpression
 ;
   
  and the followings:
   
  infixexpression
 :expression dyadicoperator expression
 |monadicoperator expression
 ;
  elementextract
 :expression '('expression (',' expression)*')'
 ;
  fieldextract
 :expression '!'fieldname
 ;
   
   
  Thank you so much in advance,
  Al

       
---------------------------------
Get the free Yahoo! toolbar and rest assured with the added security of spyware protection. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070705/76b9ec61/attachment.html 


More information about the antlr-interest mailing list