diff options
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scalac/atree/AArithmeticOp.java | 50 | ||||
-rw-r--r-- | sources/scalac/atree/AComparisonOp.java | 42 | ||||
-rw-r--r-- | sources/scalac/atree/ALogicalOp.java | 42 | ||||
-rw-r--r-- | sources/scalac/atree/AShiftOp.java | 42 | ||||
-rw-r--r-- | sources/scalac/atree/ATestOp.java | 67 | ||||
-rw-r--r-- | sources/scalac/atree/ATypeKind.java | 82 |
6 files changed, 325 insertions, 0 deletions
diff --git a/sources/scalac/atree/AArithmeticOp.java b/sources/scalac/atree/AArithmeticOp.java new file mode 100644 index 0000000000..1627ca1ad9 --- /dev/null +++ b/sources/scalac/atree/AArithmeticOp.java @@ -0,0 +1,50 @@ +/* ____ ____ ____ ____ ______ *\ +** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala ** +** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL ** +** /_____/\____/\___/\____/____/ ** +\* */ + +// $Id$ + +package scalac.atree; + +import scalac.util.Debug; + +/** This class represents an arithmetic operation. */ +public class AArithmeticOp { + + //######################################################################## + // Public Cases + + /** An arithmetic addition operation */ + public case ADD; + + /** An arithmetic subtraction operation */ + public case SUB; + + /** An arithmetic multiplication operation */ + public case MUL; + + /** An arithmetic division operation */ + public case DIV; + + /** An arithmetic remainder operation */ + public case REM; + + //######################################################################## + // Public Methods + + /** Returns a string representation of this operation. */ + public String toString() { + switch (this) { + case ADD: return "ADD"; + case SUB: return "SUB"; + case MUL: return "MUL"; + case DIV: return "DIV"; + case REM: return "REM"; + default : throw Debug.abort("unknown case", this); + } + } + + //######################################################################## +} diff --git a/sources/scalac/atree/AComparisonOp.java b/sources/scalac/atree/AComparisonOp.java new file mode 100644 index 0000000000..1e7bcf1bcd --- /dev/null +++ b/sources/scalac/atree/AComparisonOp.java @@ -0,0 +1,42 @@ +/* ____ ____ ____ ____ ______ *\ +** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala ** +** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL ** +** /_____/\____/\___/\____/____/ ** +\* */ + +// $Id$ + +package scalac.atree; + +import scalac.util.Debug; + +/** This class represents a comparison operation. */ +public class AComparisonOp { + + //######################################################################## + // Public Cases + + /** A comparison operation with -1 default for NaNs */ + public case CMPL; + + /** A comparison operation with no default for NaNs */ + public case CMP; + + /** A comparison operation with +1 default for NaNs */ + public case CMPG; + + //######################################################################## + // Public Methods + + /** Returns a string representation of this operation. */ + public String toString() { + switch (this) { + case CMPL: return "CMPL"; + case CMP : return "CMP"; + case CMPG: return "CMPG"; + default : throw Debug.abort("unknown case", this); + } + } + + //######################################################################## +} diff --git a/sources/scalac/atree/ALogicalOp.java b/sources/scalac/atree/ALogicalOp.java new file mode 100644 index 0000000000..85010ae4f0 --- /dev/null +++ b/sources/scalac/atree/ALogicalOp.java @@ -0,0 +1,42 @@ +/* ____ ____ ____ ____ ______ *\ +** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala ** +** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL ** +** /_____/\____/\___/\____/____/ ** +\* */ + +// $Id$ + +package scalac.atree; + +import scalac.util.Debug; + +/** This class represents a logical operation. */ +public class ALogicalOp { + + //######################################################################## + // Public Cases + + /** A bitwise AND operation */ + public case AND; + + /** A bitwise OR operation */ + public case OR; + + /** A bitwise XOR operation */ + public case XOR; + + //######################################################################## + // Public Methods + + /** Returns a string representation of this operation. */ + public String toString() { + switch (this) { + case AND: return "AND"; + case OR : return "OR"; + case XOR: return "XOR"; + default : throw Debug.abort("unknown case", this); + } + } + + //######################################################################## +} diff --git a/sources/scalac/atree/AShiftOp.java b/sources/scalac/atree/AShiftOp.java new file mode 100644 index 0000000000..102f7963bd --- /dev/null +++ b/sources/scalac/atree/AShiftOp.java @@ -0,0 +1,42 @@ +/* ____ ____ ____ ____ ______ *\ +** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala ** +** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL ** +** /_____/\____/\___/\____/____/ ** +\* */ + +// $Id$ + +package scalac.atree; + +import scalac.util.Debug; + +/** This class represents a shift operation. */ +public class AShiftOp { + + //######################################################################## + // Public Cases + + /** A logical shift to the left */ + public case LSL; + + /** A logical shift to the right */ + public case LSR; + + /** An arithmetic shift to the right */ + public case ASR; + + //######################################################################## + // Public Methods + + /** Returns a string representation of this operation. */ + public String toString() { + switch (this) { + case LSL: return "LSL"; + case LSR: return "LSR"; + case ASR: return "ASR"; + default: throw Debug.abort("unknown case", this); + } + } + + //######################################################################## +} 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); + } + } + + //######################################################################## +} diff --git a/sources/scalac/atree/ATypeKind.java b/sources/scalac/atree/ATypeKind.java new file mode 100644 index 0000000000..57b827473d --- /dev/null +++ b/sources/scalac/atree/ATypeKind.java @@ -0,0 +1,82 @@ +/* ____ ____ ____ ____ ______ *\ +** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala ** +** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL ** +** /_____/\____/\___/\____/____/ ** +\* */ + +// $Id$ + +package scalac.atree; + +import scalac.util.Debug; + +/** This class represents a type kind. */ +public class ATypeKind { + + //######################################################################## + // Public Cases + + /** A boolean value */ + public case BOOL; + + /** A 1-byte unsigned integer */ + public case U1; + + /** A 2-byte unsigned integer */ + public case U2; + + /** A 4-byte unsigned integer */ + public case U4; + + /** An 8-byte unsigned integer */ + public case U8; + + /** A 1-byte signed integer */ + public case I1; + + /** A 2-byte signed integer */ + public case I2; + + /** A 4-byte signed integer */ + public case I4; + + /** An 8-byte signed integer */ + public case I8; + + /** A 4-byte floating point number */ + public case R4; + + /** An 8-byte floating point number */ + public case R8; + + /** An object reference */ + public case REF; + + /** A string reference */ + public case STR; + + //######################################################################## + // Public Methods + + /** Returns a string representation of this type kind. */ + public String toString() { + switch (this) { + case BOOL: return "BOOL"; + case U1 : return "U1"; + case U2 : return "U2"; + case U4 : return "U4"; + case U8 : return "U8"; + case I1 : return "I1"; + case I2 : return "I2"; + case I4 : return "I4"; + case I8 : return "I8"; + case R4 : return "R4"; + case R8 : return "R8"; + case REF : return "REF"; + case STR : return "STR"; + default : throw Debug.abort("unknown case", this); + } + } + + //######################################################################## +} |