import org.eclipse.ui.internal.dialogs.ResourceSorter; replaced by import org.eclips...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / impl / Constant.java
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
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  ******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.impl;
12
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;
17
18 public abstract class Constant implements TypeIds, OperatorIds {
19         public static final Constant NotAConstant = new DoubleConstant(Double.NaN);
20
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$
26 }
27 public byte byteValue() {
28         throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"byte")); //$NON-NLS-1$ //$NON-NLS-2$
29 }
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 :-)
35
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 ;   
52         
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 ;   
66
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 ;   
80
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 ;   
94
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 ;   
108
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 ;   
122
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 ;   
136
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 ;   
150
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 ;   
164
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 ;   
178         
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 ;   
192         
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 ;   
206
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 ;
220         }
221
222         
223
224         return NotAConstant ;
225 }
226 public char charValue() {
227         throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"char")); //$NON-NLS-1$ //$NON-NLS-2$
228 }
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
232
233         switch (operator) {
234                 case NOT        :       
235                                                 return Constant.fromValue(!cst.booleanValue());
236                 case PLUS       :       return cst ; 
237                 case MINUS      :       //the two special -9223372036854775808L and -2147483648 are inlined at parseTime
238                                                 switch (id){
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);
244                                                                                                 else
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);
252                                                                                                 else
253                                                                                                         return Constant.fromValue(0.0d);}
254                                                                                         break; //default case
255                                                 }
256                                                 return computeConstantOperationMINUS(Zero,T_int,operator,cst,id);
257                 case TWIDDLE:   
258                         switch (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
269
270         switch (operator) {
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) ;
288
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 . 
292         
293         switch (leftId){
294                 case T_boolean :                return Constant.fromValue(left.booleanValue() & right.booleanValue()) ;
295                 case T_char :
296                         switch (rightId){
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()) ;}
302                 break ;
303                 case T_byte :
304                         switch (rightId){
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()) ;}
310                 break;
311                 case T_short :
312                         switch (rightId){
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()) ;}
318                 break;
319                 case T_int :
320                         switch (rightId){
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()) ;}
326                 break;
327                 case T_long :
328                         switch (rightId){
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()) ;}
334
335                 }
336         
337
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 . 
341
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)
346
347         switch (leftId){
348                 case T_char :
349                         switch (rightId){
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()) ;}
357                 break;
358                 case T_float :
359                         switch (rightId){
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()) ;}
367                 break;
368                 case T_double :
369                         switch (rightId){
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()) ;}
377                 break;
378                 case T_byte :
379                         switch (rightId){
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()) ;}
387                 break;
388                 case T_short :
389                         switch (rightId){
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()) ;}
397                 break;
398                 case T_int :
399                         switch (rightId){
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()) ;}
407                 break;
408                 case T_long :
409                         switch (rightId){
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()) ;}
417
418                 }
419         
420
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 . 
424         
425         switch (leftId){
426                 case T_boolean :
427                         if (rightId == T_boolean) {
428                                 return Constant.fromValue(left.booleanValue() == right.booleanValue()) ;
429                         }
430                 break ;
431                 case T_char :
432                         switch (rightId){
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()) ;}
440                 break;
441                 case T_float :
442                         switch (rightId){
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()) ;}
450                 break;
451                 case T_double :
452                         switch (rightId){
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()) ;}
460                 break;
461                 case T_byte :
462                         switch (rightId){
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()) ;}
470                 break;                  
471                 case T_short :
472                         switch (rightId){
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()) ;}
480                 break;
481                 case T_int :
482                         switch (rightId){
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()) ;}
490                 break;          
491                 case T_long :
492                         switch (rightId){
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()) ;}
500                 break;
501                 case T_String :
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)) ;
506                         }
507                 break;  
508                 case T_null :
509                         if (rightId == T_String) { 
510                                 return Constant.fromValue(false);
511                         } else {
512                                 if (rightId == T_null) { 
513                                         return Constant.fromValue(true) ;
514                                 }
515                         }
516                 }
517         
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 . 
521         
522         switch (leftId){
523                 case T_char : 
524                         switch (rightId){
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()) ;}
532                 break;
533                 case T_float :
534                         switch (rightId){
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()) ;}
542                 break;
543                 case T_double :
544                         switch (rightId){
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()) ;}
552                 break;
553                 case T_byte :
554                         switch (rightId){
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()) ;}
562                 break;                  
563                 case T_short :
564                         switch (rightId){
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()) ;}
572                 break;
573                 case T_int :
574                         switch (rightId){
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()) ;}
582                 break;          
583                 case T_long :
584                         switch (rightId){
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()) ;}
592                         
593                 }
594         
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 . 
598         
599         switch (leftId){
600                 case T_char : 
601                         switch (rightId){
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()) ;}
609                 break;
610                 case T_float :
611                         switch (rightId){
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()) ;}
619                 break;
620                 case T_double :
621                         switch (rightId){
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()) ;}
629                 break;
630                 case T_byte :
631                         switch (rightId){
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()) ;}
639                 break;                  
640                 case T_short :
641                         switch (rightId){
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()) ;}
649                 break;
650                 case T_int :
651                         switch (rightId){
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()) ;}
659                 break;          
660                 case T_long :
661                         switch (rightId){
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()) ;}
669                         
670                 }
671         
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 . 
675         
676         switch (leftId){
677                 case T_char :
678                         switch (rightId){
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()) ;}
684                 break ;
685                 case T_byte :
686                         switch (rightId){
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()) ;}
692                 break;
693                 case T_short :
694                         switch (rightId){
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()) ;}
700                 break;
701                 case T_int :
702                         switch (rightId){
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()) ;}
708                 break;
709                 case T_long :
710                         switch (rightId){
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()) ;}
716
717                 }
718         
719
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 . 
723         
724         switch (leftId){
725                 case T_char : 
726                         switch (rightId){
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()) ;}
734                 break;
735                 case T_float :
736                         switch (rightId){
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()) ;}
744                 break;
745                 case T_double :
746                         switch (rightId){
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()) ;}
754                 break;
755                 case T_byte :
756                         switch (rightId){
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()) ;}
764                 break;                  
765                 case T_short :
766                         switch (rightId){
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()) ;}
774                 break;
775                 case T_int :
776                         switch (rightId){
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()) ;}
784                 break;          
785                 case T_long :
786                         switch (rightId){
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()) ;}
794                         
795                 }
796         
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 . 
800         
801         switch (leftId){
802                 case T_char : 
803                         switch (rightId){
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()) ;}
811                 break;
812                 case T_float :
813                         switch (rightId){
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()) ;}
821                 break;
822                 case T_double :
823                         switch (rightId){
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()) ;}
831                 break;
832                 case T_byte :
833                         switch (rightId){
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()) ;}
841                 break;                  
842                 case T_short :
843                         switch (rightId){
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()) ;}
851                 break;
852                 case T_int :
853                         switch (rightId){
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()) ;}
861                 break;          
862                 case T_long :
863                         switch (rightId){
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()) ;}
871                         
872                 }
873         
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 . 
877         
878         switch (leftId){
879                 case T_char : 
880                         switch (rightId){
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()) ;}
888                 break;
889                 case T_float :
890                         switch (rightId){
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()) ;}
898                 break;
899                 case T_double :
900                         switch (rightId){
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()) ;}
908                 break;
909                 case T_byte :
910                         switch (rightId){
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()) ;}
918                 break;                  
919                 case T_short :
920                         switch (rightId){
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()) ;}
928                 break;
929                 case T_int :
930                         switch (rightId){
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()) ;}
938                 break;          
939                 case T_long :
940                         switch (rightId){
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()) ;}
948                         
949                 }
950         
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 . 
954
955         switch (leftId){
956                 case T_char :
957                         switch (rightId){
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()) ;}
965                 break;
966                 case T_float :
967                         switch (rightId){
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()) ;}
975                 break;
976                 case T_double :
977                         switch (rightId){
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()) ;}
985                 break;
986                 case T_byte :
987                         switch (rightId){
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()) ;}
995                 break;
996                 case T_short :
997                         switch (rightId){
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()) ;}
1005                 break;
1006                 case T_int :
1007                         switch (rightId){
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()) ;}
1015                 break;
1016                 case T_long :
1017                         switch (rightId){
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()) ;}
1025
1026                 }
1027         
1028
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 . 
1032         
1033         switch (leftId){
1034                 case T_boolean :                return Constant.fromValue(left.booleanValue() | right.booleanValue()) ;
1035                 case T_char :
1036                         switch (rightId){
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()) ;}
1042                 break;
1043                 case T_byte :
1044                         switch (rightId){
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()) ;}
1050                 break;
1051                 case T_short :
1052                         switch (rightId){
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()) ;}
1058                 break;
1059                 case T_int :
1060                         switch (rightId){
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()) ;}
1066                 break;
1067                 case T_long :
1068                         switch (rightId){
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()) ;}
1074
1075                 }
1076         
1077
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 . 
1081
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 . 
1085         
1086         switch (leftId){
1087                 case T_Object :
1088                         if (rightId == T_String) {
1089                                 return Constant.fromValue(left.stringValue() + right.stringValue());
1090                         }
1091                 case T_boolean :
1092                         if (rightId == T_String) {
1093                                 return Constant.fromValue(left.stringValue() + right.stringValue());
1094                         }
1095                 break ;
1096                 case T_char :
1097                         switch (rightId){
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()) ;}
1106                 break;
1107                 case T_float :
1108                         switch (rightId){
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()) ; }
1117                 break;
1118                 case T_double :
1119                         switch (rightId){
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()) ;}
1128                 break;
1129                 case T_byte :
1130                         switch (rightId){
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()) ; }
1139
1140                 break;                  
1141                 case T_short :
1142                         switch (rightId){
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()) ;}
1151                 break;
1152                 case T_int :
1153                         switch (rightId){
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()) ;}
1162                 break;          
1163                 case T_long :
1164                         switch (rightId){
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()) ; }
1173                 break;
1174                 case T_String :
1175                         switch (rightId){
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()) ;}
1186                 break;  
1187                 case T_null :
1188                         switch (rightId){
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()) ; }
1198                         
1199                 }
1200         
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 . 
1204         
1205         switch (leftId){
1206                 case T_char : 
1207                         switch (rightId){
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()) ;}
1215                 break;
1216                 case T_float :
1217                         switch (rightId){
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()) ;}
1225                 break;
1226                 case T_double :
1227                         switch (rightId){
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()) ;}
1235                 break;
1236                 case T_byte :
1237                         switch (rightId){
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()) ;}
1245                 break;                  
1246                 case T_short :
1247                         switch (rightId){
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()) ;}
1255                 break;
1256                 case T_int :
1257                         switch (rightId){
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()) ;}
1265                 break;          
1266                 case T_long :
1267                         switch (rightId){
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()) ;}
1275                         
1276                 }
1277         
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 . 
1281         
1282         switch (leftId){
1283                 case T_char :
1284                         switch (rightId){
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()) ;}
1290                 break ;
1291                 case T_byte :
1292                         switch (rightId){
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()) ;}
1298                 break;
1299                 case T_short :
1300                         switch (rightId){
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()) ;}
1306                 break;
1307                 case T_int :
1308                         switch (rightId){
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()) ;}
1314                 break;
1315                 case T_long :
1316                         switch (rightId){
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()) ;}
1322
1323                 }
1324         
1325
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 . 
1329         
1330         switch (leftId){
1331                 case T_char :
1332                         switch (rightId){
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()) ;}
1338                 break ;
1339                 case T_byte :
1340                         switch (rightId){
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()) ;}
1346                 break;
1347                 case T_short :
1348                         switch (rightId){
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()) ;}
1354                 break;
1355                 case T_int :
1356                         switch (rightId){
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()) ;}
1362                 break;
1363                 case T_long :
1364                         switch (rightId){
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()) ;}
1370
1371                 }
1372         
1373
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 . 
1377         
1378         switch (leftId){
1379                 case T_boolean :                return Constant.fromValue(left.booleanValue() ^ right.booleanValue()) ;
1380                 case T_char :
1381                         switch (rightId){
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()) ;}
1387                 break ;
1388                 case T_byte :
1389                         switch (rightId){
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()) ;}
1395                 break;
1396                 case T_short :
1397                         switch (rightId){
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()) ;}
1403                 break;
1404                 case T_int :
1405                         switch (rightId){
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()) ;}
1411                 break;
1412                 case T_long :
1413                         switch (rightId){
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()) ;}
1419
1420                 }
1421         
1422
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$
1426 }
1427 public float floatValue() {
1428         throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"float")); //$NON-NLS-2$ //$NON-NLS-1$
1429 }
1430 public static Constant fromValue(byte value) {
1431         return new ByteConstant(value);
1432 }
1433 public static Constant fromValue(char value) {
1434         return new CharConstant(value);
1435 }
1436 public static Constant fromValue(double value) {
1437         return new DoubleConstant(value);
1438 }
1439 public static Constant fromValue(float value) {
1440         return new FloatConstant(value);
1441 }
1442 public static Constant fromValue(int value) {
1443         return new IntConstant(value);
1444 }
1445 public static Constant fromValue(long value) {
1446         return new LongConstant(value);
1447 }
1448 public static Constant fromValue(String value) {
1449         if (value == null) return NullConstant.Default;
1450         return new StringConstant(value);
1451 }
1452 public static Constant fromValue(short value) {
1453         return new ShortConstant(value);
1454 }
1455 public static Constant fromValue(boolean value) {
1456         return new BooleanConstant(value);
1457 }
1458 public int intValue() {
1459         throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"int")); //$NON-NLS-2$ //$NON-NLS-1$
1460 }
1461 public long longValue() {
1462         throw new ShouldNotImplement(Util.bind("constant.cannotCastedInto",typeName(),"long")); //$NON-NLS-2$ //$NON-NLS-1$
1463 }
1464 public short shortValue() {
1465         throw new ShouldNotImplement(Util.bind("constant.cannotConvertedTo",typeName(),"short")); //$NON-NLS-2$ //$NON-NLS-1$
1466 }
1467 /** Deprecated
1468 */
1469 public String stringValue() {
1470         throw new ShouldNotImplement(Util.bind("constant.cannotConvertedTo",typeName(),"String")); //$NON-NLS-1$ //$NON-NLS-2$
1471 }
1472 public String toString(){
1473
1474         if (this == NotAConstant) return "(Constant) NotAConstant" ; //$NON-NLS-1$
1475         return super.toString(); }
1476 public abstract int typeID();
1477 public String typeName() {
1478         switch (typeID()) {
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$
1490         }
1491 }
1492 }