home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VPage / Java.bin / CLASSES.ZIP / sun / tools / tree / BinaryEqualityExpression.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-07-08  |  1.8 KB  |  43 lines

  1. package sun.tools.tree;
  2.  
  3. import sun.tools.java.ClassNotFound;
  4. import sun.tools.java.Constants;
  5. import sun.tools.java.Environment;
  6. import sun.tools.java.Type;
  7.  
  8. public class BinaryEqualityExpression extends BinaryExpression {
  9.    public BinaryEqualityExpression(int var1, int var2, Expression var3, Expression var4) {
  10.       super(var1, var2, Type.tBoolean, var3, var4);
  11.    }
  12.  
  13.    void selectType(Environment var1, Context var2, int var3) {
  14.       if ((var3 & 8192) == 0) {
  15.          if ((var3 & 1792) != 0) {
  16.             try {
  17.                if (!var1.explicitCast(super.left.type, super.right.type) && !var1.explicitCast(super.right.type, super.left.type)) {
  18.                   var1.error(super.where, "incompatible.type", super.left.type, super.left.type, super.right.type);
  19.                }
  20.             } catch (ClassNotFound var6) {
  21.                var1.error(super.where, "class.not.found", var6.name, Constants.opNames[super.op]);
  22.             }
  23.          } else {
  24.             Type var4;
  25.             if ((var3 & 128) != 0) {
  26.                var4 = Type.tDouble;
  27.             } else if ((var3 & 64) != 0) {
  28.                var4 = Type.tFloat;
  29.             } else if ((var3 & 32) != 0) {
  30.                var4 = Type.tLong;
  31.             } else if ((var3 & 1) != 0) {
  32.                var4 = Type.tBoolean;
  33.             } else {
  34.                var4 = Type.tInt;
  35.             }
  36.  
  37.             super.left = ((Node)this).convert(var1, var2, var4, super.left);
  38.             super.right = ((Node)this).convert(var1, var2, var4, super.right);
  39.          }
  40.       }
  41.    }
  42. }
  43.