Loading ...
Sorry, an error occurred while loading the content.
 

Parser rule problem: newbie question.

Expand Messages
  • Bharath
    Hi grp, ... signedintegers returns [Vector strs] {strs = new Vector();} ... ( , id2: Signed_Int{strs.addElement(id2.getText());}) ; ... When I call this rule
    Message 1 of 1 , Mar 30, 2004
      Hi grp,

      I have a parser rule of this form:
      -----------------------------------------------------------
      signedintegers returns [Vector strs] {strs = new Vector();}
      : id: Signed_Int{strs.addElement(id.getText());}
      ("," id2: Signed_Int{strs.addElement(id2.getText());})
      ;
      -----------------------------------------------------------

      When I call this rule parser.signedintegers(); and provide values,
      it does not recognize the ",". For example, if my input is +99,-98
      it would say -- 1:4 unexpected character "," --. I am trying to
      provide several inputs to test my lexer rules and hence the mess.

      Thanks!

      B.
    Your message has been successfully submitted and would be delivered to recipients shortly.