projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2002-03-12 11:50:02 by simonmar]
[ghc-hetmet.git]
/
ghc
/
compiler
/
javaGen
/
Java.lhs
diff --git
a/ghc/compiler/javaGen/Java.lhs
b/ghc/compiler/javaGen/Java.lhs
index
ede6ac2
..
ec2c506
100644
(file)
--- a/
ghc/compiler/javaGen/Java.lhs
+++ b/
ghc/compiler/javaGen/Java.lhs
@@
-63,6
+63,7
@@
data Expr
| InstanceOf Expr Type
| Call Expr Name [Expr]
| Op Expr String Expr
| InstanceOf Expr Type
| Call Expr Name [Expr]
| Op Expr String Expr
+ | Raise TypeName [Expr]
| New Type [Expr] (Maybe [Decl]) -- anonymous innerclass
deriving (Show)
| New Type [Expr] (Maybe [Decl]) -- anonymous innerclass
deriving (Show)
@@
-80,7
+81,7
@@
data Type
= PrimType PrimType
| ArrayType Type
| Type TypeName
= PrimType PrimType
| ArrayType Type
| Type TypeName
- deriving (Show)
+ deriving (Show, Eq)
data PrimType
= PrimInt
data PrimType
= PrimInt
@@
-91,7
+92,7
@@
data PrimType
| PrimDouble
| PrimByte
| PrimVoid
| PrimDouble
| PrimByte
| PrimVoid
- deriving (Show)
+ deriving (Show, Eq)
type PackageName = String -- A package name
-- like "java.awt.Button"
type PackageName = String -- A package name
-- like "java.awt.Button"
@@
-112,18
+113,25
@@
data Name = Name String Type
-- So variables might be Int or Object.
-- ** method calls store the returned
-- So variables might be Int or Object.
-- ** method calls store the returned
- -- ** type, not a complete.
+ -- ** type, not a complete arg x result type.
--
-- Thinking:
-- ... foo1.foo2(...).foo3 ...
-- here you want to know the *result*
--
-- Thinking:
-- ... foo1.foo2(...).foo3 ...
-- here you want to know the *result*
- -- after callling foo1, then foo2,
+ -- after calling foo1, then foo2,
-- then foo3.
-- then foo3.
+instance Eq Name where
+ (Name nm _) == (Name nm' _) = nm == nm'
+
+
+instance Ord Name where
+ (Name nm _) `compare` (Name nm' _) = nm `compare` nm'
+
data Lit
= IntLit Integer -- unboxed
data Lit
= IntLit Integer -- unboxed
- | CharLit Char -- unboxed
+ | CharLit Int -- unboxed
| StringLit String -- java string
deriving Show
| StringLit String -- java string
deriving Show