1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 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 net.sourceforge.phpdt.internal.compiler.impl;
13 import net.sourceforge.phpdt.internal.compiler.lookup.TypeIds;
14 import net.sourceforge.phpdt.internal.compiler.problem.ShouldNotImplement;
15 import net.sourceforge.phpdt.internal.compiler.util.Util;
16 import net.sourceforge.phpeclipse.internal.compiler.ast.OperatorIds;
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_String<<4)+T_String : 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());
216 case PLUS : return cst;
217 case MINUS : //the two special -9223372036854775808L and -2147483648 are inlined at parseTime
219 case T_float : float f;
220 if ( (f= cst.floatValue()) == 0.0f)
221 { //positive and negative 0....
222 if (Float.floatToIntBits(f) == 0)
223 return Constant.fromValue(-0.0f);
225 return Constant.fromValue(0.0f);}
226 break; //default case
227 case T_double : double d;
228 if ( (d= cst.doubleValue()) == 0.0d)
229 { //positive and negative 0....
230 if (Double.doubleToLongBits(d) == 0)
231 return Constant.fromValue(-0.0d);
233 return Constant.fromValue(0.0d);}
234 break; //default case
236 return computeConstantOperationMINUS(Zero,T_int,operator,cst,id);
239 case T_char : return Constant.fromValue(~ cst.charValue());
240 case T_byte: return Constant.fromValue(~ cst.byteValue());
241 case T_short: return Constant.fromValue(~ cst.shortValue());
242 case T_int: return Constant.fromValue(~ cst.intValue());
243 case T_long: return Constant.fromValue(~ cst.longValue());
244 default : return NotAConstant;
246 default : return NotAConstant;
250 public static final Constant computeConstantOperation(Constant left, int leftId, int operator, Constant right, int rightId) {
253 case AND : return computeConstantOperationAND (left,leftId,operator,right,rightId);
254 case AND_AND : return computeConstantOperationAND_AND (left,leftId,operator,right,rightId);
255 case DIVIDE : return computeConstantOperationDIVIDE (left,leftId,operator,right,rightId);
256 case GREATER : return computeConstantOperationGREATER (left,leftId,operator,right,rightId);
257 case GREATER_EQUAL : return computeConstantOperationGREATER_EQUAL(left,leftId,operator,right,rightId);
258 case LEFT_SHIFT : return computeConstantOperationLEFT_SHIFT (left,leftId,operator,right,rightId);
259 case LESS : return computeConstantOperationLESS (left,leftId,operator,right,rightId);
260 case LESS_EQUAL : return computeConstantOperationLESS_EQUAL (left,leftId,operator,right,rightId);
261 case MINUS : return computeConstantOperationMINUS (left,leftId,operator,right,rightId);
262 case MULTIPLY : return computeConstantOperationMULTIPLY (left,leftId,operator,right,rightId);
263 case OR : return computeConstantOperationOR (left,leftId,operator,right,rightId);
264 case OR_OR : return computeConstantOperationOR_OR (left,leftId,operator,right,rightId);
265 case PLUS : return computeConstantOperationPLUS (left,leftId,operator,right,rightId);
266 case REMAINDER : return computeConstantOperationREMAINDER (left,leftId,operator,right,rightId);
267 case RIGHT_SHIFT: return computeConstantOperationRIGHT_SHIFT(left,leftId,operator,right,rightId);
268 case UNSIGNED_RIGHT_SHIFT: return computeConstantOperationUNSIGNED_RIGHT_SHIFT(left,leftId,operator,right,rightId);
269 case XOR : return computeConstantOperationXOR (left,leftId,operator,right,rightId);
271 default : return NotAConstant;
275 public static final Constant computeConstantOperationAND(Constant left, int leftId, int operator, Constant right, int rightId) {
278 case T_boolean : return Constant.fromValue(left.booleanValue() & right.booleanValue());
281 case T_char : return Constant.fromValue(left.charValue() & right.charValue());
282 case T_byte: return Constant.fromValue(left.charValue() & right.byteValue());
283 case T_short: return Constant.fromValue(left.charValue() & right.shortValue());
284 case T_int: return Constant.fromValue(left.charValue() & right.intValue());
285 case T_long: return Constant.fromValue(left.charValue() & right.longValue());
290 case T_char : return Constant.fromValue(left.byteValue() & right.charValue());
291 case T_byte: return Constant.fromValue(left.byteValue() & right.byteValue());
292 case T_short: return Constant.fromValue(left.byteValue() & right.shortValue());
293 case T_int: return Constant.fromValue(left.byteValue() & right.intValue());
294 case T_long: return Constant.fromValue(left.byteValue() & right.longValue());
299 case T_char : return Constant.fromValue(left.shortValue() & right.charValue());
300 case T_byte: return Constant.fromValue(left.shortValue() & right.byteValue());
301 case T_short: return Constant.fromValue(left.shortValue() & right.shortValue());
302 case T_int: return Constant.fromValue(left.shortValue() & right.intValue());
303 case T_long: return Constant.fromValue(left.shortValue() & right.longValue());
308 case T_char : return Constant.fromValue(left.intValue() & right.charValue());
309 case T_byte: return Constant.fromValue(left.intValue() & right.byteValue());
310 case T_short: return Constant.fromValue(left.intValue() & right.shortValue());
311 case T_int: return Constant.fromValue(left.intValue() & right.intValue());
312 case T_long: return Constant.fromValue(left.intValue() & right.longValue());
317 case T_char : return Constant.fromValue(left.longValue() & right.charValue());
318 case T_byte: return Constant.fromValue(left.longValue() & right.byteValue());
319 case T_short: return Constant.fromValue(left.longValue() & right.shortValue());
320 case T_int: return Constant.fromValue(left.longValue() & right.intValue());
321 case T_long: return Constant.fromValue(left.longValue() & right.longValue());
328 public static final Constant computeConstantOperationAND_AND(Constant left, int leftId, int operator, Constant right, int rightId) {
330 return Constant.fromValue(left.booleanValue() && right.booleanValue());
333 public static final Constant computeConstantOperationDIVIDE(Constant left, int leftId, int operator, Constant right, int rightId) {
334 // division by zero must be handled outside this method (error reporting)
339 case T_char : return Constant.fromValue(left.charValue() / right.charValue());
340 case T_float: return Constant.fromValue(left.charValue() / right.floatValue());
341 case T_double: return Constant.fromValue(left.charValue() / right.doubleValue());
342 case T_byte: return Constant.fromValue(left.charValue() / right.byteValue());
343 case T_short: return Constant.fromValue(left.charValue() / right.shortValue());
344 case T_int: return Constant.fromValue(left.charValue() / right.intValue());
345 case T_long: return Constant.fromValue(left.charValue() / right.longValue());
350 case T_char : return Constant.fromValue(left.floatValue() / right.charValue());
351 case T_float: return Constant.fromValue(left.floatValue() / right.floatValue());
352 case T_double: return Constant.fromValue(left.floatValue() / right.doubleValue());
353 case T_byte: return Constant.fromValue(left.floatValue() / right.byteValue());
354 case T_short: return Constant.fromValue(left.floatValue() / right.shortValue());
355 case T_int: return Constant.fromValue(left.floatValue() / right.intValue());
356 case T_long: return Constant.fromValue(left.floatValue() / right.longValue());
361 case T_char : return Constant.fromValue(left.doubleValue() / right.charValue());
362 case T_float: return Constant.fromValue(left.doubleValue() / right.floatValue());
363 case T_double: return Constant.fromValue(left.doubleValue() / right.doubleValue());
364 case T_byte: return Constant.fromValue(left.doubleValue() / right.byteValue());
365 case T_short: return Constant.fromValue(left.doubleValue() / right.shortValue());
366 case T_int: return Constant.fromValue(left.doubleValue() / right.intValue());
367 case T_long: return Constant.fromValue(left.doubleValue() / right.longValue());
372 case T_char : return Constant.fromValue(left.byteValue() / right.charValue());
373 case T_float: return Constant.fromValue(left.byteValue() / right.floatValue());
374 case T_double: return Constant.fromValue(left.byteValue() / right.doubleValue());
375 case T_byte: return Constant.fromValue(left.byteValue() / right.byteValue());
376 case T_short: return Constant.fromValue(left.byteValue() / right.shortValue());
377 case T_int: return Constant.fromValue(left.byteValue() / right.intValue());
378 case T_long: return Constant.fromValue(left.byteValue() / right.longValue());
383 case T_char : return Constant.fromValue(left.shortValue() / right.charValue());
384 case T_float: return Constant.fromValue(left.shortValue() / right.floatValue());
385 case T_double: return Constant.fromValue(left.shortValue() / right.doubleValue());
386 case T_byte: return Constant.fromValue(left.shortValue() / right.byteValue());
387 case T_short: return Constant.fromValue(left.shortValue() / right.shortValue());
388 case T_int: return Constant.fromValue(left.shortValue() / right.intValue());
389 case T_long: return Constant.fromValue(left.shortValue() / right.longValue());
394 case T_char : return Constant.fromValue(left.intValue() / right.charValue());
395 case T_float: return Constant.fromValue(left.intValue() / right.floatValue());
396 case T_double: return Constant.fromValue(left.intValue() / right.doubleValue());
397 case T_byte: return Constant.fromValue(left.intValue() / right.byteValue());
398 case T_short: return Constant.fromValue(left.intValue() / right.shortValue());
399 case T_int: return Constant.fromValue(left.intValue() / right.intValue());
400 case T_long: return Constant.fromValue(left.intValue() / right.longValue());
405 case T_char : return Constant.fromValue(left.longValue() / right.charValue());
406 case T_float: return Constant.fromValue(left.longValue() / right.floatValue());
407 case T_double: return Constant.fromValue(left.longValue() / right.doubleValue());
408 case T_byte: return Constant.fromValue(left.longValue() / right.byteValue());
409 case T_short: return Constant.fromValue(left.longValue() / right.shortValue());
410 case T_int: return Constant.fromValue(left.longValue() / right.intValue());
411 case T_long: return Constant.fromValue(left.longValue() / right.longValue());
419 public static final Constant computeConstantOperationEQUAL_EQUAL(Constant left, int leftId, int operator, Constant right, int rightId) {
423 if (rightId == T_boolean) {
424 return Constant.fromValue(left.booleanValue() == right.booleanValue());
429 case T_char : return Constant.fromValue(left.charValue() == right.charValue());
430 case T_float: return Constant.fromValue(left.charValue() == right.floatValue());
431 case T_double: return Constant.fromValue(left.charValue() == right.doubleValue());
432 case T_byte: return Constant.fromValue(left.charValue() == right.byteValue());
433 case T_short: return Constant.fromValue(left.charValue() == right.shortValue());
434 case T_int: return Constant.fromValue(left.charValue() == right.intValue());
435 case T_long: return Constant.fromValue(left.charValue() == right.longValue());}
439 case T_char : return Constant.fromValue(left.floatValue() == right.charValue());
440 case T_float: return Constant.fromValue(left.floatValue() == right.floatValue());
441 case T_double: return Constant.fromValue(left.floatValue() == right.doubleValue());
442 case T_byte: return Constant.fromValue(left.floatValue() == right.byteValue());
443 case T_short: return Constant.fromValue(left.floatValue() == right.shortValue());
444 case T_int: return Constant.fromValue(left.floatValue() == right.intValue());
445 case T_long: return Constant.fromValue(left.floatValue() == right.longValue());
450 case T_char : return Constant.fromValue(left.doubleValue() == right.charValue());
451 case T_float: return Constant.fromValue(left.doubleValue() == right.floatValue());
452 case T_double: return Constant.fromValue(left.doubleValue() == right.doubleValue());
453 case T_byte: return Constant.fromValue(left.doubleValue() == right.byteValue());
454 case T_short: return Constant.fromValue(left.doubleValue() == right.shortValue());
455 case T_int: return Constant.fromValue(left.doubleValue() == right.intValue());
456 case T_long: return Constant.fromValue(left.doubleValue() == right.longValue());
461 case T_char : return Constant.fromValue(left.byteValue() == right.charValue());
462 case T_float: return Constant.fromValue(left.byteValue() == right.floatValue());
463 case T_double: return Constant.fromValue(left.byteValue() == right.doubleValue());
464 case T_byte: return Constant.fromValue(left.byteValue() == right.byteValue());
465 case T_short: return Constant.fromValue(left.byteValue() == right.shortValue());
466 case T_int: return Constant.fromValue(left.byteValue() == right.intValue());
467 case T_long: return Constant.fromValue(left.byteValue() == right.longValue());
472 case T_char : return Constant.fromValue(left.shortValue() == right.charValue());
473 case T_float: return Constant.fromValue(left.shortValue() == right.floatValue());
474 case T_double: return Constant.fromValue(left.shortValue() == right.doubleValue());
475 case T_byte: return Constant.fromValue(left.shortValue() == right.byteValue());
476 case T_short: return Constant.fromValue(left.shortValue() == right.shortValue());
477 case T_int: return Constant.fromValue(left.shortValue() == right.intValue());
478 case T_long: return Constant.fromValue(left.shortValue() == right.longValue());
483 case T_char : return Constant.fromValue(left.intValue() == right.charValue());
484 case T_float: return Constant.fromValue(left.intValue() == right.floatValue());
485 case T_double: return Constant.fromValue(left.intValue() == right.doubleValue());
486 case T_byte: return Constant.fromValue(left.intValue() == right.byteValue());
487 case T_short: return Constant.fromValue(left.intValue() == right.shortValue());
488 case T_int: return Constant.fromValue(left.intValue() == right.intValue());
489 case T_long: return Constant.fromValue(left.intValue() == right.longValue());
494 case T_char : return Constant.fromValue(left.longValue() == right.charValue());
495 case T_float: return Constant.fromValue(left.longValue() == right.floatValue());
496 case T_double: return Constant.fromValue(left.longValue() == right.doubleValue());
497 case T_byte: return Constant.fromValue(left.longValue() == right.byteValue());
498 case T_short: return Constant.fromValue(left.longValue() == right.shortValue());
499 case T_int: return Constant.fromValue(left.longValue() == right.intValue());
500 case T_long: return Constant.fromValue(left.longValue() == right.longValue());
504 if (rightId == T_String) {
505 //String are interned in th compiler==>thus if two string constant
506 //get to be compared, it is an equal on the vale which is done
507 return Constant.fromValue(((StringConstant)left).compileTimeEqual((StringConstant)right));
511 if (rightId == T_String) {
512 return Constant.fromValue(false);
514 if (rightId == T_null) {
515 return Constant.fromValue(true);
520 return Constant.fromValue(false);
523 public static final Constant computeConstantOperationGREATER(Constant left, int leftId, int operator, Constant right, int rightId) {
528 case T_char : return Constant.fromValue(left.charValue() > right.charValue());
529 case T_float: return Constant.fromValue(left.charValue() > right.floatValue());
530 case T_double: return Constant.fromValue(left.charValue() > right.doubleValue());
531 case T_byte: return Constant.fromValue(left.charValue() > right.byteValue());
532 case T_short: return Constant.fromValue(left.charValue() > right.shortValue());
533 case T_int: return Constant.fromValue(left.charValue() > right.intValue());
534 case T_long: return Constant.fromValue(left.charValue() > right.longValue());
539 case T_char : return Constant.fromValue(left.floatValue() > right.charValue());
540 case T_float: return Constant.fromValue(left.floatValue() > right.floatValue());
541 case T_double: return Constant.fromValue(left.floatValue() > right.doubleValue());
542 case T_byte: return Constant.fromValue(left.floatValue() > right.byteValue());
543 case T_short: return Constant.fromValue(left.floatValue() > right.shortValue());
544 case T_int: return Constant.fromValue(left.floatValue() > right.intValue());
545 case T_long: return Constant.fromValue(left.floatValue() > right.longValue());
550 case T_char : return Constant.fromValue(left.doubleValue() > right.charValue());
551 case T_float: return Constant.fromValue(left.doubleValue() > right.floatValue());
552 case T_double: return Constant.fromValue(left.doubleValue() > right.doubleValue());
553 case T_byte: return Constant.fromValue(left.doubleValue() > right.byteValue());
554 case T_short: return Constant.fromValue(left.doubleValue() > right.shortValue());
555 case T_int: return Constant.fromValue(left.doubleValue() > right.intValue());
556 case T_long: return Constant.fromValue(left.doubleValue() > right.longValue());
561 case T_char : return Constant.fromValue(left.byteValue() > right.charValue());
562 case T_float: return Constant.fromValue(left.byteValue() > right.floatValue());
563 case T_double: return Constant.fromValue(left.byteValue() > right.doubleValue());
564 case T_byte: return Constant.fromValue(left.byteValue() > right.byteValue());
565 case T_short: return Constant.fromValue(left.byteValue() > right.shortValue());
566 case T_int: return Constant.fromValue(left.byteValue() > right.intValue());
567 case T_long: return Constant.fromValue(left.byteValue() > right.longValue());
572 case T_char : return Constant.fromValue(left.shortValue() > right.charValue());
573 case T_float: return Constant.fromValue(left.shortValue() > right.floatValue());
574 case T_double: return Constant.fromValue(left.shortValue() > right.doubleValue());
575 case T_byte: return Constant.fromValue(left.shortValue() > right.byteValue());
576 case T_short: return Constant.fromValue(left.shortValue() > right.shortValue());
577 case T_int: return Constant.fromValue(left.shortValue() > right.intValue());
578 case T_long: return Constant.fromValue(left.shortValue() > right.longValue());
583 case T_char : return Constant.fromValue(left.intValue() > right.charValue());
584 case T_float: return Constant.fromValue(left.intValue() > right.floatValue());
585 case T_double: return Constant.fromValue(left.intValue() > right.doubleValue());
586 case T_byte: return Constant.fromValue(left.intValue() > right.byteValue());
587 case T_short: return Constant.fromValue(left.intValue() > right.shortValue());
588 case T_int: return Constant.fromValue(left.intValue() > right.intValue());
589 case T_long: return Constant.fromValue(left.intValue() > right.longValue());
594 case T_char : return Constant.fromValue(left.longValue() > right.charValue());
595 case T_float: return Constant.fromValue(left.longValue() > right.floatValue());
596 case T_double: return Constant.fromValue(left.longValue() > right.doubleValue());
597 case T_byte: return Constant.fromValue(left.longValue() > right.byteValue());
598 case T_short: return Constant.fromValue(left.longValue() > right.shortValue());
599 case T_int: return Constant.fromValue(left.longValue() > right.intValue());
600 case T_long: return Constant.fromValue(left.longValue() > right.longValue());
608 public static final Constant computeConstantOperationGREATER_EQUAL(Constant left, int leftId, int operator, Constant right, int rightId) {
613 case T_char : return Constant.fromValue(left.charValue() >= right.charValue());
614 case T_float: return Constant.fromValue(left.charValue() >= right.floatValue());
615 case T_double: return Constant.fromValue(left.charValue() >= right.doubleValue());
616 case T_byte: return Constant.fromValue(left.charValue() >= right.byteValue());
617 case T_short: return Constant.fromValue(left.charValue() >= right.shortValue());
618 case T_int: return Constant.fromValue(left.charValue() >= right.intValue());
619 case T_long: return Constant.fromValue(left.charValue() >= right.longValue());
624 case T_char : return Constant.fromValue(left.floatValue() >= right.charValue());
625 case T_float: return Constant.fromValue(left.floatValue() >= right.floatValue());
626 case T_double: return Constant.fromValue(left.floatValue() >= right.doubleValue());
627 case T_byte: return Constant.fromValue(left.floatValue() >= right.byteValue());
628 case T_short: return Constant.fromValue(left.floatValue() >= right.shortValue());
629 case T_int: return Constant.fromValue(left.floatValue() >= right.intValue());
630 case T_long: return Constant.fromValue(left.floatValue() >= right.longValue());
635 case T_char : return Constant.fromValue(left.doubleValue() >= right.charValue());
636 case T_float: return Constant.fromValue(left.doubleValue() >= right.floatValue());
637 case T_double: return Constant.fromValue(left.doubleValue() >= right.doubleValue());
638 case T_byte: return Constant.fromValue(left.doubleValue() >= right.byteValue());
639 case T_short: return Constant.fromValue(left.doubleValue() >= right.shortValue());
640 case T_int: return Constant.fromValue(left.doubleValue() >= right.intValue());
641 case T_long: return Constant.fromValue(left.doubleValue() >= right.longValue());
646 case T_char : return Constant.fromValue(left.byteValue() >= right.charValue());
647 case T_float: return Constant.fromValue(left.byteValue() >= right.floatValue());
648 case T_double: return Constant.fromValue(left.byteValue() >= right.doubleValue());
649 case T_byte: return Constant.fromValue(left.byteValue() >= right.byteValue());
650 case T_short: return Constant.fromValue(left.byteValue() >= right.shortValue());
651 case T_int: return Constant.fromValue(left.byteValue() >= right.intValue());
652 case T_long: return Constant.fromValue(left.byteValue() >= right.longValue());
657 case T_char : return Constant.fromValue(left.shortValue() >= right.charValue());
658 case T_float: return Constant.fromValue(left.shortValue() >= right.floatValue());
659 case T_double: return Constant.fromValue(left.shortValue() >= right.doubleValue());
660 case T_byte: return Constant.fromValue(left.shortValue() >= right.byteValue());
661 case T_short: return Constant.fromValue(left.shortValue() >= right.shortValue());
662 case T_int: return Constant.fromValue(left.shortValue() >= right.intValue());
663 case T_long: return Constant.fromValue(left.shortValue() >= right.longValue());
668 case T_char : return Constant.fromValue(left.intValue() >= right.charValue());
669 case T_float: return Constant.fromValue(left.intValue() >= right.floatValue());
670 case T_double: return Constant.fromValue(left.intValue() >= right.doubleValue());
671 case T_byte: return Constant.fromValue(left.intValue() >= right.byteValue());
672 case T_short: return Constant.fromValue(left.intValue() >= right.shortValue());
673 case T_int: return Constant.fromValue(left.intValue() >= right.intValue());
674 case T_long: return Constant.fromValue(left.intValue() >= right.longValue());
679 case T_char : return Constant.fromValue(left.longValue() >= right.charValue());
680 case T_float: return Constant.fromValue(left.longValue() >= right.floatValue());
681 case T_double: return Constant.fromValue(left.longValue() >= right.doubleValue());
682 case T_byte: return Constant.fromValue(left.longValue() >= right.byteValue());
683 case T_short: return Constant.fromValue(left.longValue() >= right.shortValue());
684 case T_int: return Constant.fromValue(left.longValue() >= right.intValue());
685 case T_long: return Constant.fromValue(left.longValue() >= right.longValue());
693 public static final Constant computeConstantOperationLEFT_SHIFT(Constant left, int leftId, int operator, Constant right, int rightId) {
698 case T_char : return Constant.fromValue(left.charValue() << right.charValue());
699 case T_byte: return Constant.fromValue(left.charValue() << right.byteValue());
700 case T_short: return Constant.fromValue(left.charValue() << right.shortValue());
701 case T_int: return Constant.fromValue(left.charValue() << right.intValue());
702 case T_long: return Constant.fromValue(left.charValue() << right.longValue());
707 case T_char : return Constant.fromValue(left.byteValue() << right.charValue());
708 case T_byte: return Constant.fromValue(left.byteValue() << right.byteValue());
709 case T_short: return Constant.fromValue(left.byteValue() << right.shortValue());
710 case T_int: return Constant.fromValue(left.byteValue() << right.intValue());
711 case T_long: return Constant.fromValue(left.byteValue() << right.longValue());
716 case T_char : return Constant.fromValue(left.shortValue() << right.charValue());
717 case T_byte: return Constant.fromValue(left.shortValue() << right.byteValue());
718 case T_short: return Constant.fromValue(left.shortValue() << right.shortValue());
719 case T_int: return Constant.fromValue(left.shortValue() << right.intValue());
720 case T_long: return Constant.fromValue(left.shortValue() << right.longValue());
725 case T_char : return Constant.fromValue(left.intValue() << right.charValue());
726 case T_byte: return Constant.fromValue(left.intValue() << right.byteValue());
727 case T_short: return Constant.fromValue(left.intValue() << right.shortValue());
728 case T_int: return Constant.fromValue(left.intValue() << right.intValue());
729 case T_long: return Constant.fromValue(left.intValue() << right.longValue());
734 case T_char : return Constant.fromValue(left.longValue() << right.charValue());
735 case T_byte: return Constant.fromValue(left.longValue() << right.byteValue());
736 case T_short: return Constant.fromValue(left.longValue() << right.shortValue());
737 case T_int: return Constant.fromValue(left.longValue() << right.intValue());
738 case T_long: return Constant.fromValue(left.longValue() << right.longValue());
746 public static final Constant computeConstantOperationLESS(Constant left, int leftId, int operator, Constant right, int rightId) {
751 case T_char : return Constant.fromValue(left.charValue() < right.charValue());
752 case T_float: return Constant.fromValue(left.charValue() < right.floatValue());
753 case T_double: return Constant.fromValue(left.charValue() < right.doubleValue());
754 case T_byte: return Constant.fromValue(left.charValue() < right.byteValue());
755 case T_short: return Constant.fromValue(left.charValue() < right.shortValue());
756 case T_int: return Constant.fromValue(left.charValue() < right.intValue());
757 case T_long: return Constant.fromValue(left.charValue() < right.longValue());
762 case T_char : return Constant.fromValue(left.floatValue() < right.charValue());
763 case T_float: return Constant.fromValue(left.floatValue() < right.floatValue());
764 case T_double: return Constant.fromValue(left.floatValue() < right.doubleValue());
765 case T_byte: return Constant.fromValue(left.floatValue() < right.byteValue());
766 case T_short: return Constant.fromValue(left.floatValue() < right.shortValue());
767 case T_int: return Constant.fromValue(left.floatValue() < right.intValue());
768 case T_long: return Constant.fromValue(left.floatValue() < right.longValue());
773 case T_char : return Constant.fromValue(left.doubleValue() < right.charValue());
774 case T_float: return Constant.fromValue(left.doubleValue() < right.floatValue());
775 case T_double: return Constant.fromValue(left.doubleValue() < right.doubleValue());
776 case T_byte: return Constant.fromValue(left.doubleValue() < right.byteValue());
777 case T_short: return Constant.fromValue(left.doubleValue() < right.shortValue());
778 case T_int: return Constant.fromValue(left.doubleValue() < right.intValue());
779 case T_long: return Constant.fromValue(left.doubleValue() < right.longValue());
784 case T_char : return Constant.fromValue(left.byteValue() < right.charValue());
785 case T_float: return Constant.fromValue(left.byteValue() < right.floatValue());
786 case T_double: return Constant.fromValue(left.byteValue() < right.doubleValue());
787 case T_byte: return Constant.fromValue(left.byteValue() < right.byteValue());
788 case T_short: return Constant.fromValue(left.byteValue() < right.shortValue());
789 case T_int: return Constant.fromValue(left.byteValue() < right.intValue());
790 case T_long: return Constant.fromValue(left.byteValue() < right.longValue());
795 case T_char : return Constant.fromValue(left.shortValue() < right.charValue());
796 case T_float: return Constant.fromValue(left.shortValue() < right.floatValue());
797 case T_double: return Constant.fromValue(left.shortValue() < right.doubleValue());
798 case T_byte: return Constant.fromValue(left.shortValue() < right.byteValue());
799 case T_short: return Constant.fromValue(left.shortValue() < right.shortValue());
800 case T_int: return Constant.fromValue(left.shortValue() < right.intValue());
801 case T_long: return Constant.fromValue(left.shortValue() < right.longValue());
806 case T_char : return Constant.fromValue(left.intValue() < right.charValue());
807 case T_float: return Constant.fromValue(left.intValue() < right.floatValue());
808 case T_double: return Constant.fromValue(left.intValue() < right.doubleValue());
809 case T_byte: return Constant.fromValue(left.intValue() < right.byteValue());
810 case T_short: return Constant.fromValue(left.intValue() < right.shortValue());
811 case T_int: return Constant.fromValue(left.intValue() < right.intValue());
812 case T_long: return Constant.fromValue(left.intValue() < right.longValue());
817 case T_char : return Constant.fromValue(left.longValue() < right.charValue());
818 case T_float: return Constant.fromValue(left.longValue() < right.floatValue());
819 case T_double: return Constant.fromValue(left.longValue() < right.doubleValue());
820 case T_byte: return Constant.fromValue(left.longValue() < right.byteValue());
821 case T_short: return Constant.fromValue(left.longValue() < right.shortValue());
822 case T_int: return Constant.fromValue(left.longValue() < right.intValue());
823 case T_long: return Constant.fromValue(left.longValue() < right.longValue());
831 public static final Constant computeConstantOperationLESS_EQUAL(Constant left, int leftId, int operator, Constant right, int rightId) {
836 case T_char : return Constant.fromValue(left.charValue() <= right.charValue());
837 case T_float: return Constant.fromValue(left.charValue() <= right.floatValue());
838 case T_double: return Constant.fromValue(left.charValue() <= right.doubleValue());
839 case T_byte: return Constant.fromValue(left.charValue() <= right.byteValue());
840 case T_short: return Constant.fromValue(left.charValue() <= right.shortValue());
841 case T_int: return Constant.fromValue(left.charValue() <= right.intValue());
842 case T_long: return Constant.fromValue(left.charValue() <= right.longValue());
847 case T_char : return Constant.fromValue(left.floatValue() <= right.charValue());
848 case T_float: return Constant.fromValue(left.floatValue() <= right.floatValue());
849 case T_double: return Constant.fromValue(left.floatValue() <= right.doubleValue());
850 case T_byte: return Constant.fromValue(left.floatValue() <= right.byteValue());
851 case T_short: return Constant.fromValue(left.floatValue() <= right.shortValue());
852 case T_int: return Constant.fromValue(left.floatValue() <= right.intValue());
853 case T_long: return Constant.fromValue(left.floatValue() <= right.longValue());
858 case T_char : return Constant.fromValue(left.doubleValue() <= right.charValue());
859 case T_float: return Constant.fromValue(left.doubleValue() <= right.floatValue());
860 case T_double: return Constant.fromValue(left.doubleValue() <= right.doubleValue());
861 case T_byte: return Constant.fromValue(left.doubleValue() <= right.byteValue());
862 case T_short: return Constant.fromValue(left.doubleValue() <= right.shortValue());
863 case T_int: return Constant.fromValue(left.doubleValue() <= right.intValue());
864 case T_long: return Constant.fromValue(left.doubleValue() <= right.longValue());
869 case T_char : return Constant.fromValue(left.byteValue() <= right.charValue());
870 case T_float: return Constant.fromValue(left.byteValue() <= right.floatValue());
871 case T_double: return Constant.fromValue(left.byteValue() <= right.doubleValue());
872 case T_byte: return Constant.fromValue(left.byteValue() <= right.byteValue());
873 case T_short: return Constant.fromValue(left.byteValue() <= right.shortValue());
874 case T_int: return Constant.fromValue(left.byteValue() <= right.intValue());
875 case T_long: return Constant.fromValue(left.byteValue() <= right.longValue());
880 case T_char : return Constant.fromValue(left.shortValue() <= right.charValue());
881 case T_float: return Constant.fromValue(left.shortValue() <= right.floatValue());
882 case T_double: return Constant.fromValue(left.shortValue() <= right.doubleValue());
883 case T_byte: return Constant.fromValue(left.shortValue() <= right.byteValue());
884 case T_short: return Constant.fromValue(left.shortValue() <= right.shortValue());
885 case T_int: return Constant.fromValue(left.shortValue() <= right.intValue());
886 case T_long: return Constant.fromValue(left.shortValue() <= right.longValue());
891 case T_char : return Constant.fromValue(left.intValue() <= right.charValue());
892 case T_float: return Constant.fromValue(left.intValue() <= right.floatValue());
893 case T_double: return Constant.fromValue(left.intValue() <= right.doubleValue());
894 case T_byte: return Constant.fromValue(left.intValue() <= right.byteValue());
895 case T_short: return Constant.fromValue(left.intValue() <= right.shortValue());
896 case T_int: return Constant.fromValue(left.intValue() <= right.intValue());
897 case T_long: return Constant.fromValue(left.intValue() <= right.longValue());
902 case T_char : return Constant.fromValue(left.longValue() <= right.charValue());
903 case T_float: return Constant.fromValue(left.longValue() <= right.floatValue());
904 case T_double: return Constant.fromValue(left.longValue() <= right.doubleValue());
905 case T_byte: return Constant.fromValue(left.longValue() <= right.byteValue());
906 case T_short: return Constant.fromValue(left.longValue() <= right.shortValue());
907 case T_int: return Constant.fromValue(left.longValue() <= right.intValue());
908 case T_long: return Constant.fromValue(left.longValue() <= right.longValue());
915 public static final Constant computeConstantOperationMINUS(Constant left, int leftId, int operator, Constant right, int rightId) {
920 case T_char : return Constant.fromValue(left.charValue() - right.charValue());
921 case T_float: return Constant.fromValue(left.charValue() - right.floatValue());
922 case T_double: return Constant.fromValue(left.charValue() - right.doubleValue());
923 case T_byte: return Constant.fromValue(left.charValue() - right.byteValue());
924 case T_short: return Constant.fromValue(left.charValue() - right.shortValue());
925 case T_int: return Constant.fromValue(left.charValue() - right.intValue());
926 case T_long: return Constant.fromValue(left.charValue() - right.longValue());
931 case T_char : return Constant.fromValue(left.floatValue() - right.charValue());
932 case T_float: return Constant.fromValue(left.floatValue() - right.floatValue());
933 case T_double: return Constant.fromValue(left.floatValue() - right.doubleValue());
934 case T_byte: return Constant.fromValue(left.floatValue() - right.byteValue());
935 case T_short: return Constant.fromValue(left.floatValue() - right.shortValue());
936 case T_int: return Constant.fromValue(left.floatValue() - right.intValue());
937 case T_long: return Constant.fromValue(left.floatValue() - right.longValue());
942 case T_char : return Constant.fromValue(left.doubleValue() - right.charValue());
943 case T_float: return Constant.fromValue(left.doubleValue() - right.floatValue());
944 case T_double: return Constant.fromValue(left.doubleValue() - right.doubleValue());
945 case T_byte: return Constant.fromValue(left.doubleValue() - right.byteValue());
946 case T_short: return Constant.fromValue(left.doubleValue() - right.shortValue());
947 case T_int: return Constant.fromValue(left.doubleValue() - right.intValue());
948 case T_long: return Constant.fromValue(left.doubleValue() - right.longValue());
953 case T_char : return Constant.fromValue(left.byteValue() - right.charValue());
954 case T_float: return Constant.fromValue(left.byteValue() - right.floatValue());
955 case T_double: return Constant.fromValue(left.byteValue() - right.doubleValue());
956 case T_byte: return Constant.fromValue(left.byteValue() - right.byteValue());
957 case T_short: return Constant.fromValue(left.byteValue() - right.shortValue());
958 case T_int: return Constant.fromValue(left.byteValue() - right.intValue());
959 case T_long: return Constant.fromValue(left.byteValue() - right.longValue());
964 case T_char : return Constant.fromValue(left.shortValue() - right.charValue());
965 case T_float: return Constant.fromValue(left.shortValue() - right.floatValue());
966 case T_double: return Constant.fromValue(left.shortValue() - right.doubleValue());
967 case T_byte: return Constant.fromValue(left.shortValue() - right.byteValue());
968 case T_short: return Constant.fromValue(left.shortValue() - right.shortValue());
969 case T_int: return Constant.fromValue(left.shortValue() - right.intValue());
970 case T_long: return Constant.fromValue(left.shortValue() - right.longValue());
975 case T_char : return Constant.fromValue(left.intValue() - right.charValue());
976 case T_float: return Constant.fromValue(left.intValue() - right.floatValue());
977 case T_double: return Constant.fromValue(left.intValue() - right.doubleValue());
978 case T_byte: return Constant.fromValue(left.intValue() - right.byteValue());
979 case T_short: return Constant.fromValue(left.intValue() - right.shortValue());
980 case T_int: return Constant.fromValue(left.intValue() - right.intValue());
981 case T_long: return Constant.fromValue(left.intValue() - right.longValue());
986 case T_char : return Constant.fromValue(left.longValue() - right.charValue());
987 case T_float: return Constant.fromValue(left.longValue() - right.floatValue());
988 case T_double: return Constant.fromValue(left.longValue() - right.doubleValue());
989 case T_byte: return Constant.fromValue(left.longValue() - right.byteValue());
990 case T_short: return Constant.fromValue(left.longValue() - right.shortValue());
991 case T_int: return Constant.fromValue(left.longValue() - right.intValue());
992 case T_long: return Constant.fromValue(left.longValue() - right.longValue());
1000 public static final Constant computeConstantOperationMULTIPLY(Constant left, int leftId, int operator, Constant right, int rightId) {
1005 case T_char : return Constant.fromValue(left.charValue() * right.charValue());
1006 case T_float: return Constant.fromValue(left.charValue() * right.floatValue());
1007 case T_double: return Constant.fromValue(left.charValue() * right.doubleValue());
1008 case T_byte: return Constant.fromValue(left.charValue() * right.byteValue());
1009 case T_short: return Constant.fromValue(left.charValue() * right.shortValue());
1010 case T_int: return Constant.fromValue(left.charValue() * right.intValue());
1011 case T_long: return Constant.fromValue(left.charValue() * right.longValue());
1016 case T_char : return Constant.fromValue(left.floatValue() * right.charValue());
1017 case T_float: return Constant.fromValue(left.floatValue() * right.floatValue());
1018 case T_double: return Constant.fromValue(left.floatValue() * right.doubleValue());
1019 case T_byte: return Constant.fromValue(left.floatValue() * right.byteValue());
1020 case T_short: return Constant.fromValue(left.floatValue() * right.shortValue());
1021 case T_int: return Constant.fromValue(left.floatValue() * right.intValue());
1022 case T_long: return Constant.fromValue(left.floatValue() * right.longValue());
1027 case T_char : return Constant.fromValue(left.doubleValue() * right.charValue());
1028 case T_float: return Constant.fromValue(left.doubleValue() * right.floatValue());
1029 case T_double: return Constant.fromValue(left.doubleValue() * right.doubleValue());
1030 case T_byte: return Constant.fromValue(left.doubleValue() * right.byteValue());
1031 case T_short: return Constant.fromValue(left.doubleValue() * right.shortValue());
1032 case T_int: return Constant.fromValue(left.doubleValue() * right.intValue());
1033 case T_long: return Constant.fromValue(left.doubleValue() * right.longValue());
1038 case T_char : return Constant.fromValue(left.byteValue() * right.charValue());
1039 case T_float: return Constant.fromValue(left.byteValue() * right.floatValue());
1040 case T_double: return Constant.fromValue(left.byteValue() * right.doubleValue());
1041 case T_byte: return Constant.fromValue(left.byteValue() * right.byteValue());
1042 case T_short: return Constant.fromValue(left.byteValue() * right.shortValue());
1043 case T_int: return Constant.fromValue(left.byteValue() * right.intValue());
1044 case T_long: return Constant.fromValue(left.byteValue() * right.longValue());
1049 case T_char : return Constant.fromValue(left.shortValue() * right.charValue());
1050 case T_float: return Constant.fromValue(left.shortValue() * right.floatValue());
1051 case T_double: return Constant.fromValue(left.shortValue() * right.doubleValue());
1052 case T_byte: return Constant.fromValue(left.shortValue() * right.byteValue());
1053 case T_short: return Constant.fromValue(left.shortValue() * right.shortValue());
1054 case T_int: return Constant.fromValue(left.shortValue() * right.intValue());
1055 case T_long: return Constant.fromValue(left.shortValue() * right.longValue());
1060 case T_char : return Constant.fromValue(left.intValue() * right.charValue());
1061 case T_float: return Constant.fromValue(left.intValue() * right.floatValue());
1062 case T_double: return Constant.fromValue(left.intValue() * right.doubleValue());
1063 case T_byte: return Constant.fromValue(left.intValue() * right.byteValue());
1064 case T_short: return Constant.fromValue(left.intValue() * right.shortValue());
1065 case T_int: return Constant.fromValue(left.intValue() * right.intValue());
1066 case T_long: return Constant.fromValue(left.intValue() * right.longValue());
1071 case T_char : return Constant.fromValue(left.longValue() * right.charValue());
1072 case T_float: return Constant.fromValue(left.longValue() * right.floatValue());
1073 case T_double: return Constant.fromValue(left.longValue() * right.doubleValue());
1074 case T_byte: return Constant.fromValue(left.longValue() * right.byteValue());
1075 case T_short: return Constant.fromValue(left.longValue() * right.shortValue());
1076 case T_int: return Constant.fromValue(left.longValue() * right.intValue());
1077 case T_long: return Constant.fromValue(left.longValue() * right.longValue());
1081 return NotAConstant;
1084 public static final Constant computeConstantOperationOR(Constant left, int leftId, int operator, Constant right, int rightId) {
1087 case T_boolean : return Constant.fromValue(left.booleanValue() | right.booleanValue());
1090 case T_char : return Constant.fromValue(left.charValue() | right.charValue());
1091 case T_byte: return Constant.fromValue(left.charValue() | right.byteValue());
1092 case T_short: return Constant.fromValue(left.charValue() | right.shortValue());
1093 case T_int: return Constant.fromValue(left.charValue() | right.intValue());
1094 case T_long: return Constant.fromValue(left.charValue() | right.longValue());
1099 case T_char : return Constant.fromValue(left.byteValue() | right.charValue());
1100 case T_byte: return Constant.fromValue(left.byteValue() | right.byteValue());
1101 case T_short: return Constant.fromValue(left.byteValue() | right.shortValue());
1102 case T_int: return Constant.fromValue(left.byteValue() | right.intValue());
1103 case T_long: return Constant.fromValue(left.byteValue() | right.longValue());
1108 case T_char : return Constant.fromValue(left.shortValue() | right.charValue());
1109 case T_byte: return Constant.fromValue(left.shortValue() | right.byteValue());
1110 case T_short: return Constant.fromValue(left.shortValue() | right.shortValue());
1111 case T_int: return Constant.fromValue(left.shortValue() | right.intValue());
1112 case T_long: return Constant.fromValue(left.shortValue() | right.longValue());
1117 case T_char : return Constant.fromValue(left.intValue() | right.charValue());
1118 case T_byte: return Constant.fromValue(left.intValue() | right.byteValue());
1119 case T_short: return Constant.fromValue(left.intValue() | right.shortValue());
1120 case T_int: return Constant.fromValue(left.intValue() | right.intValue());
1121 case T_long: return Constant.fromValue(left.intValue() | right.longValue());
1126 case T_char : return Constant.fromValue(left.longValue() | right.charValue());
1127 case T_byte: return Constant.fromValue(left.longValue() | right.byteValue());
1128 case T_short: return Constant.fromValue(left.longValue() | right.shortValue());
1129 case T_int: return Constant.fromValue(left.longValue() | right.intValue());
1130 case T_long: return Constant.fromValue(left.longValue() | right.longValue());
1135 return NotAConstant;
1138 public static final Constant computeConstantOperationOR_OR(Constant left, int leftId, int operator, Constant right, int rightId) {
1140 return Constant.fromValue(left.booleanValue() || right.booleanValue());
1143 public static final Constant computeConstantOperationPLUS(Constant left, int leftId, int operator, Constant right, int rightId) {
1147 if (rightId == T_String) {
1148 return Constant.fromValue(left.stringValue() + right.stringValue());
1151 if (rightId == T_String) {
1152 return Constant.fromValue(left.stringValue() + right.stringValue());
1157 case T_char : return Constant.fromValue(left.charValue() + right.charValue());
1158 case T_float: return Constant.fromValue(left.charValue() + right.floatValue());
1159 case T_double: return Constant.fromValue(left.charValue() + right.doubleValue());
1160 case T_byte: return Constant.fromValue(left.charValue() + right.byteValue());
1161 case T_short: return Constant.fromValue(left.charValue() + right.shortValue());
1162 case T_int: return Constant.fromValue(left.charValue() + right.intValue());
1163 case T_long: return Constant.fromValue(left.charValue() + right.longValue());
1164 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue());
1169 case T_char : return Constant.fromValue(left.floatValue() + right.charValue());
1170 case T_float: return Constant.fromValue(left.floatValue() + right.floatValue());
1171 case T_double: return Constant.fromValue(left.floatValue() + right.doubleValue());
1172 case T_byte: return Constant.fromValue(left.floatValue() + right.byteValue());
1173 case T_short: return Constant.fromValue(left.floatValue() + right.shortValue());
1174 case T_int: return Constant.fromValue(left.floatValue() + right.intValue());
1175 case T_long: return Constant.fromValue(left.floatValue() + right.longValue());
1176 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue());
1181 case T_char : return Constant.fromValue(left.doubleValue() + right.charValue());
1182 case T_float: return Constant.fromValue(left.doubleValue() + right.floatValue());
1183 case T_double: return Constant.fromValue(left.doubleValue() + right.doubleValue());
1184 case T_byte: return Constant.fromValue(left.doubleValue() + right.byteValue());
1185 case T_short: return Constant.fromValue(left.doubleValue() + right.shortValue());
1186 case T_int: return Constant.fromValue(left.doubleValue() + right.intValue());
1187 case T_long: return Constant.fromValue(left.doubleValue() + right.longValue());
1188 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue());
1193 case T_char : return Constant.fromValue(left.byteValue() + right.charValue());
1194 case T_float: return Constant.fromValue(left.byteValue() + right.floatValue());
1195 case T_double: return Constant.fromValue(left.byteValue() + right.doubleValue());
1196 case T_byte: return Constant.fromValue(left.byteValue() + right.byteValue());
1197 case T_short: return Constant.fromValue(left.byteValue() + right.shortValue());
1198 case T_int: return Constant.fromValue(left.byteValue() + right.intValue());
1199 case T_long: return Constant.fromValue(left.byteValue() + right.longValue());
1200 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue());
1206 case T_char : return Constant.fromValue(left.shortValue() + right.charValue());
1207 case T_float: return Constant.fromValue(left.shortValue() + right.floatValue());
1208 case T_double: return Constant.fromValue(left.shortValue() + right.doubleValue());
1209 case T_byte: return Constant.fromValue(left.shortValue() + right.byteValue());
1210 case T_short: return Constant.fromValue(left.shortValue() + right.shortValue());
1211 case T_int: return Constant.fromValue(left.shortValue() + right.intValue());
1212 case T_long: return Constant.fromValue(left.shortValue() + right.longValue());
1213 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue());
1218 case T_char : return Constant.fromValue(left.intValue() + right.charValue());
1219 case T_float: return Constant.fromValue(left.intValue() + right.floatValue());
1220 case T_double: return Constant.fromValue(left.intValue() + right.doubleValue());
1221 case T_byte: return Constant.fromValue(left.intValue() + right.byteValue());
1222 case T_short: return Constant.fromValue(left.intValue() + right.shortValue());
1223 case T_int: return Constant.fromValue(left.intValue() + right.intValue());
1224 case T_long: return Constant.fromValue(left.intValue() + right.longValue());
1225 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue());
1230 case T_char : return Constant.fromValue(left.longValue() + right.charValue());
1231 case T_float: return Constant.fromValue(left.longValue() + right.floatValue());
1232 case T_double: return Constant.fromValue(left.longValue() + right.doubleValue());
1233 case T_byte: return Constant.fromValue(left.longValue() + right.byteValue());
1234 case T_short: return Constant.fromValue(left.longValue() + right.shortValue());
1235 case T_int: return Constant.fromValue(left.longValue() + right.intValue());
1236 case T_long: return Constant.fromValue(left.longValue() + right.longValue());
1237 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue());
1242 case T_char : return Constant.fromValue(left.stringValue() + right.stringValue());
1243 case T_float: return Constant.fromValue(left.stringValue() + right.stringValue());
1244 case T_double: return Constant.fromValue(left.stringValue() + right.stringValue());
1245 case T_byte: return Constant.fromValue(left.stringValue() + right.stringValue());
1246 case T_short: return Constant.fromValue(left.stringValue() + right.stringValue());
1247 case T_int: return Constant.fromValue(left.stringValue() + right.stringValue());
1248 case T_long: return Constant.fromValue(left.stringValue() + right.stringValue());
1249 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue());
1250 case T_boolean: return Constant.fromValue(left.stringValue() + right.stringValue());
1255 case T_char : return Constant.fromValue(left.stringValue() + right.stringValue());
1256 case T_float: return Constant.fromValue(left.stringValue() + right.stringValue());
1257 case T_double: return Constant.fromValue(left.stringValue() + right.stringValue());
1258 case T_byte: return Constant.fromValue(left.stringValue() + right.stringValue());
1259 case T_short: return Constant.fromValue(left.stringValue() + right.stringValue());
1260 case T_int: return Constant.fromValue(left.stringValue() + right.stringValue());
1261 case T_long: return Constant.fromValue(left.stringValue() + right.stringValue());
1262 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue());
1267 return NotAConstant;
1270 public static final Constant computeConstantOperationREMAINDER(Constant left, int leftId, int operator, Constant right, int rightId) {
1275 case T_char : return Constant.fromValue(left.charValue() % right.charValue());
1276 case T_float: return Constant.fromValue(left.charValue() % right.floatValue());
1277 case T_double: return Constant.fromValue(left.charValue() % right.doubleValue());
1278 case T_byte: return Constant.fromValue(left.charValue() % right.byteValue());
1279 case T_short: return Constant.fromValue(left.charValue() % right.shortValue());
1280 case T_int: return Constant.fromValue(left.charValue() % right.intValue());
1281 case T_long: return Constant.fromValue(left.charValue() % right.longValue());
1286 case T_char : return Constant.fromValue(left.floatValue() % right.charValue());
1287 case T_float: return Constant.fromValue(left.floatValue() % right.floatValue());
1288 case T_double: return Constant.fromValue(left.floatValue() % right.doubleValue());
1289 case T_byte: return Constant.fromValue(left.floatValue() % right.byteValue());
1290 case T_short: return Constant.fromValue(left.floatValue() % right.shortValue());
1291 case T_int: return Constant.fromValue(left.floatValue() % right.intValue());
1292 case T_long: return Constant.fromValue(left.floatValue() % right.longValue());
1297 case T_char : return Constant.fromValue(left.doubleValue() % right.charValue());
1298 case T_float: return Constant.fromValue(left.doubleValue() % right.floatValue());
1299 case T_double: return Constant.fromValue(left.doubleValue() % right.doubleValue());
1300 case T_byte: return Constant.fromValue(left.doubleValue() % right.byteValue());
1301 case T_short: return Constant.fromValue(left.doubleValue() % right.shortValue());
1302 case T_int: return Constant.fromValue(left.doubleValue() % right.intValue());
1303 case T_long: return Constant.fromValue(left.doubleValue() % right.longValue());
1308 case T_char : return Constant.fromValue(left.byteValue() % right.charValue());
1309 case T_float: return Constant.fromValue(left.byteValue() % right.floatValue());
1310 case T_double: return Constant.fromValue(left.byteValue() % right.doubleValue());
1311 case T_byte: return Constant.fromValue(left.byteValue() % right.byteValue());
1312 case T_short: return Constant.fromValue(left.byteValue() % right.shortValue());
1313 case T_int: return Constant.fromValue(left.byteValue() % right.intValue());
1314 case T_long: return Constant.fromValue(left.byteValue() % right.longValue());
1319 case T_char : return Constant.fromValue(left.shortValue() % right.charValue());
1320 case T_float: return Constant.fromValue(left.shortValue() % right.floatValue());
1321 case T_double: return Constant.fromValue(left.shortValue() % right.doubleValue());
1322 case T_byte: return Constant.fromValue(left.shortValue() % right.byteValue());
1323 case T_short: return Constant.fromValue(left.shortValue() % right.shortValue());
1324 case T_int: return Constant.fromValue(left.shortValue() % right.intValue());
1325 case T_long: return Constant.fromValue(left.shortValue() % right.longValue());
1330 case T_char : return Constant.fromValue(left.intValue() % right.charValue());
1331 case T_float: return Constant.fromValue(left.intValue() % right.floatValue());
1332 case T_double: return Constant.fromValue(left.intValue() % right.doubleValue());
1333 case T_byte: return Constant.fromValue(left.intValue() % right.byteValue());
1334 case T_short: return Constant.fromValue(left.intValue() % right.shortValue());
1335 case T_int: return Constant.fromValue(left.intValue() % right.intValue());
1336 case T_long: return Constant.fromValue(left.intValue() % right.longValue());
1341 case T_char : return Constant.fromValue(left.longValue() % right.charValue());
1342 case T_float: return Constant.fromValue(left.longValue() % right.floatValue());
1343 case T_double: return Constant.fromValue(left.longValue() % right.doubleValue());
1344 case T_byte: return Constant.fromValue(left.longValue() % right.byteValue());
1345 case T_short: return Constant.fromValue(left.longValue() % right.shortValue());
1346 case T_int: return Constant.fromValue(left.longValue() % right.intValue());
1347 case T_long: return Constant.fromValue(left.longValue() % right.longValue());
1352 return NotAConstant;
1355 public static final Constant computeConstantOperationRIGHT_SHIFT(Constant left, int leftId, int operator, Constant right, int rightId) {
1360 case T_char : return Constant.fromValue(left.charValue() >> right.charValue());
1361 case T_byte: return Constant.fromValue(left.charValue() >> right.byteValue());
1362 case T_short: return Constant.fromValue(left.charValue() >> right.shortValue());
1363 case T_int: return Constant.fromValue(left.charValue() >> right.intValue());
1364 case T_long: return Constant.fromValue(left.charValue() >> right.longValue());
1369 case T_char : return Constant.fromValue(left.byteValue() >> right.charValue());
1370 case T_byte: return Constant.fromValue(left.byteValue() >> right.byteValue());
1371 case T_short: return Constant.fromValue(left.byteValue() >> right.shortValue());
1372 case T_int: return Constant.fromValue(left.byteValue() >> right.intValue());
1373 case T_long: return Constant.fromValue(left.byteValue() >> right.longValue());
1378 case T_char : return Constant.fromValue(left.shortValue() >> right.charValue());
1379 case T_byte: return Constant.fromValue(left.shortValue() >> right.byteValue());
1380 case T_short: return Constant.fromValue(left.shortValue() >> right.shortValue());
1381 case T_int: return Constant.fromValue(left.shortValue() >> right.intValue());
1382 case T_long: return Constant.fromValue(left.shortValue() >> right.longValue());
1387 case T_char : return Constant.fromValue(left.intValue() >> right.charValue());
1388 case T_byte: return Constant.fromValue(left.intValue() >> right.byteValue());
1389 case T_short: return Constant.fromValue(left.intValue() >> right.shortValue());
1390 case T_int: return Constant.fromValue(left.intValue() >> right.intValue());
1391 case T_long: return Constant.fromValue(left.intValue() >> right.longValue());
1396 case T_char : return Constant.fromValue(left.longValue() >> right.charValue());
1397 case T_byte: return Constant.fromValue(left.longValue() >> right.byteValue());
1398 case T_short: return Constant.fromValue(left.longValue() >> right.shortValue());
1399 case T_int: return Constant.fromValue(left.longValue() >> right.intValue());
1400 case T_long: return Constant.fromValue(left.longValue() >> right.longValue());
1405 return NotAConstant;
1408 public static final Constant computeConstantOperationUNSIGNED_RIGHT_SHIFT(Constant left, int leftId, int operator, Constant right, int rightId) {
1413 case T_char : return Constant.fromValue(left.charValue() >>> right.charValue());
1414 case T_byte: return Constant.fromValue(left.charValue() >>> right.byteValue());
1415 case T_short: return Constant.fromValue(left.charValue() >>> right.shortValue());
1416 case T_int: return Constant.fromValue(left.charValue() >>> right.intValue());
1417 case T_long: return Constant.fromValue(left.charValue() >>> right.longValue());
1422 case T_char : return Constant.fromValue(left.byteValue() >>> right.charValue());
1423 case T_byte: return Constant.fromValue(left.byteValue() >>> right.byteValue());
1424 case T_short: return Constant.fromValue(left.byteValue() >>> right.shortValue());
1425 case T_int: return Constant.fromValue(left.byteValue() >>> right.intValue());
1426 case T_long: return Constant.fromValue(left.byteValue() >>> right.longValue());
1431 case T_char : return Constant.fromValue(left.shortValue() >>> right.charValue());
1432 case T_byte: return Constant.fromValue(left.shortValue() >>> right.byteValue());
1433 case T_short: return Constant.fromValue(left.shortValue() >>> right.shortValue());
1434 case T_int: return Constant.fromValue(left.shortValue() >>> right.intValue());
1435 case T_long: return Constant.fromValue(left.shortValue() >>> right.longValue());
1440 case T_char : return Constant.fromValue(left.intValue() >>> right.charValue());
1441 case T_byte: return Constant.fromValue(left.intValue() >>> right.byteValue());
1442 case T_short: return Constant.fromValue(left.intValue() >>> right.shortValue());
1443 case T_int: return Constant.fromValue(left.intValue() >>> right.intValue());
1444 case T_long: return Constant.fromValue(left.intValue() >>> right.longValue());
1449 case T_char : return Constant.fromValue(left.longValue() >>> right.charValue());
1450 case T_byte: return Constant.fromValue(left.longValue() >>> right.byteValue());
1451 case T_short: return Constant.fromValue(left.longValue() >>> right.shortValue());
1452 case T_int: return Constant.fromValue(left.longValue() >>> right.intValue());
1453 case T_long: return Constant.fromValue(left.longValue() >>> right.longValue());
1458 return NotAConstant;
1461 public static final Constant computeConstantOperationXOR(Constant left, int leftId, int operator, Constant right, int rightId) {
1464 case T_boolean : return Constant.fromValue(left.booleanValue() ^ right.booleanValue());
1467 case T_char : return Constant.fromValue(left.charValue() ^ right.charValue());
1468 case T_byte: return Constant.fromValue(left.charValue() ^ right.byteValue());
1469 case T_short: return Constant.fromValue(left.charValue() ^ right.shortValue());
1470 case T_int: return Constant.fromValue(left.charValue() ^ right.intValue());
1471 case T_long: return Constant.fromValue(left.charValue() ^ right.longValue());
1476 case T_char : return Constant.fromValue(left.byteValue() ^ right.charValue());
1477 case T_byte: return Constant.fromValue(left.byteValue() ^ right.byteValue());
1478 case T_short: return Constant.fromValue(left.byteValue() ^ right.shortValue());
1479 case T_int: return Constant.fromValue(left.byteValue() ^ right.intValue());
1480 case T_long: return Constant.fromValue(left.byteValue() ^ right.longValue());
1485 case T_char : return Constant.fromValue(left.shortValue() ^ right.charValue());
1486 case T_byte: return Constant.fromValue(left.shortValue() ^ right.byteValue());
1487 case T_short: return Constant.fromValue(left.shortValue() ^ right.shortValue());
1488 case T_int: return Constant.fromValue(left.shortValue() ^ right.intValue());
1489 case T_long: return Constant.fromValue(left.shortValue() ^ right.longValue());
1494 case T_char : return Constant.fromValue(left.intValue() ^ right.charValue());
1495 case T_byte: return Constant.fromValue(left.intValue() ^ right.byteValue());
1496 case T_short: return Constant.fromValue(left.intValue() ^ right.shortValue());
1497 case T_int: return Constant.fromValue(left.intValue() ^ right.intValue());
1498 case T_long: return Constant.fromValue(left.intValue() ^ right.longValue());
1503 case T_char : return Constant.fromValue(left.longValue() ^ right.charValue());
1504 case T_byte: return Constant.fromValue(left.longValue() ^ right.byteValue());
1505 case T_short: return Constant.fromValue(left.longValue() ^ right.shortValue());
1506 case T_int: return Constant.fromValue(left.longValue() ^ right.intValue());
1507 case T_long: return Constant.fromValue(left.longValue() ^ right.longValue());
1511 return NotAConstant;
1514 public double doubleValue() {
1516 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"double")); //$NON-NLS-2$ //$NON-NLS-1$
1519 public float floatValue() {
1521 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"float")); //$NON-NLS-2$ //$NON-NLS-1$
1524 // public static Constant fromValue(byte value) {
1526 // return new ByteConstant(value);
1529 // public static Constant fromValue(char value) {
1531 // return new CharConstant(value);
1534 public static Constant fromValue(double value) {
1536 return new DoubleConstant(value);
1539 // public static Constant fromValue(float value) {
1541 // return new FloatConstant(value);
1544 public static Constant fromValue(int value) {
1546 return new IntConstant(value);
1549 // public static Constant fromValue(long value) {
1551 // return new LongConstant(value);
1554 public static Constant fromValue(String value) {
1556 return new StringConstant(value);
1559 // public static Constant fromValue(short value) {
1561 // return new ShortConstant(value);
1564 public static Constant fromValue(boolean value) {
1566 return new BooleanConstant(value);
1569 public int intValue() {
1571 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"int")); //$NON-NLS-2$ //$NON-NLS-1$
1574 public long longValue() {
1576 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"long")); //$NON-NLS-2$ //$NON-NLS-1$
1579 public short shortValue() {
1581 throw new ShouldNotImplement(Util.bind("constant.cannotConvertedTo",typeName(),"short")); //$NON-NLS-2$ //$NON-NLS-1$
1584 public String stringValue() {
1586 throw new ShouldNotImplement(Util.bind("constant.cannotConvertedTo",typeName(),"String")); //$NON-NLS-1$ //$NON-NLS-2$
1589 public String toString(){
1591 if (this == NotAConstant) return "(Constant) NotAConstant"; //$NON-NLS-1$
1592 return super.toString(); }
1594 public abstract int typeID();
1596 public String typeName() {
1598 case T_int : return "int"; //$NON-NLS-1$
1599 case T_byte : return "byte"; //$NON-NLS-1$
1600 case T_short : return "short"; //$NON-NLS-1$
1601 case T_char : return "char"; //$NON-NLS-1$
1602 case T_float : return "float"; //$NON-NLS-1$
1603 case T_double : return "double"; //$NON-NLS-1$
1604 case T_boolean : return "boolean"; //$NON-NLS-1$
1605 case T_long : return "long";//$NON-NLS-1$
1606 case T_String : return "java.lang.String"; //$NON-NLS-1$
1607 case T_null : return "null"; //$NON-NLS-1$
1608 default: return "unknown"; //$NON-NLS-1$