anchor.diff:    ;
   //[11]
   RangeExpr
  -  : AdditiveExpr ( "to" AdditiveExpr )?
  +  : AdditiveExpr ( 'to' AdditiveExpr )?
     ;
   //[12]
   AdditiveExpr
  -  : MultiplicativeExpr ( ("+" | "-") MultiplicativeExpr )*
  +  : MultiplicativeExpr ( ('+' | '-') MultiplicativeExpr )*
     ;
   //[13]
   MultiplicativeExpr
  -  : UnionExpr ( ("*" | "div" | "idiv" | "mod") UnionExpr )*
  +  : UnionExpr ( ('*' | 'div' | 'idiv' | 'mod') UnionExpr )*
     ;
   //[14]
   UnionExpr
  -  : IntersectExceptExpr ( ("union" | "|") IntersectExceptExpr )*
  +  : IntersectExceptExpr ( ('union' | '|') IntersectExceptExpr )*
     ;
   //[15]
   IntersectExceptExpr
  -  : InstanceofExpr ( ("intersect" | "except") InstanceofExpr )*
  +  : InstanceofExpr ( ('intersect' | 'except') InstanceofExpr )*
     ;
   //[16]
   InstanceofExpr
  -  : TreatExpr ( "instance" "of" SequenceType )?
  +  : TreatExpr ( 'instance' 'of' SequenceType )?
     ;
   //[17]
   TreatExpr
  -  : CastableExpr ( "treat" "as" SequenceType )?
  +  : CastableExpr ( 'treat' 'as' SequenceType )?
     ;
   //[18]
   CastableExpr
  -  : CastExpr ( "castable" "as" SingleType )?
  +  : CastExpr ( 'castable' 'as' SingleType )?
     ;
   //[19]
   CastExpr
  -  : UnaryExpr ( "cast" "as" SingleType )?
  +  : UnaryExpr ( 'cast' 'as' SingleType )?
     ;
   //[20]
   UnaryExpr
  -  : ("-" | "+")* ValueExpr
  +  : ('-' | '+')* ValueExpr
     ;
   //[21]
   ValueExpr
  
positive.code: 
  // XPath 2.0
  
  //[1]
  XPath
    : Expr
    ;
  //[2]
  Expr
    : ExprSingle ("," ExprSingle)*
    ;
  //[3]
  ExprSingle
  
negative.code:   ;
  //[46]
  ParenthesizedExpr
    : '(' Expr? ')'
    ;
  //[47]
  ContextItemExpr
    : '.'
    ;
  //[48]
  FunctionCall
    : QName '(' (ExprSingle (',' ExprSingle)*)? ')'   /* xgs: reserved-function-names */
    ;
          /* gn: parens */
  //[49]
  SingleType
    : AtomicType '?'?
    ;
  //[50]
  SequenceType
    : ('empty-sequence' '(' ')')
    | (ItemType OccurrenceIndicator?)
    ;
  //[51]
  OccurrenceIndicator
    : '?' | '*' | '+'   /* xgs: occurrence-indicators */
    ;
  //[52]
  ItemType
    : KindTest | ('item' '(' ')') | AtomicType
    ;
  //[53]
  AtomicType
  