author | lana |
Thu, 26 Dec 2013 12:04:16 -0800 | |
changeset 23010 | 6dadb192ad81 |
parent 21278 | ef8a3a2a72f2 |
child 25799 | 1afc4675dc75 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
23010
6dadb192ad81
8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents:
21278
diff
changeset
|
2 |
* Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package sun.tools.tree; |
|
27 |
||
28 |
import sun.tools.java.*; |
|
29 |
import java.util.Hashtable; |
|
30 |
||
31 |
/** |
|
21278 | 32 |
* Parenthesized expressions. |
2 | 33 |
* |
34 |
* WARNING: The contents of this source file are not part of any |
|
35 |
* supported API. Code that depends on them does so at its own risk: |
|
36 |
* they are subject to change or removal without notice. |
|
37 |
*/ |
|
38 |
||
39 |
public |
|
40 |
class ExprExpression extends UnaryExpression { |
|
41 |
/** |
|
42 |
* Constructor |
|
43 |
*/ |
|
44 |
public ExprExpression(long where, Expression right) { |
|
45 |
super(EXPR, where, right.type, right); |
|
46 |
} |
|
47 |
||
48 |
/** |
|
49 |
* Check a condition. We must pass it on to our unparenthesised form. |
|
50 |
*/ |
|
51 |
public void checkCondition(Environment env, Context ctx, Vset vset, |
|
52 |
Hashtable exp, ConditionVars cvars) { |
|
53 |
right.checkCondition(env, ctx, vset, exp, cvars); |
|
54 |
type = right.type; |
|
55 |
} |
|
56 |
||
57 |
/** |
|
58 |
* Check the expression if it appears as an lvalue. |
|
59 |
* We just pass it on to our unparenthesized subexpression. |
|
60 |
* (Part of fix for 4090372) |
|
61 |
*/ |
|
62 |
public Vset checkAssignOp(Environment env, Context ctx, |
|
63 |
Vset vset, Hashtable exp, Expression outside) { |
|
64 |
vset = right.checkAssignOp(env, ctx, vset, exp, outside); |
|
65 |
type = right.type; |
|
66 |
return vset; |
|
67 |
} |
|
68 |
||
69 |
/** |
|
70 |
* Delegate to our subexpression. |
|
71 |
* (Part of fix for 4090372) |
|
72 |
*/ |
|
73 |
public FieldUpdater getUpdater(Environment env, Context ctx) { |
|
74 |
return right.getUpdater(env, ctx); |
|
75 |
} |
|
76 |
||
77 |
// Allow (x) = 9; |
|
78 |
// |
|
79 |
// I will hold off on this until I'm sure about it. Nobody's |
|
80 |
// going to clammer for this one. |
|
81 |
// |
|
82 |
// public Vset checkLHS(Environment env, Context ctx, |
|
83 |
// Vset vset, Hashtable exp) { |
|
84 |
// vset = right.check(env, ctx, vset, exp); |
|
85 |
// type = right.type; |
|
86 |
// return vset; |
|
87 |
// } |
|
88 |
||
89 |
public boolean isNull() { |
|
90 |
return right.isNull(); |
|
91 |
} |
|
92 |
||
93 |
public boolean isNonNull() { |
|
94 |
return right.isNonNull(); |
|
95 |
} |
|
96 |
||
97 |
// Probably not necessary |
|
98 |
public Object getValue() { |
|
99 |
return right.getValue(); |
|
100 |
} |
|
101 |
||
102 |
/** |
|
103 |
* Delegate to our subexpression. |
|
104 |
* See the comment in AddExpression#inlineValueSB() for |
|
105 |
* information about this method. |
|
106 |
*/ |
|
107 |
protected StringBuffer inlineValueSB(Environment env, |
|
108 |
Context ctx, |
|
109 |
StringBuffer buffer) { |
|
110 |
return right.inlineValueSB(env, ctx, buffer); |
|
111 |
} |
|
112 |
||
113 |
/** |
|
114 |
* Select the type of the expression |
|
115 |
*/ |
|
116 |
void selectType(Environment env, Context ctx, int tm) { |
|
117 |
type = right.type; |
|
118 |
} |
|
119 |
||
120 |
/** |
|
121 |
* Simplify |
|
122 |
*/ |
|
123 |
Expression simplify() { |
|
124 |
return right; |
|
125 |
} |
|
126 |
} |