[antlr-interest] Newbie: NoViableAltException

Loring Craymer lgcraymer at yahoo.com
Tue Apr 10 13:23:53 PDT 2007


Your first input line is STRING STRING SEMI, not the
STRING SEMI expected by your grammar.  Fix
def_command.

--Loring

--- me 262 <me262c at gmail.com> wrote:

> 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!
> 



       
____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check. 
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html 


More information about the antlr-interest mailing list