anchor.diff:  	;
   
   betweenExpr returns [Predicate retval]
  -	: a=attribRef[ExprType.NumberType] n=keyNOT? 
  +	: a=intAttrib n=keyNOT? 
   	  keyBETWEEN n1=numberExpr keyAND n2=numberExpr	{retval = new Between(ExprType.NumberType, $a.retval, ($n.text != null), $n1.retval, $n2.retval);}
  -	| a=attribRef[ExprType.StringType] n=keyNOT?  
  +	| a=strAttrib n=keyNOT?  
   	  keyBETWEEN s1=stringExpr keyAND s2=stringExpr	{retval = new Between(ExprType.StringType, $a.retval, ($n.text != null), $n1.retval, $n2.retval);}
  -	| a=attribRef[ExprType.DateType] n=keyNOT? 
  +	| a=dateAttrib n=keyNOT? 
   	  keyBETWEEN d1=dateExpr keyAND d2=dateExpr
   	;
   
   likeExpr 
  -	: attribRef[ExprType.StringType] 
  +	: strAttrib 
   	  keyNOT? keyLIKE pattern_value=stringLiteral; // ('ESCAPE' escape_character=string_literal)?;
   
   inExpr returns [Predicate retval]
  -	: a=attribRef[ExprType.NumberType] n=keyNOT? keyIN 
  +	: a=intAttrib n=keyNOT? keyIN 
   	  LPAREN i=intItemList RPAREN			{retval = new In(ExprType.NumberType, $a.retval, ($n.text != null), $i.retval);} 
  -	| a=attribRef[ExprType.StringType] n=keyNOT? keyIN 
  +	| a=strAttrib n=keyNOT? keyIN 
   	  LPAREN s=strItemList RPAREN			{retval = new In(ExprType.StringType, $a.retval, ($n.text != null), $s.retval);} 
   	;
   
  
positive.code: 	: keyWHERE c=orExpr 				{retval = new WhereExpr($c.retval);};
  		
  orExpr returns [Predicate retval]
  	: expr1=andExpr (keyOR expr2=orExpr)?		{retval= new OrExpr($expr1.retval, $expr2.retval);;}
  	//| cond_expr keyOR cond_term
  	;
  
  andExpr returns [Predicate retval]
  	: expr1=condFactor (keyAND expr2=andExpr)?	{retval = new AndExpr($expr1.retval, $expr2.retval);}
  	//| cond_term keyAND cond_factor
  	;
  	
  condFactor returns [Predicate retval]			 
  	: k=keyNOT? p=condPrimary			{retval = new CondFactor(($k.text != null), $p.retval);}
  	;
  
  condPrimary returns [Predicate retval]
  	: simpleCondExpr  				{retval = $simpleCondExpr.retval;}
  
negative.code: 	: 
  	;
  
  strAttrib returns [AttribRef retval]
  	: a=attribRef[ExprType.StringType] 		{retval = $a.retval;};
  
  intAttrib returns [AttribRef retval]
  	: a=attribRef[ExprType.NumberType] 		{retval = $a.retval;};
  
  dateAttrib returns [AttribRef retval]
  	: a=attribRef[ExprType.DateType] 		{retval = $a.retval;};
  
  attribRef [ExprType type] returns [AttribRef retval]
  	: v=ID 						{retval = new AttribRef(type, $v.text);};
  		
  