-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJavaAST.hs
More file actions
37 lines (33 loc) · 911 Bytes
/
JavaAST.hs
File metadata and controls
37 lines (33 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{-
Copyright (c) 2012, Caitlin Sadowski (University of California, Santa Cruz)
and Jaeheon Yi (University of California, Santa Cruz).
All Rights Reserved.
-}
module JavaAST where
{---------------- Java AST Type Definition------------}
type NumThreads = Int
type Name = String
type Value = Int
type Tid = Int
type Var = String
type Obj = Name
type Label = Name
data Type = TInt
| TLInt
| TObj Name
-- Class packagename classname
data Class = Class Name Name [Decl] [Tid] [ThreadBlock]
-- Declarations
data Decl = Decl Type Name Value
| ObjDecl Name
-- List of operations by a thread
data ThreadBlock = ThreadBlock Tid [Stmt]
data Stmt = Read Var (Maybe Value)
| Write Var (Maybe Value)
| Fork Tid
| Join Tid
| Nop
| Lock Obj [Stmt]
| Trans Label [Stmt]
| Empty
deriving Show