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..equals("1.0")) 
        { 
         ruleVersion1();
        }
        else if(myVersion.trim().equals("2.0"))
        {
           ruleVersion2();
        }
      }
  ;



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

  ruleVersion2:  { System.out.println("Inside  ruleVersion1");};
_______________________________________________
antlr-dev mailing list
[email protected]
http://www.antlr.org/mailman/listinfo/antlr-dev

Reply via email to