anchor.diff:      ;
   
   orderCondition
  -    : ^(ORDER_CONDITION ASC e=expression) -> orderCondition(attribute={$ASC.text}, expression={$e.st})
  -    | ^(ORDER_CONDITION DESC e=expression) -> orderCondition(attribute={$DESC.text}, expression={$e.st})
  +    : ^(ORDER_CONDITION ASC b=brackettedExpression) -> orderCondition(attribute={$ASC.text}, brackettedExpression={$b.st})
  +    | ^(ORDER_CONDITION DESC b=brackettedExpression) -> orderCondition(attribute={$DESC.text}, brackettedExpression={$b.st})
       | ^(ORDER_CONDITION c=constraint) -> orderCondition(constraint={$c.st})
       | ^(ORDER_CONDITION v=var) -> orderCondition(var={$v.st})
       ;
  
positive.code:     ;
      
  unaryExpression
      : ^(UNARY_NOT p=primaryExpression) -> unaryExpression(operator={$UNARY_NOT.text}, primaryExpression={$p.st})
      | ^(UNARY_PLUS p=primaryExpression) -> unaryExpression(operator={$UNARY_PLUS.text}, primaryExpression={$p.st})
      | ^(UNARY_MINUS p=primaryExpression) -> unaryExpression(operator={$UNARY_MINUS.text}, primaryExpression={$p.st})
      | ^(UNARY p=primaryExpression) -> unaryExpression(primaryExpression={$p.st})
      ;
  
  primaryExpression 
      : c=builtInCall -> primaryExpression(builtInCall={$c.st}) 
      | i=iriRefOrFunction -> primaryExpression(iriRefOrFunction={$i.st}) 
      | r=rdfLiteral -> primaryExpression(rdfLiteral={$r.st})
      | n=numericLiteral  -> primaryExpression(numericLiteral={$n.st})
      | b=booleanLiteral -> primaryExpression(booleanLiteral={$b.st}) 
      | v=var -> primaryExpression(var={$v.st}) 
      | a=aggregate -> primaryExpression(aggregate={$a.st})
      ;
  
  builtInCall
  
negative.code:     ;
  
  constraint
      : e=brackettedExpression -> constraint(brackettedExpression={$e.st})
      | b=builtInCall -> constraint(expression={$b.st})
      | f=functionCall -> constraint(expression={$f.st})
      ;
  