Пример #1
0
 // ArrayIndexExpression
 private void Dump(ArrayIndexExpression node)
 {
     WalkNode(node.Array);
     Out("[");
     WalkNode(node.Index);
     Out("]");
 }
Пример #2
0
 // ArrayIndexExpression
 private void DefaultWalk(ArrayIndexExpression node)
 {
     if (Walk(node))
     {
         WalkNode(node.Array);
         WalkNode(node.Index);
     }
     PostWalk(node);
 }
Пример #3
0
        // ArrayIndexExpression
        private Expression Rewrite(ArrayIndexExpression node)
        {
            Expression array = RewriteExpression(node.Array);
            Expression index = RewriteExpression(node.Index);

            if (((object)array != (object)node.Array) ||
                ((object)index != (object)node.Index))
            {
                Expression saveArray, saveIndex;

                array = ToTemp(array, out saveArray);
                index = ToTemp(index, out saveIndex);

                return(Ast.Comma(
                           saveArray,
                           saveIndex,
                           Ast.ArrayIndex(array, index)
                           ));
            }
            else
            {
                return(node);
            }
        }