anchor.diff:          if ($qualifiedReference.typeArgumentList!=null)
               qe.setTypeArguments($qualifiedReference.typeArgumentList);
           $primary=qe; }
  -      | indexExpression
  -        { IndexExpression xe = new IndexExpression(null);
  -          xe.setPrimary($primary);
  -          xe.setIndexOperator($indexExpression.operator); 
  -          xe.setElementOrRange($indexExpression.elementOrRange);
  -          $primary=xe; }
         | arguments
           { InvocationExpression ie = new InvocationExpression(null);
             ie.setPrimary($primary);
  
positive.code:       )
      ;
  
  indexExpression returns [IndexOperator operator, ElementOrRange elementOrRange]
      : elementSelectionOperator 
        { $operator=$elementSelectionOperator.operator; }
        indexOrIndexRange 
        { $elementOrRange=$indexOrIndexRange.elementOrRange; }
        RBRACKET
      ;
  
  memberSelectionOperator returns [MemberOperator operator]
      : MEMBER_OP
        { $operator=new MemberOp($MEMBER_OP); }
  
negative.code:     )
      ;
  
  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);
          $indexExpression.setElementOrRange(e);
          e.setExpression($l.expression); }
        (
          ELLIPSIS
          { $indexExpression.setEndToken($ELLIPSIS); }
        { ElementRange er1 = new ElementRange(null);
          $indexExpression.setElementOrRange(er1);
          er1.setLowerBound($l.expression); }
        | RANGE_OP 
          { $indexExpression.setEndToken($RANGE_OP); }
          u=index 
        { ElementRange er2 = new ElementRange(null);
          $indexExpression.setElementOrRange(er2);
          er2.setLowerBound($l.expression); 
          er2.setUpperBound($u.expression); }
        | SEGMENT_OP
          { $indexExpression.setEndToken($SEGMENT_OP); }
          s=index 
        { ElementRange er3 = new ElementRange(null);
          $indexExpression.setElementOrRange(er3);
          er3.setLowerBound($l.expression); 
          er3.setLength($s.expression); }
        )?
        RBRACKET
        { $indexExpression.setEndToken($RBRACKET); }
      ;
  
  index returns [Expression expression]
  