anchor.diff:  	| p=booleanParen				{retval = $p.retval;}
   	;
   
  +eqneCompare returns [ValueExpr retval]
  +options {backtrack=true;}	
  +	: v1=valueExpr o=eqneOp v2=valueExpr 		{retval = new ValueCompare($v1.retval, $o.retval, $v2.retval);}	
  +	| c=ltgtCompare					{retval = $c.retval;}
  +	;
  +
  +ltgtCompare returns [ValueExpr retval]
  +	: v1=valueExpr o=ltgtOp v2=valueExpr		{retval = new ValueCompare($v1.retval, $o.retval, $v2.retval);}
  +	;
  +
  +booleanParen returns [BooleanValue retval]
  +options {backtrack=true;}	
  +	: LPAREN o=booleanExpr RPAREN			{retval = $o.retval;}
  +	| f=booleanVal					{retval = $f.retval;}
  +	;
  +
  +booleanVal returns [BooleanValue retval]
  +options {backtrack=true;}	
  +	: f=booleanFuncs				{retval = $f.retval;}
  +	| b=booleanAtom					{retval = new BooleanExpr($b.retval);}
  +	;
  +	
  +booleanAtom returns [ValueExpr retval]
  +	: b=booleanLiteral				{retval = $b.retval;}
  +	| v=varRef					{retval = this.getVariableRef($v.text);}
  +	| p=paramRef
  +	;
  +			
   booleanFuncs returns [BooleanValue retval]
   options {backtrack=true;}	
   	: s1=valueExpr keyCONTAINS s2=valueExpr		{retval = new BooleanFunction(FunctionType.CONTAINS, $s1.retval, $s2.retval);}
  
positive.code: 	;
  
  // Functions
  functions returns [ValueExpr retval]
  	: keyNOW LPAREN	RPAREN				{retval = new DateLiteral(DateLiteral.Type.NOW);}
  	| keyMINDATE LPAREN RPAREN			{retval = new DateLiteral(DateLiteral.Type.MINDATE);}
  	| keyMAXDATE LPAREN RPAREN			{retval = new DateLiteral(DateLiteral.Type.MAXDATE);}
  
negative.code: 	| s1=valueExpr keyIS (n=keyNOT)? keyNULL	{retval = new ValueNullCompare(($n.text != null), $s1.retval);}	
  	;
  
  // Expressions
  valueExpr returns [ValueExpr retval] 
  @init {List<ValueExpr> exprList = Lists.newArrayList(); List<Operator> opList = Lists.newArrayList(); }
  