[antlr-interest] Newbie: NoViableAltException

me 262 me262c at gmail.com
Tue Apr 10 13:19:33 PDT 2007


Hi,

 I know this is very basic.  I am trying to parse the following two commands:

  mystr val;
  val = wolf;

  I am getting NoViableAltException on the first line.

  The grammar looks like this:

	command : (op_command) => op_command
	        | def_command
	    {#command = #([COMMAND, "COMMAND"], #command);};
	
	def_command : (	STRING SEMI!)
		{#def_command = #([DEFCOMMAND, "DEFCOMMAND"], #def_command);};
	
	op_command : ( STRING EQUALS! rhs SEMI!)
		{#op_command = #([OPCOMMAND, "OPCOMMAND"], #op_command);};	

Thanks in advance!


More information about the antlr-interest mailing list