diff options
author | paltherr <paltherr@epfl.ch> | 2003-11-05 14:32:27 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-11-05 14:32:27 +0000 |
commit | 263b33d07e7416b48228fff7fbb680e3be9468a3 (patch) | |
tree | 09abcaa50340fbd736a0e903158182a1df068681 /sources/scalac/atree/ATestOp.java | |
parent | ca1fb5b2eaffd9bd183012f8ef57c249f56e0c9a (diff) | |
download | scala-263b33d07e7416b48228fff7fbb680e3be9468a3.tar.gz scala-263b33d07e7416b48228fff7fbb680e3be9468a3.tar.bz2 scala-263b33d07e7416b48228fff7fbb680e3be9468a3.zip |
- Added atree/AArithmeticOp.java
- Added atree/AComparisonOp.java
- Added atree/ALogicalOp.java
- Added atree/AShiftOp.java
- Added atree/ATestOp.java
- Added atree/ATypeKind.java
Diffstat (limited to 'sources/scalac/atree/ATestOp.java')
-rw-r--r-- | sources/scalac/atree/ATestOp.java | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/sources/scalac/atree/ATestOp.java b/sources/scalac/atree/ATestOp.java new file mode 100644 index 0000000000..3eed9bd2c5 --- /dev/null +++ b/sources/scalac/atree/ATestOp.java @@ -0,0 +1,67 @@ +/* ____ ____ ____ ____ ______ *\ +** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala ** +** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL ** +** /_____/\____/\___/\____/____/ ** +\* */ + +// $Id$ + +package scalac.atree; + +import scalac.util.Debug; + +/** This class represents a test operation. */ +public class ATestOp { + + //######################################################################## + // Public Cases + + /** An equality test */ + public case EQ; + + /** A non-equality test */ + public case NE; + + /** A less-than test */ + public case LT; + + /** A greater-than-or-equal test */ + public case GE; + + /** A less-than-or-equal test */ + public case LE; + + /** A greater-than test */ + public case GT; + + //######################################################################## + // Public Methods + + /** Returns the negation of this operation. */ + public ATestOp negate() { + switch (this) { + case EQ: return NE; + case NE: return EQ; + case LT: return GE; + case GE: return LT; + case LE: return GT; + case GT: return LE; + default: throw Debug.abort("unknown case", this); + } + } + + /** Returns a string representation of this operation. */ + public String toString() { + switch (this) { + case EQ: return "NE"; + case NE: return "EQ"; + case LT: return "GE"; + case GE: return "LT"; + case LE: return "GT"; + case GT: return "LE"; + default: throw Debug.abort("unknown case", this); + } + } + + //######################################################################## +} |