[antlr-interest] newbie Grammar problem

amol Bhagavat amol_bhagavat at yahoo.co.uk
Wed Nov 14 00:36:15 PST 2007


Hi,
   
  Please tell me will the following syantax in grammar will work
   
  mainRule
  scope {
  boolean LocalVar; 
  }
  @init
  {
  $mainRule::LocalVar = false;
  }
  : ruleA {$mainRule::LocalVar }?=> ruleB
  ;
   
  ruleA
  :IDENTIFIER {$mainRule::LocalVar = true;}
  | ruleX
  | ruleY
  ;
   
  Please tell me is this right? the mainRule should execute completly only if the condition is true.
  If this is wrong pls tell me how to achieve it?
   
  Thanks..
  
 
   

       
---------------------------------
 Yahoo! Answers - Get better answers from someone who knows. Tryit now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20071114/d4695218/attachment.html 


More information about the antlr-interest mailing list