anchor.diff:      )
       ;
   
  -indexOrIndexRange returns [ElementOrRange elementOrRange]
  -    : l=index
  -    (
  +indexOrIndexRange returns [IndexExpression indexExpression]
  +    //TODO: move indexOperator to ElementOrRange and
  +    //      make this rule return ElementOrRange instead
  +    //      of IndexExpression, instantiating IndexExpression
  +    //      from the calling primary rule
  +    : elementSelectionOperator
  +      { $indexExpression = new IndexExpression(null);
  +        $indexExpression.setIndexOperator($elementSelectionOperator.operator); }
  +      l=index
         { Element e = new Element(null);
  -        $elementOrRange = e;
  +        $indexExpression.setElementOrRange(e);
           e.setExpression($l.expression); }
  -      | '...' 
  +      (
  +        ELLIPSIS
  +        { $indexExpression.setEndToken($ELLIPSIS); }
         { ElementRange er1 = new ElementRange(null);
  -        $elementOrRange = er1;
  +        $indexExpression.setElementOrRange(er1);
           er1.setLowerBound($l.expression); }
  -      | '..' u=index 
  +      | RANGE_OP 
  +        { $indexExpression.setEndToken($RANGE_OP); }
  +        u=index 
         { ElementRange er2 = new ElementRange(null);
  -        $elementOrRange = er2;
  +        $indexExpression.setElementOrRange(er2);
           er2.setLowerBound($l.expression); 
           er2.setUpperBound($u.expression); }
  -      | ':' s=index 
  +      | SEGMENT_OP
  +        { $indexExpression.setEndToken($SEGMENT_OP); }
  +        s=index 
         { ElementRange er3 = new ElementRange(null);
  -        $elementOrRange = er3;
  +        $indexExpression.setElementOrRange(er3);
           er3.setLowerBound($l.expression); 
           er3.setLength($s.expression); }
  -    )
  +      )?
  +      RBRACKET
  +      { $indexExpression.setEndToken($RBRACKET); }
       ;
   
   index returns [Expression expression]
  
positive.code:           if ($arguments.argumentList instanceof NamedArgumentList)
                ie.setNamedArgumentList((NamedArgumentList)$arguments.argumentList);
            $primary=ie; }
      )*
      ;
  
  
negative.code:       )
      ;
  
  memberSelectionOperator returns [MemberOperator operator]
      : MEMBER_OP
        { $operator=new MemberOp($MEMBER_OP); }
  