-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSkelRnb.hs
219 lines (214 loc) · 6.39 KB
/
SkelRnb.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
module SkelRnb where
-- Haskell module generated by the BNF converter
import AbsRnb
import ErrM
type Result = Err String
failure :: Show a => a -> Result
failure x = Bad $ "Undefined case: " ++ show x
transBTry :: BTry -> Result
transBTry x = case x of
BTry string -> failure x
transBCatch :: BCatch -> Result
transBCatch x = case x of
BCatch string -> failure x
transBLoop :: BLoop -> Result
transBLoop x = case x of
BLoop string -> failure x
transBCase :: BCase -> Result
transBCase x = case x of
BCase string -> failure x
transBAss :: BAss -> Result
transBAss x = case x of
BAss string -> failure x
transBPlus :: BPlus -> Result
transBPlus x = case x of
BPlus string -> failure x
transBMinus :: BMinus -> Result
transBMinus x = case x of
BMinus string -> failure x
transBDiv :: BDiv -> Result
transBDiv x = case x of
BDiv string -> failure x
transBMul :: BMul -> Result
transBMul x = case x of
BMul string -> failure x
transBUpTo :: BUpTo -> Result
transBUpTo x = case x of
BUpTo string -> failure x
transBMod :: BMod -> Result
transBMod x = case x of
BMod string -> failure x
transBAnd :: BAnd -> Result
transBAnd x = case x of
BAnd string -> failure x
transBOr :: BOr -> Result
transBOr x = case x of
BOr string -> failure x
transBNot :: BNot -> Result
transBNot x = case x of
BNot string -> failure x
transBLBra :: BLBra -> Result
transBLBra x = case x of
BLBra string -> failure x
transBLe :: BLe -> Result
transBLe x = case x of
BLe string -> failure x
transBLeEq :: BLeEq -> Result
transBLeEq x = case x of
BLeEq string -> failure x
transBGr :: BGr -> Result
transBGr x = case x of
BGr string -> failure x
transBGrEq :: BGrEq -> Result
transBGrEq x = case x of
BGrEq string -> failure x
transBNotEq :: BNotEq -> Result
transBNotEq x = case x of
BNotEq string -> failure x
transBEq :: BEq -> Result
transBEq x = case x of
BEq string -> failure x
transBBool :: BBool -> Result
transBBool x = case x of
BBool string -> failure x
transBReturn :: BReturn -> Result
transBReturn x = case x of
BReturn string -> failure x
transBExit :: BExit -> Result
transBExit x = case x of
BExit string -> failure x
transBContinue :: BContinue -> Result
transBContinue x = case x of
BContinue string -> failure x
transBExitOn :: BExitOn -> Result
transBExitOn x = case x of
BExitOn string -> failure x
transBIdent :: BIdent -> Result
transBIdent x = case x of
BIdent string -> failure x
transBInteger :: BInteger -> Result
transBInteger x = case x of
BInteger string -> failure x
transBReal :: BReal -> Result
transBReal x = case x of
BReal string -> failure x
transBChar :: BChar -> Result
transBChar x = case x of
BChar string -> failure x
transBString :: BString -> Result
transBString x = case x of
BString string -> failure x
transProgram :: Program -> Result
transProgram x = case x of
Start decls -> failure x
transDecl :: Decl -> Result
transDecl x = case x of
VarDecl bident type_ -> failure x
VarDef bident type_ bass expr -> failure x
ConstDef bident type_ bass expr -> failure x
FuncDef bident1 params bident2 type_ stmts bident3 -> failure x
ProcDef bident1 params stmts bident2 -> failure x
transParam :: Param -> Result
transParam x = case x of
Parameter bident mod type_ -> failure x
transMod :: Mod -> Result
transMod x = case x of
ModRef -> failure x
ModVal -> failure x
ModConst -> failure x
ModValRes -> failure x
transExpr :: Expr -> Result
transExpr x = case x of
ExprVal val -> failure x
ExprArray blbra exprs -> failure x
ExprCreate ble type_ bgr expr -> failure x
ExprAddress leftexpr -> failure x
ExprLeft leftexpr -> failure x
ExprCall bident exprs -> failure x
ExprBrack expr -> failure x
ExprPostIncr leftexpr -> failure x
ExprPostDecr leftexpr -> failure x
ExprPow expr1 bupto expr2 -> failure x
ExprMul expr1 bmul expr2 -> failure x
ExprMod expr1 bmod expr2 -> failure x
ExprDiv expr1 bdiv expr2 -> failure x
ExprSum expr1 bplus expr2 -> failure x
ExprMinus expr1 bminus expr2 -> failure x
ExprUnaryMinus bminus expr -> failure x
ExprUnaryPlus bplus expr -> failure x
ExprAnd expr1 band expr2 -> failure x
ExprOr expr1 bor expr2 -> failure x
ExprNot bnot expr -> failure x
ExprRel expr1 rel expr2 -> failure x
ExprIf expr1 expr2 expr3 -> failure x
transRel :: Rel -> Result
transRel x = case x of
RelLess ble -> failure x
RelLessEq bleeq -> failure x
RelGreater bgr -> failure x
RelGreaterEq bgreq -> failure x
RelNotEq bnoteq -> failure x
RelEq beq -> failure x
transStmt :: Stmt -> Result
transStmt x = case x of
StmtAssign leftexpr bass expr -> failure x
StmtIf expr stmts elsestmt -> failure x
StmtLoop bloop1 stmts bloop2 -> failure x
StmtLoopCmd loopcmd -> failure x
StmtFor bident btype bass expr1 dir expr2 stmts -> failure x
StmtReturn breturn -> failure x
StmtCase bcase1 expr cases bcase2 -> failure x
StmtLocal stmts -> failure x
StmtDecl decl -> failure x
StmtExpr expr -> failure x
StmtTryCatch btry stmts1 bcatch1 stmts2 bcatch2 -> failure x
transElseStmt :: ElseStmt -> Result
transElseStmt x = case x of
StmtElseIf expr stmts elsestmt -> failure x
StmtElse stmts -> failure x
StmtNoElse -> failure x
transDir :: Dir -> Result
transDir x = case x of
FromTo -> failure x
DownTo -> failure x
transLoopCmd :: LoopCmd -> Result
transLoopCmd x = case x of
LoopExitOn bexiton expr -> failure x
LoopExit bexit -> failure x
LoopContinue bcontinue -> failure x
transCases :: Cases -> Result
transCases x = case x of
CaseEps -> failure x
CaseDefault stmts -> failure x
CaseVal expr stmts cases -> failure x
transLeftExpr :: LeftExpr -> Result
transLeftExpr x = case x of
LEId bident -> failure x
LEArray leftexpr dim -> failure x
LEBra leftexpr -> failure x
LEDeref leftexpr -> failure x
LEPreIncrem leftexpr -> failure x
LEPreDecr leftexpr -> failure x
transDim :: Dim -> Result
transDim x = case x of
DimArray blbra expr -> failure x
transVal :: Val -> Result
transVal x = case x of
IntVal binteger -> failure x
RealVal breal -> failure x
CharVal bchar -> failure x
BoolVal bbool -> failure x
StringVal bstring -> failure x
transType :: Type -> Result
transType x = case x of
BasicType btype -> failure x
ArrayType ble type_ bgr -> failure x
ArrayDimType ble type_ bgr expr -> failure x
PointerType type_ -> failure x
transBType :: BType -> Result
transBType x = case x of
TypeInt -> failure x
TypeReal -> failure x
TypeChar -> failure x
TypeBool -> failure x
TypeString -> failure x