-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSkelshl.hs
112 lines (81 loc) · 2.41 KB
/
Skelshl.hs
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
module Skelshl where
-- Haskell module generated by the BNF converter
import Absshl
import ErrM
type Result = Err String
failure :: Show a => a -> Result
failure x = Bad $ "Undefined case: " ++ show x
transIdent :: Ident -> Result
transIdent x = case x of
Ident str -> failure x
transProg :: Prog -> Result
transProg x = case x of
Program blk -> failure x
transBlk :: Blk -> Result
transBlk x = case x of
Block decs stms -> failure x
transStm :: Stm -> Result
transStm x = case x of
ForLoop id exp blk -> failure x
IfStmt exp blk -> failure x
IfElseStmt exp blk1 blk2 -> failure x
ReturnStmt exp -> failure x
PrintStmt exp -> failure x
ExpStmt exp -> failure x
AssignMultiple assms exps -> failure x
transAssM :: AssM -> Result
transAssM x = case x of
AssignVar id -> failure x
AssignArr id exp -> failure x
transAssE :: AssE -> Result
transAssE x = case x of
AssignExp exp -> failure x
transDec :: Dec -> Result
transDec x = case x of
Declaration typ id -> failure x
DeclarationAssing typ id exp -> failure x
DeclarationFunc typ id fargs blk -> failure x
DeclarationArray typ id exp -> failure x
transFArg :: FArg -> Result
transFArg x = case x of
FArgument typ id -> failure x
FArgumentAssing typ id exp -> failure x
FArgumentFunc typ id fargs -> failure x
FArgumentRef typ id -> failure x
FArgumentArr typ id -> failure x
transTyp :: Typ -> Result
transTyp x = case x of
TInt -> failure x
TBool -> failure x
TString -> failure x
transExp :: Exp -> Result
transExp x = case x of
Eeq exp1 exp2 -> failure x
Eneq exp1 exp2 -> failure x
Elthen exp1 exp2 -> failure x
Egrthen exp1 exp2 -> failure x
Ele exp1 exp2 -> failure x
Ege exp1 exp2 -> failure x
Eplus exp1 exp2 -> failure x
Eminus exp1 exp2 -> failure x
Etimes exp1 exp2 -> failure x
Ediv exp1 exp2 -> failure x
Einc id -> failure x
Edec id -> failure x
Einvok id iparams -> failure x
Evar id -> failure x
Econst constraint -> failure x
Elmb fargs exp -> failure x
Earr id exp -> failure x
transConstraint :: Constraint -> Result
transConstraint x = case x of
Eint n -> failure x
Ebool boolt -> failure x
Estring str -> failure x
transBoolT :: BoolT -> Result
transBoolT x = case x of
Constraint_True -> failure x
Constraint_False -> failure x
transIParam :: IParam -> Result
transIParam x = case x of
InvokeParamater exp -> failure x