root / trunk / compiler / cppAst / ast / serialize / ProtoBufAstTraversal.cpp @ 11
1 |
/**
|
---|---|
2 |
*
|
3 |
* OOAS Compiler - C++ AST
|
4 |
*
|
5 |
* Copyright 2015, AIT Austrian Institute of Technology.
|
6 |
* All rights reserved.
|
7 |
*
|
8 |
* SEE THE "LICENSE" FILE FOR THE TERMS UNDER WHICH THIS FILE IS PROVIDED.
|
9 |
*
|
10 |
* If you modify the file please update the list of contributors below to in-
|
11 |
* clude your name. Please also stick to the coding convention of using TABs
|
12 |
* to do the basic (block-level) indentation and spaces for anything after
|
13 |
* that. (Enable the display of special chars and it should be pretty obvious
|
14 |
* what this means.) Also, remove all trailing whitespace.
|
15 |
*
|
16 |
* Contributors:
|
17 |
* Willibald Krenn (AIT)
|
18 |
* Stephan Zimmerer (AIT)
|
19 |
* Christoph Czurda (AIT)
|
20 |
*
|
21 |
*/
|
22 |
|
23 |
|
24 |
|
25 |
#include "ProtoBufAstTraversal.hpp" |
26 |
#include <tiresias.h> |
27 |
#include <cstdint> |
28 |
#include <iostream> |
29 |
#include <fstream> |
30 |
#include <boost/format.hpp> |
31 |
|
32 |
namespace Ast {
|
33 |
|
34 |
ProtoBufAstTraversal::ProtoBufAstTraversal (CallContext* context) : |
35 |
m_context(context) |
36 |
{} |
37 |
|
38 |
ProtoBufAstTraversal::~ProtoBufAstTraversal () {} |
39 |
|
40 |
void* ProtoBufAstTraversal::deserialize(){
|
41 |
GOOGLE_PROTOBUF_VERIFY_VERSION; |
42 |
|
43 |
// read in the serialized AST
|
44 |
serialize::PBAstTraversal traversal; |
45 |
std::fstream input(m_context->m_astLocation, std::ios::in | std::ios::binary); |
46 |
if (!traversal.ParseFromIstream(&input)) {
|
47 |
std::cerr << "Failed to parse seralized ast from " << m_context->m_astLocation << std::endl;
|
48 |
throw;
|
49 |
} |
50 |
|
51 |
return doDeserialize(traversal);
|
52 |
} |
53 |
|
54 |
|
55 |
void* ProtoBufAstTraversal::deserialize(const std::uint8_t * buffer, std::uint32_t size) { |
56 |
GOOGLE_PROTOBUF_VERIFY_VERSION; |
57 |
|
58 |
// read in the serialized AST
|
59 |
serialize::PBAstTraversal traversal; |
60 |
if (!traversal.ParseFromArray(buffer, size)) {
|
61 |
std::cerr << "Failed to parse seralized ast from memory buffer." << std::endl;
|
62 |
throw;
|
63 |
} |
64 |
|
65 |
return doDeserialize(traversal);
|
66 |
} |
67 |
|
68 |
void* ProtoBufAstTraversal::doDeserialize(serialize::PBAstTraversal & traversal) {
|
69 |
// Function calls may be passed a null reference, which has no UUID assigned.
|
70 |
// Instead it is tagged "NULL" and must be mapped to a nullptr manually.
|
71 |
m_objects[0] = (void*) nullptr; |
72 |
|
73 |
for(int i = 0; i < traversal.calls_size(); i++){ |
74 |
const serialize::PBFunctionCall& call = traversal.calls(i);
|
75 |
|
76 |
if(call.has_allocate())
|
77 |
allocate(call); |
78 |
else if (call.has_add()) |
79 |
add(call); |
80 |
else if (call.has_identifier()) |
81 |
identifier(call); |
82 |
else if (call.has_type()) |
83 |
type(call); |
84 |
else if (call.has_statement()) |
85 |
statement(call); |
86 |
else if (call.has_expression()) |
87 |
expression(call); |
88 |
} |
89 |
|
90 |
void* result = m_objects.at(traversal.main_module());
|
91 |
|
92 |
// Delete all global objects allocated by libprotobuf.
|
93 |
google::protobuf::ShutdownProtobufLibrary(); |
94 |
|
95 |
return result;
|
96 |
} |
97 |
|
98 |
|
99 |
/**
|
100 |
* Calls to allocation functions, like create identifier etc
|
101 |
* */
|
102 |
void ProtoBufAstTraversal::allocate(const serialize::PBFunctionCall& call){ |
103 |
void* object;
|
104 |
|
105 |
switch (call.allocate()) {
|
106 |
case serialize::PBAllocation::TIRESIAS_CREATE_IDENTIFIER :
|
107 |
{ |
108 |
// DLL void* TIRESIAS_CREATE_IDENTIFIER(void* context, std::int32_t ordinal, std::int32_t subOrd);
|
109 |
object = TIRESIAS_CREATE_IDENTIFIER (m_context |
110 |
, call.parameters(0).int32_value()
|
111 |
, call.parameters(1).int32_value());
|
112 |
break;
|
113 |
} |
114 |
case serialize::PBAllocation::TIRESIAS_CREATE_TYPE :
|
115 |
{ |
116 |
// DLL void* TIRESIAS_CREATE_TYPE(void* context, std::int32_t ordinal);
|
117 |
object = TIRESIAS_CREATE_TYPE (m_context, call.parameters(0).int32_value());
|
118 |
break;
|
119 |
} |
120 |
case serialize::PBAllocation::TIRESIAS_CREATE_STATEMENT :
|
121 |
{ |
122 |
// DLL void* TIRESIAS_CREATE_STATEMENT(void* context, std::int32_t ordinal);
|
123 |
object = TIRESIAS_CREATE_STATEMENT (m_context, call.parameters(0).int32_value());
|
124 |
break;
|
125 |
} |
126 |
case serialize::PBAllocation::TIRESIAS_CREATE_EXPRESSION :
|
127 |
{ |
128 |
// DLL void* TIRESIAS_CREATE_EXPRESSION(void* context, std::int32_t ordinal, std::int32_t subOrd);
|
129 |
object = TIRESIAS_CREATE_EXPRESSION (m_context |
130 |
, call.parameters(0).int32_value()
|
131 |
, call.parameters(1).int32_value());
|
132 |
break;
|
133 |
} |
134 |
case serialize::PBAllocation::TIRESIAS_CREATE_IDENTIFIERLIST :
|
135 |
{ |
136 |
object = TIRESIAS_CREATE_IDENTIFIERLIST (m_context); |
137 |
break;
|
138 |
} |
139 |
case serialize::PBAllocation::TIRESIAS_CREATE_TYPELIST :
|
140 |
{ |
141 |
object = TIRESIAS_CREATE_TYPELIST (m_context); |
142 |
break;
|
143 |
} |
144 |
case serialize::PBAllocation::TIRESIAS_CREATE_STATEMENTLIST :
|
145 |
{ |
146 |
object = TIRESIAS_CREATE_STATEMENTLIST (m_context); |
147 |
break;
|
148 |
} |
149 |
case serialize::PBAllocation::TIRESIAS_CREATE_EXPRESSIONLIST :
|
150 |
{ |
151 |
object = TIRESIAS_CREATE_EXPRESSIONLIST (m_context); |
152 |
break;
|
153 |
} |
154 |
case serialize::PBAllocation::TIRESIAS_CREATE_SYMBTAB :
|
155 |
{ |
156 |
object = TIRESIAS_CREATE_SYMBTAB (m_context); |
157 |
break;
|
158 |
} |
159 |
case serialize::PBAllocation::TIRESIAS_CREATE_PARAMLIST :
|
160 |
{ |
161 |
object = TIRESIAS_CREATE_PARAMLIST (m_context); |
162 |
break;
|
163 |
} |
164 |
case serialize::PBAllocation::TIRESIAS_CREATE_ACTIONSYSTEMINSTANCE :
|
165 |
{ |
166 |
object = TIRESIAS_CREATE_ACTIONSYSTEMINSTANCE (m_context); |
167 |
break;
|
168 |
} |
169 |
case serialize::PBAllocation::TIRESIAS_CREATE_ACTIONSYSTEMINSTANCELIST :
|
170 |
{ |
171 |
object = TIRESIAS_CREATE_ACTIONSYSTEMINSTANCELIST (m_context); |
172 |
break;
|
173 |
} |
174 |
case serialize::PBAllocation::TIRESIAS_CAST_ASTELEMENT_TO_ISCOPE :
|
175 |
{ |
176 |
// DLL void* TIRESIAS_CAST_ASTELEMENT_TO_ISCOPE(void* context, void* astelement);
|
177 |
object = TIRESIAS_CAST_ASTELEMENT_TO_ISCOPE(m_context |
178 |
, m_objects.at(call.parameters(0).uint64_value()));
|
179 |
break;
|
180 |
} |
181 |
default:
|
182 |
m_context->logError("Unknown value for enum PBAllocation.");
|
183 |
abort(); |
184 |
} |
185 |
|
186 |
std::uint64_t id = call.return_value().return_id(); |
187 |
m_objects[id] = object; |
188 |
} |
189 |
|
190 |
/**
|
191 |
* Calls to functions that add objects to containers, like add identifier to symboltable etc.
|
192 |
* */
|
193 |
void ProtoBufAstTraversal::add(const serialize::PBFunctionCall& call){ |
194 |
switch (call.add()) {
|
195 |
case serialize::PBAdd::TIRESIAS_ADD_IDENTIFIERTOLIST :
|
196 |
{ |
197 |
// DLL bool TIRESIAS_ADD_IDENTIFIERTOLIST(void* context, void* idList, void* idRef);
|
198 |
TIRESIAS_ADD_IDENTIFIERTOLIST (m_context |
199 |
, m_objects.at(call.parameters(0).uint64_value())
|
200 |
, m_objects.at(call.parameters(1).uint64_value()));
|
201 |
break;
|
202 |
} |
203 |
case serialize::PBAdd::TIRESIAS_ADD_TYPETOLIST :
|
204 |
{ |
205 |
// DLL bool TIRESIAS_ADD_TYPETOLIST(void* context, void* typeList, void* type);
|
206 |
TIRESIAS_ADD_TYPETOLIST (m_context |
207 |
, m_objects.at(call.parameters(0).uint64_value())
|
208 |
, m_objects.at(call.parameters(1).uint64_value()));
|
209 |
break;
|
210 |
} |
211 |
case serialize::PBAdd::TIRESIAS_ADD_STATEMENTTOLIST :
|
212 |
{ |
213 |
// DLL bool TIRESIAS_ADD_STATEMENTTOLIST(void* context, void* stmtList, void* stmntRef);
|
214 |
TIRESIAS_ADD_STATEMENTTOLIST (m_context |
215 |
, m_objects.at(call.parameters(0).uint64_value())
|
216 |
, m_objects.at(call.parameters(1).uint64_value()));
|
217 |
break;
|
218 |
} |
219 |
case serialize::PBAdd::TIRESIAS_ADD_EXPRESSIONTOLIST :
|
220 |
{ |
221 |
// DLL bool TIRESIAS_ADD_EXPRESSIONTOLIST(void* context, void* exprList, void* exprRef);
|
222 |
TIRESIAS_ADD_EXPRESSIONTOLIST (m_context |
223 |
, m_objects.at(call.parameters(0).uint64_value())
|
224 |
, m_objects.at(call.parameters(1).uint64_value()));
|
225 |
break;
|
226 |
} |
227 |
case serialize::PBAdd::TIRESIAS_ADD_IDTOSYMBTAB :
|
228 |
{ |
229 |
// DLL bool TIRESIAS_ADD_IDTOSYMBTAB(void* context, void* symbolTable, void* identifier);
|
230 |
TIRESIAS_ADD_IDTOSYMBTAB (m_context |
231 |
, m_objects.at(call.parameters(0).uint64_value())
|
232 |
, m_objects.at(call.parameters(1).uint64_value()));
|
233 |
break;
|
234 |
} |
235 |
case serialize::PBAdd::TIRESIAS_ADD_PARAMTOLIST :
|
236 |
{ |
237 |
// DLL bool TIRESIAS_ADD_PARAMTOLIST(void* context, void* parameterList, void* par);
|
238 |
TIRESIAS_ADD_PARAMTOLIST (m_context |
239 |
, m_objects.at(call.parameters(0).uint64_value())
|
240 |
, m_objects.at(call.parameters(1).uint64_value()));
|
241 |
break;
|
242 |
} |
243 |
case serialize::PBAdd::TIRESIAS_ADD_ACTIONSYSTEMINSTANCETOLIST :
|
244 |
{ |
245 |
// DLL bool TIRESIAS_ADD_ACTIONSYSTEMINSTANCETOLIST(void* context, void* objectsList, void* instanceRef);
|
246 |
TIRESIAS_ADD_ACTIONSYSTEMINSTANCETOLIST (m_context |
247 |
, m_objects.at(call.parameters(0).uint64_value())
|
248 |
, m_objects.at(call.parameters(1).uint64_value()));
|
249 |
break;
|
250 |
} |
251 |
case serialize::PBAdd::TIRESIAS_ADD_IDENTIFIERTOBLOCK :
|
252 |
{ |
253 |
// DLL bool TIRESIAS_ADD_IDENTIFIERTOBLOCK(void* context, void* idList, void* idRef);
|
254 |
TIRESIAS_ADD_IDENTIFIERTOBLOCK (m_context |
255 |
, m_objects.at(call.parameters(0).uint64_value())
|
256 |
, m_objects.at(call.parameters(1).uint64_value()));
|
257 |
break;
|
258 |
} |
259 |
default:
|
260 |
m_context->logError("Unknown value for enum PBAdd.");
|
261 |
abort(); |
262 |
} |
263 |
} |
264 |
|
265 |
/**
|
266 |
* Calls to functions that initialize the various subtypes of Identifier.
|
267 |
* */
|
268 |
void ProtoBufAstTraversal::identifier(const serialize::PBFunctionCall& call){ |
269 |
bool ok = true; |
270 |
switch (call.identifier()) {
|
271 |
case serialize::PBIdentifiers::TIRESIAS_INIT_ENUMIDENTIFIER :
|
272 |
{ |
273 |
// DLL bool TIRESIAS_INIT_ENUMIDENTIFIER(void* context,
|
274 |
// void* enumId, std::int32_t line, std::int32_t col, const char* text,
|
275 |
// void* scopeRef, void* typeRef, bool haveValue, std::int32_t value);
|
276 |
ok = TIRESIAS_INIT_ENUMIDENTIFIER (m_context |
277 |
, m_objects.at(call.parameters(0).uint64_value())
|
278 |
, call.parameters(1).int32_value()
|
279 |
, call.parameters(2).int32_value()
|
280 |
, call.parameters(3).literal_value().c_str()
|
281 |
, m_objects.at(call.parameters(4).uint64_value())
|
282 |
, m_objects.at(call.parameters(5).uint64_value())
|
283 |
, call.parameters(6).bool_value()
|
284 |
, call.parameters(7).int32_value());
|
285 |
break;
|
286 |
} |
287 |
case serialize::PBIdentifiers::TIRESIAS_INIT_CONSTIDENTIFIER :
|
288 |
{ |
289 |
// DLL bool TIRESIAS_INIT_CONSTIDENTIFIER(void* context,
|
290 |
// void* constId, std::int32_t line, std::int32_t col, const char* text,
|
291 |
// void* scopeRef, void* typeRef, void* valueRef);
|
292 |
ok = TIRESIAS_INIT_CONSTIDENTIFIER (m_context |
293 |
, m_objects.at(call.parameters(0).uint64_value())
|
294 |
, call.parameters(1).int32_value()
|
295 |
, call.parameters(2).int32_value()
|
296 |
, call.parameters(3).literal_value().c_str()
|
297 |
, m_objects.at(call.parameters(4).uint64_value())
|
298 |
, m_objects.at(call.parameters(5).uint64_value())
|
299 |
, m_objects.at(call.parameters(6).uint64_value()));
|
300 |
break;
|
301 |
} |
302 |
case serialize::PBIdentifiers::TIRESIAS_INIT_ATTRIDENTIFIER :
|
303 |
{ |
304 |
// DLL bool TIRESIAS_INIT_ATTRIDENTIFIER(void* context,
|
305 |
// void* attrId, std::int32_t line, std::int32_t col, const char* text,
|
306 |
// void* scopeRef, void* typeRef, void* initRef,
|
307 |
// bool isStatic, bool isControllable, bool isObservable);
|
308 |
ok = TIRESIAS_INIT_ATTRIDENTIFIER (m_context |
309 |
, m_objects.at(call.parameters(0).uint64_value())
|
310 |
, call.parameters(1).int32_value()
|
311 |
, call.parameters(2).int32_value()
|
312 |
, call.parameters(3).literal_value().c_str()
|
313 |
, m_objects.at(call.parameters(4).uint64_value())
|
314 |
, m_objects.at(call.parameters(5).uint64_value())
|
315 |
, m_objects.at(call.parameters(6).uint64_value())
|
316 |
, call.parameters(7).bool_value()
|
317 |
, call.parameters(8).bool_value()
|
318 |
, call.parameters(9).bool_value());
|
319 |
break;
|
320 |
} |
321 |
case serialize::PBIdentifiers::TIRESIAS_INIT_EXPRVARIDENTIFIER :
|
322 |
{ |
323 |
// DLL bool TIRESIAS_INIT_EXPRVARIDENTIFIER(void* context,
|
324 |
// void* exprVarId, std::int32_t line, std::int32_t col, const char* text,
|
325 |
// void* scopeRef, void* typeRef, bool initialized);
|
326 |
ok = TIRESIAS_INIT_EXPRVARIDENTIFIER (m_context |
327 |
, m_objects.at(call.parameters(0).uint64_value())
|
328 |
, call.parameters(1).int32_value()
|
329 |
, call.parameters(2).int32_value()
|
330 |
, call.parameters(3).literal_value().c_str()
|
331 |
, m_objects.at(call.parameters(4).uint64_value())
|
332 |
, m_objects.at(call.parameters(5).uint64_value())
|
333 |
, call.parameters(6).bool_value());
|
334 |
break;
|
335 |
} |
336 |
case serialize::PBIdentifiers::TIRESIAS_INIT_PARAMIDENTIFIER :
|
337 |
{ |
338 |
// DLL bool TIRESIAS_INIT_PARAMIDENTIFIER(void* context,
|
339 |
// void* paramId, std::int32_t line, std::int32_t column, const char* text,
|
340 |
// void* scopeRef, void* typeRef);
|
341 |
ok = TIRESIAS_INIT_PARAMIDENTIFIER (m_context |
342 |
, m_objects.at(call.parameters(0).uint64_value())
|
343 |
, call.parameters(1).int32_value()
|
344 |
, call.parameters(2).int32_value()
|
345 |
, call.parameters(3).literal_value().c_str()
|
346 |
, m_objects.at(call.parameters(4).uint64_value())
|
347 |
, m_objects.at(call.parameters(5).uint64_value()));
|
348 |
break;
|
349 |
} |
350 |
case serialize::PBIdentifiers::TIRESIAS_INIT_LOCVARIDENTIFIER :
|
351 |
{ |
352 |
// DLL bool TIRESIAS_INIT_LOCVARIDENTIFIER(void* context,
|
353 |
// void* locVarId, std::int32_t line, std::int32_t column, const char* text,
|
354 |
// void* scopeRef, void* typeRef);
|
355 |
ok = TIRESIAS_INIT_LOCVARIDENTIFIER (m_context |
356 |
, m_objects.at(call.parameters(0).uint64_value())
|
357 |
, call.parameters(1).int32_value()
|
358 |
, call.parameters(2).int32_value()
|
359 |
, call.parameters(3).literal_value().c_str()
|
360 |
, m_objects.at(call.parameters(4).uint64_value())
|
361 |
, m_objects.at(call.parameters(5).uint64_value()));
|
362 |
break;
|
363 |
} |
364 |
case serialize::PBIdentifiers::TIRESIAS_INIT_TYPEIDENTIFIER :
|
365 |
{ |
366 |
// DLL bool TIRESIAS_INIT_TYPEIDENTIFIER(void* context,
|
367 |
// void* typeId, std::int32_t line, std::int32_t column, const char* text,
|
368 |
// void* scopeRef, void* typeRef, const char* prefix);
|
369 |
ok = TIRESIAS_INIT_TYPEIDENTIFIER (m_context |
370 |
, m_objects.at(call.parameters(0).uint64_value())
|
371 |
, call.parameters(1).int32_value()
|
372 |
, call.parameters(2).int32_value()
|
373 |
, call.parameters(3).literal_value().c_str()
|
374 |
, m_objects.at(call.parameters(4).uint64_value())
|
375 |
, m_objects.at(call.parameters(5).uint64_value())
|
376 |
, call.parameters(6).literal_value().c_str());
|
377 |
break;
|
378 |
} |
379 |
case serialize::PBIdentifiers::TIRESIAS_INIT_SELFIDENTIFIER :
|
380 |
{ |
381 |
// DLL bool TIRESIAS_INIT_SELFIDENTIFIER(void* context,
|
382 |
// void* typeId, std::int32_t line, std::int32_t column, const char* text,
|
383 |
// void* scopeRef, void* typeRef, const char* prefix);
|
384 |
ok = TIRESIAS_INIT_SELFIDENTIFIER (m_context |
385 |
, m_objects.at(call.parameters(0).uint64_value())
|
386 |
, call.parameters(1).int32_value()
|
387 |
, call.parameters(2).int32_value()
|
388 |
, call.parameters(3).literal_value().c_str()
|
389 |
, m_objects.at(call.parameters(4).uint64_value())
|
390 |
, m_objects.at(call.parameters(5).uint64_value())
|
391 |
, call.parameters(6).literal_value().c_str());
|
392 |
break;
|
393 |
} |
394 |
case serialize::PBIdentifiers::TIRESIAS_INIT_METHODIDENTIFIER :
|
395 |
{ |
396 |
// DLL bool TIRESIAS_INIT_METHODIDENTIFIER(void* context,
|
397 |
// void* methodId, std::int32_t line, std::int32_t column, const char* text,
|
398 |
// void* scopeRef, void* typeRef, const char* prefix, void* parameterListRef,
|
399 |
// void* symbolTableRef, void* bodyRef);
|
400 |
ok = TIRESIAS_INIT_METHODIDENTIFIER (m_context |
401 |
, m_objects.at(call.parameters(0).uint64_value())
|
402 |
, call.parameters(1).int32_value()
|
403 |
, call.parameters(2).int32_value()
|
404 |
, call.parameters(3).literal_value().c_str()
|
405 |
, m_objects.at(call.parameters(4).uint64_value())
|
406 |
, m_objects.at(call.parameters(5).uint64_value())
|
407 |
, call.parameters(6).literal_value().c_str()
|
408 |
, m_objects.at(call.parameters(7).uint64_value())
|
409 |
, m_objects.at(call.parameters(8).uint64_value())
|
410 |
, m_objects.at(call.parameters(9).uint64_value()));
|
411 |
break;
|
412 |
} |
413 |
case serialize::PBIdentifiers::TIRESIAS_INIT_MODULE :
|
414 |
{ |
415 |
// DLL bool TIRESIAS_INIT_MODULE(void* context, void* moduleId,
|
416 |
// int line, int column, const char* text, void* scopeRef,
|
417 |
// void* typeRef, const char* prefix, void* symTabRef);
|
418 |
ok = TIRESIAS_INIT_MODULE (m_context |
419 |
, m_objects.at(call.parameters(0).uint64_value())
|
420 |
, call.parameters(1).int32_value()
|
421 |
, call.parameters(2).int32_value()
|
422 |
, call.parameters(3).literal_value().c_str()
|
423 |
, m_objects.at(call.parameters(4).uint64_value())
|
424 |
, m_objects.at(call.parameters(5).uint64_value())
|
425 |
, call.parameters(6).literal_value().c_str()
|
426 |
, m_objects.at(call.parameters(7).uint64_value()));
|
427 |
break;
|
428 |
} |
429 |
case serialize::PBIdentifiers::TIRESIAS_INIT_MAINMODULE :
|
430 |
{ |
431 |
// DLL bool TIRESIAS_INIT_MAINMODULE(void* context,
|
432 |
// void* moduleId, int line, int column, const char* text,
|
433 |
// void* scopeRef, void* typeRef, const char* prefix,
|
434 |
// void* symTabRef, void* identifierListRef);
|
435 |
ok = TIRESIAS_INIT_MAINMODULE (m_context |
436 |
, m_objects.at(call.parameters(0).uint64_value())
|
437 |
, call.parameters(1).int32_value()
|
438 |
, call.parameters(2).int32_value()
|
439 |
, call.parameters(3).literal_value().c_str()
|
440 |
, m_objects.at(call.parameters(4).uint64_value())
|
441 |
, m_objects.at(call.parameters(5).uint64_value())
|
442 |
, call.parameters(6).literal_value().c_str()
|
443 |
, m_objects.at(call.parameters(7).uint64_value())
|
444 |
, m_objects.at(call.parameters(8).uint64_value()));
|
445 |
break;
|
446 |
} |
447 |
default:
|
448 |
m_context->logError("Unknown value for enum PBIdentifiers.");
|
449 |
abort(); |
450 |
} |
451 |
if (!ok) {
|
452 |
m_context->logError("Error initializing identifier.");
|
453 |
abort(); |
454 |
} |
455 |
} |
456 |
|
457 |
/**
|
458 |
* Calls to functions that initialize the various subtypes of Type.
|
459 |
* */
|
460 |
void ProtoBufAstTraversal::type(const serialize::PBFunctionCall& call){ |
461 |
switch (call.type()) {
|
462 |
case serialize::PBTypes::TIRESIAS_INIT_INTTYPE :
|
463 |
{ |
464 |
// DLL bool TIRESIAS_INIT_INTTYPE(void* context, void* typeId,
|
465 |
// void* identifierRef, bool anonymousType, std::int32_t low,
|
466 |
// std::int32_t high);
|
467 |
TIRESIAS_INIT_INTTYPE (m_context |
468 |
, m_objects.at(call.parameters(0).uint64_value())
|
469 |
, m_objects.at(call.parameters(1).uint64_value())
|
470 |
, call.parameters(2).bool_value()
|
471 |
, call.parameters(3).int32_value()
|
472 |
, call.parameters(4).int32_value());
|
473 |
break;
|
474 |
} |
475 |
case serialize::PBTypes::TIRESIAS_INIT_BOOLTYPE :
|
476 |
{ |
477 |
// DLL bool TIRESIAS_INIT_BOOLTYPE(void* context, void* typeId,
|
478 |
// void* identifierRef, bool anonymousType);
|
479 |
TIRESIAS_INIT_BOOLTYPE (m_context |
480 |
, m_objects.at(call.parameters(0).uint64_value())
|
481 |
, m_objects.at(call.parameters(1).uint64_value())
|
482 |
, call.parameters(2).bool_value());
|
483 |
|
484 |
break;
|
485 |
} |
486 |
case serialize::PBTypes::TIRESIAS_INIT_VALUEDENUMTYPE :
|
487 |
{ |
488 |
// DLL bool TIRESIAS_INIT_VALUEDENUMTYPE(void* context,
|
489 |
// void* typeId, void* identifierRef,
|
490 |
// bool anonymousType, void* symTabRef, void* intTypeRef);
|
491 |
TIRESIAS_INIT_VALUEDENUMTYPE (m_context |
492 |
, m_objects.at(call.parameters(0).uint64_value())
|
493 |
, m_objects.at(call.parameters(1).uint64_value())
|
494 |
, call.parameters(2).bool_value()
|
495 |
, m_objects.at(call.parameters(3).uint64_value())
|
496 |
, m_objects.at(call.parameters(4).uint64_value()));
|
497 |
break;
|
498 |
} |
499 |
case serialize::PBTypes::TIRESIAS_INIT_ENUMTYPE :
|
500 |
{ |
501 |
// DLL bool TIRESIAS_INIT_ENUMTYPE(void* context, void* typeId,
|
502 |
// void* identifierRef, bool anonymousType,
|
503 |
// void* symTabRef);
|
504 |
TIRESIAS_INIT_ENUMTYPE (m_context |
505 |
, m_objects.at(call.parameters(0).uint64_value())
|
506 |
, m_objects.at(call.parameters(1).uint64_value())
|
507 |
, call.parameters(2).bool_value()
|
508 |
, m_objects.at(call.parameters(3).uint64_value()));
|
509 |
break;
|
510 |
} |
511 |
case serialize::PBTypes::TIRESIAS_INIT_LISTTYPE :
|
512 |
{ |
513 |
// DLL bool TIRESIAS_INIT_LISTTYPE(void* context, void* typeId,
|
514 |
// void* identifierRef, bool anonymousType,
|
515 |
// void* innerTypeRef, std::uint32_t maxNumberOfElements);
|
516 |
TIRESIAS_INIT_LISTTYPE (m_context |
517 |
, m_objects.at(call.parameters(0).uint64_value())
|
518 |
, m_objects.at(call.parameters(1).uint64_value())
|
519 |
, call.parameters(2).bool_value()
|
520 |
, m_objects.at(call.parameters(3).uint64_value())
|
521 |
, call.parameters(4).uint32_value());
|
522 |
break;
|
523 |
} |
524 |
case serialize::PBTypes::TIRESIAS_INIT_TUPLETYPE :
|
525 |
{ |
526 |
// DLL bool TIRESIAS_INIT_TUPLETYPE(void* context, void* typeId,
|
527 |
// void* identifierRef, bool anonymousType,
|
528 |
// void* typeListRef);
|
529 |
TIRESIAS_INIT_TUPLETYPE (m_context |
530 |
, m_objects.at(call.parameters(0).uint64_value())
|
531 |
, m_objects.at(call.parameters(1).uint64_value())
|
532 |
, call.parameters(2).bool_value()
|
533 |
, m_objects.at(call.parameters(3).uint64_value()));
|
534 |
break;
|
535 |
} |
536 |
case serialize::PBTypes::TIRESIAS_INIT_FUNCTIONTYPE :
|
537 |
{ |
538 |
// DLL bool TIRESIAS_INIT_FUNCTIONTYPE(void* context,
|
539 |
// void* typeId, void* identifierRef,
|
540 |
// bool anonymousType, void* paramTypeListRef,
|
541 |
// void* returnTypeRef, std::int32_t functionKind, bool isPure);
|
542 |
TIRESIAS_INIT_FUNCTIONTYPE (m_context |
543 |
, m_objects.at(call.parameters(0).uint64_value())
|
544 |
, m_objects.at(call.parameters(1).uint64_value())
|
545 |
, call.parameters(2).bool_value()
|
546 |
, m_objects.at(call.parameters(3).uint64_value())
|
547 |
, m_objects.at(call.parameters(4).uint64_value())
|
548 |
, call.parameters(5).int32_value()
|
549 |
, call.parameters(6).bool_value());
|
550 |
break;
|
551 |
} |
552 |
case serialize::PBTypes::TIRESIAS_INIT_ACTIONSYSTEMINSTANCE :
|
553 |
{ |
554 |
// DLL bool TIRESIAS_INIT_ACTIONSYSTEMINSTANCE(void* context,
|
555 |
// void* instance, void* typeRef, const char* name,
|
556 |
// std::int32_t numOfCreatedObjs, void* parentInstanceRef);
|
557 |
TIRESIAS_INIT_ACTIONSYSTEMINSTANCE (m_context |
558 |
, m_objects.at(call.parameters(0).uint64_value())
|
559 |
, m_objects.at(call.parameters(1).uint64_value())
|
560 |
, call.parameters(2).literal_value().c_str()
|
561 |
, call.parameters(3).int32_value()
|
562 |
, m_objects.at(call.parameters(4).uint64_value()));
|
563 |
break;
|
564 |
} |
565 |
case serialize::PBTypes::TIRESIAS_INIT_ACTIONSYSTEMTYPE :
|
566 |
{ |
567 |
// DLL bool TIRESIAS_INIT_ACTIONSYSTEMTYPE(void* context,
|
568 |
// void* typeId, void* identifierRef,
|
569 |
// bool anonymousType, void* baseTypeRef,
|
570 |
// void* parentScopeRef, void* doOdBlockRef,
|
571 |
// void* symTab, void* objectsListRef,
|
572 |
// void* derivedObjectsListRef, bool autoConstruction,
|
573 |
// bool isInSystemDescription);
|
574 |
TIRESIAS_INIT_ACTIONSYSTEMTYPE (m_context |
575 |
, m_objects.at(call.parameters(0).uint64_value())
|
576 |
, m_objects.at(call.parameters(1).uint64_value())
|
577 |
, call.parameters(2).bool_value()
|
578 |
, m_objects.at(call.parameters(3).uint64_value())
|
579 |
, m_objects.at(call.parameters(4).uint64_value())
|
580 |
, m_objects.at(call.parameters(5).uint64_value())
|
581 |
, m_objects.at(call.parameters(6).uint64_value())
|
582 |
, m_objects.at(call.parameters(7).uint64_value())
|
583 |
, m_objects.at(call.parameters(8).uint64_value())
|
584 |
, call.parameters(9).bool_value()
|
585 |
, call.parameters(10).bool_value());
|
586 |
break;
|
587 |
} |
588 |
case serialize::PBTypes::TIRESIAS_INIT_NULLTYPE :
|
589 |
{ |
590 |
// DLL bool TIRESIAS_INIT_NULLTYPE(void* context, void* typeId,
|
591 |
// void* identifierRef, bool anonymousType);
|
592 |
TIRESIAS_INIT_NULLTYPE (m_context |
593 |
, m_objects.at(call.parameters(0).uint64_value())
|
594 |
, m_objects.at(call.parameters(1).uint64_value())
|
595 |
, call.parameters(2).bool_value());
|
596 |
break;
|
597 |
} |
598 |
default:
|
599 |
m_context->logError("Unknown value for enum PBTypes.");
|
600 |
abort(); |
601 |
|
602 |
} |
603 |
} |
604 |
|
605 |
/**
|
606 |
* Calls to functions that initialize the various subtypes of Statement.
|
607 |
* */
|
608 |
void ProtoBufAstTraversal::statement(const serialize::PBFunctionCall& call){ |
609 |
switch (call.statement()) {
|
610 |
case serialize::PBStatements::TIRESIAS_INIT_SKIP :
|
611 |
{ |
612 |
// DLL bool TIRESIAS_INIT_SKIP(void* context, void* stmnt,
|
613 |
// std::int32_t line, std::int32_t col);
|
614 |
TIRESIAS_INIT_SKIP (m_context |
615 |
, m_objects.at(call.parameters(0).uint64_value())
|
616 |
, call.parameters(1).int32_value()
|
617 |
, call.parameters(2).int32_value());
|
618 |
break;
|
619 |
} |
620 |
case serialize::PBStatements::TIRESIAS_INIT_BREAK :
|
621 |
{ |
622 |
// DLL bool TIRESIAS_INIT_BREAK(void* context, void* stmnt,
|
623 |
// std::int32_t line, std::int32_t col);
|
624 |
TIRESIAS_INIT_BREAK (m_context |
625 |
, m_objects.at(call.parameters(0).uint64_value())
|
626 |
, call.parameters(1).int32_value()
|
627 |
, call.parameters(2).int32_value());
|
628 |
break;
|
629 |
} |
630 |
case serialize::PBStatements::TIRESIAS_INIT_ABORT :
|
631 |
{ |
632 |
// DLL bool TIRESIAS_INIT_ABORT(void* context, void* stmnt,
|
633 |
// std::int32_t line, std::int32_t col);
|
634 |
TIRESIAS_INIT_ABORT (m_context |
635 |
, m_objects.at(call.parameters(0).uint64_value())
|
636 |
, call.parameters(1).int32_value()
|
637 |
, call.parameters(2).int32_value());
|
638 |
break;
|
639 |
} |
640 |
case serialize::PBStatements::TIRESIAS_INIT_NONDETBLOCK :
|
641 |
{ |
642 |
// DLL bool TIRESIAS_INIT_NONDETBLOCK(void* context, void* block,
|
643 |
// std::int32_t line, std::int32_t col, void* symTabRef, void* stmtListRef,
|
644 |
// void* scopeRef);
|
645 |
TIRESIAS_INIT_NONDETBLOCK (m_context |
646 |
, m_objects.at(call.parameters(0).uint64_value())
|
647 |
, call.parameters(1).int32_value()
|
648 |
, call.parameters(2).int32_value()
|
649 |
, m_objects.at(call.parameters(3).uint64_value())
|
650 |
, m_objects.at(call.parameters(4).uint64_value())
|
651 |
, m_objects.at(call.parameters(5).uint64_value()));
|
652 |
break;
|
653 |
} |
654 |
case serialize::PBStatements::TIRESIAS_INIT_SEQBLOCK :
|
655 |
{ |
656 |
// DLL bool TIRESIAS_INIT_SEQBLOCK(void* context, void* block,
|
657 |
// std::int32_t line, std::int32_t col, void* symTabRef, void* stmtListRef,
|
658 |
// void* scopeRef, void* filterExprRef);
|
659 |
TIRESIAS_INIT_SEQBLOCK (m_context |
660 |
, m_objects.at(call.parameters(0).uint64_value())
|
661 |
, call.parameters(1).int32_value()
|
662 |
, call.parameters(2).int32_value()
|
663 |
, m_objects.at(call.parameters(3).uint64_value())
|
664 |
, m_objects.at(call.parameters(4).uint64_value())
|
665 |
, m_objects.at(call.parameters(5).uint64_value())
|
666 |
, m_objects.at(call.parameters(6).uint64_value()));
|
667 |
break;
|
668 |
} |
669 |
case serialize::PBStatements::TIRESIAS_INIT_PRIOBLOCK :
|
670 |
{ |
671 |
// DLL bool TIRESIAS_INIT_PRIOBLOCK(void* context, void* block,
|
672 |
// std::int32_t line, std::int32_t col, void* symTabRef, void* stmtListRef,
|
673 |
// void* scopeRef);
|
674 |
TIRESIAS_INIT_PRIOBLOCK (m_context |
675 |
, m_objects.at(call.parameters(0).uint64_value())
|
676 |
, call.parameters(1).int32_value()
|
677 |
, call.parameters(2).int32_value()
|
678 |
, m_objects.at(call.parameters(3).uint64_value())
|
679 |
, m_objects.at(call.parameters(4).uint64_value())
|
680 |
, m_objects.at(call.parameters(5).uint64_value()));
|
681 |
break;
|
682 |
} |
683 |
case serialize::PBStatements::TIRESIAS_INIT_GUARDEDCOMMAND :
|
684 |
{ |
685 |
// DLL bool TIRESIAS_INIT_GUARDEDCOMMAND(void* context,
|
686 |
// void* stmt, std::int32_t line, std::int32_t pos, void* scopeRef,
|
687 |
// void* guardExprRef, void* bodyRef);
|
688 |
TIRESIAS_INIT_GUARDEDCOMMAND (m_context |
689 |
, m_objects.at(call.parameters(0).uint64_value())
|
690 |
, call.parameters(1).int32_value()
|
691 |
, call.parameters(2).int32_value()
|
692 |
, m_objects.at(call.parameters(3).uint64_value())
|
693 |
, m_objects.at(call.parameters(4).uint64_value())
|
694 |
, m_objects.at(call.parameters(5).uint64_value()));
|
695 |
break;
|
696 |
} |
697 |
case serialize::PBStatements::TIRESIAS_INIT_ASSIGNMENT :
|
698 |
{ |
699 |
// DLL bool TIRESIAS_INIT_ASSIGNMENT(void* context, void* stmt,
|
700 |
// std::int32_t line, std::int32_t pos, void* scopeRef, void* nonDetExprRef,
|
701 |
// void* placeExprListRef, void* valueExprListRef,
|
702 |
// void* symTabRef);
|
703 |
TIRESIAS_INIT_ASSIGNMENT (m_context |
704 |
, m_objects.at(call.parameters(0).uint64_value())
|
705 |
, call.parameters(1).int32_value()
|
706 |
, call.parameters(2).int32_value()
|
707 |
, m_objects.at(call.parameters(3).uint64_value())
|
708 |
, m_objects.at(call.parameters(4).uint64_value())
|
709 |
, m_objects.at(call.parameters(5).uint64_value())
|
710 |
, m_objects.at(call.parameters(6).uint64_value())
|
711 |
, m_objects.at(call.parameters(7).uint64_value()));
|
712 |
break;
|
713 |
} |
714 |
case serialize::PBStatements::TIRESIAS_INIT_CALL :
|
715 |
{ |
716 |
// DLL bool TIRESIAS_INIT_CALL(void* context, void* stmt,
|
717 |
// std::int32_t line, std::int32_t pos, void* callExprRef);
|
718 |
TIRESIAS_INIT_CALL (m_context |
719 |
, m_objects.at(call.parameters(0).uint64_value())
|
720 |
, call.parameters(1).int32_value()
|
721 |
, call.parameters(2).int32_value()
|
722 |
, m_objects.at(call.parameters(3).uint64_value()));
|
723 |
break;
|
724 |
} |
725 |
default:
|
726 |
m_context->logError("Unknown value for enum PBStatements.");
|
727 |
abort(); |
728 |
} |
729 |
} |
730 |
|
731 |
/**
|
732 |
* Calls to functions that initialize the various subtypes of Expression.
|
733 |
* */
|
734 |
void ProtoBufAstTraversal::expression(const serialize::PBFunctionCall& call){ |
735 |
switch (call.expression()) {
|
736 |
case serialize::PBExpressions::TIRESIAS_INIT_TYPEEXPRESSION :
|
737 |
{ |
738 |
// DLL bool TIRESIAS_INIT_TYPEEXPRESSION(void* context,
|
739 |
// void* expr, std::int32_t line, std::int32_t pos, void* typeRef,
|
740 |
// void* callTargetsIdentifierListRef, void* symbTabRef);
|
741 |
TIRESIAS_INIT_TYPEEXPRESSION (m_context |
742 |
, m_objects.at(call.parameters(0).uint64_value())
|
743 |
, call.parameters(1).int32_value()
|
744 |
, call.parameters(2).int32_value()
|
745 |
, m_objects.at(call.parameters(3).uint64_value())
|
746 |
, m_objects.at(call.parameters(4).uint64_value())
|
747 |
, m_objects.at(call.parameters(5).uint64_value()));
|
748 |
break;
|
749 |
} |
750 |
case serialize::PBExpressions::TIRESIAS_INIT_IDENTIFIEREXPRESSION :
|
751 |
{ |
752 |
// DLL bool TIRESIAS_INIT_IDENTIFIEREXPRESSION(void* context,
|
753 |
// void* expr, std::int32_t line, std::int32_t pos, void* typeRef,
|
754 |
// void* callTargetsIdentifierListRef, void* symbTabRef,
|
755 |
// void* identifierRef, bool isSelf);
|
756 |
TIRESIAS_INIT_IDENTIFIEREXPRESSION (m_context |
757 |
, m_objects.at(call.parameters(0).uint64_value())
|
758 |
, call.parameters(1).int32_value()
|
759 |
, call.parameters(2).int32_value()
|
760 |
, m_objects.at(call.parameters(3).uint64_value())
|
761 |
, m_objects.at(call.parameters(4).uint64_value())
|
762 |
, m_objects.at(call.parameters(5).uint64_value())
|
763 |
, m_objects.at(call.parameters(6).uint64_value())
|
764 |
, call.parameters(7).bool_value());
|
765 |
break;
|
766 |
} |
767 |
case serialize::PBExpressions::TIRESIAS_INIT_UNARYEXPRESSION :
|
768 |
{ |
769 |
// DLL bool TIRESIAS_INIT_UNARYEXPRESSION(void* context,
|
770 |
// void* expr, std::int32_t line, std::int32_t pos, void* typeRef,
|
771 |
// void* callTargetsIdentifierListRef, void* symbTabRef,
|
772 |
// void* child);
|
773 |
TIRESIAS_INIT_UNARYEXPRESSION (m_context |
774 |
, m_objects.at(call.parameters(0).uint64_value())
|
775 |
, call.parameters(1).int32_value()
|
776 |
, call.parameters(2).int32_value()
|
777 |
, m_objects.at(call.parameters(3).uint64_value())
|
778 |
, m_objects.at(call.parameters(4).uint64_value())
|
779 |
, m_objects.at(call.parameters(5).uint64_value())
|
780 |
, m_objects.at(call.parameters(6).uint64_value()));
|
781 |
break;
|
782 |
} |
783 |
case serialize::PBExpressions::TIRESIAS_INIT_BINARYEXPRESSION :
|
784 |
{ |
785 |
// DLL bool TIRESIAS_INIT_BINARYEXPRESSION(void* context,
|
786 |
// void* expr, std::int32_t line, std::int32_t pos, void* typeRef,
|
787 |
// void* callTargetsIdentifierListRef, void* symbTabRef,
|
788 |
// void* left, void* right);
|
789 |
TIRESIAS_INIT_BINARYEXPRESSION (m_context |
790 |
, m_objects.at(call.parameters(0).uint64_value())
|
791 |
, call.parameters(1).int32_value()
|
792 |
, call.parameters(2).int32_value()
|
793 |
, m_objects.at(call.parameters(3).uint64_value())
|
794 |
, m_objects.at(call.parameters(4).uint64_value())
|
795 |
, m_objects.at(call.parameters(5).uint64_value())
|
796 |
, m_objects.at(call.parameters(6).uint64_value())
|
797 |
, m_objects.at(call.parameters(7).uint64_value()));
|
798 |
break;
|
799 |
} |
800 |
case serialize::PBExpressions::TIRESIAS_INIT_TERNARYEXPRESSION :
|
801 |
{ |
802 |
// DLL bool TIRESIAS_INIT_TERNARYEXPRESSION(void* context,
|
803 |
// void* expr, std::int32_t line, std::int32_t pos, void* typeRef,
|
804 |
// void* callTargetsIdentifierListRef, void* symbTabRef,
|
805 |
// void* left, void* mid, void* right, void* defScopeRef);
|
806 |
TIRESIAS_INIT_TERNARYEXPRESSION (m_context |
807 |
, m_objects.at(call.parameters(0).uint64_value())
|
808 |
, call.parameters(1).int32_value()
|
809 |
, call.parameters(2).int32_value()
|
810 |
, m_objects.at(call.parameters(3).uint64_value())
|
811 |
, m_objects.at(call.parameters(4).uint64_value())
|
812 |
, m_objects.at(call.parameters(5).uint64_value())
|
813 |
, m_objects.at(call.parameters(6).uint64_value())
|
814 |
, m_objects.at(call.parameters(7).uint64_value())
|
815 |
, m_objects.at(call.parameters(8).uint64_value())
|
816 |
, m_objects.at(call.parameters(9).uint64_value()));
|
817 |
break;
|
818 |
} |
819 |
case serialize::PBExpressions::TIRESIAS_INIT_INTVALUEEXPRESSION :
|
820 |
{ |
821 |
// DLL bool TIRESIAS_INIT_INTVALUEEXPRESSION(void* context,
|
822 |
// void* expr, std::int32_t line, std::int32_t pos, void* typeRef,
|
823 |
// void* callTargetsIdentifierListRef, void* symbTabRef,
|
824 |
// std::int32_t value);
|
825 |
TIRESIAS_INIT_INTVALUEEXPRESSION (m_context |
826 |
, m_objects.at(call.parameters(0).uint64_value())
|
827 |
, call.parameters(1).int32_value()
|
828 |
, call.parameters(2).int32_value()
|
829 |
, m_objects.at(call.parameters(3).uint64_value())
|
830 |
, m_objects.at(call.parameters(4).uint64_value())
|
831 |
, m_objects.at(call.parameters(5).uint64_value())
|
832 |
, call.parameters(6).int32_value());
|
833 |
break;
|
834 |
} |
835 |
case serialize::PBExpressions::TIRESIAS_INIT_BOOLVALUEEXPRESSION :
|
836 |
{ |
837 |
// DLL bool TIRESIAS_INIT_BOOLVALUEEXPRESSION(void* context,
|
838 |
// void* expr, std::int32_t line, std::int32_t pos, void* typeRef,
|
839 |
// void* callTargetsIdentifierListRef, void* symbTabRef,
|
840 |
// bool value);
|
841 |
TIRESIAS_INIT_BOOLVALUEEXPRESSION (m_context |
842 |
, m_objects.at(call.parameters(0).uint64_value())
|
843 |
, call.parameters(1).int32_value()
|
844 |
, call.parameters(2).int32_value()
|
845 |
, m_objects.at(call.parameters(3).uint64_value())
|
846 |
, m_objects.at(call.parameters(4).uint64_value())
|
847 |
, m_objects.at(call.parameters(5).uint64_value())
|
848 |
, call.parameters(6).bool_value());
|
849 |
break;
|
850 |
} |
851 |
case serialize::PBExpressions::TIRESIAS_INIT_REFVALUEEXPRESSION :
|
852 |
{ |
853 |
// DLL bool TIRESIAS_INIT_REFVALUEEXPRESSION(void* context,
|
854 |
// void* expr, std::int32_t line, std::int32_t pos, void* typeRef,
|
855 |
// void* callTargetsIdentifierListRef, void* symbTabRef,void* object);
|
856 |
TIRESIAS_INIT_REFVALUEEXPRESSION (m_context |
857 |
, m_objects.at(call.parameters(0).uint64_value())
|
858 |
, call.parameters(1).int32_value()
|
859 |
, call.parameters(2).int32_value()
|
860 |
, m_objects.at(call.parameters(3).uint64_value())
|
861 |
, m_objects.at(call.parameters(4).uint64_value())
|
862 |
, m_objects.at(call.parameters(5).uint64_value())
|
863 |
, m_objects.at(call.parameters(6).uint64_value()));
|
864 |
break;
|
865 |
} |
866 |
case serialize::PBExpressions::TIRESIAS_INIT_LISTCONSTRUCTOR :
|
867 |
{ |
868 |
// DLL bool TIRESIAS_INIT_LISTCONSTRUCTOR(void* context,
|
869 |
// void* expr, std::int32_t line, std::int32_t pos, void* typeRef,
|
870 |
// void* callTargetsIdentifierListRef, void* symbTabRef,
|
871 |
// void* exprList, void* symTab, void* parentScope,
|
872 |
// void* comprehension, bool hasComprehension);
|
873 |
TIRESIAS_INIT_LISTCONSTRUCTOR (m_context |
874 |
, m_objects.at(call.parameters(0).uint64_value())
|
875 |
, call.parameters(1).int32_value()
|
876 |
, call.parameters(2).int32_value()
|
877 |
, m_objects.at(call.parameters(3).uint64_value())
|
878 |
, m_objects.at(call.parameters(4).uint64_value())
|
879 |
, m_objects.at(call.parameters(5).uint64_value())
|
880 |
, m_objects.at(call.parameters(6).uint64_value())
|
881 |
, m_objects.at(call.parameters(7).uint64_value())
|
882 |
, m_objects.at(call.parameters(8).uint64_value())
|
883 |
, m_objects.at(call.parameters(9).uint64_value())
|
884 |
, call.parameters(10).bool_value());
|
885 |
break;
|
886 |
} |
887 |
case serialize::PBExpressions::TIRESIAS_INIT_SETCONSTRUCTOR :
|
888 |
{ |
889 |
// DLL bool TIRESIAS_INIT_SETCONSTRUCTOR(void* context,
|
890 |
// void* expr, std::int32_t line, std::int32_t pos, void* typeRef,
|
891 |
// void* callTargetsIdentifierListRef, void* symbTabRef,
|
892 |
// void* exprList, void* symTab, void* parentScope,
|
893 |
// void* comprehension, bool hasComprehension);
|
894 |
TIRESIAS_INIT_SETCONSTRUCTOR (m_context |
895 |
, m_objects.at(call.parameters(0).uint64_value())
|
896 |
, call.parameters(1).int32_value()
|
897 |
, call.parameters(2).int32_value()
|
898 |
, m_objects.at(call.parameters(3).uint64_value())
|
899 |
, m_objects.at(call.parameters(4).uint64_value())
|
900 |
, m_objects.at(call.parameters(5).uint64_value())
|
901 |
, m_objects.at(call.parameters(6).uint64_value())
|
902 |
, m_objects.at(call.parameters(7).uint64_value())
|
903 |
, m_objects.at(call.parameters(8).uint64_value())
|
904 |
, m_objects.at(call.parameters(9).uint64_value())
|
905 |
, call.parameters(10).bool_value());
|
906 |
break;
|
907 |
} |
908 |
case serialize::PBExpressions::TIRESIAS_INIT_TUPLECONSTRUCTOR :
|
909 |
{ |
910 |
// DLL bool TIRESIAS_INIT_TUPLECONSTRUCTOR(void* context,
|
911 |
// void* expr, std::int32_t line, std::int32_t pos, void* typeRef,
|
912 |
// void* callTargetsIdentifierListRef, void* symbTabRef,
|
913 |
// void* exprList, void* tupleTypeId, bool isMatcher);
|
914 |
TIRESIAS_INIT_TUPLECONSTRUCTOR (m_context |
915 |
, m_objects.at(call.parameters(0).uint64_value())
|
916 |
, call.parameters(1).int32_value()
|
917 |
, call.parameters(2).int32_value()
|
918 |
, m_objects.at(call.parameters(3).uint64_value())
|
919 |
, m_objects.at(call.parameters(4).uint64_value())
|
920 |
, m_objects.at(call.parameters(5).uint64_value())
|
921 |
, m_objects.at(call.parameters(6).uint64_value())
|
922 |
, m_objects.at(call.parameters(7).uint64_value())
|
923 |
, call.parameters(8).bool_value());
|
924 |
break;
|
925 |
} |
926 |
case serialize::PBExpressions::TIRESIAS_INIT_ACCESSEXPRESSION :
|
927 |
{ |
928 |
// DLL bool TIRESIAS_INIT_ACCESSEXPRESSION(void* context,
|
929 |
// void* expr, std::int32_t line, std::int32_t pos, void* typeRef,
|
930 |
// void* callTargetsIdentifierListRef, void* symbTabRef,
|
931 |
// void* left, void* right);
|
932 |
TIRESIAS_INIT_ACCESSEXPRESSION (m_context |
933 |
, m_objects.at(call.parameters(0).uint64_value())
|
934 |
, call.parameters(1).int32_value()
|
935 |
, call.parameters(2).int32_value()
|
936 |
, m_objects.at(call.parameters(3).uint64_value())
|
937 |
, m_objects.at(call.parameters(4).uint64_value())
|
938 |
, m_objects.at(call.parameters(5).uint64_value())
|
939 |
, m_objects.at(call.parameters(6).uint64_value())
|
940 |
, m_objects.at(call.parameters(7).uint64_value()));
|
941 |
break;
|
942 |
} |
943 |
case serialize::PBExpressions::TIRESIAS_INIT_TUPLEMAPACCESSEXPRESSION :
|
944 |
{ |
945 |
// DLL bool TIRESIAS_INIT_TUPLEMAPACCESSEXPRESSION(void* context,
|
946 |
// void* expr, std::int32_t line, std::int32_t pos, void* typeRef,
|
947 |
// void* callTargetsIdentifierListRef, void* symbTabRef,
|
948 |
// void* child, void* argument);
|
949 |
TIRESIAS_INIT_TUPLEMAPACCESSEXPRESSION (m_context |
950 |
, m_objects.at(call.parameters(0).uint64_value())
|
951 |
, call.parameters(1).int32_value()
|
952 |
, call.parameters(2).int32_value()
|
953 |
, m_objects.at(call.parameters(3).uint64_value())
|
954 |
, m_objects.at(call.parameters(4).uint64_value())
|
955 |
, m_objects.at(call.parameters(5).uint64_value())
|
956 |
, m_objects.at(call.parameters(6).uint64_value())
|
957 |
, m_objects.at(call.parameters(7).uint64_value()));
|
958 |
break;
|
959 |
} |
960 |
case serialize::PBExpressions::TIRESIAS_INIT_CALLEXPRESSION :
|
961 |
{ |
962 |
// DLL bool TIRESIAS_INIT_CALLEXPRESSION(void* context,
|
963 |
// void* expr, std::int32_t line, std::int32_t pos, void* typeRef,
|
964 |
// void* callTargetsIdentifierListRef, void* symbTabRef,
|
965 |
// void* child, void* argumentList, void* scopeRef);
|
966 |
TIRESIAS_INIT_CALLEXPRESSION (m_context |
967 |
, m_objects.at(call.parameters(0).uint64_value())
|
968 |
, call.parameters(1).int32_value()
|
969 |
, call.parameters(2).int32_value()
|
970 |
, m_objects.at(call.parameters(3).uint64_value())
|
971 |
, m_objects.at(call.parameters(4).uint64_value())
|
972 |
, m_objects.at(call.parameters(5).uint64_value())
|
973 |
, m_objects.at(call.parameters(6).uint64_value())
|
974 |
, m_objects.at(call.parameters(7).uint64_value())
|
975 |
, m_objects.at(call.parameters(8).uint64_value()));
|
976 |
break;
|
977 |
} |
978 |
case serialize::PBExpressions::TIRESIAS_INIT_QUANTIFIEREXPRESSION :
|
979 |
{ |
980 |
// DLL bool TIRESIAS_INIT_QUANTIFIEREXPRESSION(void* context,
|
981 |
// void* expr, std::int32_t line, std::int32_t pos, void* typeRef,
|
982 |
// void* callTargetsIdentifierListRef, void* symbTabRef,
|
983 |
// void* child, void* symTabRef, void* scopeRef);
|
984 |
TIRESIAS_INIT_QUANTIFIEREXPRESSION (m_context |
985 |
, m_objects.at(call.parameters(0).uint64_value())
|
986 |
, call.parameters(1).int32_value()
|
987 |
, call.parameters(2).int32_value()
|
988 |
, m_objects.at(call.parameters(3).uint64_value())
|
989 |
, m_objects.at(call.parameters(4).uint64_value())
|
990 |
, m_objects.at(call.parameters(5).uint64_value())
|
991 |
, m_objects.at(call.parameters(6).uint64_value())
|
992 |
, m_objects.at(call.parameters(7).uint64_value())
|
993 |
, m_objects.at(call.parameters(8).uint64_value()));
|
994 |
break;
|
995 |
} |
996 |
case serialize::PBExpressions::TIRESIAS_INIT_OBJECTCONSTRUCTOR :
|
997 |
{ |
998 |
// DLL bool TIRESIAS_INIT_OBJECTCONSTRUCTOR(void* context,
|
999 |
// void* expr, std::int32_t line, std::int32_t pos, void* typeRef,
|
1000 |
// void* callTargetsIdentifierListRef, void* symbTabRef,
|
1001 |
// void* instanceList, std::uint32_t currentInstance, const char* name);
|
1002 |
TIRESIAS_INIT_OBJECTCONSTRUCTOR (m_context |
1003 |
, m_objects.at(call.parameters(0).uint64_value())
|
1004 |
, call.parameters(1).int32_value()
|
1005 |
, call.parameters(2).int32_value()
|
1006 |
, m_objects.at(call.parameters(3).uint64_value())
|
1007 |
, m_objects.at(call.parameters(4).uint64_value())
|
1008 |
, m_objects.at(call.parameters(5).uint64_value())
|
1009 |
, m_objects.at(call.parameters(6).uint64_value())
|
1010 |
, call.parameters(7).uint32_value()
|
1011 |
, call.parameters(8).literal_value().c_str());
|
1012 |
break;
|
1013 |
} |
1014 |
default:
|
1015 |
m_context->logError("Unknown value for enum PBExpressions.");
|
1016 |
abort(); |
1017 |
} |
1018 |
} |
1019 |
|
1020 |
} |