Hi ,
Can some one please help me in correcting this grammar ASAP . I want to call 
different rule based on the Version I get from the input .The following code 
works but not sure if this is the right way to do this in ANTLR - Thanks 

callVersionTemplate
  //THERE IS  A BETTER WAY TO DO 
  : { isValidVersion }? => (ALPHANUMERIC)* 
    {
        if (myVersion..equalsIgnoreCase("1.0")) 
        { 
         ruleVersion1();
        }
        else if(myVersion.trim().equalsIgnoreCase("2.0"))
        {
           ruleVersion2();
        }
      }
  ;



  ruleVersion1:  { System.out.println("Inside  ruleVersion1" );};

  ruleVersion2:  { System.out.println("Inside  ruleVersion1");};





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to