jdk/src/share/classes/sun/tools/tree/BinaryExpression.java
author prr
Tue, 15 Jul 2014 11:22:14 -0700
changeset 25522 10d789df41bb
parent 5506 202f599c92aa
child 25799 1afc4675dc75
permissions -rw-r--r--
8049892: Replace uses of 'new Integer()' with appropriate alternative across core classes Reviewed-by: psandoz, prr Contributed-by: otaviopolianasantana@gmail.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.tools.tree;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import sun.tools.java.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import sun.tools.asm.Label;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import sun.tools.asm.Assembler;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.io.PrintStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.util.Hashtable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * WARNING: The contents of this source file are not part of any
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * supported API.  Code that depends on them does so at its own risk:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * they are subject to change or removal without notice.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
public
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
class BinaryExpression extends UnaryExpression {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    Expression left;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
     * Constructor
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    BinaryExpression(int op, long where, Type type, Expression left, Expression right) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
        super(op, where, type, right);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
        this.left = left;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     * Order the expression based on precedence
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    public Expression order() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        if (precedence() > left.precedence()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
            UnaryExpression e = (UnaryExpression)left;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
            left = e.right;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
            e.right = order();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
            return e;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * Check a binary expression
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        vset = left.checkValue(env, ctx, vset, exp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        vset = right.checkValue(env, ctx, vset, exp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        int tm = left.type.getTypeMask() | right.type.getTypeMask();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        if ((tm & TM_ERROR) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
            return vset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
        selectType(env, ctx, tm);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
        if (type.isType(TC_ERROR)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
            env.error(where, "invalid.args", opNames[op]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        return vset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * Check if constant
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    public boolean isConstant() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        switch (op) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
        case MUL:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        case DIV:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        case REM:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        case ADD:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        case SUB:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        case LSHIFT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        case RSHIFT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        case URSHIFT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        case LT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        case LE:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        case GT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        case GE:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        case EQ:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        case NE:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        case BITAND:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        case BITXOR:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        case BITOR:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        case AND:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        case OR:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
            return left.isConstant() && right.isConstant();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * Evaluate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    Expression eval(int a, int b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    Expression eval(long a, long b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    Expression eval(float a, float b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    Expression eval(double a, double b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    Expression eval(boolean a, boolean b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    Expression eval(String a, String b) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    Expression eval() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        // See also the eval() code in BinaryShiftExpression.java.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        if (left.op == right.op) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
            switch (left.op) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
              case BYTEVAL:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
              case CHARVAL:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
              case SHORTVAL:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
              case INTVAL:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
                return eval(((IntegerExpression)left).value, ((IntegerExpression)right).value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
              case LONGVAL:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
                return eval(((LongExpression)left).value, ((LongExpression)right).value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
              case FLOATVAL:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
                return eval(((FloatExpression)left).value, ((FloatExpression)right).value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
              case DOUBLEVAL:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
                return eval(((DoubleExpression)left).value, ((DoubleExpression)right).value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
              case BOOLEANVAL:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
                return eval(((BooleanExpression)left).value, ((BooleanExpression)right).value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
              case STRINGVAL:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
                return eval(((StringExpression)left).value, ((StringExpression)right).value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * Inline
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    public Expression inline(Environment env, Context ctx) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        left = left.inline(env, ctx);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        right = right.inline(env, ctx);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        return (left == null) ? right : new CommaExpression(where, left, right);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    public Expression inlineValue(Environment env, Context ctx) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        left = left.inlineValue(env, ctx);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        right = right.inlineValue(env, ctx);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
            return eval().simplify();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        } catch (ArithmeticException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
            // Got rid of this error message.  It isn't illegal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
            // have a program which does a constant division by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            // zero.  We return `this' to make the compiler to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
            // generate code here.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
            // (bugs 4019304, 4089107).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
            // env.error(where, "arithmetic.exception");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
            return this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * Create a copy of the expression for method inlining
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    public Expression copyInline(Context ctx) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        BinaryExpression e = (BinaryExpression)clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        if (left != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
            e.left = left.copyInline(ctx);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
        if (right != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
            e.right = right.copyInline(ctx);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        return e;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * The cost of inlining this expression
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    public int costInline(int thresh, Environment env, Context ctx) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        return 1 + ((left != null) ? left.costInline(thresh, env, ctx) : 0) +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
                   ((right != null) ? right.costInline(thresh, env, ctx) : 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * Code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    void codeOperation(Environment env, Context ctx, Assembler asm) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        throw new CompilerError("codeOperation: " + opNames[op]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    public void codeValue(Environment env, Context ctx, Assembler asm) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        if (type.isType(TC_BOOLEAN)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
            Label l1 = new Label();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
            Label l2 = new Label();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
            codeBranch(env, ctx, asm, l1, true);
25522
10d789df41bb 8049892: Replace uses of 'new Integer()' with appropriate alternative across core classes
prr
parents: 5506
diff changeset
   215
            asm.add(true, where, opc_ldc, 0);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
            asm.add(true, where, opc_goto, l2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
            asm.add(l1);
25522
10d789df41bb 8049892: Replace uses of 'new Integer()' with appropriate alternative across core classes
prr
parents: 5506
diff changeset
   218
            asm.add(true, where, opc_ldc, 1);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
            asm.add(l2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
            left.codeValue(env, ctx, asm);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
            right.codeValue(env, ctx, asm);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
            codeOperation(env, ctx, asm);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     * Print
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    public void print(PrintStream out) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
        out.print("(" + opNames[op] + " ");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
        if (left != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
            left.print(out);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
            out.print("<null>");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        out.print(" ");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
        if (right != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
            right.print(out);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
            out.print("<null>");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        out.print(")");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
}