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