[antlr-interest] Two semantic actions possible

weberjn <weberjn at yahoo.com> weberjn at yahoo.com
Fri Feb 7 04:26:40 PST 2003


Hi,

in this grammar I wanted { s1=s;} to be called after both
alternatives. Antlr puts it to the void action (putting () around the
alternatives yields what I want). But shouldn't antlr warn that there
are two semantic actions in the rule?

Juergen


class MyParser extends Parser;

op_type_spec 
{ String s=null,s1=null;}

	:   "null" { s="null"; }
	|   "void" { s="void";}

	{ s1=s;} 
	        
	;


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list