1 /*******************************************************************************
2 * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v0.5
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v05.html
9 * IBM Corporation - initial API and implementation
10 ******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.impl;
13 import net.sourceforge.phpdt.internal.compiler.ast.OperatorIds;
14 import net.sourceforge.phpdt.internal.compiler.lookup.TypeIds;
15 import net.sourceforge.phpdt.internal.compiler.problem.ShouldNotImplement;
16 import net.sourceforge.phpdt.internal.compiler.util.Util;
18 public abstract class Constant implements TypeIds, OperatorIds {
19 public static final Constant NotAConstant = new DoubleConstant(Double.NaN);
21 public static final IntConstant Zero = new IntConstant(0);
22 public static final IntConstant Two = new IntConstant(2);
23 public static final IntConstant One = new IntConstant(1);
24 public boolean booleanValue() {
25 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"boolean")); //$NON-NLS-1$ //$NON-NLS-2$
27 public byte byteValue() {
28 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"byte")); //$NON-NLS-1$ //$NON-NLS-2$
30 public final Constant castTo(int conversionToTargetType){
31 //the cast is an int of the form
32 // (castId<<4)+typeId (in order to follow the
33 //user written style (cast)expression ....
34 //This method assumes that the TC is done (correctly :-)
36 if (this == NotAConstant) return NotAConstant ;
37 switch(conversionToTargetType){
38 case T_undefined : return this;
39 // case (T_undefined<<4)+T_undefined : return NotAConstant ;
40 // case (T_undefined<<4)+T_byte : return NotAConstant ;
41 // case (T_undefined<<4)+T_long : return NotAConstant ;
42 // case (T_undefined<<4)+T_short : return NotAConstant ;
43 // case (T_undefined<<4)+T_void : return NotAConstant ;
44 // case (T_undefined<<4)+T_String : return NotAConstant ;
45 // case (T_undefined<<4)+T_Object : return NotAConstant ;
46 // case (T_undefined<<4)+T_double : return NotAConstant ;
47 // case (T_undefined<<4)+T_float : return NotAConstant ;
48 // case (T_undefined<<4)+T_boolean : return NotAConstant ;
49 // case (T_undefined<<4)+T_char : return NotAConstant ;
50 // case (T_undefined<<4)+T_int : return NotAConstant ;
51 // case (T_undefined<<4)+T_null : return NotAConstant ;
53 // case (T_byte<<4)+T_undefined : return NotAConstant ;
54 case (T_byte<<4)+T_byte : return this ;
55 case (T_byte<<4)+T_long : return Constant.fromValue((byte)this.longValue()) ;
56 case (T_byte<<4)+T_short : return Constant.fromValue((byte)this.shortValue());
57 // case (T_byte<<4)+T_void : return NotAConstant ;
58 // case (T_byte<<4)+T_String : return NotAConstant ;
59 // case (T_byte<<4)+T_Object : return NotAConstant ;
60 case (T_byte<<4)+T_double : return Constant.fromValue((byte)this.doubleValue());
61 case (T_byte<<4)+T_float : return Constant.fromValue((byte)this.floatValue());
62 // case (T_byte<<4)+T_boolean : return NotAConstant ;
63 case (T_byte<<4)+T_char : return Constant.fromValue((byte)this.charValue());
64 case (T_byte<<4)+T_int : return Constant.fromValue((byte)this.intValue());
65 // case (T_byte<<4)+T_null : return NotAConstant ;
67 // case (T_long<<4)+T_undefined : return NotAConstant ;
68 case (T_long<<4)+T_byte : return Constant.fromValue((long)this.byteValue());
69 case (T_long<<4)+T_long : return this ;
70 case (T_long<<4)+T_short : return Constant.fromValue((long)this.shortValue());
71 // case (T_long<<4)+T_void : return NotAConstant ;
72 // case (T_long<<4)+T_String : return NotAConstant ;
73 // case (T_long<<4)+T_Object : return NotAConstant ;
74 case (T_long<<4)+T_double : return Constant.fromValue((long)this.doubleValue());
75 case (T_long<<4)+T_float : return Constant.fromValue((long)this.floatValue());
76 // case (T_long<<4)+T_boolean : return NotAConstant ;
77 case (T_long<<4)+T_char : return Constant.fromValue((long)this.charValue());
78 case (T_long<<4)+T_int : return Constant.fromValue((long)this.intValue());
79 // case (T_long<<4)+T_null : return NotAConstant ;
81 // case (T_short<<4)+T_undefined : return NotAConstant ;
82 case (T_short<<4)+T_byte : return Constant.fromValue((short)this.byteValue());
83 case (T_short<<4)+T_long : return Constant.fromValue((short)this.longValue());
84 case (T_short<<4)+T_short : return this ;
85 // case (T_short<<4)+T_void : return NotAConstant ;
86 // case (T_short<<4)+T_String : return NotAConstant ;
87 // case (T_short<<4)+T_Object : return NotAConstant ;
88 case (T_short<<4)+T_double : return Constant.fromValue((short)this.doubleValue()) ;
89 case (T_short<<4)+T_float : return Constant.fromValue((short)this.floatValue()) ;
90 // case (T_short<<4)+T_boolean : return NotAConstant ;
91 case (T_short<<4)+T_char : return Constant.fromValue((short)this.charValue()) ;
92 case (T_short<<4)+T_int : return Constant.fromValue((short)this.intValue()) ;
93 // case (T_short<<4)+T_null : return NotAConstant ;
95 // case (T_void<<4)+T_undefined : return NotAConstant ;
96 // case (T_void<<4)+T_byte : return NotAConstant ;
97 // case (T_void<<4)+T_long : return NotAConstant ;
98 // case (T_void<<4)+T_short : return NotAConstant ;
99 // case (T_void<<4)+T_void : return NotAConstant ;
100 // case (T_void<<4)+T_String : return NotAConstant ;
101 // case (T_void<<4)+T_Object : return NotAConstant ;
102 // case (T_void<<4)+T_double : return NotAConstant ;
103 // case (T_void<<4)+T_float : return NotAConstant ;
104 // case (T_void<<4)+T_boolean : return NotAConstant ;
105 // case (T_void<<4)+T_char : return NotAConstant ;
106 // case (T_void<<4)+T_int : return NotAConstant ;
107 // case (T_void<<4)+T_null : return NotAConstant ;
109 // case (T_String<<4)+T_undefined : return NotAConstant ;
110 // case (T_String<<4)+T_byte : return NotAConstant ;
111 // case (T_String<<4)+T_long : return NotAConstant ;
112 // case (T_String<<4)+T_short : return NotAConstant ;
113 // case (T_String<<4)+T_void : return NotAConstant ;
114 case (T_String<<4)+T_String : return this ;
115 // case (T_String<<4)+T_Object : return NotAConstant ;
116 // case (T_String<<4)+T_double : return NotAConstant ;
117 // case (T_String<<4)+T_float : return NotAConstant ;
118 // case (T_String<<4)+T_boolean : return NotAConstant ;
119 // case (T_String<<4)+T_char : return NotAConstant ;
120 // case (T_String<<4)+T_int : return NotAConstant ;
121 // case (T_String<<4)+T_null : 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 ;
135 case (T_Object<<4)+T_null : return this ;
137 // case (T_double<<4)+T_undefined : return NotAConstant ;
138 case (T_double<<4)+T_byte : return Constant.fromValue((double)this.byteValue()) ;
139 case (T_double<<4)+T_long : return Constant.fromValue((double)this.longValue()) ;
140 case (T_double<<4)+T_short : return Constant.fromValue((double)this.shortValue()) ;
141 // case (T_double<<4)+T_void : return NotAConstant ;
142 // case (T_double<<4)+T_String : return NotAConstant ;
143 // case (T_double<<4)+T_Object : return NotAConstant ;
144 case (T_double<<4)+T_double : return this ;
145 case (T_double<<4)+T_float : return Constant.fromValue((double)this.floatValue()) ;
146 // case (T_double<<4)+T_boolean : return NotAConstant ;
147 case (T_double<<4)+T_char : return Constant.fromValue((double)this.charValue()) ;
148 case (T_double<<4)+T_int : return Constant.fromValue((double)this.intValue());
149 // case (T_double<<4)+T_null : return NotAConstant ;
151 // case (T_float<<4)+T_undefined : return NotAConstant ;
152 case (T_float<<4)+T_byte : return Constant.fromValue((float)this.byteValue()) ;
153 case (T_float<<4)+T_long : return Constant.fromValue((float)this.longValue()) ;
154 case (T_float<<4)+T_short : return Constant.fromValue((float)this.shortValue()) ;
155 // case (T_float<<4)+T_void : return NotAConstant ;
156 // case (T_float<<4)+T_String : return NotAConstant ;
157 // case (T_float<<4)+T_Object : return NotAConstant ;
158 case (T_float<<4)+T_double : return Constant.fromValue((float)this.doubleValue()) ;
159 case (T_float<<4)+T_float : return this ;
160 // case (T_float<<4)+T_boolean : return NotAConstant ;
161 case (T_float<<4)+T_char : return Constant.fromValue((float)this.charValue()) ;
162 case (T_float<<4)+T_int : return Constant.fromValue((float)this.intValue()) ;
163 // case (T_float<<4)+T_null : return NotAConstant ;
165 // case (T_boolean<<4)+T_undefined : return NotAConstant ;
166 // case (T_boolean<<4)+T_byte : return NotAConstant ;
167 // case (T_boolean<<4)+T_long : return NotAConstant ;
168 // case (T_boolean<<4)+T_short : return NotAConstant ;
169 // case (T_boolean<<4)+T_void : return NotAConstant ;
170 // case (T_boolean<<4)+T_String : return NotAConstant ;
171 // case (T_boolean<<4)+T_Object : return NotAConstant ;
172 // case (T_boolean<<4)+T_double : return NotAConstant ;
173 // case (T_boolean<<4)+T_float : return NotAConstant ;
174 case (T_boolean<<4)+T_boolean : return this ;
175 // case (T_boolean<<4)+T_char : return NotAConstant ;
176 // case (T_boolean<<4)+T_int : return NotAConstant ;
177 // case (T_boolean<<4)+T_null : return NotAConstant ;
179 // case (T_char<<4)+T_undefined : return NotAConstant ;
180 case (T_char<<4)+T_byte : return Constant.fromValue((char)this.byteValue()) ;
181 case (T_char<<4)+T_long : return Constant.fromValue((char)this.longValue()) ;
182 case (T_char<<4)+T_short : return Constant.fromValue((char)this.shortValue()) ;
183 // case (T_char<<4)+T_void : return NotAConstant ;
184 // case (T_char<<4)+T_String : return NotAConstant ;
185 // case (T_char<<4)+T_Object : return NotAConstant ;
186 case (T_char<<4)+T_double : return Constant.fromValue((char)this.doubleValue()) ;
187 case (T_char<<4)+T_float : return Constant.fromValue((char)this.floatValue()) ;
188 // case (T_char<<4)+T_boolean : return NotAConstant ;
189 case (T_char<<4)+T_char : return this ;
190 case (T_char<<4)+T_int : return Constant.fromValue((char)this.intValue()) ;
191 // case (T_char<<4)+T_null : return NotAConstant ;
193 // case (T_int<<4)+T_undefined : return NotAConstant ;
194 case (T_int<<4)+T_byte : return Constant.fromValue((int)this.byteValue()) ;
195 case (T_int<<4)+T_long : return Constant.fromValue((int)this.longValue()) ;
196 case (T_int<<4)+T_short : return Constant.fromValue((int)this.shortValue()) ;
197 // case (T_int<<4)+T_void : return NotAConstant ;
198 // case (T_int<<4)+T_String : return NotAConstant ;
199 // case (T_int<<4)+T_Object : return NotAConstant ;
200 case (T_int<<4)+T_double : return Constant.fromValue((int)this.doubleValue()) ;
201 case (T_int<<4)+T_float : return Constant.fromValue((int)this.floatValue()) ;
202 // case (T_int<<4)+T_boolean : return NotAConstant ;
203 case (T_int<<4)+T_char : return Constant.fromValue((int)this.charValue()) ;
204 case (T_int<<4)+T_int : return this ;
205 // case (T_int<<4)+T_null : return NotAConstant ;
207 // case (T_null<<4)+T_undefined : return NotAConstant ;
208 // case (T_null<<4)+T_byte : return NotAConstant ;
209 // case (T_null<<4)+T_long : return NotAConstant ;
210 // case (T_null<<4)+T_short : return NotAConstant ;
211 // case (T_null<<4)+T_void : return NotAConstant ;
212 // case (T_null<<4)+T_String : return NotAConstant ;
213 // case (T_null<<4)+T_Object : return NotAConstant ;
214 // case (T_null<<4)+T_double : return NotAConstant ;
215 // case (T_null<<4)+T_float : return NotAConstant ;
216 // case (T_null<<4)+T_boolean : return NotAConstant ;
217 // case (T_null<<4)+T_char : return NotAConstant ;
218 // case (T_null<<4)+T_int : return NotAConstant ;
219 case (T_null<<4)+T_null : return this ;
224 return NotAConstant ;
226 public char charValue() {
227 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"char")); //$NON-NLS-1$ //$NON-NLS-2$
229 public static final Constant computeConstantOperation(Constant cst, int id, int operator) {
230 //this method assumes that the TC has been done .
231 //the result should be availbale with not runtime error
235 return Constant.fromValue(!cst.booleanValue());
236 case PLUS : return cst ;
237 case MINUS : //the two special -9223372036854775808L and -2147483648 are inlined at parseTime
239 case T_float : float f ;
240 if ( (f= cst.floatValue()) == 0.0f)
241 { //positive and negative 0....
242 if (Float.floatToIntBits(f) == 0)
243 return Constant.fromValue(-0.0f);
245 return Constant.fromValue(0.0f);}
246 break; //default case
247 case T_double : double d ;
248 if ( (d= cst.doubleValue()) == 0.0d)
249 { //positive and negative 0....
250 if (Double.doubleToLongBits(d) == 0)
251 return Constant.fromValue(-0.0d);
253 return Constant.fromValue(0.0d);}
254 break; //default case
256 return computeConstantOperationMINUS(Zero,T_int,operator,cst,id);
259 case T_char : return Constant.fromValue(~ cst.charValue()) ;
260 case T_byte: return Constant.fromValue(~ cst.byteValue()) ;
261 case T_short: return Constant.fromValue(~ cst.shortValue()) ;
262 case T_int: return Constant.fromValue(~ cst.intValue()) ;
263 case T_long: return Constant.fromValue(~ cst.longValue()) ;
264 default : return NotAConstant;} //should not occur.....(conservative code)
265 default : return NotAConstant ;}} //should not occur....(conservative code)
266 public static final Constant computeConstantOperation(Constant left, int leftId, int operator, Constant right, int rightId) {
267 //this method assumes that the TC has been done . So (except for divide by zero)
268 //the result should be availbale with not runtime error
271 case AND : return computeConstantOperationAND (left,leftId,operator,right,rightId) ;
272 case AND_AND : return computeConstantOperationAND_AND (left,leftId,operator,right,rightId) ;
273 case DIVIDE : return computeConstantOperationDIVIDE (left,leftId,operator,right,rightId) ;
274 case GREATER : return computeConstantOperationGREATER (left,leftId,operator,right,rightId) ;
275 case GREATER_EQUAL : return computeConstantOperationGREATER_EQUAL(left,leftId,operator,right,rightId) ;
276 case LEFT_SHIFT : return computeConstantOperationLEFT_SHIFT (left,leftId,operator,right,rightId) ;
277 case LESS : return computeConstantOperationLESS (left,leftId,operator,right,rightId) ;
278 case LESS_EQUAL : return computeConstantOperationLESS_EQUAL (left,leftId,operator,right,rightId) ;
279 case MINUS : return computeConstantOperationMINUS (left,leftId,operator,right,rightId) ;
280 case MULTIPLY : return computeConstantOperationMULTIPLY (left,leftId,operator,right,rightId) ;
281 case OR : return computeConstantOperationOR (left,leftId,operator,right,rightId) ;
282 case OR_OR : return computeConstantOperationOR_OR (left,leftId,operator,right,rightId) ;
283 case PLUS : return computeConstantOperationPLUS (left,leftId,operator,right,rightId) ;
284 case REMAINDER : return computeConstantOperationREMAINDER (left,leftId,operator,right,rightId) ;
285 case RIGHT_SHIFT: return computeConstantOperationRIGHT_SHIFT(left,leftId,operator,right,rightId) ;
286 case UNSIGNED_RIGHT_SHIFT: return computeConstantOperationUNSIGNED_RIGHT_SHIFT(left,leftId,operator,right,rightId) ;
287 case XOR : return computeConstantOperationXOR (left,leftId,operator,right,rightId) ;
289 default : return NotAConstant ;}} //should not occurs....(conservative code)
290 public static final Constant computeConstantOperationAND(Constant left, int leftId, int operator, Constant right, int rightId) {
291 //this method assumes that the TC has been done .
294 case T_boolean : return Constant.fromValue(left.booleanValue() & right.booleanValue()) ;
297 case T_char : return Constant.fromValue(left.charValue() & right.charValue()) ;
298 case T_byte: return Constant.fromValue(left.charValue() & right.byteValue()) ;
299 case T_short: return Constant.fromValue(left.charValue() & right.shortValue()) ;
300 case T_int: return Constant.fromValue(left.charValue() & right.intValue()) ;
301 case T_long: return Constant.fromValue(left.charValue() & right.longValue()) ;}
305 case T_char : return Constant.fromValue(left.byteValue() & right.charValue()) ;
306 case T_byte: return Constant.fromValue(left.byteValue() & right.byteValue()) ;
307 case T_short: return Constant.fromValue(left.byteValue() & right.shortValue()) ;
308 case T_int: return Constant.fromValue(left.byteValue() & right.intValue()) ;
309 case T_long: return Constant.fromValue(left.byteValue() & right.longValue()) ;}
313 case T_char : return Constant.fromValue(left.shortValue() & right.charValue()) ;
314 case T_byte: return Constant.fromValue(left.shortValue() & right.byteValue()) ;
315 case T_short: return Constant.fromValue(left.shortValue() & right.shortValue()) ;
316 case T_int: return Constant.fromValue(left.shortValue() & right.intValue()) ;
317 case T_long: return Constant.fromValue(left.shortValue() & right.longValue()) ;}
321 case T_char : return Constant.fromValue(left.intValue() & right.charValue()) ;
322 case T_byte: return Constant.fromValue(left.intValue() & right.byteValue()) ;
323 case T_short: return Constant.fromValue(left.intValue() & right.shortValue()) ;
324 case T_int: return Constant.fromValue(left.intValue() & right.intValue()) ;
325 case T_long: return Constant.fromValue(left.intValue() & right.longValue()) ;}
329 case T_char : return Constant.fromValue(left.longValue() & right.charValue()) ;
330 case T_byte: return Constant.fromValue(left.longValue() & right.byteValue()) ;
331 case T_short: return Constant.fromValue(left.longValue() & right.shortValue()) ;
332 case T_int: return Constant.fromValue(left.longValue() & right.intValue()) ;
333 case T_long: return Constant.fromValue(left.longValue() & right.longValue()) ;}
338 return NotAConstant ;} // should not get here
339 public static final Constant computeConstantOperationAND_AND(Constant left, int leftId, int operator, Constant right, int rightId) {
340 //this method assumes that the TC has been done .
342 return Constant.fromValue(left.booleanValue() && right.booleanValue()) ;}
343 public static final Constant computeConstantOperationDIVIDE(Constant left, int leftId, int operator, Constant right, int rightId) {
344 //this method assumes that the TC has been done .
345 // the /0 must be handled outside this method (error reporting)
350 case T_char : return Constant.fromValue(left.charValue() / right.charValue()) ;
351 case T_float: return Constant.fromValue(left.charValue() / right.floatValue()) ;
352 case T_double: return Constant.fromValue(left.charValue() / right.doubleValue()) ;
353 case T_byte: return Constant.fromValue(left.charValue() / right.byteValue()) ;
354 case T_short: return Constant.fromValue(left.charValue() / right.shortValue()) ;
355 case T_int: return Constant.fromValue(left.charValue() / right.intValue()) ;
356 case T_long: return Constant.fromValue(left.charValue() / right.longValue()) ;}
360 case T_char : return Constant.fromValue(left.floatValue() / right.charValue()) ;
361 case T_float: return Constant.fromValue(left.floatValue() / right.floatValue()) ;
362 case T_double: return Constant.fromValue(left.floatValue() / right.doubleValue()) ;
363 case T_byte: return Constant.fromValue(left.floatValue() / right.byteValue()) ;
364 case T_short: return Constant.fromValue(left.floatValue() / right.shortValue()) ;
365 case T_int: return Constant.fromValue(left.floatValue() / right.intValue()) ;
366 case T_long: return Constant.fromValue(left.floatValue() / right.longValue()) ;}
370 case T_char : return Constant.fromValue(left.doubleValue() / right.charValue()) ;
371 case T_float: return Constant.fromValue(left.doubleValue() / right.floatValue()) ;
372 case T_double: return Constant.fromValue(left.doubleValue() / right.doubleValue()) ;
373 case T_byte: return Constant.fromValue(left.doubleValue() / right.byteValue()) ;
374 case T_short: return Constant.fromValue(left.doubleValue() / right.shortValue()) ;
375 case T_int: return Constant.fromValue(left.doubleValue() / right.intValue()) ;
376 case T_long: return Constant.fromValue(left.doubleValue() / right.longValue()) ;}
380 case T_char : return Constant.fromValue(left.byteValue() / right.charValue()) ;
381 case T_float: return Constant.fromValue(left.byteValue() / right.floatValue()) ;
382 case T_double: return Constant.fromValue(left.byteValue() / right.doubleValue()) ;
383 case T_byte: return Constant.fromValue(left.byteValue() / right.byteValue()) ;
384 case T_short: return Constant.fromValue(left.byteValue() / right.shortValue()) ;
385 case T_int: return Constant.fromValue(left.byteValue() / right.intValue()) ;
386 case T_long: return Constant.fromValue(left.byteValue() / right.longValue()) ;}
390 case T_char : return Constant.fromValue(left.shortValue() / right.charValue()) ;
391 case T_float: return Constant.fromValue(left.shortValue() / right.floatValue()) ;
392 case T_double: return Constant.fromValue(left.shortValue() / right.doubleValue()) ;
393 case T_byte: return Constant.fromValue(left.shortValue() / right.byteValue()) ;
394 case T_short: return Constant.fromValue(left.shortValue() / right.shortValue()) ;
395 case T_int: return Constant.fromValue(left.shortValue() / right.intValue()) ;
396 case T_long: return Constant.fromValue(left.shortValue() / right.longValue()) ;}
400 case T_char : return Constant.fromValue(left.intValue() / right.charValue()) ;
401 case T_float: return Constant.fromValue(left.intValue() / right.floatValue()) ;
402 case T_double: return Constant.fromValue(left.intValue() / right.doubleValue()) ;
403 case T_byte: return Constant.fromValue(left.intValue() / right.byteValue()) ;
404 case T_short: return Constant.fromValue(left.intValue() / right.shortValue()) ;
405 case T_int: return Constant.fromValue(left.intValue() / right.intValue()) ;
406 case T_long: return Constant.fromValue(left.intValue() / right.longValue()) ;}
410 case T_char : return Constant.fromValue(left.longValue() / right.charValue()) ;
411 case T_float: return Constant.fromValue(left.longValue() / right.floatValue()) ;
412 case T_double: return Constant.fromValue(left.longValue() / right.doubleValue()) ;
413 case T_byte: return Constant.fromValue(left.longValue() / right.byteValue()) ;
414 case T_short: return Constant.fromValue(left.longValue() / right.shortValue()) ;
415 case T_int: return Constant.fromValue(left.longValue() / right.intValue()) ;
416 case T_long: return Constant.fromValue(left.longValue() / right.longValue()) ;}
421 return NotAConstant ;} //should not get here
422 public static final Constant computeConstantOperationEQUAL_EQUAL(Constant left, int leftId, int operator, Constant right, int rightId) {
423 //this method assumes that the TC has been done .
427 if (rightId == T_boolean) {
428 return Constant.fromValue(left.booleanValue() == right.booleanValue()) ;
433 case T_char : return Constant.fromValue(left.charValue() == right.charValue()) ;
434 case T_float: return Constant.fromValue(left.charValue() == right.floatValue()) ;
435 case T_double: return Constant.fromValue(left.charValue() == right.doubleValue()) ;
436 case T_byte: return Constant.fromValue(left.charValue() == right.byteValue()) ;
437 case T_short: return Constant.fromValue(left.charValue() == right.shortValue()) ;
438 case T_int: return Constant.fromValue(left.charValue() == right.intValue()) ;
439 case T_long: return Constant.fromValue(left.charValue() == right.longValue()) ;}
443 case T_char : return Constant.fromValue(left.floatValue() == right.charValue()) ;
444 case T_float: return Constant.fromValue(left.floatValue() == right.floatValue()) ;
445 case T_double: return Constant.fromValue(left.floatValue() == right.doubleValue()) ;
446 case T_byte: return Constant.fromValue(left.floatValue() == right.byteValue()) ;
447 case T_short: return Constant.fromValue(left.floatValue() == right.shortValue()) ;
448 case T_int: return Constant.fromValue(left.floatValue() == right.intValue()) ;
449 case T_long: return Constant.fromValue(left.floatValue() == right.longValue()) ;}
453 case T_char : return Constant.fromValue(left.doubleValue() == right.charValue()) ;
454 case T_float: return Constant.fromValue(left.doubleValue() == right.floatValue()) ;
455 case T_double: return Constant.fromValue(left.doubleValue() == right.doubleValue()) ;
456 case T_byte: return Constant.fromValue(left.doubleValue() == right.byteValue()) ;
457 case T_short: return Constant.fromValue(left.doubleValue() == right.shortValue()) ;
458 case T_int: return Constant.fromValue(left.doubleValue() == right.intValue()) ;
459 case T_long: return Constant.fromValue(left.doubleValue() == right.longValue()) ;}
463 case T_char : return Constant.fromValue(left.byteValue() == right.charValue()) ;
464 case T_float: return Constant.fromValue(left.byteValue() == right.floatValue()) ;
465 case T_double: return Constant.fromValue(left.byteValue() == right.doubleValue()) ;
466 case T_byte: return Constant.fromValue(left.byteValue() == right.byteValue()) ;
467 case T_short: return Constant.fromValue(left.byteValue() == right.shortValue()) ;
468 case T_int: return Constant.fromValue(left.byteValue() == right.intValue()) ;
469 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()) ;}
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()) ;}
493 case T_char : return Constant.fromValue(left.longValue() == right.charValue()) ;
494 case T_float: return Constant.fromValue(left.longValue() == right.floatValue()) ;
495 case T_double: return Constant.fromValue(left.longValue() == right.doubleValue()) ;
496 case T_byte: return Constant.fromValue(left.longValue() == right.byteValue()) ;
497 case T_short: return Constant.fromValue(left.longValue() == right.shortValue()) ;
498 case T_int: return Constant.fromValue(left.longValue() == right.intValue()) ;
499 case T_long: return Constant.fromValue(left.longValue() == right.longValue()) ;}
502 if (rightId == T_String) {
503 //String are intermed in th compiler==>thus if two string constant
504 //get to be compared, it is an equal on the vale which is done
505 return Constant.fromValue(((StringConstant)left).compileTimeEqual((StringConstant)right)) ;
509 if (rightId == T_String) {
510 return Constant.fromValue(false);
512 if (rightId == T_null) {
513 return Constant.fromValue(true) ;
518 return Constant.fromValue(false) ;}
519 public static final Constant computeConstantOperationGREATER(Constant left, int leftId, int operator, Constant right, int rightId) {
520 //this method assumes that the TC has been done .
525 case T_char : return Constant.fromValue(left.charValue() > right.charValue()) ;
526 case T_float: return Constant.fromValue(left.charValue() > right.floatValue()) ;
527 case T_double: return Constant.fromValue(left.charValue() > right.doubleValue()) ;
528 case T_byte: return Constant.fromValue(left.charValue() > right.byteValue()) ;
529 case T_short: return Constant.fromValue(left.charValue() > right.shortValue()) ;
530 case T_int: return Constant.fromValue(left.charValue() > right.intValue()) ;
531 case T_long: return Constant.fromValue(left.charValue() > right.longValue()) ;}
535 case T_char : return Constant.fromValue(left.floatValue() > right.charValue()) ;
536 case T_float: return Constant.fromValue(left.floatValue() > right.floatValue()) ;
537 case T_double: return Constant.fromValue(left.floatValue() > right.doubleValue()) ;
538 case T_byte: return Constant.fromValue(left.floatValue() > right.byteValue()) ;
539 case T_short: return Constant.fromValue(left.floatValue() > right.shortValue()) ;
540 case T_int: return Constant.fromValue(left.floatValue() > right.intValue()) ;
541 case T_long: return Constant.fromValue(left.floatValue() > right.longValue()) ;}
545 case T_char : return Constant.fromValue(left.doubleValue() > right.charValue()) ;
546 case T_float: return Constant.fromValue(left.doubleValue() > right.floatValue()) ;
547 case T_double: return Constant.fromValue(left.doubleValue() > right.doubleValue()) ;
548 case T_byte: return Constant.fromValue(left.doubleValue() > right.byteValue()) ;
549 case T_short: return Constant.fromValue(left.doubleValue() > right.shortValue()) ;
550 case T_int: return Constant.fromValue(left.doubleValue() > right.intValue()) ;
551 case T_long: return Constant.fromValue(left.doubleValue() > right.longValue()) ;}
555 case T_char : return Constant.fromValue(left.byteValue() > right.charValue()) ;
556 case T_float: return Constant.fromValue(left.byteValue() > right.floatValue()) ;
557 case T_double: return Constant.fromValue(left.byteValue() > right.doubleValue()) ;
558 case T_byte: return Constant.fromValue(left.byteValue() > right.byteValue()) ;
559 case T_short: return Constant.fromValue(left.byteValue() > right.shortValue()) ;
560 case T_int: return Constant.fromValue(left.byteValue() > right.intValue()) ;
561 case T_long: return Constant.fromValue(left.byteValue() > right.longValue()) ;}
565 case T_char : return Constant.fromValue(left.shortValue() > right.charValue()) ;
566 case T_float: return Constant.fromValue(left.shortValue() > right.floatValue()) ;
567 case T_double: return Constant.fromValue(left.shortValue() > right.doubleValue()) ;
568 case T_byte: return Constant.fromValue(left.shortValue() > right.byteValue()) ;
569 case T_short: return Constant.fromValue(left.shortValue() > right.shortValue()) ;
570 case T_int: return Constant.fromValue(left.shortValue() > right.intValue()) ;
571 case T_long: return Constant.fromValue(left.shortValue() > right.longValue()) ;}
575 case T_char : return Constant.fromValue(left.intValue() > right.charValue()) ;
576 case T_float: return Constant.fromValue(left.intValue() > right.floatValue()) ;
577 case T_double: return Constant.fromValue(left.intValue() > right.doubleValue()) ;
578 case T_byte: return Constant.fromValue(left.intValue() > right.byteValue()) ;
579 case T_short: return Constant.fromValue(left.intValue() > right.shortValue()) ;
580 case T_int: return Constant.fromValue(left.intValue() > right.intValue()) ;
581 case T_long: return Constant.fromValue(left.intValue() > right.longValue()) ;}
585 case T_char : return Constant.fromValue(left.longValue() > right.charValue()) ;
586 case T_float: return Constant.fromValue(left.longValue() > right.floatValue()) ;
587 case T_double: return Constant.fromValue(left.longValue() > right.doubleValue()) ;
588 case T_byte: return Constant.fromValue(left.longValue() > right.byteValue()) ;
589 case T_short: return Constant.fromValue(left.longValue() > right.shortValue()) ;
590 case T_int: return Constant.fromValue(left.longValue() > right.intValue()) ;
591 case T_long: return Constant.fromValue(left.longValue() > right.longValue()) ;}
595 return NotAConstant ;} //should not get here
596 public static final Constant computeConstantOperationGREATER_EQUAL(Constant left, int leftId, int operator, Constant right, int rightId) {
597 //this method assumes that the TC has been done .
602 case T_char : return Constant.fromValue(left.charValue() >= right.charValue()) ;
603 case T_float: return Constant.fromValue(left.charValue() >= right.floatValue()) ;
604 case T_double: return Constant.fromValue(left.charValue() >= right.doubleValue()) ;
605 case T_byte: return Constant.fromValue(left.charValue() >= right.byteValue()) ;
606 case T_short: return Constant.fromValue(left.charValue() >= right.shortValue()) ;
607 case T_int: return Constant.fromValue(left.charValue() >= right.intValue()) ;
608 case T_long: return Constant.fromValue(left.charValue() >= right.longValue()) ;}
612 case T_char : return Constant.fromValue(left.floatValue() >= right.charValue()) ;
613 case T_float: return Constant.fromValue(left.floatValue() >= right.floatValue()) ;
614 case T_double: return Constant.fromValue(left.floatValue() >= right.doubleValue()) ;
615 case T_byte: return Constant.fromValue(left.floatValue() >= right.byteValue()) ;
616 case T_short: return Constant.fromValue(left.floatValue() >= right.shortValue()) ;
617 case T_int: return Constant.fromValue(left.floatValue() >= right.intValue()) ;
618 case T_long: return Constant.fromValue(left.floatValue() >= right.longValue()) ;}
622 case T_char : return Constant.fromValue(left.doubleValue() >= right.charValue()) ;
623 case T_float: return Constant.fromValue(left.doubleValue() >= right.floatValue()) ;
624 case T_double: return Constant.fromValue(left.doubleValue() >= right.doubleValue()) ;
625 case T_byte: return Constant.fromValue(left.doubleValue() >= right.byteValue()) ;
626 case T_short: return Constant.fromValue(left.doubleValue() >= right.shortValue()) ;
627 case T_int: return Constant.fromValue(left.doubleValue() >= right.intValue()) ;
628 case T_long: return Constant.fromValue(left.doubleValue() >= right.longValue()) ;}
632 case T_char : return Constant.fromValue(left.byteValue() >= right.charValue()) ;
633 case T_float: return Constant.fromValue(left.byteValue() >= right.floatValue()) ;
634 case T_double: return Constant.fromValue(left.byteValue() >= right.doubleValue()) ;
635 case T_byte: return Constant.fromValue(left.byteValue() >= right.byteValue()) ;
636 case T_short: return Constant.fromValue(left.byteValue() >= right.shortValue()) ;
637 case T_int: return Constant.fromValue(left.byteValue() >= right.intValue()) ;
638 case T_long: return Constant.fromValue(left.byteValue() >= right.longValue()) ;}
642 case T_char : return Constant.fromValue(left.shortValue() >= right.charValue()) ;
643 case T_float: return Constant.fromValue(left.shortValue() >= right.floatValue()) ;
644 case T_double: return Constant.fromValue(left.shortValue() >= right.doubleValue()) ;
645 case T_byte: return Constant.fromValue(left.shortValue() >= right.byteValue()) ;
646 case T_short: return Constant.fromValue(left.shortValue() >= right.shortValue()) ;
647 case T_int: return Constant.fromValue(left.shortValue() >= right.intValue()) ;
648 case T_long: return Constant.fromValue(left.shortValue() >= right.longValue()) ;}
652 case T_char : return Constant.fromValue(left.intValue() >= right.charValue()) ;
653 case T_float: return Constant.fromValue(left.intValue() >= right.floatValue()) ;
654 case T_double: return Constant.fromValue(left.intValue() >= right.doubleValue()) ;
655 case T_byte: return Constant.fromValue(left.intValue() >= right.byteValue()) ;
656 case T_short: return Constant.fromValue(left.intValue() >= right.shortValue()) ;
657 case T_int: return Constant.fromValue(left.intValue() >= right.intValue()) ;
658 case T_long: return Constant.fromValue(left.intValue() >= right.longValue()) ;}
662 case T_char : return Constant.fromValue(left.longValue() >= right.charValue()) ;
663 case T_float: return Constant.fromValue(left.longValue() >= right.floatValue()) ;
664 case T_double: return Constant.fromValue(left.longValue() >= right.doubleValue()) ;
665 case T_byte: return Constant.fromValue(left.longValue() >= right.byteValue()) ;
666 case T_short: return Constant.fromValue(left.longValue() >= right.shortValue()) ;
667 case T_int: return Constant.fromValue(left.longValue() >= right.intValue()) ;
668 case T_long: return Constant.fromValue(left.longValue() >= right.longValue()) ;}
672 return NotAConstant ;} //should not get here
673 public static final Constant computeConstantOperationLEFT_SHIFT(Constant left, int leftId, int operator, Constant right, int rightId) {
674 //this method assumes that the TC has been done .
679 case T_char : return Constant.fromValue(left.charValue() << right.charValue()) ;
680 case T_byte: return Constant.fromValue(left.charValue() << right.byteValue()) ;
681 case T_short: return Constant.fromValue(left.charValue() << right.shortValue()) ;
682 case T_int: return Constant.fromValue(left.charValue() << right.intValue()) ;
683 case T_long: return Constant.fromValue(left.charValue() << right.longValue()) ;}
687 case T_char : return Constant.fromValue(left.byteValue() << right.charValue()) ;
688 case T_byte: return Constant.fromValue(left.byteValue() << right.byteValue()) ;
689 case T_short: return Constant.fromValue(left.byteValue() << right.shortValue()) ;
690 case T_int: return Constant.fromValue(left.byteValue() << right.intValue()) ;
691 case T_long: return Constant.fromValue(left.byteValue() << right.longValue()) ;}
695 case T_char : return Constant.fromValue(left.shortValue() << right.charValue()) ;
696 case T_byte: return Constant.fromValue(left.shortValue() << right.byteValue()) ;
697 case T_short: return Constant.fromValue(left.shortValue() << right.shortValue()) ;
698 case T_int: return Constant.fromValue(left.shortValue() << right.intValue()) ;
699 case T_long: return Constant.fromValue(left.shortValue() << right.longValue()) ;}
703 case T_char : return Constant.fromValue(left.intValue() << right.charValue()) ;
704 case T_byte: return Constant.fromValue(left.intValue() << right.byteValue()) ;
705 case T_short: return Constant.fromValue(left.intValue() << right.shortValue()) ;
706 case T_int: return Constant.fromValue(left.intValue() << right.intValue()) ;
707 case T_long: return Constant.fromValue(left.intValue() << right.longValue()) ;}
711 case T_char : return Constant.fromValue(left.longValue() << right.charValue()) ;
712 case T_byte: return Constant.fromValue(left.longValue() << right.byteValue()) ;
713 case T_short: return Constant.fromValue(left.longValue() << right.shortValue()) ;
714 case T_int: return Constant.fromValue(left.longValue() << right.intValue()) ;
715 case T_long: return Constant.fromValue(left.longValue() << right.longValue()) ;}
720 return NotAConstant ;} // should not get here
721 public static final Constant computeConstantOperationLESS(Constant left, int leftId, int operator, Constant right, int rightId) {
722 //this method assumes that the TC has been done .
727 case T_char : return Constant.fromValue(left.charValue() < right.charValue()) ;
728 case T_float: return Constant.fromValue(left.charValue() < right.floatValue()) ;
729 case T_double: return Constant.fromValue(left.charValue() < right.doubleValue()) ;
730 case T_byte: return Constant.fromValue(left.charValue() < right.byteValue()) ;
731 case T_short: return Constant.fromValue(left.charValue() < right.shortValue()) ;
732 case T_int: return Constant.fromValue(left.charValue() < right.intValue()) ;
733 case T_long: return Constant.fromValue(left.charValue() < right.longValue()) ;}
737 case T_char : return Constant.fromValue(left.floatValue() < right.charValue()) ;
738 case T_float: return Constant.fromValue(left.floatValue() < right.floatValue()) ;
739 case T_double: return Constant.fromValue(left.floatValue() < right.doubleValue()) ;
740 case T_byte: return Constant.fromValue(left.floatValue() < right.byteValue()) ;
741 case T_short: return Constant.fromValue(left.floatValue() < right.shortValue()) ;
742 case T_int: return Constant.fromValue(left.floatValue() < right.intValue()) ;
743 case T_long: return Constant.fromValue(left.floatValue() < right.longValue()) ;}
747 case T_char : return Constant.fromValue(left.doubleValue() < right.charValue()) ;
748 case T_float: return Constant.fromValue(left.doubleValue() < right.floatValue()) ;
749 case T_double: return Constant.fromValue(left.doubleValue() < right.doubleValue()) ;
750 case T_byte: return Constant.fromValue(left.doubleValue() < right.byteValue()) ;
751 case T_short: return Constant.fromValue(left.doubleValue() < right.shortValue()) ;
752 case T_int: return Constant.fromValue(left.doubleValue() < right.intValue()) ;
753 case T_long: return Constant.fromValue(left.doubleValue() < right.longValue()) ;}
757 case T_char : return Constant.fromValue(left.byteValue() < right.charValue()) ;
758 case T_float: return Constant.fromValue(left.byteValue() < right.floatValue()) ;
759 case T_double: return Constant.fromValue(left.byteValue() < right.doubleValue()) ;
760 case T_byte: return Constant.fromValue(left.byteValue() < right.byteValue()) ;
761 case T_short: return Constant.fromValue(left.byteValue() < right.shortValue()) ;
762 case T_int: return Constant.fromValue(left.byteValue() < right.intValue()) ;
763 case T_long: return Constant.fromValue(left.byteValue() < right.longValue()) ;}
767 case T_char : return Constant.fromValue(left.shortValue() < right.charValue()) ;
768 case T_float: return Constant.fromValue(left.shortValue() < right.floatValue()) ;
769 case T_double: return Constant.fromValue(left.shortValue() < right.doubleValue()) ;
770 case T_byte: return Constant.fromValue(left.shortValue() < right.byteValue()) ;
771 case T_short: return Constant.fromValue(left.shortValue() < right.shortValue()) ;
772 case T_int: return Constant.fromValue(left.shortValue() < right.intValue()) ;
773 case T_long: return Constant.fromValue(left.shortValue() < right.longValue()) ;}
777 case T_char : return Constant.fromValue(left.intValue() < right.charValue()) ;
778 case T_float: return Constant.fromValue(left.intValue() < right.floatValue()) ;
779 case T_double: return Constant.fromValue(left.intValue() < right.doubleValue()) ;
780 case T_byte: return Constant.fromValue(left.intValue() < right.byteValue()) ;
781 case T_short: return Constant.fromValue(left.intValue() < right.shortValue()) ;
782 case T_int: return Constant.fromValue(left.intValue() < right.intValue()) ;
783 case T_long: return Constant.fromValue(left.intValue() < right.longValue()) ;}
787 case T_char : return Constant.fromValue(left.longValue() < right.charValue()) ;
788 case T_float: return Constant.fromValue(left.longValue() < right.floatValue()) ;
789 case T_double: return Constant.fromValue(left.longValue() < right.doubleValue()) ;
790 case T_byte: return Constant.fromValue(left.longValue() < right.byteValue()) ;
791 case T_short: return Constant.fromValue(left.longValue() < right.shortValue()) ;
792 case T_int: return Constant.fromValue(left.longValue() < right.intValue()) ;
793 case T_long: return Constant.fromValue(left.longValue() < right.longValue()) ;}
797 return NotAConstant ;} //should not get here
798 public static final Constant computeConstantOperationLESS_EQUAL(Constant left, int leftId, int operator, Constant right, int rightId) {
799 //this method assumes that the TC has been done .
804 case T_char : return Constant.fromValue(left.charValue() <= right.charValue()) ;
805 case T_float: return Constant.fromValue(left.charValue() <= right.floatValue()) ;
806 case T_double: return Constant.fromValue(left.charValue() <= right.doubleValue()) ;
807 case T_byte: return Constant.fromValue(left.charValue() <= right.byteValue()) ;
808 case T_short: return Constant.fromValue(left.charValue() <= right.shortValue()) ;
809 case T_int: return Constant.fromValue(left.charValue() <= right.intValue()) ;
810 case T_long: return Constant.fromValue(left.charValue() <= right.longValue()) ;}
814 case T_char : return Constant.fromValue(left.floatValue() <= right.charValue()) ;
815 case T_float: return Constant.fromValue(left.floatValue() <= right.floatValue()) ;
816 case T_double: return Constant.fromValue(left.floatValue() <= right.doubleValue()) ;
817 case T_byte: return Constant.fromValue(left.floatValue() <= right.byteValue()) ;
818 case T_short: return Constant.fromValue(left.floatValue() <= right.shortValue()) ;
819 case T_int: return Constant.fromValue(left.floatValue() <= right.intValue()) ;
820 case T_long: return Constant.fromValue(left.floatValue() <= right.longValue()) ;}
824 case T_char : return Constant.fromValue(left.doubleValue() <= right.charValue()) ;
825 case T_float: return Constant.fromValue(left.doubleValue() <= right.floatValue()) ;
826 case T_double: return Constant.fromValue(left.doubleValue() <= right.doubleValue()) ;
827 case T_byte: return Constant.fromValue(left.doubleValue() <= right.byteValue()) ;
828 case T_short: return Constant.fromValue(left.doubleValue() <= right.shortValue()) ;
829 case T_int: return Constant.fromValue(left.doubleValue() <= right.intValue()) ;
830 case T_long: return Constant.fromValue(left.doubleValue() <= right.longValue()) ;}
834 case T_char : return Constant.fromValue(left.byteValue() <= right.charValue()) ;
835 case T_float: return Constant.fromValue(left.byteValue() <= right.floatValue()) ;
836 case T_double: return Constant.fromValue(left.byteValue() <= right.doubleValue()) ;
837 case T_byte: return Constant.fromValue(left.byteValue() <= right.byteValue()) ;
838 case T_short: return Constant.fromValue(left.byteValue() <= right.shortValue()) ;
839 case T_int: return Constant.fromValue(left.byteValue() <= right.intValue()) ;
840 case T_long: return Constant.fromValue(left.byteValue() <= right.longValue()) ;}
844 case T_char : return Constant.fromValue(left.shortValue() <= right.charValue()) ;
845 case T_float: return Constant.fromValue(left.shortValue() <= right.floatValue()) ;
846 case T_double: return Constant.fromValue(left.shortValue() <= right.doubleValue()) ;
847 case T_byte: return Constant.fromValue(left.shortValue() <= right.byteValue()) ;
848 case T_short: return Constant.fromValue(left.shortValue() <= right.shortValue()) ;
849 case T_int: return Constant.fromValue(left.shortValue() <= right.intValue()) ;
850 case T_long: return Constant.fromValue(left.shortValue() <= right.longValue()) ;}
854 case T_char : return Constant.fromValue(left.intValue() <= right.charValue()) ;
855 case T_float: return Constant.fromValue(left.intValue() <= right.floatValue()) ;
856 case T_double: return Constant.fromValue(left.intValue() <= right.doubleValue()) ;
857 case T_byte: return Constant.fromValue(left.intValue() <= right.byteValue()) ;
858 case T_short: return Constant.fromValue(left.intValue() <= right.shortValue()) ;
859 case T_int: return Constant.fromValue(left.intValue() <= right.intValue()) ;
860 case T_long: return Constant.fromValue(left.intValue() <= right.longValue()) ;}
864 case T_char : return Constant.fromValue(left.longValue() <= right.charValue()) ;
865 case T_float: return Constant.fromValue(left.longValue() <= right.floatValue()) ;
866 case T_double: return Constant.fromValue(left.longValue() <= right.doubleValue()) ;
867 case T_byte: return Constant.fromValue(left.longValue() <= right.byteValue()) ;
868 case T_short: return Constant.fromValue(left.longValue() <= right.shortValue()) ;
869 case T_int: return Constant.fromValue(left.longValue() <= right.intValue()) ;
870 case T_long: return Constant.fromValue(left.longValue() <= right.longValue()) ;}
874 return NotAConstant ;} //should not get here
875 public static final Constant computeConstantOperationMINUS(Constant left, int leftId, int operator, Constant right, int rightId) {
876 //this method assumes that the TC has been done .
881 case T_char : return Constant.fromValue(left.charValue() - right.charValue()) ;
882 case T_float: return Constant.fromValue(left.charValue() - right.floatValue()) ;
883 case T_double: return Constant.fromValue(left.charValue() - right.doubleValue()) ;
884 case T_byte: return Constant.fromValue(left.charValue() - right.byteValue()) ;
885 case T_short: return Constant.fromValue(left.charValue() - right.shortValue()) ;
886 case T_int: return Constant.fromValue(left.charValue() - right.intValue()) ;
887 case T_long: return Constant.fromValue(left.charValue() - right.longValue()) ;}
891 case T_char : return Constant.fromValue(left.floatValue() - right.charValue()) ;
892 case T_float: return Constant.fromValue(left.floatValue() - right.floatValue()) ;
893 case T_double: return Constant.fromValue(left.floatValue() - right.doubleValue()) ;
894 case T_byte: return Constant.fromValue(left.floatValue() - right.byteValue()) ;
895 case T_short: return Constant.fromValue(left.floatValue() - right.shortValue()) ;
896 case T_int: return Constant.fromValue(left.floatValue() - right.intValue()) ;
897 case T_long: return Constant.fromValue(left.floatValue() - right.longValue()) ;}
901 case T_char : return Constant.fromValue(left.doubleValue() - right.charValue()) ;
902 case T_float: return Constant.fromValue(left.doubleValue() - right.floatValue()) ;
903 case T_double: return Constant.fromValue(left.doubleValue() - right.doubleValue()) ;
904 case T_byte: return Constant.fromValue(left.doubleValue() - right.byteValue()) ;
905 case T_short: return Constant.fromValue(left.doubleValue() - right.shortValue()) ;
906 case T_int: return Constant.fromValue(left.doubleValue() - right.intValue()) ;
907 case T_long: return Constant.fromValue(left.doubleValue() - right.longValue()) ;}
911 case T_char : return Constant.fromValue(left.byteValue() - right.charValue()) ;
912 case T_float: return Constant.fromValue(left.byteValue() - right.floatValue()) ;
913 case T_double: return Constant.fromValue(left.byteValue() - right.doubleValue()) ;
914 case T_byte: return Constant.fromValue(left.byteValue() - right.byteValue()) ;
915 case T_short: return Constant.fromValue(left.byteValue() - right.shortValue()) ;
916 case T_int: return Constant.fromValue(left.byteValue() - right.intValue()) ;
917 case T_long: return Constant.fromValue(left.byteValue() - right.longValue()) ;}
921 case T_char : return Constant.fromValue(left.shortValue() - right.charValue()) ;
922 case T_float: return Constant.fromValue(left.shortValue() - right.floatValue()) ;
923 case T_double: return Constant.fromValue(left.shortValue() - right.doubleValue()) ;
924 case T_byte: return Constant.fromValue(left.shortValue() - right.byteValue()) ;
925 case T_short: return Constant.fromValue(left.shortValue() - right.shortValue()) ;
926 case T_int: return Constant.fromValue(left.shortValue() - right.intValue()) ;
927 case T_long: return Constant.fromValue(left.shortValue() - right.longValue()) ;}
931 case T_char : return Constant.fromValue(left.intValue() - right.charValue()) ;
932 case T_float: return Constant.fromValue(left.intValue() - right.floatValue()) ;
933 case T_double: return Constant.fromValue(left.intValue() - right.doubleValue()) ;
934 case T_byte: return Constant.fromValue(left.intValue() - right.byteValue()) ;
935 case T_short: return Constant.fromValue(left.intValue() - right.shortValue()) ;
936 case T_int: return Constant.fromValue(left.intValue() - right.intValue()) ;
937 case T_long: return Constant.fromValue(left.intValue() - right.longValue()) ;}
941 case T_char : return Constant.fromValue(left.longValue() - right.charValue()) ;
942 case T_float: return Constant.fromValue(left.longValue() - right.floatValue()) ;
943 case T_double: return Constant.fromValue(left.longValue() - right.doubleValue()) ;
944 case T_byte: return Constant.fromValue(left.longValue() - right.byteValue()) ;
945 case T_short: return Constant.fromValue(left.longValue() - right.shortValue()) ;
946 case T_int: return Constant.fromValue(left.longValue() - right.intValue()) ;
947 case T_long: return Constant.fromValue(left.longValue() - right.longValue()) ;}
951 return NotAConstant ;} //should not get here
952 public static final Constant computeConstantOperationMULTIPLY(Constant left, int leftId, int operator, Constant right, int rightId) {
953 //this method assumes that the TC has been done .
958 case T_char : return Constant.fromValue(left.charValue() * right.charValue()) ;
959 case T_float: return Constant.fromValue(left.charValue() * right.floatValue()) ;
960 case T_double: return Constant.fromValue(left.charValue() * right.doubleValue()) ;
961 case T_byte: return Constant.fromValue(left.charValue() * right.byteValue()) ;
962 case T_short: return Constant.fromValue(left.charValue() * right.shortValue()) ;
963 case T_int: return Constant.fromValue(left.charValue() * right.intValue()) ;
964 case T_long: return Constant.fromValue(left.charValue() * right.longValue()) ;}
968 case T_char : return Constant.fromValue(left.floatValue() * right.charValue()) ;
969 case T_float: return Constant.fromValue(left.floatValue() * right.floatValue()) ;
970 case T_double: return Constant.fromValue(left.floatValue() * right.doubleValue()) ;
971 case T_byte: return Constant.fromValue(left.floatValue() * right.byteValue()) ;
972 case T_short: return Constant.fromValue(left.floatValue() * right.shortValue()) ;
973 case T_int: return Constant.fromValue(left.floatValue() * right.intValue()) ;
974 case T_long: return Constant.fromValue(left.floatValue() * right.longValue()) ;}
978 case T_char : return Constant.fromValue(left.doubleValue() * right.charValue()) ;
979 case T_float: return Constant.fromValue(left.doubleValue() * right.floatValue()) ;
980 case T_double: return Constant.fromValue(left.doubleValue() * right.doubleValue()) ;
981 case T_byte: return Constant.fromValue(left.doubleValue() * right.byteValue()) ;
982 case T_short: return Constant.fromValue(left.doubleValue() * right.shortValue()) ;
983 case T_int: return Constant.fromValue(left.doubleValue() * right.intValue()) ;
984 case T_long: return Constant.fromValue(left.doubleValue() * right.longValue()) ;}
988 case T_char : return Constant.fromValue(left.byteValue() * right.charValue()) ;
989 case T_float: return Constant.fromValue(left.byteValue() * right.floatValue()) ;
990 case T_double: return Constant.fromValue(left.byteValue() * right.doubleValue()) ;
991 case T_byte: return Constant.fromValue(left.byteValue() * right.byteValue()) ;
992 case T_short: return Constant.fromValue(left.byteValue() * right.shortValue()) ;
993 case T_int: return Constant.fromValue(left.byteValue() * right.intValue()) ;
994 case T_long: return Constant.fromValue(left.byteValue() * right.longValue()) ;}
998 case T_char : return Constant.fromValue(left.shortValue() * right.charValue()) ;
999 case T_float: return Constant.fromValue(left.shortValue() * right.floatValue()) ;
1000 case T_double: return Constant.fromValue(left.shortValue() * right.doubleValue()) ;
1001 case T_byte: return Constant.fromValue(left.shortValue() * right.byteValue()) ;
1002 case T_short: return Constant.fromValue(left.shortValue() * right.shortValue()) ;
1003 case T_int: return Constant.fromValue(left.shortValue() * right.intValue()) ;
1004 case T_long: return Constant.fromValue(left.shortValue() * right.longValue()) ;}
1008 case T_char : return Constant.fromValue(left.intValue() * right.charValue()) ;
1009 case T_float: return Constant.fromValue(left.intValue() * right.floatValue()) ;
1010 case T_double: return Constant.fromValue(left.intValue() * right.doubleValue()) ;
1011 case T_byte: return Constant.fromValue(left.intValue() * right.byteValue()) ;
1012 case T_short: return Constant.fromValue(left.intValue() * right.shortValue()) ;
1013 case T_int: return Constant.fromValue(left.intValue() * right.intValue()) ;
1014 case T_long: return Constant.fromValue(left.intValue() * right.longValue()) ;}
1018 case T_char : return Constant.fromValue(left.longValue() * right.charValue()) ;
1019 case T_float: return Constant.fromValue(left.longValue() * right.floatValue()) ;
1020 case T_double: return Constant.fromValue(left.longValue() * right.doubleValue()) ;
1021 case T_byte: return Constant.fromValue(left.longValue() * right.byteValue()) ;
1022 case T_short: return Constant.fromValue(left.longValue() * right.shortValue()) ;
1023 case T_int: return Constant.fromValue(left.longValue() * right.intValue()) ;
1024 case T_long: return Constant.fromValue(left.longValue() * right.longValue()) ;}
1029 return NotAConstant ;} //should not get here
1030 public static final Constant computeConstantOperationOR(Constant left, int leftId, int operator, Constant right, int rightId) {
1031 //this method assumes that the TC has been done .
1034 case T_boolean : return Constant.fromValue(left.booleanValue() | right.booleanValue()) ;
1037 case T_char : return Constant.fromValue(left.charValue() | right.charValue()) ;
1038 case T_byte: return Constant.fromValue(left.charValue() | right.byteValue()) ;
1039 case T_short: return Constant.fromValue(left.charValue() | right.shortValue()) ;
1040 case T_int: return Constant.fromValue(left.charValue() | right.intValue()) ;
1041 case T_long: return Constant.fromValue(left.charValue() | right.longValue()) ;}
1045 case T_char : return Constant.fromValue(left.byteValue() | right.charValue()) ;
1046 case T_byte: return Constant.fromValue(left.byteValue() | right.byteValue()) ;
1047 case T_short: return Constant.fromValue(left.byteValue() | right.shortValue()) ;
1048 case T_int: return Constant.fromValue(left.byteValue() | right.intValue()) ;
1049 case T_long: return Constant.fromValue(left.byteValue() | right.longValue()) ;}
1053 case T_char : return Constant.fromValue(left.shortValue() | right.charValue()) ;
1054 case T_byte: return Constant.fromValue(left.shortValue() | right.byteValue()) ;
1055 case T_short: return Constant.fromValue(left.shortValue() | right.shortValue()) ;
1056 case T_int: return Constant.fromValue(left.shortValue() | right.intValue()) ;
1057 case T_long: return Constant.fromValue(left.shortValue() | right.longValue()) ;}
1061 case T_char : return Constant.fromValue(left.intValue() | right.charValue()) ;
1062 case T_byte: return Constant.fromValue(left.intValue() | right.byteValue()) ;
1063 case T_short: return Constant.fromValue(left.intValue() | right.shortValue()) ;
1064 case T_int: return Constant.fromValue(left.intValue() | right.intValue()) ;
1065 case T_long: return Constant.fromValue(left.intValue() | right.longValue()) ;}
1069 case T_char : return Constant.fromValue(left.longValue() | right.charValue()) ;
1070 case T_byte: return Constant.fromValue(left.longValue() | right.byteValue()) ;
1071 case T_short: return Constant.fromValue(left.longValue() | right.shortValue()) ;
1072 case T_int: return Constant.fromValue(left.longValue() | right.intValue()) ;
1073 case T_long: return Constant.fromValue(left.longValue() | right.longValue()) ;}
1078 return NotAConstant ;} // should not get here
1079 public static final Constant computeConstantOperationOR_OR(Constant left, int leftId, int operator, Constant right, int rightId) {
1080 //this method assumes that the TC has been done .
1082 return Constant.fromValue(left.booleanValue() || right.booleanValue()) ;}
1083 public static final Constant computeConstantOperationPLUS(Constant left, int leftId, int operator, Constant right, int rightId) {
1084 //this method assumes that the TC has been done .
1088 if (rightId == T_String) {
1089 return Constant.fromValue(left.stringValue() + right.stringValue());
1092 if (rightId == T_String) {
1093 return Constant.fromValue(left.stringValue() + right.stringValue());
1098 case T_char : return Constant.fromValue(left.charValue() + right.charValue()) ;
1099 case T_float: return Constant.fromValue(left.charValue() + right.floatValue()) ;
1100 case T_double: return Constant.fromValue(left.charValue() + right.doubleValue()) ;
1101 case T_byte: return Constant.fromValue(left.charValue() + right.byteValue()) ;
1102 case T_short: return Constant.fromValue(left.charValue() + right.shortValue()) ;
1103 case T_int: return Constant.fromValue(left.charValue() + right.intValue()) ;
1104 case T_long: return Constant.fromValue(left.charValue() + right.longValue()) ;
1105 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue()) ;}
1109 case T_char : return Constant.fromValue(left.floatValue() + right.charValue()) ;
1110 case T_float: return Constant.fromValue(left.floatValue() + right.floatValue()) ;
1111 case T_double: return Constant.fromValue(left.floatValue() + right.doubleValue()) ;
1112 case T_byte: return Constant.fromValue(left.floatValue() + right.byteValue()) ;
1113 case T_short: return Constant.fromValue(left.floatValue() + right.shortValue()) ;
1114 case T_int: return Constant.fromValue(left.floatValue() + right.intValue()) ;
1115 case T_long: return Constant.fromValue(left.floatValue() + right.longValue()) ;
1116 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue()) ; }
1120 case T_char : return Constant.fromValue(left.doubleValue() + right.charValue()) ;
1121 case T_float: return Constant.fromValue(left.doubleValue() + right.floatValue()) ;
1122 case T_double: return Constant.fromValue(left.doubleValue() + right.doubleValue()) ;
1123 case T_byte: return Constant.fromValue(left.doubleValue() + right.byteValue()) ;
1124 case T_short: return Constant.fromValue(left.doubleValue() + right.shortValue()) ;
1125 case T_int: return Constant.fromValue(left.doubleValue() + right.intValue()) ;
1126 case T_long: return Constant.fromValue(left.doubleValue() + right.longValue()) ;
1127 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue()) ;}
1131 case T_char : return Constant.fromValue(left.byteValue() + right.charValue()) ;
1132 case T_float: return Constant.fromValue(left.byteValue() + right.floatValue()) ;
1133 case T_double: return Constant.fromValue(left.byteValue() + right.doubleValue()) ;
1134 case T_byte: return Constant.fromValue(left.byteValue() + right.byteValue()) ;
1135 case T_short: return Constant.fromValue(left.byteValue() + right.shortValue()) ;
1136 case T_int: return Constant.fromValue(left.byteValue() + right.intValue()) ;
1137 case T_long: return Constant.fromValue(left.byteValue() + right.longValue()) ;
1138 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue()) ; }
1143 case T_char : return Constant.fromValue(left.shortValue() + right.charValue()) ;
1144 case T_float: return Constant.fromValue(left.shortValue() + right.floatValue()) ;
1145 case T_double: return Constant.fromValue(left.shortValue() + right.doubleValue()) ;
1146 case T_byte: return Constant.fromValue(left.shortValue() + right.byteValue()) ;
1147 case T_short: return Constant.fromValue(left.shortValue() + right.shortValue()) ;
1148 case T_int: return Constant.fromValue(left.shortValue() + right.intValue()) ;
1149 case T_long: return Constant.fromValue(left.shortValue() + right.longValue()) ;
1150 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue()) ;}
1154 case T_char : return Constant.fromValue(left.intValue() + right.charValue()) ;
1155 case T_float: return Constant.fromValue(left.intValue() + right.floatValue()) ;
1156 case T_double: return Constant.fromValue(left.intValue() + right.doubleValue()) ;
1157 case T_byte: return Constant.fromValue(left.intValue() + right.byteValue()) ;
1158 case T_short: return Constant.fromValue(left.intValue() + right.shortValue()) ;
1159 case T_int: return Constant.fromValue(left.intValue() + right.intValue()) ;
1160 case T_long: return Constant.fromValue(left.intValue() + right.longValue()) ;
1161 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue()) ;}
1165 case T_char : return Constant.fromValue(left.longValue() + right.charValue()) ;
1166 case T_float: return Constant.fromValue(left.longValue() + right.floatValue()) ;
1167 case T_double: return Constant.fromValue(left.longValue() + right.doubleValue()) ;
1168 case T_byte: return Constant.fromValue(left.longValue() + right.byteValue()) ;
1169 case T_short: return Constant.fromValue(left.longValue() + right.shortValue()) ;
1170 case T_int: return Constant.fromValue(left.longValue() + right.intValue()) ;
1171 case T_long: return Constant.fromValue(left.longValue() + right.longValue()) ;
1172 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue()) ; }
1176 case T_char : return Constant.fromValue(left.stringValue() + right.stringValue()) ;
1177 case T_float: return Constant.fromValue(left.stringValue() + right.stringValue()) ;
1178 case T_double: return Constant.fromValue(left.stringValue() + right.stringValue()) ;
1179 case T_byte: return Constant.fromValue(left.stringValue() + right.stringValue()) ;
1180 case T_short: return Constant.fromValue(left.stringValue() + right.stringValue()) ;
1181 case T_int: return Constant.fromValue(left.stringValue() + right.stringValue()) ;
1182 case T_long: return Constant.fromValue(left.stringValue() + right.stringValue()) ;
1183 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue()) ;
1184 case T_null: return Constant.fromValue(left.stringValue() + right.stringValue()) ;
1185 case T_boolean: return Constant.fromValue(left.stringValue() + right.stringValue()) ;}
1189 case T_char : return Constant.fromValue(left.stringValue() + right.stringValue()) ;
1190 case T_float: return Constant.fromValue(left.stringValue() + right.stringValue()) ;
1191 case T_double: return Constant.fromValue(left.stringValue() + right.stringValue()) ;
1192 case T_byte: return Constant.fromValue(left.stringValue() + right.stringValue()) ;
1193 case T_short: return Constant.fromValue(left.stringValue() + right.stringValue()) ;
1194 case T_int: return Constant.fromValue(left.stringValue() + right.stringValue()) ;
1195 case T_long: return Constant.fromValue(left.stringValue() + right.stringValue()) ;
1196 case T_String: return Constant.fromValue(left.stringValue() + right.stringValue()) ;
1197 case T_null: return Constant.fromValue(left.stringValue() + right.stringValue()) ; }
1201 return NotAConstant ;} //should not get here
1202 public static final Constant computeConstantOperationREMAINDER(Constant left, int leftId, int operator, Constant right, int rightId) {
1203 //this method assumes that the TC has been done .
1208 case T_char : return Constant.fromValue(left.charValue() % right.charValue()) ;
1209 case T_float: return Constant.fromValue(left.charValue() % right.floatValue()) ;
1210 case T_double: return Constant.fromValue(left.charValue() % right.doubleValue()) ;
1211 case T_byte: return Constant.fromValue(left.charValue() % right.byteValue()) ;
1212 case T_short: return Constant.fromValue(left.charValue() % right.shortValue()) ;
1213 case T_int: return Constant.fromValue(left.charValue() % right.intValue()) ;
1214 case T_long: return Constant.fromValue(left.charValue() % right.longValue()) ;}
1218 case T_char : return Constant.fromValue(left.floatValue() % right.charValue()) ;
1219 case T_float: return Constant.fromValue(left.floatValue() % right.floatValue()) ;
1220 case T_double: return Constant.fromValue(left.floatValue() % right.doubleValue()) ;
1221 case T_byte: return Constant.fromValue(left.floatValue() % right.byteValue()) ;
1222 case T_short: return Constant.fromValue(left.floatValue() % right.shortValue()) ;
1223 case T_int: return Constant.fromValue(left.floatValue() % right.intValue()) ;
1224 case T_long: return Constant.fromValue(left.floatValue() % right.longValue()) ;}
1228 case T_char : return Constant.fromValue(left.doubleValue() % right.charValue()) ;
1229 case T_float: return Constant.fromValue(left.doubleValue() % right.floatValue()) ;
1230 case T_double: return Constant.fromValue(left.doubleValue() % right.doubleValue()) ;
1231 case T_byte: return Constant.fromValue(left.doubleValue() % right.byteValue()) ;
1232 case T_short: return Constant.fromValue(left.doubleValue() % right.shortValue()) ;
1233 case T_int: return Constant.fromValue(left.doubleValue() % right.intValue()) ;
1234 case T_long: return Constant.fromValue(left.doubleValue() % right.longValue()) ;}
1238 case T_char : return Constant.fromValue(left.byteValue() % right.charValue()) ;
1239 case T_float: return Constant.fromValue(left.byteValue() % right.floatValue()) ;
1240 case T_double: return Constant.fromValue(left.byteValue() % right.doubleValue()) ;
1241 case T_byte: return Constant.fromValue(left.byteValue() % right.byteValue()) ;
1242 case T_short: return Constant.fromValue(left.byteValue() % right.shortValue()) ;
1243 case T_int: return Constant.fromValue(left.byteValue() % right.intValue()) ;
1244 case T_long: return Constant.fromValue(left.byteValue() % right.longValue()) ;}
1248 case T_char : return Constant.fromValue(left.shortValue() % right.charValue()) ;
1249 case T_float: return Constant.fromValue(left.shortValue() % right.floatValue()) ;
1250 case T_double: return Constant.fromValue(left.shortValue() % right.doubleValue()) ;
1251 case T_byte: return Constant.fromValue(left.shortValue() % right.byteValue()) ;
1252 case T_short: return Constant.fromValue(left.shortValue() % right.shortValue()) ;
1253 case T_int: return Constant.fromValue(left.shortValue() % right.intValue()) ;
1254 case T_long: return Constant.fromValue(left.shortValue() % right.longValue()) ;}
1258 case T_char : return Constant.fromValue(left.intValue() % right.charValue()) ;
1259 case T_float: return Constant.fromValue(left.intValue() % right.floatValue()) ;
1260 case T_double: return Constant.fromValue(left.intValue() % right.doubleValue()) ;
1261 case T_byte: return Constant.fromValue(left.intValue() % right.byteValue()) ;
1262 case T_short: return Constant.fromValue(left.intValue() % right.shortValue()) ;
1263 case T_int: return Constant.fromValue(left.intValue() % right.intValue()) ;
1264 case T_long: return Constant.fromValue(left.intValue() % right.longValue()) ;}
1268 case T_char : return Constant.fromValue(left.longValue() % right.charValue()) ;
1269 case T_float: return Constant.fromValue(left.longValue() % right.floatValue()) ;
1270 case T_double: return Constant.fromValue(left.longValue() % right.doubleValue()) ;
1271 case T_byte: return Constant.fromValue(left.longValue() % right.byteValue()) ;
1272 case T_short: return Constant.fromValue(left.longValue() % right.shortValue()) ;
1273 case T_int: return Constant.fromValue(left.longValue() % right.intValue()) ;
1274 case T_long: return Constant.fromValue(left.longValue() % right.longValue()) ;}
1278 return NotAConstant ;} //should not get here
1279 public static final Constant computeConstantOperationRIGHT_SHIFT(Constant left, int leftId, int operator, Constant right, int rightId) {
1280 //this method assumes that the TC has been done .
1285 case T_char : return Constant.fromValue(left.charValue() >> right.charValue()) ;
1286 case T_byte: return Constant.fromValue(left.charValue() >> right.byteValue()) ;
1287 case T_short: return Constant.fromValue(left.charValue() >> right.shortValue()) ;
1288 case T_int: return Constant.fromValue(left.charValue() >> right.intValue()) ;
1289 case T_long: return Constant.fromValue(left.charValue() >> right.longValue()) ;}
1293 case T_char : return Constant.fromValue(left.byteValue() >> right.charValue()) ;
1294 case T_byte: return Constant.fromValue(left.byteValue() >> right.byteValue()) ;
1295 case T_short: return Constant.fromValue(left.byteValue() >> right.shortValue()) ;
1296 case T_int: return Constant.fromValue(left.byteValue() >> right.intValue()) ;
1297 case T_long: return Constant.fromValue(left.byteValue() >> right.longValue()) ;}
1301 case T_char : return Constant.fromValue(left.shortValue() >> right.charValue()) ;
1302 case T_byte: return Constant.fromValue(left.shortValue() >> right.byteValue()) ;
1303 case T_short: return Constant.fromValue(left.shortValue() >> right.shortValue()) ;
1304 case T_int: return Constant.fromValue(left.shortValue() >> right.intValue()) ;
1305 case T_long: return Constant.fromValue(left.shortValue() >> right.longValue()) ;}
1309 case T_char : return Constant.fromValue(left.intValue() >> right.charValue()) ;
1310 case T_byte: return Constant.fromValue(left.intValue() >> right.byteValue()) ;
1311 case T_short: return Constant.fromValue(left.intValue() >> right.shortValue()) ;
1312 case T_int: return Constant.fromValue(left.intValue() >> right.intValue()) ;
1313 case T_long: return Constant.fromValue(left.intValue() >> right.longValue()) ;}
1317 case T_char : return Constant.fromValue(left.longValue() >> right.charValue()) ;
1318 case T_byte: return Constant.fromValue(left.longValue() >> right.byteValue()) ;
1319 case T_short: return Constant.fromValue(left.longValue() >> right.shortValue()) ;
1320 case T_int: return Constant.fromValue(left.longValue() >> right.intValue()) ;
1321 case T_long: return Constant.fromValue(left.longValue() >> right.longValue()) ;}
1326 return NotAConstant ;} // should not get here
1327 public static final Constant computeConstantOperationUNSIGNED_RIGHT_SHIFT(Constant left, int leftId, int operator, Constant right, int rightId) {
1328 //this method assumes that the TC has been done .
1333 case T_char : return Constant.fromValue(left.charValue() >>> right.charValue()) ;
1334 case T_byte: return Constant.fromValue(left.charValue() >>> right.byteValue()) ;
1335 case T_short: return Constant.fromValue(left.charValue() >>> right.shortValue()) ;
1336 case T_int: return Constant.fromValue(left.charValue() >>> right.intValue()) ;
1337 case T_long: return Constant.fromValue(left.charValue() >>> right.longValue()) ;}
1341 case T_char : return Constant.fromValue(left.byteValue() >>> right.charValue()) ;
1342 case T_byte: return Constant.fromValue(left.byteValue() >>> right.byteValue()) ;
1343 case T_short: return Constant.fromValue(left.byteValue() >>> right.shortValue()) ;
1344 case T_int: return Constant.fromValue(left.byteValue() >>> right.intValue()) ;
1345 case T_long: return Constant.fromValue(left.byteValue() >>> right.longValue()) ;}
1349 case T_char : return Constant.fromValue(left.shortValue() >>> right.charValue()) ;
1350 case T_byte: return Constant.fromValue(left.shortValue() >>> right.byteValue()) ;
1351 case T_short: return Constant.fromValue(left.shortValue() >>> right.shortValue()) ;
1352 case T_int: return Constant.fromValue(left.shortValue() >>> right.intValue()) ;
1353 case T_long: return Constant.fromValue(left.shortValue() >>> right.longValue()) ;}
1357 case T_char : return Constant.fromValue(left.intValue() >>> right.charValue()) ;
1358 case T_byte: return Constant.fromValue(left.intValue() >>> right.byteValue()) ;
1359 case T_short: return Constant.fromValue(left.intValue() >>> right.shortValue()) ;
1360 case T_int: return Constant.fromValue(left.intValue() >>> right.intValue()) ;
1361 case T_long: return Constant.fromValue(left.intValue() >>> right.longValue()) ;}
1365 case T_char : return Constant.fromValue(left.longValue() >>> right.charValue()) ;
1366 case T_byte: return Constant.fromValue(left.longValue() >>> right.byteValue()) ;
1367 case T_short: return Constant.fromValue(left.longValue() >>> right.shortValue()) ;
1368 case T_int: return Constant.fromValue(left.longValue() >>> right.intValue()) ;
1369 case T_long: return Constant.fromValue(left.longValue() >>> right.longValue()) ;}
1374 return NotAConstant ;} // should not get here
1375 public static final Constant computeConstantOperationXOR(Constant left, int leftId, int operator, Constant right, int rightId) {
1376 //this method assumes that the TC has been done .
1379 case T_boolean : return Constant.fromValue(left.booleanValue() ^ right.booleanValue()) ;
1382 case T_char : return Constant.fromValue(left.charValue() ^ right.charValue()) ;
1383 case T_byte: return Constant.fromValue(left.charValue() ^ right.byteValue()) ;
1384 case T_short: return Constant.fromValue(left.charValue() ^ right.shortValue()) ;
1385 case T_int: return Constant.fromValue(left.charValue() ^ right.intValue()) ;
1386 case T_long: return Constant.fromValue(left.charValue() ^ right.longValue()) ;}
1390 case T_char : return Constant.fromValue(left.byteValue() ^ right.charValue()) ;
1391 case T_byte: return Constant.fromValue(left.byteValue() ^ right.byteValue()) ;
1392 case T_short: return Constant.fromValue(left.byteValue() ^ right.shortValue()) ;
1393 case T_int: return Constant.fromValue(left.byteValue() ^ right.intValue()) ;
1394 case T_long: return Constant.fromValue(left.byteValue() ^ right.longValue()) ;}
1398 case T_char : return Constant.fromValue(left.shortValue() ^ right.charValue()) ;
1399 case T_byte: return Constant.fromValue(left.shortValue() ^ right.byteValue()) ;
1400 case T_short: return Constant.fromValue(left.shortValue() ^ right.shortValue()) ;
1401 case T_int: return Constant.fromValue(left.shortValue() ^ right.intValue()) ;
1402 case T_long: return Constant.fromValue(left.shortValue() ^ right.longValue()) ;}
1406 case T_char : return Constant.fromValue(left.intValue() ^ right.charValue()) ;
1407 case T_byte: return Constant.fromValue(left.intValue() ^ right.byteValue()) ;
1408 case T_short: return Constant.fromValue(left.intValue() ^ right.shortValue()) ;
1409 case T_int: return Constant.fromValue(left.intValue() ^ right.intValue()) ;
1410 case T_long: return Constant.fromValue(left.intValue() ^ right.longValue()) ;}
1414 case T_char : return Constant.fromValue(left.longValue() ^ right.charValue()) ;
1415 case T_byte: return Constant.fromValue(left.longValue() ^ right.byteValue()) ;
1416 case T_short: return Constant.fromValue(left.longValue() ^ right.shortValue()) ;
1417 case T_int: return Constant.fromValue(left.longValue() ^ right.intValue()) ;
1418 case T_long: return Constant.fromValue(left.longValue() ^ right.longValue()) ;}
1423 return NotAConstant ;} // should not get here
1424 public double doubleValue() {
1425 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"double")); //$NON-NLS-2$ //$NON-NLS-1$
1427 public float floatValue() {
1428 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"float")); //$NON-NLS-2$ //$NON-NLS-1$
1430 public static Constant fromValue(byte value) {
1431 return new ByteConstant(value);
1433 public static Constant fromValue(char value) {
1434 return new CharConstant(value);
1436 public static Constant fromValue(double value) {
1437 return new DoubleConstant(value);
1439 public static Constant fromValue(float value) {
1440 return new FloatConstant(value);
1442 public static Constant fromValue(int value) {
1443 return new IntConstant(value);
1445 public static Constant fromValue(long value) {
1446 return new LongConstant(value);
1448 public static Constant fromValue(String value) {
1449 if (value == null) return NullConstant.Default;
1450 return new StringConstant(value);
1452 public static Constant fromValue(short value) {
1453 return new ShortConstant(value);
1455 public static Constant fromValue(boolean value) {
1456 return new BooleanConstant(value);
1458 public int intValue() {
1459 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"int")); //$NON-NLS-2$ //$NON-NLS-1$
1461 public long longValue() {
1462 throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"long")); //$NON-NLS-2$ //$NON-NLS-1$
1464 public short shortValue() {
1465 throw new ShouldNotImplement(Util.bind("constant.cannotConvertedTo",typeName(),"short")); //$NON-NLS-2$ //$NON-NLS-1$
1469 public String stringValue() {
1470 throw new ShouldNotImplement(Util.bind("constant.cannotConvertedTo",typeName(),"String")); //$NON-NLS-1$ //$NON-NLS-2$
1472 public String toString(){
1474 if (this == NotAConstant) return "(Constant) NotAConstant" ; //$NON-NLS-1$
1475 return super.toString(); }
1476 public abstract int typeID();
1477 public String typeName() {
1479 case T_int : return "int"; //$NON-NLS-1$
1480 case T_byte : return "byte"; //$NON-NLS-1$
1481 case T_short : return "short"; //$NON-NLS-1$
1482 case T_char : return "char"; //$NON-NLS-1$
1483 case T_float : return "float"; //$NON-NLS-1$
1484 case T_double : return "double"; //$NON-NLS-1$
1485 case T_boolean : return "boolean"; //$NON-NLS-1$
1486 case T_long : return "long";//$NON-NLS-1$
1487 case T_String : return "java.lang.String"; //$NON-NLS-1$
1488 case T_null : return "null"; //$NON-NLS-1$
1489 default: return "unknown"; //$NON-NLS-1$