1 /*******************************************************************************
2 * Copyright (c) 2000, 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.jdt.internal.compiler.impl;
13 import org.eclipse.jdt.internal.compiler.ast.OperatorIds;
14 import org.eclipse.jdt.internal.compiler.lookup.TypeIds;
15 import org.eclipse.jdt.internal.compiler.problem.ShouldNotImplement;
16 import org.eclipse.jdt.internal.compiler.util.Util;
18 public abstract class Constant implements TypeIds, OperatorIds {
20 public static final Constant NotAConstant = new DoubleConstant(Double.NaN);
22 public static final IntConstant Zero = new IntConstant(0);
23 public static final IntConstant Two = new IntConstant(2);
24 public static final IntConstant One = new IntConstant(1);
26 public boolean booleanValue() {
28 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"boolean")); //$NON-NLS-1$ //$NON-NLS-2$
31 public byte byteValue() {
33 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"byte")); //$NON-NLS-1$ //$NON-NLS-2$
36 public final Constant castTo(int conversionToTargetType){
37 //the cast is an int of the form
38 // (castId<<4)+typeId (in order to follow the
39 //user written style (cast)expression ....
41 if (this == NotAConstant) return NotAConstant;
42 switch(conversionToTargetType){
43 case T_undefined : return this;
44 // TARGET TYPE <- FROM TYPE
45 // case (T_undefined<<4)+T_undefined : return NotAConstant;
46 // case (T_undefined<<4)+T_byte : return NotAConstant;
47 // case (T_undefined<<4)+T_long : return NotAConstant;
48 // case (T_undefined<<4)+T_short : return NotAConstant;
49 // case (T_undefined<<4)+T_void : return NotAConstant;
50 // case (T_undefined<<4)+T_String : return NotAConstant;
51 // case (T_undefined<<4)+T_Object : return NotAConstant;
52 // case (T_undefined<<4)+T_double : return NotAConstant;
53 // case (T_undefined<<4)+T_float : return NotAConstant;
54 // case (T_undefined<<4)+T_boolean : return NotAConstant;
55 // case (T_undefined<<4)+T_char : return NotAConstant;
56 // case (T_undefined<<4)+T_int : return NotAConstant;
58 // case (T_byte<<4)+T_undefined : return NotAConstant;
59 case (T_byte<<4)+T_byte : return this;
60 case (T_byte<<4)+T_long : return Constant.fromValue((byte)this.longValue());
61 case (T_byte<<4)+T_short : return Constant.fromValue((byte)this.shortValue());
62 // case (T_byte<<4)+T_void : return NotAConstant;
63 // case (T_byte<<4)+T_String : return NotAConstant;
64 // case (T_byte<<4)+T_Object : return NotAConstant;
65 case (T_byte<<4)+T_double : return Constant.fromValue((byte)this.doubleValue());
66 case (T_byte<<4)+T_float : return Constant.fromValue((byte)this.floatValue());
67 // case (T_byte<<4)+T_boolean : return NotAConstant;
68 case (T_byte<<4)+T_char : return Constant.fromValue((byte)this.charValue());
69 case (T_byte<<4)+T_int : return Constant.fromValue((byte)this.intValue());
71 // case (T_long<<4)+T_undefined : return NotAConstant;
72 case (T_long<<4)+T_byte : return Constant.fromValue((long)this.byteValue());
73 case (T_long<<4)+T_long : return this;
74 case (T_long<<4)+T_short : return Constant.fromValue((long)this.shortValue());
75 // case (T_long<<4)+T_void : return NotAConstant;
76 // case (T_long<<4)+T_String : return NotAConstant;
77 // case (T_long<<4)+T_Object : return NotAConstant;
78 case (T_long<<4)+T_double : return Constant.fromValue((long)this.doubleValue());
79 case (T_long<<4)+T_float : return Constant.fromValue((long)this.floatValue());
80 // case (T_long<<4)+T_boolean : return NotAConstant;
81 case (T_long<<4)+T_char : return Constant.fromValue((long)this.charValue());
82 case (T_long<<4)+T_int : return Constant.fromValue((long)this.intValue());
84 // case (T_short<<4)+T_undefined : return NotAConstant;
85 case (T_short<<4)+T_byte : return Constant.fromValue((short)this.byteValue());
86 case (T_short<<4)+T_long : return Constant.fromValue((short)this.longValue());
87 case (T_short<<4)+T_short : return this;
88 // case (T_short<<4)+T_void : return NotAConstant;
89 // case (T_short<<4)+T_String : return NotAConstant;
90 // case (T_short<<4)+T_Object : return NotAConstant;
91 case (T_short<<4)+T_double : return Constant.fromValue((short)this.doubleValue());
92 case (T_short<<4)+T_float : return Constant.fromValue((short)this.floatValue());
93 // case (T_short<<4)+T_boolean : return NotAConstant;
94 case (T_short<<4)+T_char : return Constant.fromValue((short)this.charValue());
95 case (T_short<<4)+T_int : return Constant.fromValue((short)this.intValue());
97 // case (T_void<<4)+T_undefined : return NotAConstant;
98 // case (T_void<<4)+T_byte : return NotAConstant;
99 // case (T_void<<4)+T_long : return NotAConstant;
100 // case (T_void<<4)+T_short : return NotAConstant;
101 // case (T_void<<4)+T_void : return NotAConstant;
102 // case (T_void<<4)+T_String : return NotAConstant;
103 // case (T_void<<4)+T_Object : return NotAConstant;
104 // case (T_void<<4)+T_double : return NotAConstant;
105 // case (T_void<<4)+T_float : return NotAConstant;
106 // case (T_void<<4)+T_boolean : return NotAConstant;
107 // case (T_void<<4)+T_char : return NotAConstant;
108 // case (T_void<<4)+T_int : return NotAConstant;
110 // case (T_String<<4)+T_undefined : return NotAConstant;
111 // case (T_String<<4)+T_byte : return NotAConstant;
112 // case (T_String<<4)+T_long : return NotAConstant;
113 // case (T_String<<4)+T_short : return NotAConstant;
114 // case (T_String<<4)+T_void : return NotAConstant;
115 case (T_JavaLangString<<4)+T_JavaLangString : return this;
116 // case (T_String<<4)+T_Object : return NotAConstant;
117 // case (T_String<<4)+T_double : return NotAConstant;
118 // case (T_String<<4)+T_float : return NotAConstant;
119 // case (T_String<<4)+T_boolean : return NotAConstant;
120 // case (T_String<<4)+T_char : return NotAConstant;
121 // case (T_String<<4)+T_int : return NotAConstant;
123 // case (T_Object<<4)+T_undefined : return NotAConstant;
124 // case (T_Object<<4)+T_byte : return NotAConstant;
125 // case (T_Object<<4)+T_long : return NotAConstant;
126 // case (T_Object<<4)+T_short : return NotAConstant;
127 // case (T_Object<<4)+T_void : return NotAConstant;
128 // case (T_Object<<4)+T_String : return NotAConstant;
129 // case (T_Object<<4)+T_Object : return NotAConstant;
130 // case (T_Object<<4)+T_double : return NotAConstant;
131 // case (T_Object<<4)+T_float : return NotAConstant;
132 // case (T_Object<<4)+T_boolean : return NotAConstant;
133 // case (T_Object<<4)+T_char : return NotAConstant;
134 // case (T_Object<<4)+T_int : return NotAConstant;
136 // case (T_double<<4)+T_undefined : return NotAConstant;
137 case (T_double<<4)+T_byte : return Constant.fromValue((double)this.byteValue());
138 case (T_double<<4)+T_long : return Constant.fromValue((double)this.longValue());
139 case (T_double<<4)+T_short : return Constant.fromValue((double)this.shortValue());
140 // case (T_double<<4)+T_void : return NotAConstant;
141 // case (T_double<<4)+T_String : return NotAConstant;
142 // case (T_double<<4)+T_Object : return NotAConstant;
143 case (T_double<<4)+T_double : return this;
144 case (T_double<<4)+T_float : return Constant.fromValue((double)this.floatValue());
145 // case (T_double<<4)+T_boolean : return NotAConstant;
146 case (T_double<<4)+T_char : return Constant.fromValue((double)this.charValue());
147 case (T_double<<4)+T_int : return Constant.fromValue((double)this.intValue());
149 // case (T_float<<4)+T_undefined : return NotAConstant;
150 case (T_float<<4)+T_byte : return Constant.fromValue((float)this.byteValue());
151 case (T_float<<4)+T_long : return Constant.fromValue((float)this.longValue());
152 case (T_float<<4)+T_short : return Constant.fromValue((float)this.shortValue());
153 // case (T_float<<4)+T_void : return NotAConstant;
154 // case (T_float<<4)+T_String : return NotAConstant;
155 // case (T_float<<4)+T_Object : return NotAConstant;
156 case (T_float<<4)+T_double : return Constant.fromValue((float)this.doubleValue());
157 case (T_float<<4)+T_float : return this;
158 // case (T_float<<4)+T_boolean : return NotAConstant;
159 case (T_float<<4)+T_char : return Constant.fromValue((float)this.charValue());
160 case (T_float<<4)+T_int : return Constant.fromValue((float)this.intValue());
162 // case (T_boolean<<4)+T_undefined : return NotAConstant;
163 // case (T_boolean<<4)+T_byte : return NotAConstant;
164 // case (T_boolean<<4)+T_long : return NotAConstant;
165 // case (T_boolean<<4)+T_short : return NotAConstant;
166 // case (T_boolean<<4)+T_void : return NotAConstant;
167 // case (T_boolean<<4)+T_String : return NotAConstant;
168 // case (T_boolean<<4)+T_Object : return NotAConstant;
169 // case (T_boolean<<4)+T_double : return NotAConstant;
170 // case (T_boolean<<4)+T_float : return NotAConstant;
171 case (T_boolean<<4)+T_boolean : return this;
172 // case (T_boolean<<4)+T_char : return NotAConstant;
173 // case (T_boolean<<4)+T_int : return NotAConstant;
175 // case (T_char<<4)+T_undefined : return NotAConstant;
176 case (T_char<<4)+T_byte : return Constant.fromValue((char)this.byteValue());
177 case (T_char<<4)+T_long : return Constant.fromValue((char)this.longValue());
178 case (T_char<<4)+T_short : return Constant.fromValue((char)this.shortValue());
179 // case (T_char<<4)+T_void : return NotAConstant;
180 // case (T_char<<4)+T_String : return NotAConstant;
181 // case (T_char<<4)+T_Object : return NotAConstant;
182 case (T_char<<4)+T_double : return Constant.fromValue((char)this.doubleValue());
183 case (T_char<<4)+T_float : return Constant.fromValue((char)this.floatValue());
184 // case (T_char<<4)+T_boolean : return NotAConstant;
185 case (T_char<<4)+T_char : return this;
186 case (T_char<<4)+T_int : return Constant.fromValue((char)this.intValue());
188 // case (T_int<<4)+T_undefined : return NotAConstant;
189 case (T_int<<4)+T_byte : return Constant.fromValue((int)this.byteValue());
190 case (T_int<<4)+T_long : return Constant.fromValue((int)this.longValue());
191 case (T_int<<4)+T_short : return Constant.fromValue((int)this.shortValue());
192 // case (T_int<<4)+T_void : return NotAConstant;
193 // case (T_int<<4)+T_String : return NotAConstant;
194 // case (T_int<<4)+T_Object : return NotAConstant;
195 case (T_int<<4)+T_double : return Constant.fromValue((int)this.doubleValue());
196 case (T_int<<4)+T_float : return Constant.fromValue((int)this.floatValue());
197 // case (T_int<<4)+T_boolean : return NotAConstant;
198 case (T_int<<4)+T_char : return Constant.fromValue((int)this.charValue());
199 case (T_int<<4)+T_int : return this;
206 public char charValue() {
208 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"char")); //$NON-NLS-1$ //$NON-NLS-2$
211 public static final Constant computeConstantOperation(Constant cst, int id, int operator) {
215 return Constant.fromValue(!cst.booleanValue());
217 return computeConstantOperationPLUS(Zero,T_int,cst,id);
218 case MINUS : //the two special -9223372036854775808L and -2147483648 are inlined at parseTime
220 case T_float : float f;
221 if ( (f= cst.floatValue()) == 0.0f)
222 { //positive and negative 0....
223 if (Float.floatToIntBits(f) == 0)
224 return Constant.fromValue(-0.0f);
226 return Constant.fromValue(0.0f);}
227 break; //default case
228 case T_double : double d;
229 if ( (d= cst.doubleValue()) == 0.0d)
230 { //positive and negative 0....
231 if (Double.doubleToLongBits(d) == 0)
232 return Constant.fromValue(-0.0d);
234 return Constant.fromValue(0.0d);}
235 break; //default case
237 return computeConstantOperationMINUS(Zero,T_int,cst,id);
240 case T_char : return Constant.fromValue(~ cst.charValue());
241 case T_byte: return Constant.fromValue(~ cst.byteValue());
242 case T_short: return Constant.fromValue(~ cst.shortValue());
243 case T_int: return Constant.fromValue(~ cst.intValue());
244 case T_long: return Constant.fromValue(~ cst.longValue());
245 default : return NotAConstant;
247 default : return NotAConstant;
251 public static final Constant computeConstantOperation(Constant left, int leftId, int operator, Constant right, int rightId) {
254 case AND : return computeConstantOperationAND (left,leftId,right,rightId);
255 case AND_AND : return computeConstantOperationAND_AND (left,leftId,right,rightId);
256 case DIVIDE : return computeConstantOperationDIVIDE (left,leftId,right,rightId);
257 case GREATER : return computeConstantOperationGREATER (left,leftId,right,rightId);
258 case GREATER_EQUAL : return computeConstantOperationGREATER_EQUAL(left,leftId,right,rightId);
259 case LEFT_SHIFT : return computeConstantOperationLEFT_SHIFT (left,leftId,right,rightId);
260 case LESS : return computeConstantOperationLESS (left,leftId,right,rightId);
261 case LESS_EQUAL : return computeConstantOperationLESS_EQUAL (left,leftId,right,rightId);
262 case MINUS : return computeConstantOperationMINUS (left,leftId,right,rightId);
263 case MULTIPLY : return computeConstantOperationMULTIPLY (left,leftId,right,rightId);
264 case OR : return computeConstantOperationOR (left,leftId,right,rightId);
265 case OR_OR : return computeConstantOperationOR_OR (left,leftId,right,rightId);
266 case PLUS : return computeConstantOperationPLUS (left,leftId,right,rightId);
267 case REMAINDER : return computeConstantOperationREMAINDER (left,leftId,right,rightId);
268 case RIGHT_SHIFT: return computeConstantOperationRIGHT_SHIFT(left,leftId,right,rightId);
269 case UNSIGNED_RIGHT_SHIFT: return computeConstantOperationUNSIGNED_RIGHT_SHIFT(left,leftId,right,rightId);
270 case XOR : return computeConstantOperationXOR (left,leftId,right,rightId);
272 default : return NotAConstant;
276 public static final Constant computeConstantOperationAND(Constant left, int leftId, Constant right, int rightId) {
279 case T_boolean : return Constant.fromValue(left.booleanValue() & right.booleanValue());
282 case T_char : return Constant.fromValue(left.charValue() & right.charValue());
283 case T_byte: return Constant.fromValue(left.charValue() & right.byteValue());
284 case T_short: return Constant.fromValue(left.charValue() & right.shortValue());
285 case T_int: return Constant.fromValue(left.charValue() & right.intValue());
286 case T_long: return Constant.fromValue(left.charValue() & right.longValue());
291 case T_char : return Constant.fromValue(left.byteValue() & right.charValue());
292 case T_byte: return Constant.fromValue(left.byteValue() & right.byteValue());
293 case T_short: return Constant.fromValue(left.byteValue() & right.shortValue());
294 case T_int: return Constant.fromValue(left.byteValue() & right.intValue());
295 case T_long: return Constant.fromValue(left.byteValue() & right.longValue());
300 case T_char : return Constant.fromValue(left.shortValue() & right.charValue());
301 case T_byte: return Constant.fromValue(left.shortValue() & right.byteValue());
302 case T_short: return Constant.fromValue(left.shortValue() & right.shortValue());
303 case T_int: return Constant.fromValue(left.shortValue() & right.intValue());
304 case T_long: return Constant.fromValue(left.shortValue() & right.longValue());
309 case T_char : return Constant.fromValue(left.intValue() & right.charValue());
310 case T_byte: return Constant.fromValue(left.intValue() & right.byteValue());
311 case T_short: return Constant.fromValue(left.intValue() & right.shortValue());
312 case T_int: return Constant.fromValue(left.intValue() & right.intValue());
313 case T_long: return Constant.fromValue(left.intValue() & right.longValue());
318 case T_char : return Constant.fromValue(left.longValue() & right.charValue());
319 case T_byte: return Constant.fromValue(left.longValue() & right.byteValue());
320 case T_short: return Constant.fromValue(left.longValue() & right.shortValue());
321 case T_int: return Constant.fromValue(left.longValue() & right.intValue());
322 case T_long: return Constant.fromValue(left.longValue() & right.longValue());
329 public static final Constant computeConstantOperationAND_AND(Constant left, int leftId, Constant right, int rightId) {
331 return Constant.fromValue(left.booleanValue() && right.booleanValue());
334 public static final Constant computeConstantOperationDIVIDE(Constant left, int leftId, Constant right, int rightId) {
335 // division by zero must be handled outside this method (error reporting)
340 case T_char : return Constant.fromValue(left.charValue() / right.charValue());
341 case T_float: return Constant.fromValue(left.charValue() / right.floatValue());
342 case T_double: return Constant.fromValue(left.charValue() / right.doubleValue());
343 case T_byte: return Constant.fromValue(left.charValue() / right.byteValue());
344 case T_short: return Constant.fromValue(left.charValue() / right.shortValue());
345 case T_int: return Constant.fromValue(left.charValue() / right.intValue());
346 case T_long: return Constant.fromValue(left.charValue() / right.longValue());
351 case T_char : return Constant.fromValue(left.floatValue() / right.charValue());
352 case T_float: return Constant.fromValue(left.floatValue() / right.floatValue());
353 case T_double: return Constant.fromValue(left.floatValue() / right.doubleValue());
354 case T_byte: return Constant.fromValue(left.floatValue() / right.byteValue());
355 case T_short: return Constant.fromValue(left.floatValue() / right.shortValue());
356 case T_int: return Constant.fromValue(left.floatValue() / right.intValue());
357 case T_long: return Constant.fromValue(left.floatValue() / right.longValue());
362 case T_char : return Constant.fromValue(left.doubleValue() / right.charValue());
363 case T_float: return Constant.fromValue(left.doubleValue() / right.floatValue());
364 case T_double: return Constant.fromValue(left.doubleValue() / right.doubleValue());
365 case T_byte: return Constant.fromValue(left.doubleValue() / right.byteValue());
366 case T_short: return Constant.fromValue(left.doubleValue() / right.shortValue());
367 case T_int: return Constant.fromValue(left.doubleValue() / right.intValue());
368 case T_long: return Constant.fromValue(left.doubleValue() / right.longValue());
373 case T_char : return Constant.fromValue(left.byteValue() / right.charValue());
374 case T_float: return Constant.fromValue(left.byteValue() / right.floatValue());
375 case T_double: return Constant.fromValue(left.byteValue() / right.doubleValue());
376 case T_byte: return Constant.fromValue(left.byteValue() / right.byteValue());
377 case T_short: return Constant.fromValue(left.byteValue() / right.shortValue());
378 case T_int: return Constant.fromValue(left.byteValue() / right.intValue());
379 case T_long: return Constant.fromValue(left.byteValue() / right.longValue());
384 case T_char : return Constant.fromValue(left.shortValue() / right.charValue());
385 case T_float: return Constant.fromValue(left.shortValue() / right.floatValue());
386 case T_double: return Constant.fromValue(left.shortValue() / right.doubleValue());
387 case T_byte: return Constant.fromValue(left.shortValue() / right.byteValue());
388 case T_short: return Constant.fromValue(left.shortValue() / right.shortValue());
389 case T_int: return Constant.fromValue(left.shortValue() / right.intValue());
390 case T_long: return Constant.fromValue(left.shortValue() / right.longValue());
395 case T_char : return Constant.fromValue(left.intValue() / right.charValue());
396 case T_float: return Constant.fromValue(left.intValue() / right.floatValue());
397 case T_double: return Constant.fromValue(left.intValue() / right.doubleValue());
398 case T_byte: return Constant.fromValue(left.intValue() / right.byteValue());
399 case T_short: return Constant.fromValue(left.intValue() / right.shortValue());
400 case T_int: return Constant.fromValue(left.intValue() / right.intValue());
401 case T_long: return Constant.fromValue(left.intValue() / right.longValue());
406 case T_char : return Constant.fromValue(left.longValue() / right.charValue());
407 case T_float: return Constant.fromValue(left.longValue() / right.floatValue());
408 case T_double: return Constant.fromValue(left.longValue() / right.doubleValue());
409 case T_byte: return Constant.fromValue(left.longValue() / right.byteValue());
410 case T_short: return Constant.fromValue(left.longValue() / right.shortValue());
411 case T_int: return Constant.fromValue(left.longValue() / right.intValue());
412 case T_long: return Constant.fromValue(left.longValue() / right.longValue());
420 public static final Constant computeConstantOperationEQUAL_EQUAL(Constant left, int leftId, Constant right, int rightId) {
424 if (rightId == T_boolean) {
425 return Constant.fromValue(left.booleanValue() == right.booleanValue());
430 case T_char : return Constant.fromValue(left.charValue() == right.charValue());
431 case T_float: return Constant.fromValue(left.charValue() == right.floatValue());
432 case T_double: return Constant.fromValue(left.charValue() == right.doubleValue());
433 case T_byte: return Constant.fromValue(left.charValue() == right.byteValue());
434 case T_short: return Constant.fromValue(left.charValue() == right.shortValue());
435 case T_int: return Constant.fromValue(left.charValue() == right.intValue());
436 case T_long: return Constant.fromValue(left.charValue() == right.longValue());}
440 case T_char : return Constant.fromValue(left.floatValue() == right.charValue());
441 case T_float: return Constant.fromValue(left.floatValue() == right.floatValue());
442 case T_double: return Constant.fromValue(left.floatValue() == right.doubleValue());
443 case T_byte: return Constant.fromValue(left.floatValue() == right.byteValue());
444 case T_short: return Constant.fromValue(left.floatValue() == right.shortValue());
445 case T_int: return Constant.fromValue(left.floatValue() == right.intValue());
446 case T_long: return Constant.fromValue(left.floatValue() == right.longValue());
451 case T_char : return Constant.fromValue(left.doubleValue() == right.charValue());
452 case T_float: return Constant.fromValue(left.doubleValue() == right.floatValue());
453 case T_double: return Constant.fromValue(left.doubleValue() == right.doubleValue());
454 case T_byte: return Constant.fromValue(left.doubleValue() == right.byteValue());
455 case T_short: return Constant.fromValue(left.doubleValue() == right.shortValue());
456 case T_int: return Constant.fromValue(left.doubleValue() == right.intValue());
457 case T_long: return Constant.fromValue(left.doubleValue() == right.longValue());
462 case T_char : return Constant.fromValue(left.byteValue() == right.charValue());
463 case T_float: return Constant.fromValue(left.byteValue() == right.floatValue());
464 case T_double: return Constant.fromValue(left.byteValue() == right.doubleValue());
465 case T_byte: return Constant.fromValue(left.byteValue() == right.byteValue());
466 case T_short: return Constant.fromValue(left.byteValue() == right.shortValue());
467 case T_int: return Constant.fromValue(left.byteValue() == right.intValue());
468 case T_long: return Constant.fromValue(left.byteValue() == right.longValue());
473 case T_char : return Constant.fromValue(left.shortValue() == right.charValue());
474 case T_float: return Constant.fromValue(left.shortValue() == right.floatValue());
475 case T_double: return Constant.fromValue(left.shortValue() == right.doubleValue());
476 case T_byte: return Constant.fromValue(left.shortValue() == right.byteValue());
477 case T_short: return Constant.fromValue(left.shortValue() == right.shortValue());
478 case T_int: return Constant.fromValue(left.shortValue() == right.intValue());
479 case T_long: return Constant.fromValue(left.shortValue() == right.longValue());
484 case T_char : return Constant.fromValue(left.intValue() == right.charValue());
485 case T_float: return Constant.fromValue(left.intValue() == right.floatValue());
486 case T_double: return Constant.fromValue(left.intValue() == right.doubleValue());
487 case T_byte: return Constant.fromValue(left.intValue() == right.byteValue());
488 case T_short: return Constant.fromValue(left.intValue() == right.shortValue());
489 case T_int: return Constant.fromValue(left.intValue() == right.intValue());
490 case T_long: return Constant.fromValue(left.intValue() == right.longValue());
495 case T_char : return Constant.fromValue(left.longValue() == right.charValue());
496 case T_float: return Constant.fromValue(left.longValue() == right.floatValue());
497 case T_double: return Constant.fromValue(left.longValue() == right.doubleValue());
498 case T_byte: return Constant.fromValue(left.longValue() == right.byteValue());
499 case T_short: return Constant.fromValue(left.longValue() == right.shortValue());
500 case T_int: return Constant.fromValue(left.longValue() == right.intValue());
501 case T_long: return Constant.fromValue(left.longValue() == right.longValue());
504 case T_JavaLangString :
505 if (rightId == T_JavaLangString) {
506 //String are interned in th compiler==>thus if two string constant
507 //get to be compared, it is an equal on the vale which is done
508 return Constant.fromValue(((StringConstant)left).compileTimeEqual((StringConstant)right));
512 if (rightId == T_JavaLangString) {
513 return Constant.fromValue(false);
515 if (rightId == T_null) {
516 return Constant.fromValue(true);
521 return Constant.fromValue(false);
524 public static final Constant computeConstantOperationGREATER(Constant left, int leftId, Constant right, int rightId) {
529 case T_char : return Constant.fromValue(left.charValue() > right.charValue());
530 case T_float: return Constant.fromValue(left.charValue() > right.floatValue());
531 case T_double: return Constant.fromValue(left.charValue() > right.doubleValue());
532 case T_byte: return Constant.fromValue(left.charValue() > right.byteValue());
533 case T_short: return Constant.fromValue(left.charValue() > right.shortValue());
534 case T_int: return Constant.fromValue(left.charValue() > right.intValue());
535 case T_long: return Constant.fromValue(left.charValue() > right.longValue());
540 case T_char : return Constant.fromValue(left.floatValue() > right.charValue());
541 case T_float: return Constant.fromValue(left.floatValue() > right.floatValue());
542 case T_double: return Constant.fromValue(left.floatValue() > right.doubleValue());
543 case T_byte: return Constant.fromValue(left.floatValue() > right.byteValue());
544 case T_short: return Constant.fromValue(left.floatValue() > right.shortValue());
545 case T_int: return Constant.fromValue(left.floatValue() > right.intValue());
546 case T_long: return Constant.fromValue(left.floatValue() > right.longValue());
551 case T_char : return Constant.fromValue(left.doubleValue() > right.charValue());
552 case T_float: return Constant.fromValue(left.doubleValue() > right.floatValue());
553 case T_double: return Constant.fromValue(left.doubleValue() > right.doubleValue());
554 case T_byte: return Constant.fromValue(left.doubleValue() > right.byteValue());
555 case T_short: return Constant.fromValue(left.doubleValue() > right.shortValue());
556 case T_int: return Constant.fromValue(left.doubleValue() > right.intValue());
557 case T_long: return Constant.fromValue(left.doubleValue() > right.longValue());
562 case T_char : return Constant.fromValue(left.byteValue() > right.charValue());
563 case T_float: return Constant.fromValue(left.byteValue() > right.floatValue());
564 case T_double: return Constant.fromValue(left.byteValue() > right.doubleValue());
565 case T_byte: return Constant.fromValue(left.byteValue() > right.byteValue());
566 case T_short: return Constant.fromValue(left.byteValue() > right.shortValue());
567 case T_int: return Constant.fromValue(left.byteValue() > right.intValue());
568 case T_long: return Constant.fromValue(left.byteValue() > right.longValue());
573 case T_char : return Constant.fromValue(left.shortValue() > right.charValue());
574 case T_float: return Constant.fromValue(left.shortValue() > right.floatValue());
575 case T_double: return Constant.fromValue(left.shortValue() > right.doubleValue());
576 case T_byte: return Constant.fromValue(left.shortValue() > right.byteValue());
577 case T_short: return Constant.fromValue(left.shortValue() > right.shortValue());
578 case T_int: return Constant.fromValue(left.shortValue() > right.intValue());
579 case T_long: return Constant.fromValue(left.shortValue() > right.longValue());
584 case T_char : return Constant.fromValue(left.intValue() > right.charValue());
585 case T_float: return Constant.fromValue(left.intValue() > right.floatValue());
586 case T_double: return Constant.fromValue(left.intValue() > right.doubleValue());
587 case T_byte: return Constant.fromValue(left.intValue() > right.byteValue());
588 case T_short: return Constant.fromValue(left.intValue() > right.shortValue());
589 case T_int: return Constant.fromValue(left.intValue() > right.intValue());
590 case T_long: return Constant.fromValue(left.intValue() > right.longValue());
595 case T_char : return Constant.fromValue(left.longValue() > right.charValue());
596 case T_float: return Constant.fromValue(left.longValue() > right.floatValue());
597 case T_double: return Constant.fromValue(left.longValue() > right.doubleValue());
598 case T_byte: return Constant.fromValue(left.longValue() > right.byteValue());
599 case T_short: return Constant.fromValue(left.longValue() > right.shortValue());
600 case T_int: return Constant.fromValue(left.longValue() > right.intValue());
601 case T_long: return Constant.fromValue(left.longValue() > right.longValue());
609 public static final Constant computeConstantOperationGREATER_EQUAL(Constant left, int leftId, Constant right, int rightId) {
614 case T_char : return Constant.fromValue(left.charValue() >= right.charValue());
615 case T_float: return Constant.fromValue(left.charValue() >= right.floatValue());
616 case T_double: return Constant.fromValue(left.charValue() >= right.doubleValue());
617 case T_byte: return Constant.fromValue(left.charValue() >= right.byteValue());
618 case T_short: return Constant.fromValue(left.charValue() >= right.shortValue());
619 case T_int: return Constant.fromValue(left.charValue() >= right.intValue());
620 case T_long: return Constant.fromValue(left.charValue() >= right.longValue());
625 case T_char : return Constant.fromValue(left.floatValue() >= right.charValue());
626 case T_float: return Constant.fromValue(left.floatValue() >= right.floatValue());
627 case T_double: return Constant.fromValue(left.floatValue() >= right.doubleValue());
628 case T_byte: return Constant.fromValue(left.floatValue() >= right.byteValue());
629 case T_short: return Constant.fromValue(left.floatValue() >= right.shortValue());
630 case T_int: return Constant.fromValue(left.floatValue() >= right.intValue());
631 case T_long: return Constant.fromValue(left.floatValue() >= right.longValue());
636 case T_char : return Constant.fromValue(left.doubleValue() >= right.charValue());
637 case T_float: return Constant.fromValue(left.doubleValue() >= right.floatValue());
638 case T_double: return Constant.fromValue(left.doubleValue() >= right.doubleValue());
639 case T_byte: return Constant.fromValue(left.doubleValue() >= right.byteValue());
640 case T_short: return Constant.fromValue(left.doubleValue() >= right.shortValue());
641 case T_int: return Constant.fromValue(left.doubleValue() >= right.intValue());
642 case T_long: return Constant.fromValue(left.doubleValue() >= right.longValue());
647 case T_char : return Constant.fromValue(left.byteValue() >= right.charValue());
648 case T_float: return Constant.fromValue(left.byteValue() >= right.floatValue());
649 case T_double: return Constant.fromValue(left.byteValue() >= right.doubleValue());
650 case T_byte: return Constant.fromValue(left.byteValue() >= right.byteValue());
651 case T_short: return Constant.fromValue(left.byteValue() >= right.shortValue());
652 case T_int: return Constant.fromValue(left.byteValue() >= right.intValue());
653 case T_long: return Constant.fromValue(left.byteValue() >= right.longValue());
658 case T_char : return Constant.fromValue(left.shortValue() >= right.charValue());
659 case T_float: return Constant.fromValue(left.shortValue() >= right.floatValue());
660 case T_double: return Constant.fromValue(left.shortValue() >= right.doubleValue());
661 case T_byte: return Constant.fromValue(left.shortValue() >= right.byteValue());
662 case T_short: return Constant.fromValue(left.shortValue() >= right.shortValue());
663 case T_int: return Constant.fromValue(left.shortValue() >= right.intValue());
664 case T_long: return Constant.fromValue(left.shortValue() >= right.longValue());
669 case T_char : return Constant.fromValue(left.intValue() >= right.charValue());
670 case T_float: return Constant.fromValue(left.intValue() >= right.floatValue());
671 case T_double: return Constant.fromValue(left.intValue() >= right.doubleValue());
672 case T_byte: return Constant.fromValue(left.intValue() >= right.byteValue());
673 case T_short: return Constant.fromValue(left.intValue() >= right.shortValue());
674 case T_int: return Constant.fromValue(left.intValue() >= right.intValue());
675 case T_long: return Constant.fromValue(left.intValue() >= right.longValue());
680 case T_char : return Constant.fromValue(left.longValue() >= right.charValue());
681 case T_float: return Constant.fromValue(left.longValue() >= right.floatValue());
682 case T_double: return Constant.fromValue(left.longValue() >= right.doubleValue());
683 case T_byte: return Constant.fromValue(left.longValue() >= right.byteValue());
684 case T_short: return Constant.fromValue(left.longValue() >= right.shortValue());
685 case T_int: return Constant.fromValue(left.longValue() >= right.intValue());
686 case T_long: return Constant.fromValue(left.longValue() >= right.longValue());
694 public static final Constant computeConstantOperationLEFT_SHIFT(Constant left, int leftId, Constant right, int rightId) {
699 case T_char : return Constant.fromValue(left.charValue() << right.charValue());
700 case T_byte: return Constant.fromValue(left.charValue() << right.byteValue());
701 case T_short: return Constant.fromValue(left.charValue() << right.shortValue());
702 case T_int: return Constant.fromValue(left.charValue() << right.intValue());
703 case T_long: return Constant.fromValue(left.charValue() << right.longValue());
708 case T_char : return Constant.fromValue(left.byteValue() << right.charValue());
709 case T_byte: return Constant.fromValue(left.byteValue() << right.byteValue());
710 case T_short: return Constant.fromValue(left.byteValue() << right.shortValue());
711 case T_int: return Constant.fromValue(left.byteValue() << right.intValue());
712 case T_long: return Constant.fromValue(left.byteValue() << right.longValue());
717 case T_char : return Constant.fromValue(left.shortValue() << right.charValue());
718 case T_byte: return Constant.fromValue(left.shortValue() << right.byteValue());
719 case T_short: return Constant.fromValue(left.shortValue() << right.shortValue());
720 case T_int: return Constant.fromValue(left.shortValue() << right.intValue());
721 case T_long: return Constant.fromValue(left.shortValue() << right.longValue());
726 case T_char : return Constant.fromValue(left.intValue() << right.charValue());
727 case T_byte: return Constant.fromValue(left.intValue() << right.byteValue());
728 case T_short: return Constant.fromValue(left.intValue() << right.shortValue());
729 case T_int: return Constant.fromValue(left.intValue() << right.intValue());
730 case T_long: return Constant.fromValue(left.intValue() << right.longValue());
735 case T_char : return Constant.fromValue(left.longValue() << right.charValue());
736 case T_byte: return Constant.fromValue(left.longValue() << right.byteValue());
737 case T_short: return Constant.fromValue(left.longValue() << right.shortValue());
738 case T_int: return Constant.fromValue(left.longValue() << right.intValue());
739 case T_long: return Constant.fromValue(left.longValue() << right.longValue());
747 public static final Constant computeConstantOperationLESS(Constant left, int leftId, Constant right, int rightId) {
752 case T_char : return Constant.fromValue(left.charValue() < right.charValue());
753 case T_float: return Constant.fromValue(left.charValue() < right.floatValue());
754 case T_double: return Constant.fromValue(left.charValue() < right.doubleValue());
755 case T_byte: return Constant.fromValue(left.charValue() < right.byteValue());
756 case T_short: return Constant.fromValue(left.charValue() < right.shortValue());
757 case T_int: return Constant.fromValue(left.charValue() < right.intValue());
758 case T_long: return Constant.fromValue(left.charValue() < right.longValue());
763 case T_char : return Constant.fromValue(left.floatValue() < right.charValue());
764 case T_float: return Constant.fromValue(left.floatValue() < right.floatValue());
765 case T_double: return Constant.fromValue(left.floatValue() < right.doubleValue());
766 case T_byte: return Constant.fromValue(left.floatValue() < right.byteValue());
767 case T_short: return Constant.fromValue(left.floatValue() < right.shortValue());
768 case T_int: return Constant.fromValue(left.floatValue() < right.intValue());
769 case T_long: return Constant.fromValue(left.floatValue() < right.longValue());
774 case T_char : return Constant.fromValue(left.doubleValue() < right.charValue());
775 case T_float: return Constant.fromValue(left.doubleValue() < right.floatValue());
776 case T_double: return Constant.fromValue(left.doubleValue() < right.doubleValue());
777 case T_byte: return Constant.fromValue(left.doubleValue() < right.byteValue());
778 case T_short: return Constant.fromValue(left.doubleValue() < right.shortValue());
779 case T_int: return Constant.fromValue(left.doubleValue() < right.intValue());
780 case T_long: return Constant.fromValue(left.doubleValue() < right.longValue());
785 case T_char : return Constant.fromValue(left.byteValue() < right.charValue());
786 case T_float: return Constant.fromValue(left.byteValue() < right.floatValue());
787 case T_double: return Constant.fromValue(left.byteValue() < right.doubleValue());
788 case T_byte: return Constant.fromValue(left.byteValue() < right.byteValue());
789 case T_short: return Constant.fromValue(left.byteValue() < right.shortValue());
790 case T_int: return Constant.fromValue(left.byteValue() < right.intValue());
791 case T_long: return Constant.fromValue(left.byteValue() < right.longValue());
796 case T_char : return Constant.fromValue(left.shortValue() < right.charValue());
797 case T_float: return Constant.fromValue(left.shortValue() < right.floatValue());
798 case T_double: return Constant.fromValue(left.shortValue() < right.doubleValue());
799 case T_byte: return Constant.fromValue(left.shortValue() < right.byteValue());
800 case T_short: return Constant.fromValue(left.shortValue() < right.shortValue());
801 case T_int: return Constant.fromValue(left.shortValue() < right.intValue());
802 case T_long: return Constant.fromValue(left.shortValue() < right.longValue());
807 case T_char : return Constant.fromValue(left.intValue() < right.charValue());
808 case T_float: return Constant.fromValue(left.intValue() < right.floatValue());
809 case T_double: return Constant.fromValue(left.intValue() < right.doubleValue());
810 case T_byte: return Constant.fromValue(left.intValue() < right.byteValue());
811 case T_short: return Constant.fromValue(left.intValue() < right.shortValue());
812 case T_int: return Constant.fromValue(left.intValue() < right.intValue());
813 case T_long: return Constant.fromValue(left.intValue() < right.longValue());
818 case T_char : return Constant.fromValue(left.longValue() < right.charValue());
819 case T_float: return Constant.fromValue(left.longValue() < right.floatValue());
820 case T_double: return Constant.fromValue(left.longValue() < right.doubleValue());
821 case T_byte: return Constant.fromValue(left.longValue() < right.byteValue());
822 case T_short: return Constant.fromValue(left.longValue() < right.shortValue());
823 case T_int: return Constant.fromValue(left.longValue() < right.intValue());
824 case T_long: return Constant.fromValue(left.longValue() < right.longValue());
832 public static final Constant computeConstantOperationLESS_EQUAL(Constant left, int leftId, Constant right, int rightId) {
837 case T_char : return Constant.fromValue(left.charValue() <= right.charValue());
838 case T_float: return Constant.fromValue(left.charValue() <= right.floatValue());
839 case T_double: return Constant.fromValue(left.charValue() <= right.doubleValue());
840 case T_byte: return Constant.fromValue(left.charValue() <= right.byteValue());
841 case T_short: return Constant.fromValue(left.charValue() <= right.shortValue());
842 case T_int: return Constant.fromValue(left.charValue() <= right.intValue());
843 case T_long: return Constant.fromValue(left.charValue() <= right.longValue());
848 case T_char : return Constant.fromValue(left.floatValue() <= right.charValue());
849 case T_float: return Constant.fromValue(left.floatValue() <= right.floatValue());
850 case T_double: return Constant.fromValue(left.floatValue() <= right.doubleValue());
851 case T_byte: return Constant.fromValue(left.floatValue() <= right.byteValue());
852 case T_short: return Constant.fromValue(left.floatValue() <= right.shortValue());
853 case T_int: return Constant.fromValue(left.floatValue() <= right.intValue());
854 case T_long: return Constant.fromValue(left.floatValue() <= right.longValue());
859 case T_char : return Constant.fromValue(left.doubleValue() <= right.charValue());
860 case T_float: return Constant.fromValue(left.doubleValue() <= right.floatValue());
861 case T_double: return Constant.fromValue(left.doubleValue() <= right.doubleValue());
862 case T_byte: return Constant.fromValue(left.doubleValue() <= right.byteValue());
863 case T_short: return Constant.fromValue(left.doubleValue() <= right.shortValue());
864 case T_int: return Constant.fromValue(left.doubleValue() <= right.intValue());
865 case T_long: return Constant.fromValue(left.doubleValue() <= right.longValue());
870 case T_char : return Constant.fromValue(left.byteValue() <= right.charValue());
871 case T_float: return Constant.fromValue(left.byteValue() <= right.floatValue());
872 case T_double: return Constant.fromValue(left.byteValue() <= right.doubleValue());
873 case T_byte: return Constant.fromValue(left.byteValue() <= right.byteValue());
874 case T_short: return Constant.fromValue(left.byteValue() <= right.shortValue());
875 case T_int: return Constant.fromValue(left.byteValue() <= right.intValue());
876 case T_long: return Constant.fromValue(left.byteValue() <= right.longValue());
881 case T_char : return Constant.fromValue(left.shortValue() <= right.charValue());
882 case T_float: return Constant.fromValue(left.shortValue() <= right.floatValue());
883 case T_double: return Constant.fromValue(left.shortValue() <= right.doubleValue());
884 case T_byte: return Constant.fromValue(left.shortValue() <= right.byteValue());
885 case T_short: return Constant.fromValue(left.shortValue() <= right.shortValue());
886 case T_int: return Constant.fromValue(left.shortValue() <= right.intValue());
887 case T_long: return Constant.fromValue(left.shortValue() <= right.longValue());
892 case T_char : return Constant.fromValue(left.intValue() <= right.charValue());
893 case T_float: return Constant.fromValue(left.intValue() <= right.floatValue());
894 case T_double: return Constant.fromValue(left.intValue() <= right.doubleValue());
895 case T_byte: return Constant.fromValue(left.intValue() <= right.byteValue());
896 case T_short: return Constant.fromValue(left.intValue() <= right.shortValue());
897 case T_int: return Constant.fromValue(left.intValue() <= right.intValue());
898 case T_long: return Constant.fromValue(left.intValue() <= right.longValue());
903 case T_char : return Constant.fromValue(left.longValue() <= right.charValue());
904 case T_float: return Constant.fromValue(left.longValue() <= right.floatValue());
905 case T_double: return Constant.fromValue(left.longValue() <= right.doubleValue());
906 case T_byte: return Constant.fromValue(left.longValue() <= right.byteValue());
907 case T_short: return Constant.fromValue(left.longValue() <= right.shortValue());
908 case T_int: return Constant.fromValue(left.longValue() <= right.intValue());
909 case T_long: return Constant.fromValue(left.longValue() <= right.longValue());
916 public static final Constant computeConstantOperationMINUS(Constant left, int leftId, Constant right, int rightId) {
921 case T_char : return Constant.fromValue(left.charValue() - right.charValue());
922 case T_float: return Constant.fromValue(left.charValue() - right.floatValue());
923 case T_double: return Constant.fromValue(left.charValue() - right.doubleValue());
924 case T_byte: return Constant.fromValue(left.charValue() - right.byteValue());
925 case T_short: return Constant.fromValue(left.charValue() - right.shortValue());
926 case T_int: return Constant.fromValue(left.charValue() - right.intValue());
927 case T_long: return Constant.fromValue(left.charValue() - right.longValue());
932 case T_char : return Constant.fromValue(left.floatValue() - right.charValue());
933 case T_float: return Constant.fromValue(left.floatValue() - right.floatValue());
934 case T_double: return Constant.fromValue(left.floatValue() - right.doubleValue());
935 case T_byte: return Constant.fromValue(left.floatValue() - right.byteValue());
936 case T_short: return Constant.fromValue(left.floatValue() - right.shortValue());
937 case T_int: return Constant.fromValue(left.floatValue() - right.intValue());
938 case T_long: return Constant.fromValue(left.floatValue() - right.longValue());
943 case T_char : return Constant.fromValue(left.doubleValue() - right.charValue());
944 case T_float: return Constant.fromValue(left.doubleValue() - right.floatValue());
945 case T_double: return Constant.fromValue(left.doubleValue() - right.doubleValue());
946 case T_byte: return Constant.fromValue(left.doubleValue() - right.byteValue());
947 case T_short: return Constant.fromValue(left.doubleValue() - right.shortValue());
948 case T_int: return Constant.fromValue(left.doubleValue() - right.intValue());
949 case T_long: return Constant.fromValue(left.doubleValue() - right.longValue());
954 case T_char : return Constant.fromValue(left.byteValue() - right.charValue());
955 case T_float: return Constant.fromValue(left.byteValue() - right.floatValue());
956 case T_double: return Constant.fromValue(left.byteValue() - right.doubleValue());
957 case T_byte: return Constant.fromValue(left.byteValue() - right.byteValue());
958 case T_short: return Constant.fromValue(left.byteValue() - right.shortValue());
959 case T_int: return Constant.fromValue(left.byteValue() - right.intValue());
960 case T_long: return Constant.fromValue(left.byteValue() - right.longValue());
965 case T_char : return Constant.fromValue(left.shortValue() - right.charValue());
966 case T_float: return Constant.fromValue(left.shortValue() - right.floatValue());
967 case T_double: return Constant.fromValue(left.shortValue() - right.doubleValue());
968 case T_byte: return Constant.fromValue(left.shortValue() - right.byteValue());
969 case T_short: return Constant.fromValue(left.shortValue() - right.shortValue());
970 case T_int: return Constant.fromValue(left.shortValue() - right.intValue());
971 case T_long: return Constant.fromValue(left.shortValue() - right.longValue());
976 case T_char : return Constant.fromValue(left.intValue() - right.charValue());
977 case T_float: return Constant.fromValue(left.intValue() - right.floatValue());
978 case T_double: return Constant.fromValue(left.intValue() - right.doubleValue());
979 case T_byte: return Constant.fromValue(left.intValue() - right.byteValue());
980 case T_short: return Constant.fromValue(left.intValue() - right.shortValue());
981 case T_int: return Constant.fromValue(left.intValue() - right.intValue());
982 case T_long: return Constant.fromValue(left.intValue() - right.longValue());
987 case T_char : return Constant.fromValue(left.longValue() - right.charValue());
988 case T_float: return Constant.fromValue(left.longValue() - right.floatValue());
989 case T_double: return Constant.fromValue(left.longValue() - right.doubleValue());
990 case T_byte: return Constant.fromValue(left.longValue() - right.byteValue());
991 case T_short: return Constant.fromValue(left.longValue() - right.shortValue());
992 case T_int: return Constant.fromValue(left.longValue() - right.intValue());
993 case T_long: return Constant.fromValue(left.longValue() - right.longValue());
1001 public static final Constant computeConstantOperationMULTIPLY(Constant left, int leftId, Constant right, int rightId) {
1006 case T_char : return Constant.fromValue(left.charValue() * right.charValue());
1007 case T_float: return Constant.fromValue(left.charValue() * right.floatValue());
1008 case T_double: return Constant.fromValue(left.charValue() * right.doubleValue());
1009 case T_byte: return Constant.fromValue(left.charValue() * right.byteValue());
1010 case T_short: return Constant.fromValue(left.charValue() * right.shortValue());
1011 case T_int: return Constant.fromValue(left.charValue() * right.intValue());
1012 case T_long: return Constant.fromValue(left.charValue() * right.longValue());
1017 case T_char : return Constant.fromValue(left.floatValue() * right.charValue());
1018 case T_float: return Constant.fromValue(left.floatValue() * right.floatValue());
1019 case T_double: return Constant.fromValue(left.floatValue() * right.doubleValue());
1020 case T_byte: return Constant.fromValue(left.floatValue() * right.byteValue());
1021 case T_short: return Constant.fromValue(left.floatValue() * right.shortValue());
1022 case T_int: return Constant.fromValue(left.floatValue() * right.intValue());
1023 case T_long: return Constant.fromValue(left.floatValue() * right.longValue());
1028 case T_char : return Constant.fromValue(left.doubleValue() * right.charValue());
1029 case T_float: return Constant.fromValue(left.doubleValue() * right.floatValue());
1030 case T_double: return Constant.fromValue(left.doubleValue() * right.doubleValue());
1031 case T_byte: return Constant.fromValue(left.doubleValue() * right.byteValue());
1032 case T_short: return Constant.fromValue(left.doubleValue() * right.shortValue());
1033 case T_int: return Constant.fromValue(left.doubleValue() * right.intValue());
1034 case T_long: return Constant.fromValue(left.doubleValue() * right.longValue());
1039 case T_char : return Constant.fromValue(left.byteValue() * right.charValue());
1040 case T_float: return Constant.fromValue(left.byteValue() * right.floatValue());
1041 case T_double: return Constant.fromValue(left.byteValue() * right.doubleValue());
1042 case T_byte: return Constant.fromValue(left.byteValue() * right.byteValue());
1043 case T_short: return Constant.fromValue(left.byteValue() * right.shortValue());
1044 case T_int: return Constant.fromValue(left.byteValue() * right.intValue());
1045 case T_long: return Constant.fromValue(left.byteValue() * right.longValue());
1050 case T_char : return Constant.fromValue(left.shortValue() * right.charValue());
1051 case T_float: return Constant.fromValue(left.shortValue() * right.floatValue());
1052 case T_double: return Constant.fromValue(left.shortValue() * right.doubleValue());
1053 case T_byte: return Constant.fromValue(left.shortValue() * right.byteValue());
1054 case T_short: return Constant.fromValue(left.shortValue() * right.shortValue());
1055 case T_int: return Constant.fromValue(left.shortValue() * right.intValue());
1056 case T_long: return Constant.fromValue(left.shortValue() * right.longValue());
1061 case T_char : return Constant.fromValue(left.intValue() * right.charValue());
1062 case T_float: return Constant.fromValue(left.intValue() * right.floatValue());
1063 case T_double: return Constant.fromValue(left.intValue() * right.doubleValue());
1064 case T_byte: return Constant.fromValue(left.intValue() * right.byteValue());
1065 case T_short: return Constant.fromValue(left.intValue() * right.shortValue());
1066 case T_int: return Constant.fromValue(left.intValue() * right.intValue());
1067 case T_long: return Constant.fromValue(left.intValue() * right.longValue());
1072 case T_char : return Constant.fromValue(left.longValue() * right.charValue());
1073 case T_float: return Constant.fromValue(left.longValue() * right.floatValue());
1074 case T_double: return Constant.fromValue(left.longValue() * right.doubleValue());
1075 case T_byte: return Constant.fromValue(left.longValue() * right.byteValue());
1076 case T_short: return Constant.fromValue(left.longValue() * right.shortValue());
1077 case T_int: return Constant.fromValue(left.longValue() * right.intValue());
1078 case T_long: return Constant.fromValue(left.longValue() * right.longValue());
1082 return NotAConstant;
1085 public static final Constant computeConstantOperationOR(Constant left, int leftId, Constant right, int rightId) {
1088 case T_boolean : return Constant.fromValue(left.booleanValue() | right.booleanValue());
1091 case T_char : return Constant.fromValue(left.charValue() | right.charValue());
1092 case T_byte: return Constant.fromValue(left.charValue() | right.byteValue());
1093 case T_short: return Constant.fromValue(left.charValue() | right.shortValue());
1094 case T_int: return Constant.fromValue(left.charValue() | right.intValue());
1095 case T_long: return Constant.fromValue(left.charValue() | right.longValue());
1100 case T_char : return Constant.fromValue(left.byteValue() | right.charValue());
1101 case T_byte: return Constant.fromValue(left.byteValue() | right.byteValue());
1102 case T_short: return Constant.fromValue(left.byteValue() | right.shortValue());
1103 case T_int: return Constant.fromValue(left.byteValue() | right.intValue());
1104 case T_long: return Constant.fromValue(left.byteValue() | right.longValue());
1109 case T_char : return Constant.fromValue(left.shortValue() | right.charValue());
1110 case T_byte: return Constant.fromValue(left.shortValue() | right.byteValue());
1111 case T_short: return Constant.fromValue(left.shortValue() | right.shortValue());
1112 case T_int: return Constant.fromValue(left.shortValue() | right.intValue());
1113 case T_long: return Constant.fromValue(left.shortValue() | right.longValue());
1118 case T_char : return Constant.fromValue(left.intValue() | right.charValue());
1119 case T_byte: return Constant.fromValue(left.intValue() | right.byteValue());
1120 case T_short: return Constant.fromValue(left.intValue() | right.shortValue());
1121 case T_int: return Constant.fromValue(left.intValue() | right.intValue());
1122 case T_long: return Constant.fromValue(left.intValue() | right.longValue());
1127 case T_char : return Constant.fromValue(left.longValue() | right.charValue());
1128 case T_byte: return Constant.fromValue(left.longValue() | right.byteValue());
1129 case T_short: return Constant.fromValue(left.longValue() | right.shortValue());
1130 case T_int: return Constant.fromValue(left.longValue() | right.intValue());
1131 case T_long: return Constant.fromValue(left.longValue() | right.longValue());
1136 return NotAConstant;
1139 public static final Constant computeConstantOperationOR_OR(Constant left, int leftId, Constant right, int rightId) {
1141 return Constant.fromValue(left.booleanValue() || right.booleanValue());
1144 public static final Constant computeConstantOperationPLUS(Constant left, int leftId, Constant right, int rightId) {
1147 case T_JavaLangObject :
1148 if (rightId == T_JavaLangString) {
1149 return Constant.fromValue(left.stringValue() + right.stringValue());
1152 if (rightId == T_JavaLangString) {
1153 return Constant.fromValue(left.stringValue() + right.stringValue());
1158 case T_char : return Constant.fromValue(left.charValue() + right.charValue());
1159 case T_float: return Constant.fromValue(left.charValue() + right.floatValue());
1160 case T_double: return Constant.fromValue(left.charValue() + right.doubleValue());
1161 case T_byte: return Constant.fromValue(left.charValue() + right.byteValue());
1162 case T_short: return Constant.fromValue(left.charValue() + right.shortValue());
1163 case T_int: return Constant.fromValue(left.charValue() + right.intValue());
1164 case T_long: return Constant.fromValue(left.charValue() + right.longValue());
1165 case T_JavaLangString: return Constant.fromValue(left.stringValue() + right.stringValue());
1170 case T_char : return Constant.fromValue(left.floatValue() + right.charValue());
1171 case T_float: return Constant.fromValue(left.floatValue() + right.floatValue());
1172 case T_double: return Constant.fromValue(left.floatValue() + right.doubleValue());
1173 case T_byte: return Constant.fromValue(left.floatValue() + right.byteValue());
1174 case T_short: return Constant.fromValue(left.floatValue() + right.shortValue());
1175 case T_int: return Constant.fromValue(left.floatValue() + right.intValue());
1176 case T_long: return Constant.fromValue(left.floatValue() + right.longValue());
1177 case T_JavaLangString: return Constant.fromValue(left.stringValue() + right.stringValue());
1182 case T_char : return Constant.fromValue(left.doubleValue() + right.charValue());
1183 case T_float: return Constant.fromValue(left.doubleValue() + right.floatValue());
1184 case T_double: return Constant.fromValue(left.doubleValue() + right.doubleValue());
1185 case T_byte: return Constant.fromValue(left.doubleValue() + right.byteValue());
1186 case T_short: return Constant.fromValue(left.doubleValue() + right.shortValue());
1187 case T_int: return Constant.fromValue(left.doubleValue() + right.intValue());
1188 case T_long: return Constant.fromValue(left.doubleValue() + right.longValue());
1189 case T_JavaLangString: return Constant.fromValue(left.stringValue() + right.stringValue());
1194 case T_char : return Constant.fromValue(left.byteValue() + right.charValue());
1195 case T_float: return Constant.fromValue(left.byteValue() + right.floatValue());
1196 case T_double: return Constant.fromValue(left.byteValue() + right.doubleValue());
1197 case T_byte: return Constant.fromValue(left.byteValue() + right.byteValue());
1198 case T_short: return Constant.fromValue(left.byteValue() + right.shortValue());
1199 case T_int: return Constant.fromValue(left.byteValue() + right.intValue());
1200 case T_long: return Constant.fromValue(left.byteValue() + right.longValue());
1201 case T_JavaLangString: return Constant.fromValue(left.stringValue() + right.stringValue());
1207 case T_char : return Constant.fromValue(left.shortValue() + right.charValue());
1208 case T_float: return Constant.fromValue(left.shortValue() + right.floatValue());
1209 case T_double: return Constant.fromValue(left.shortValue() + right.doubleValue());
1210 case T_byte: return Constant.fromValue(left.shortValue() + right.byteValue());
1211 case T_short: return Constant.fromValue(left.shortValue() + right.shortValue());
1212 case T_int: return Constant.fromValue(left.shortValue() + right.intValue());
1213 case T_long: return Constant.fromValue(left.shortValue() + right.longValue());
1214 case T_JavaLangString: return Constant.fromValue(left.stringValue() + right.stringValue());
1219 case T_char : return Constant.fromValue(left.intValue() + right.charValue());
1220 case T_float: return Constant.fromValue(left.intValue() + right.floatValue());
1221 case T_double: return Constant.fromValue(left.intValue() + right.doubleValue());
1222 case T_byte: return Constant.fromValue(left.intValue() + right.byteValue());
1223 case T_short: return Constant.fromValue(left.intValue() + right.shortValue());
1224 case T_int: return Constant.fromValue(left.intValue() + right.intValue());
1225 case T_long: return Constant.fromValue(left.intValue() + right.longValue());
1226 case T_JavaLangString: return Constant.fromValue(left.stringValue() + right.stringValue());
1231 case T_char : return Constant.fromValue(left.longValue() + right.charValue());
1232 case T_float: return Constant.fromValue(left.longValue() + right.floatValue());
1233 case T_double: return Constant.fromValue(left.longValue() + right.doubleValue());
1234 case T_byte: return Constant.fromValue(left.longValue() + right.byteValue());
1235 case T_short: return Constant.fromValue(left.longValue() + right.shortValue());
1236 case T_int: return Constant.fromValue(left.longValue() + right.intValue());
1237 case T_long: return Constant.fromValue(left.longValue() + right.longValue());
1238 case T_JavaLangString: return Constant.fromValue(left.stringValue() + right.stringValue());
1241 case T_JavaLangString :
1243 case T_char : return Constant.fromValue(left.stringValue() + right.stringValue());
1244 case T_float: return Constant.fromValue(left.stringValue() + right.stringValue());
1245 case T_double: return Constant.fromValue(left.stringValue() + right.stringValue());
1246 case T_byte: return Constant.fromValue(left.stringValue() + right.stringValue());
1247 case T_short: return Constant.fromValue(left.stringValue() + right.stringValue());
1248 case T_int: return Constant.fromValue(left.stringValue() + right.stringValue());
1249 case T_long: return Constant.fromValue(left.stringValue() + right.stringValue());
1250 case T_JavaLangString: return Constant.fromValue(left.stringValue() + right.stringValue());
1251 case T_boolean: return Constant.fromValue(left.stringValue() + right.stringValue());
1256 case T_char : return Constant.fromValue(left.stringValue() + right.stringValue());
1257 case T_float: return Constant.fromValue(left.stringValue() + right.stringValue());
1258 case T_double: return Constant.fromValue(left.stringValue() + right.stringValue());
1259 case T_byte: return Constant.fromValue(left.stringValue() + right.stringValue());
1260 case T_short: return Constant.fromValue(left.stringValue() + right.stringValue());
1261 case T_int: return Constant.fromValue(left.stringValue() + right.stringValue());
1262 case T_long: return Constant.fromValue(left.stringValue() + right.stringValue());
1263 case T_JavaLangString: return Constant.fromValue(left.stringValue() + right.stringValue());
1268 return NotAConstant;
1271 public static final Constant computeConstantOperationREMAINDER(Constant left, int leftId, Constant right, int rightId) {
1276 case T_char : return Constant.fromValue(left.charValue() % right.charValue());
1277 case T_float: return Constant.fromValue(left.charValue() % right.floatValue());
1278 case T_double: return Constant.fromValue(left.charValue() % right.doubleValue());
1279 case T_byte: return Constant.fromValue(left.charValue() % right.byteValue());
1280 case T_short: return Constant.fromValue(left.charValue() % right.shortValue());
1281 case T_int: return Constant.fromValue(left.charValue() % right.intValue());
1282 case T_long: return Constant.fromValue(left.charValue() % right.longValue());
1287 case T_char : return Constant.fromValue(left.floatValue() % right.charValue());
1288 case T_float: return Constant.fromValue(left.floatValue() % right.floatValue());
1289 case T_double: return Constant.fromValue(left.floatValue() % right.doubleValue());
1290 case T_byte: return Constant.fromValue(left.floatValue() % right.byteValue());
1291 case T_short: return Constant.fromValue(left.floatValue() % right.shortValue());
1292 case T_int: return Constant.fromValue(left.floatValue() % right.intValue());
1293 case T_long: return Constant.fromValue(left.floatValue() % right.longValue());
1298 case T_char : return Constant.fromValue(left.doubleValue() % right.charValue());
1299 case T_float: return Constant.fromValue(left.doubleValue() % right.floatValue());
1300 case T_double: return Constant.fromValue(left.doubleValue() % right.doubleValue());
1301 case T_byte: return Constant.fromValue(left.doubleValue() % right.byteValue());
1302 case T_short: return Constant.fromValue(left.doubleValue() % right.shortValue());
1303 case T_int: return Constant.fromValue(left.doubleValue() % right.intValue());
1304 case T_long: return Constant.fromValue(left.doubleValue() % right.longValue());
1309 case T_char : return Constant.fromValue(left.byteValue() % right.charValue());
1310 case T_float: return Constant.fromValue(left.byteValue() % right.floatValue());
1311 case T_double: return Constant.fromValue(left.byteValue() % right.doubleValue());
1312 case T_byte: return Constant.fromValue(left.byteValue() % right.byteValue());
1313 case T_short: return Constant.fromValue(left.byteValue() % right.shortValue());
1314 case T_int: return Constant.fromValue(left.byteValue() % right.intValue());
1315 case T_long: return Constant.fromValue(left.byteValue() % right.longValue());
1320 case T_char : return Constant.fromValue(left.shortValue() % right.charValue());
1321 case T_float: return Constant.fromValue(left.shortValue() % right.floatValue());
1322 case T_double: return Constant.fromValue(left.shortValue() % right.doubleValue());
1323 case T_byte: return Constant.fromValue(left.shortValue() % right.byteValue());
1324 case T_short: return Constant.fromValue(left.shortValue() % right.shortValue());
1325 case T_int: return Constant.fromValue(left.shortValue() % right.intValue());
1326 case T_long: return Constant.fromValue(left.shortValue() % right.longValue());
1331 case T_char : return Constant.fromValue(left.intValue() % right.charValue());
1332 case T_float: return Constant.fromValue(left.intValue() % right.floatValue());
1333 case T_double: return Constant.fromValue(left.intValue() % right.doubleValue());
1334 case T_byte: return Constant.fromValue(left.intValue() % right.byteValue());
1335 case T_short: return Constant.fromValue(left.intValue() % right.shortValue());
1336 case T_int: return Constant.fromValue(left.intValue() % right.intValue());
1337 case T_long: return Constant.fromValue(left.intValue() % right.longValue());
1342 case T_char : return Constant.fromValue(left.longValue() % right.charValue());
1343 case T_float: return Constant.fromValue(left.longValue() % right.floatValue());
1344 case T_double: return Constant.fromValue(left.longValue() % right.doubleValue());
1345 case T_byte: return Constant.fromValue(left.longValue() % right.byteValue());
1346 case T_short: return Constant.fromValue(left.longValue() % right.shortValue());
1347 case T_int: return Constant.fromValue(left.longValue() % right.intValue());
1348 case T_long: return Constant.fromValue(left.longValue() % right.longValue());
1353 return NotAConstant;
1356 public static final Constant computeConstantOperationRIGHT_SHIFT(Constant left, int leftId, Constant right, int rightId) {
1361 case T_char : return Constant.fromValue(left.charValue() >> right.charValue());
1362 case T_byte: return Constant.fromValue(left.charValue() >> right.byteValue());
1363 case T_short: return Constant.fromValue(left.charValue() >> right.shortValue());
1364 case T_int: return Constant.fromValue(left.charValue() >> right.intValue());
1365 case T_long: return Constant.fromValue(left.charValue() >> right.longValue());
1370 case T_char : return Constant.fromValue(left.byteValue() >> right.charValue());
1371 case T_byte: return Constant.fromValue(left.byteValue() >> right.byteValue());
1372 case T_short: return Constant.fromValue(left.byteValue() >> right.shortValue());
1373 case T_int: return Constant.fromValue(left.byteValue() >> right.intValue());
1374 case T_long: return Constant.fromValue(left.byteValue() >> right.longValue());
1379 case T_char : return Constant.fromValue(left.shortValue() >> right.charValue());
1380 case T_byte: return Constant.fromValue(left.shortValue() >> right.byteValue());
1381 case T_short: return Constant.fromValue(left.shortValue() >> right.shortValue());
1382 case T_int: return Constant.fromValue(left.shortValue() >> right.intValue());
1383 case T_long: return Constant.fromValue(left.shortValue() >> right.longValue());
1388 case T_char : return Constant.fromValue(left.intValue() >> right.charValue());
1389 case T_byte: return Constant.fromValue(left.intValue() >> right.byteValue());
1390 case T_short: return Constant.fromValue(left.intValue() >> right.shortValue());
1391 case T_int: return Constant.fromValue(left.intValue() >> right.intValue());
1392 case T_long: return Constant.fromValue(left.intValue() >> right.longValue());
1397 case T_char : return Constant.fromValue(left.longValue() >> right.charValue());
1398 case T_byte: return Constant.fromValue(left.longValue() >> right.byteValue());
1399 case T_short: return Constant.fromValue(left.longValue() >> right.shortValue());
1400 case T_int: return Constant.fromValue(left.longValue() >> right.intValue());
1401 case T_long: return Constant.fromValue(left.longValue() >> right.longValue());
1406 return NotAConstant;
1409 public static final Constant computeConstantOperationUNSIGNED_RIGHT_SHIFT(Constant left, int leftId, Constant right, int rightId) {
1414 case T_char : return Constant.fromValue(left.charValue() >>> right.charValue());
1415 case T_byte: return Constant.fromValue(left.charValue() >>> right.byteValue());
1416 case T_short: return Constant.fromValue(left.charValue() >>> right.shortValue());
1417 case T_int: return Constant.fromValue(left.charValue() >>> right.intValue());
1418 case T_long: return Constant.fromValue(left.charValue() >>> right.longValue());
1423 case T_char : return Constant.fromValue(left.byteValue() >>> right.charValue());
1424 case T_byte: return Constant.fromValue(left.byteValue() >>> right.byteValue());
1425 case T_short: return Constant.fromValue(left.byteValue() >>> right.shortValue());
1426 case T_int: return Constant.fromValue(left.byteValue() >>> right.intValue());
1427 case T_long: return Constant.fromValue(left.byteValue() >>> right.longValue());
1432 case T_char : return Constant.fromValue(left.shortValue() >>> right.charValue());
1433 case T_byte: return Constant.fromValue(left.shortValue() >>> right.byteValue());
1434 case T_short: return Constant.fromValue(left.shortValue() >>> right.shortValue());
1435 case T_int: return Constant.fromValue(left.shortValue() >>> right.intValue());
1436 case T_long: return Constant.fromValue(left.shortValue() >>> right.longValue());
1441 case T_char : return Constant.fromValue(left.intValue() >>> right.charValue());
1442 case T_byte: return Constant.fromValue(left.intValue() >>> right.byteValue());
1443 case T_short: return Constant.fromValue(left.intValue() >>> right.shortValue());
1444 case T_int: return Constant.fromValue(left.intValue() >>> right.intValue());
1445 case T_long: return Constant.fromValue(left.intValue() >>> right.longValue());
1450 case T_char : return Constant.fromValue(left.longValue() >>> right.charValue());
1451 case T_byte: return Constant.fromValue(left.longValue() >>> right.byteValue());
1452 case T_short: return Constant.fromValue(left.longValue() >>> right.shortValue());
1453 case T_int: return Constant.fromValue(left.longValue() >>> right.intValue());
1454 case T_long: return Constant.fromValue(left.longValue() >>> right.longValue());
1459 return NotAConstant;
1462 public static final Constant computeConstantOperationXOR(Constant left, int leftId, Constant right, int rightId) {
1465 case T_boolean : return Constant.fromValue(left.booleanValue() ^ right.booleanValue());
1468 case T_char : return Constant.fromValue(left.charValue() ^ right.charValue());
1469 case T_byte: return Constant.fromValue(left.charValue() ^ right.byteValue());
1470 case T_short: return Constant.fromValue(left.charValue() ^ right.shortValue());
1471 case T_int: return Constant.fromValue(left.charValue() ^ right.intValue());
1472 case T_long: return Constant.fromValue(left.charValue() ^ right.longValue());
1477 case T_char : return Constant.fromValue(left.byteValue() ^ right.charValue());
1478 case T_byte: return Constant.fromValue(left.byteValue() ^ right.byteValue());
1479 case T_short: return Constant.fromValue(left.byteValue() ^ right.shortValue());
1480 case T_int: return Constant.fromValue(left.byteValue() ^ right.intValue());
1481 case T_long: return Constant.fromValue(left.byteValue() ^ right.longValue());
1486 case T_char : return Constant.fromValue(left.shortValue() ^ right.charValue());
1487 case T_byte: return Constant.fromValue(left.shortValue() ^ right.byteValue());
1488 case T_short: return Constant.fromValue(left.shortValue() ^ right.shortValue());
1489 case T_int: return Constant.fromValue(left.shortValue() ^ right.intValue());
1490 case T_long: return Constant.fromValue(left.shortValue() ^ right.longValue());
1495 case T_char : return Constant.fromValue(left.intValue() ^ right.charValue());
1496 case T_byte: return Constant.fromValue(left.intValue() ^ right.byteValue());
1497 case T_short: return Constant.fromValue(left.intValue() ^ right.shortValue());
1498 case T_int: return Constant.fromValue(left.intValue() ^ right.intValue());
1499 case T_long: return Constant.fromValue(left.intValue() ^ right.longValue());
1504 case T_char : return Constant.fromValue(left.longValue() ^ right.charValue());
1505 case T_byte: return Constant.fromValue(left.longValue() ^ right.byteValue());
1506 case T_short: return Constant.fromValue(left.longValue() ^ right.shortValue());
1507 case T_int: return Constant.fromValue(left.longValue() ^ right.intValue());
1508 case T_long: return Constant.fromValue(left.longValue() ^ right.longValue());
1512 return NotAConstant;
1515 public double doubleValue() {
1517 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"double")); //$NON-NLS-2$ //$NON-NLS-1$
1520 public float floatValue() {
1522 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"float")); //$NON-NLS-2$ //$NON-NLS-1$
1525 public static Constant fromValue(byte value) {
1527 return new ByteConstant(value);
1530 public static Constant fromValue(char value) {
1532 return new CharConstant(value);
1535 public static Constant fromValue(double value) {
1537 return new DoubleConstant(value);
1540 public static Constant fromValue(float value) {
1542 return new FloatConstant(value);
1545 public static Constant fromValue(int value) {
1547 return new IntConstant(value);
1550 public static Constant fromValue(long value) {
1552 return new LongConstant(value);
1555 public static Constant fromValue(String value) {
1557 return new StringConstant(value);
1560 public static Constant fromValue(short value) {
1562 return new ShortConstant(value);
1565 public static Constant fromValue(boolean value) {
1567 return new BooleanConstant(value);
1570 public int intValue() {
1572 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"int")); //$NON-NLS-2$ //$NON-NLS-1$
1575 public long longValue() {
1577 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"long")); //$NON-NLS-2$ //$NON-NLS-1$
1580 public short shortValue() {
1582 throw new ShouldNotImplement(Util.bind("constant.cannotConvertedTo",typeName(),"short")); //$NON-NLS-2$ //$NON-NLS-1$
1585 public String stringValue() {
1587 throw new ShouldNotImplement(Util.bind("constant.cannotConvertedTo",typeName(),"String")); //$NON-NLS-1$ //$NON-NLS-2$
1590 public String toString(){
1592 if (this == NotAConstant) return "(Constant) NotAConstant"; //$NON-NLS-1$
1593 return super.toString(); }
1595 public abstract int typeID();
1597 public String typeName() {
1599 case T_int : return "int"; //$NON-NLS-1$
1600 case T_byte : return "byte"; //$NON-NLS-1$
1601 case T_short : return "short"; //$NON-NLS-1$
1602 case T_char : return "char"; //$NON-NLS-1$
1603 case T_float : return "float"; //$NON-NLS-1$
1604 case T_double : return "double"; //$NON-NLS-1$
1605 case T_boolean : return "boolean"; //$NON-NLS-1$
1606 case T_long : return "long";//$NON-NLS-1$
1607 case T_JavaLangString : return "java.lang.String"; //$NON-NLS-1$
1608 case T_null : return "null"; //$NON-NLS-1$
1609 default: return "unknown"; //$NON-NLS-1$