anchor.diff:      ;
       
   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 NEGATION p=primaryExpression) -> unaryExpression(operator={$NEGATION.text}, primaryExpression={$p.st})
  +    | ^(UNARY PLUS p=primaryExpression) -> unaryExpression(operator={$PLUS.text}, primaryExpression={$p.st})
  +    | ^(UNARY MINUS p=primaryExpression) -> unaryExpression(operator={$MINUS.text}, primaryExpression={$p.st})
       | ^(UNARY p=primaryExpression) -> unaryExpression(primaryExpression={$p.st})
       ;
   
   primaryExpression 
  -    : c=builtInCall -> primaryExpression(builtInCall={$c.st}) 
  +    : e=brackettedExpression -> primaryExpression(brackettedExpression={$e.st}) 
  +    | 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})
  +    | u=unaryExpression -> primaryExpression(unaryExpression={$u.st})
  +    ;
  +
  +brackettedExpression
  +    : ^(BRACKETTED_EXPRESSION e=expression) -> brackettedExpression(expression={$e.st})
       ;
   
   builtInCall
  
positive.code:     | ^(TRIPLES_NODE ^(SUBJECT BLANK_NODE) p=propertyListNotEmpty) -> triplesNode(subject={"[ ]"}, propertyListNotEmpty={$p.st})
      ;
  
  graphNode
      : v=varOrTerm -> graphNode(varOrTerm={$v.st}) 
      | t=triplesNode -> graphNode(triplesNode={$t.st})
      ;
  
negative.code:     ;
  
  constraint
      : e=brackettedExpression -> constraint(brackettedExpression={$e.st})
      | b=builtInCall -> constraint(expression={$b.st})
      | f=functionCall -> constraint(expression={$f.st})
      ;
  