-
Notifications
You must be signed in to change notification settings - Fork 4
/
declarations.mpl
365 lines (292 loc) · 7.74 KB
/
declarations.mpl
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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# Copyright (C) 2021 Matway Burkow
#
# This repository and all its contents belong to Matway Burkow (referred here and below as "the owner").
# The content is for demonstration purposes only.
# It is forbidden to use the content or any part of it for any purpose without explicit permission from the owner.
# By contributing to the repository, contributors acknowledge that ownership of their work transfers to the owner.
"String" use
"control" use
"Block" use
"MplFile" use
"NameManager" use
"Var" use
"astNodeType" use
"processor" use
{
processor: Processor Ref;
block: Block Cref;
message: StringView Cref;
} () {} "compilerErrorImpl" importFunction
compilerError: [processor: block:;; makeStringView block @processor compilerErrorImpl];
{
processor: Processor Ref;
signature: CFunctionSignature Cref;
astArrayIndex: Int32;
nodeCase: NodeCaseCode;
parentIndex: 0;
functionName: StringView Cref;
} 0 {} "astNodeToCodeNode" importFunction
{
processor: Processor Ref;
refToVar: RefToVar Cref;
} () {} "createDtorForGlobalVar" importFunction
{
block: Block Ref;
processor: Processor Ref;
name: StringView Cref;
nodeCase: NodeCaseCode;
astArrayIndex: Int32;
} () {} "processCallByIndexArray" importFunction
{
block: Block Ref;
processor: Processor Ref;
index: Int32;
} () {} "callBuiltin" importFunction
{
block: Block Ref;
processor: Processor Ref;
refToVar: RefToVar Cref;
} () {} "processFuncPtr" importFunction
{
block: Block Ref;
processor: Processor Ref;
astArrayIndex: Int32;
} Cond {} "processPre" importFunction
{
block: Block Ref;
processor: Processor Ref;
name: StringView Cref;
astArrayIndex: Int32;
} () {} "processCall" importFunction
{
block: Block Ref;
processor: Processor Ref;
} () {} "defaultCall" importFunction
{
block: Block Ref;
processor: Processor Ref;
asCodeRef: Cond;
name: StringView Cref;
signature: CFunctionSignature Cref;
} Int32 {} "processImportFunction" importFunction
{
block: Block Ref;
processor: Processor Ref;
asLambda: Cond;
name: StringView Cref;
astArrayIndex: Int32;
signature: CFunctionSignature Cref;
} Int32 {} "processExportFunction" importFunction
{
processor: Processor Cref;
makeMessage: Cond;
comparingMessage: String Ref;
checkConstness: Cond;
forMatching: Cond;
cacheEntry: RefToVar Cref;
stackEntry: RefToVar Cref;
} Cond {} "compareOnePair" importFunction
{
block: Block Cref;
processor: Processor Ref;
refToVar: RefToVar Ref;
} () {} "makeVariableType" importFunction
{
block: Block Ref;
processor: Processor Ref;
forMatching: Cond;
result: RefToVar Ref;
} () {} "popWith" importFunction
{
block: Block Ref;
entry: RefToVar Cref;
} () {} "push" importFunction
{
block: Block Ref;
processor: Processor Ref;
dynamicStoraged: Cond;
reason: Int32;
refToVar: RefToVar Cref;
result: RefToVar Ref;
} () {} "makeShadowsWith" importFunction
makeShadows: [
processor: block:;;
FALSE @processor @block makeShadowsWith
];
makeShadowsDynamic: [
processor: block:;;
TRUE @processor @block makeShadowsWith
];
{
block: Block Cref;
processor: Processor Ref;
refToVar: RefToVar Cref;
} Int32 {} "generateDebugTypeId" importFunction
{
block: Block Cref;
processor: Processor Ref;
refToVar: RefToVar Cref;
} Int32 {} "generateIrTypeId" importFunction
{
block: Block Cref;
processor: Processor Cref;
resultMPL: String Ref;
refToVar: RefToVar Cref;
} () {} "getMplTypeImpl" importFunction
getMplType: [
processor: block: ;;
result: String;
@result @processor block getMplTypeImpl
@result
];
{
block: Block Cref;
processor: Processor Cref;
} () {} "defaultPrintStack" importFunction
{
block: Block Cref;
processor: Processor Cref;
} () {} "defaultPrintStackTrace" importFunction
{
block: Block Ref;
processor: Processor Ref;
createOperation: Cond;
mutable: Cond;
refToVar: RefToVar Cref;
result: RefToVar Ref;
} () {} "createRefWithImpl" importFunction
createRefWith: [
refToVar: mutable: createOperation: processor: block: ;;;;;
result: RefToVar;
@result refToVar mutable createOperation @processor @block createRefWithImpl
@result
];
{
block: Block Ref;
processor: Processor Ref;
refToVar: RefToVar Cref;
} () {} "callInit" importFunction
{
block: Block Ref;
processor: Processor Ref;
refToDst: RefToVar Cref;
refToSrc: RefToVar Cref;
} () {} "callAssign" importFunction
{
block: Block Ref;
processor: Processor Ref;
refToVar: RefToVar Cref;
} () {} "callDie" importFunction
{
block: Block Ref;
processor: Processor Ref;
refToDst: RefToVar Cref;
refToSrc: RefToVar Cref;
} () {} "setVar" importFunction
TryImplicitLambdaCastResult: [{
success: FALSE dynamic;
refToVar: RefToVar;
}];
{
block: Block Ref;
processor: Processor Ref;
refToDst: RefToVar Ref;
refToSrc: RefToVar Ref;
result: TryImplicitLambdaCastResult Ref;
} () {} "tryImplicitLambdaCastImpl" importFunction
tryImplicitLambdaCast: [
refToSrc: refToDst: processor: block: ;;;;
result: TryImplicitLambdaCastResult;
@result @refToSrc @refToDst @processor @block tryImplicitLambdaCastImpl
@result
];
CopyVarFlags: {
TO_NEW: [1n8 dynamic];
FROM_CHILD: [2n8 dynamic];
FROM_TYPE: [4n8 dynamic];
};
{
block: Block Ref;
processor: Processor Ref;
flags: Nat8;
refToVar: RefToVar Cref;
result: RefToVar Ref;
} () {} "copyVarImpl" importFunction
copyVarWith: [
refToVar: flags: processor: block: ;;;;
result: RefToVar;
@result refToVar flags @processor @block copyVarImpl
@result
];
copyVar: [processor: block:;; 0n8 @processor @block copyVarWith]; #fromchild is static arg
copyVarFromChild: [processor: block:;; CopyVarFlags.FROM_CHILD @processor @block copyVarWith];
copyVarToNew: [processor: block:;; CopyVarFlags.TO_NEW @processor @block copyVarWith];
copyVarFromType: [processor: block:;; CopyVarFlags.FROM_TYPE @processor @block copyVarWith];
{
block: Block Ref;
processor: Processor Ref;
flags: Nat8;
refToVar: RefToVar Cref;
result: RefToVar Ref;
} () {} "copyOneVarWithImpl" importFunction
copyOneVarWith: [
src: flags: processor: block: ;;;;
result: RefToVar;
@result src flags @processor @block copyOneVarWithImpl
@result
];
copyOneVar: [processor: block:;; 0n8 @processor @block copyOneVarWith];
copyOneVarFromType: [processor: block:;; CopyVarFlags.FROM_TYPE @processor @block copyOneVarWith];
{
block: Block Ref;
processor: Processor Ref;
refToDst: RefToVar Ref;
refToSrc: RefToVar Ref;
} () {} "createCopyToExists" importFunction
{
block: Block Ref;
processor: Processor Ref;
string: String Ref;
result: RefToVar Ref;
} () {} "makeVarStringImpl" importFunction
makeVarString: [
text: processor: block: ;;;
string: text toString;
result: RefToVar;
@result @string @processor @block makeVarStringImpl
@result
];
{
block: Block Ref;
processor: Processor Ref;
} () {} "addDebugLocationForLastInstruction" importFunction
{
block: Block Ref;
processor: Processor Ref;
message: String Ref;
} () {} "createFailWithMessageImpl" importFunction
createFailWithMessage: [
text: processor: block: ;;;
string: text String same [@text] [text toString] uif;
@string @processor @block createFailWithMessageImpl
];
{
nameManager: NameInfoEntry NameManager Ref;
multiParserResult: MultiParserResult Ref;
fileText: StringView Cref;
fileName: StringView Cref;
fileId: Int32;
errorMessage: String Ref;
} () {} "addToProcessImpl" importFunction
addToProcess: [
result: String;
fileId: fileName: fileText: multiParserResult: nameManager: ;;;;;
@result fileId fileName fileText @multiParserResult @nameManager addToProcessImpl
@result
];
{
processor: Processor Ref;
fileText: StringView Cref;
fileName: StringView Cref;
fromCmd: Cond;
} Int32 {} "addFileNameToProcessor" importFunction