anchor.diff:  	;
   
   and_tail 
  -	: AND! term^
  +	:	AND! term^
   	;	
   
   
   expr
  -	: term
  -		(	and_tail+ -> ^('&' term and_tail+)
  -		|	or_tail+ -> ^('|' term or_tail+)
  +	: (term -> term )
  +		(	and_tail+ -> ^(AND term and_tail+)
  +		|	or_tail+ -> ^(OR term or_tail+)
   		)?
   	;
   
  
positive.code: 
  qName
  	: namespace=ID ':' name=ID -> ^($name $namespace)
  	| ID^
  	;
  
  term
  	: qName^
  	|	qName EQ text_spec -> ^('=' qName text_spec)
  	| qName NEQ text_spec -> ^('=' qName text_spec)
  	| '('! expr^ ')'!
  	;
  	
  	
  
negative.code: 
  ID  :	('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*
      ;
      
  REF
  	:	'#' ( '0' .. '9' )+
  	;
  
  fragment
  HEX_DIGIT : ('0'..'9'|'a'..'f'|'A'..'F') ;
  