diff options
author | NAME <USER@epfl.ch> | 2004-01-30 13:07:45 +0000 |
---|---|---|
committer | NAME <USER@epfl.ch> | 2004-01-30 13:07:45 +0000 |
commit | bec9884b00d60a79671e51a5a65b1717f753f981 (patch) | |
tree | 0a8d4bfa78fbe173ddaf6a8fa8f1e34902f8ee84 /sources/scalac/atree | |
parent | 0bc48e99d91c250590e6ec1ed376aec348df5cb4 (diff) | |
download | scala-bec9884b00d60a79671e51a5a65b1717f753f981.tar.gz scala-bec9884b00d60a79671e51a5a65b1717f753f981.tar.bz2 scala-bec9884b00d60a79671e51a5a65b1717f753f981.zip |
Added intermediate code and corresponding jvm b...
Added intermediate code and corresponding jvm backend
Diffstat (limited to 'sources/scalac/atree')
-rw-r--r-- | sources/scalac/atree/AMethod.java | 5 | ||||
-rw-r--r-- | sources/scalac/atree/AShiftOp.java | 14 | ||||
-rw-r--r-- | sources/scalac/atree/ATreeTyper.java | 32 |
3 files changed, 43 insertions, 8 deletions
diff --git a/sources/scalac/atree/AMethod.java b/sources/scalac/atree/AMethod.java index 332f2284d4..f904fa6b92 100644 --- a/sources/scalac/atree/AMethod.java +++ b/sources/scalac/atree/AMethod.java @@ -13,6 +13,11 @@ import scalac.symtab.Type; /** This class represents an attributed method. */ public class AMethod extends AMember { + //######################################################################## + // Public Fields + + /** Contains the Intermediate code of this Method */ + public Object icode = null; //######################################################################## // Public Constructors diff --git a/sources/scalac/atree/AShiftOp.java b/sources/scalac/atree/AShiftOp.java index 102f7963bd..fbed80fcde 100644 --- a/sources/scalac/atree/AShiftOp.java +++ b/sources/scalac/atree/AShiftOp.java @@ -16,24 +16,24 @@ 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 left */ + public case ASL; /** An arithmetic shift to the right */ public case ASR; + /** A logical shift to the right */ + public case LSR; + //######################################################################## // Public Methods /** Returns a string representation of this operation. */ public String toString() { switch (this) { - case LSL: return "LSL"; - case LSR: return "LSR"; + case ASL: return "ASL"; case ASR: return "ASR"; + case LSR: return "LSR"; default: throw Debug.abort("unknown case", this); } } diff --git a/sources/scalac/atree/ATreeTyper.java b/sources/scalac/atree/ATreeTyper.java index 3a1a1df5c7..dead4e7c40 100644 --- a/sources/scalac/atree/ATreeTyper.java +++ b/sources/scalac/atree/ATreeTyper.java @@ -217,6 +217,36 @@ public class ATreeTyper { } //######################################################################## + // Public Methods - aliases of type() for scala + public Type[] computeType(ACode[] codes) { + return type(codes); + } + + public Type computeType(ACode code) { + return type(code); + } + + public Type computeType(ALocation location) { + return type(location); + } + + public Type computeType(AFunction function) { + return type(function); + } + + public Type computeType(APrimitive primitive) { + return type(primitive); + } + + public Type computeType(AConstant constant) { + return type(constant); + } + + public Type computeType(ATypeKind kind) { + return type(kind); + } + + //######################################################################## // Private Methods /** Returns the application of given arguments to given type. */ @@ -231,7 +261,7 @@ public class ATreeTyper { } /** Returns the element type of the given array type. */ - private Type getArrayElementType(Type type) { + public Type getArrayElementType(Type type) { // !!! public / private switch (type) { case TypeRef(_, Symbol symbol, Type[] args): assert symbol == definitions.ARRAY_CLASS && args.length == 1: type; |