libTriton  version 0.7 build 1398
astContext.cpp
Go to the documentation of this file.
1 /*
3 ** Copyright (C) - Triton
4 **
5 ** This program is under the terms of the BSD License.
6 */
7 
8 #include <triton/ast.hpp>
9 #include <triton/astContext.hpp>
10 #include <triton/exceptions.hpp>
13 
14 
15 
16 namespace triton {
17  namespace ast {
18 
20  }
21 
22 
24  : astRepresentation(other.astRepresentation),
25  valueMapping(other.valueMapping) {
26  }
27 
28 
30  this->valueMapping.clear();
31  }
32 
33 
35  this->astRepresentation = other.astRepresentation;
36  this->valueMapping = other.valueMapping;
37  return *this;
38  }
39 
40 
42  SharedAbstractNode node = std::make_shared<AssertNode>(expr);
43  if (node == nullptr)
44  throw triton::exceptions::Ast("Node builders - Not enough memory");
45  node->init();
46  return node;
47  }
48 
49 
51  SharedAbstractNode node = std::make_shared<BvNode>(value, size, *this);
52  if (node == nullptr)
53  throw triton::exceptions::Ast("Node builders - Not enough memory");
54  node->init();
55  return node;
56  }
57 
58 
60  SharedAbstractNode node = std::make_shared<BvaddNode>(expr1, expr2);
61  if (node == nullptr)
62  throw triton::exceptions::Ast("Node builders - Not enough memory");
63  node->init();
64  return node;
65  }
66 
67 
69  SharedAbstractNode node = std::make_shared<BvandNode>(expr1, expr2);
70  if (node == nullptr)
71  throw triton::exceptions::Ast("Node builders - Not enough memory");
72  node->init();
73  return node;
74  }
75 
76 
78  SharedAbstractNode node = std::make_shared<BvashrNode>(expr1, expr2);
79  if (node == nullptr)
80  throw triton::exceptions::Ast("Node builders - Not enough memory");
81  node->init();
82  return node;
83  }
84 
85 
87  SharedAbstractNode node = std::make_shared<BvNode>(0, 1, *this);
88  if (node == nullptr)
89  throw triton::exceptions::Ast("Node builders - Not enough memory");
90  node->init();
91  return node;
92  }
93 
94 
96  SharedAbstractNode node = std::make_shared<BvlshrNode>(expr1, expr2);
97  if (node == nullptr)
98  throw triton::exceptions::Ast("Node builders - Not enough memory");
99  node->init();
100  return node;
101  }
102 
103 
105  SharedAbstractNode node = std::make_shared<BvmulNode>(expr1, expr2);
106  if (node == nullptr)
107  throw triton::exceptions::Ast("Node builders - Not enough memory");
108  node->init();
109  return node;
110  }
111 
112 
114  SharedAbstractNode node = std::make_shared<BvnandNode>(expr1, expr2);
115  if (node == nullptr)
116  throw triton::exceptions::Ast("Node builders - Not enough memory");
117  node->init();
118  return node;
119  }
120 
121 
123  SharedAbstractNode node = std::make_shared<BvnegNode>(expr);
124  if (node == nullptr)
125  throw triton::exceptions::Ast("Node builders - Not enough memory");
126  node->init();
127  return node;
128  }
129 
130 
132  SharedAbstractNode node = std::make_shared<BvnorNode>(expr1, expr2);
133  if (node == nullptr)
134  throw triton::exceptions::Ast("Node builders - Not enough memory");
135  node->init();
136  return node;
137  }
138 
139 
141  SharedAbstractNode node = std::make_shared<BvnotNode>(expr);
142  if (node == nullptr)
143  throw triton::exceptions::Ast("Node builders - Not enough memory");
144  node->init();
145  return node;
146  }
147 
148 
150  SharedAbstractNode node = std::make_shared<BvorNode>(expr1, expr2);
151  if (node == nullptr)
152  throw triton::exceptions::Ast("Node builders - Not enough memory");
153  node->init();
154  return node;
155  }
156 
157 
159  SharedAbstractNode node = std::make_shared<BvrolNode>(rot, expr);
160  if (node == nullptr)
161  throw triton::exceptions::Ast("Node builders - Not enough memory");
162  node->init();
163  return node;
164  }
165 
166 
168  SharedAbstractNode node = std::make_shared<BvrolNode>(rot, expr);
169  if (node == nullptr)
170  throw triton::exceptions::Ast("Node builders - Not enough memory");
171  node->init();
172  return node;
173  }
174 
175 
177  SharedAbstractNode node = std::make_shared<BvrorNode>(rot, expr);
178  if (node == nullptr)
179  throw triton::exceptions::Ast("Node builders - Not enough memory");
180  node->init();
181  return node;
182  }
183 
184 
186  SharedAbstractNode node = std::make_shared<BvrorNode>(rot, expr);
187  if (node == nullptr)
188  throw triton::exceptions::Ast("Node builders - Not enough memory");
189  node->init();
190  return node;
191  }
192 
193 
195  SharedAbstractNode node = std::make_shared<BvsdivNode>(expr1, expr2);
196  if (node == nullptr)
197  throw triton::exceptions::Ast("Node builders - Not enough memory");
198  node->init();
199  return node;
200  }
201 
202 
204  SharedAbstractNode node = std::make_shared<BvsgeNode>(expr1, expr2);
205  if (node == nullptr)
206  throw triton::exceptions::Ast("Node builders - Not enough memory");
207  node->init();
208  return node;
209  }
210 
211 
213  SharedAbstractNode node = std::make_shared<BvsgtNode>(expr1, expr2);
214  if (node == nullptr)
215  throw triton::exceptions::Ast("Node builders - Not enough memory");
216  node->init();
217  return node;
218  }
219 
220 
222  SharedAbstractNode node = std::make_shared<BvshlNode>(expr1, expr2);
223  if (node == nullptr)
224  throw triton::exceptions::Ast("Node builders - Not enough memory");
225  node->init();
226  return node;
227  }
228 
229 
231  SharedAbstractNode node = std::make_shared<BvsleNode>(expr1, expr2);
232  if (node == nullptr)
233  throw triton::exceptions::Ast("Node builders - Not enough memory");
234  node->init();
235  return node;
236  }
237 
238 
240  SharedAbstractNode node = std::make_shared<BvsltNode>(expr1, expr2);
241  if (node == nullptr)
242  throw triton::exceptions::Ast("Node builders - Not enough memory");
243  node->init();
244  return node;
245  }
246 
247 
249  SharedAbstractNode node = std::make_shared<BvsmodNode>(expr1, expr2);
250  if (node == nullptr)
251  throw triton::exceptions::Ast("Node builders - Not enough memory");
252  node->init();
253  return node;
254  }
255 
256 
258  SharedAbstractNode node = std::make_shared<BvsremNode>(expr1, expr2);
259  if (node == nullptr)
260  throw triton::exceptions::Ast("Node builders - Not enough memory");
261  node->init();
262  return node;
263  }
264 
265 
267  SharedAbstractNode node = std::make_shared<BvsubNode>(expr1, expr2);
268  if (node == nullptr)
269  throw triton::exceptions::Ast("Node builders - Not enough memory");
270  node->init();
271  return node;
272  }
273 
274 
276  SharedAbstractNode node = std::make_shared<BvNode>(1, 1, *this);
277  if (node == nullptr)
278  throw triton::exceptions::Ast("Node builders - Not enough memory");
279  node->init();
280  return node;
281  }
282 
283 
285  SharedAbstractNode node = std::make_shared<BvudivNode>(expr1, expr2);
286  if (node == nullptr)
287  throw triton::exceptions::Ast("Node builders - Not enough memory");
288  node->init();
289  return node;
290  }
291 
292 
294  SharedAbstractNode node = std::make_shared<BvugeNode>(expr1, expr2);
295  if (node == nullptr)
296  throw triton::exceptions::Ast("Node builders - Not enough memory");
297  node->init();
298  return node;
299  }
300 
301 
303  SharedAbstractNode node = std::make_shared<BvugtNode>(expr1, expr2);
304  if (node == nullptr)
305  throw triton::exceptions::Ast("Node builders - Not enough memory");
306  node->init();
307  return node;
308  }
309 
310 
312  SharedAbstractNode node = std::make_shared<BvuleNode>(expr1, expr2);
313  if (node == nullptr)
314  throw triton::exceptions::Ast("Node builders - Not enough memory");
315  node->init();
316  return node;
317  }
318 
319 
321  SharedAbstractNode node = std::make_shared<BvultNode>(expr1, expr2);
322  if (node == nullptr)
323  throw triton::exceptions::Ast("Node builders - Not enough memory");
324  node->init();
325  return node;
326  }
327 
328 
330  SharedAbstractNode node = std::make_shared<BvuremNode>(expr1, expr2);
331  if (node == nullptr)
332  throw triton::exceptions::Ast("Node builders - Not enough memory");
333  node->init();
334  return node;
335  }
336 
337 
339  SharedAbstractNode node = std::make_shared<BvxnorNode>(expr1, expr2);
340  if (node == nullptr)
341  throw triton::exceptions::Ast("Node builders - Not enough memory");
342  node->init();
343  return node;
344  }
345 
346 
348  SharedAbstractNode node = std::make_shared<BvxorNode>(expr1, expr2);
349  if (node == nullptr)
350  throw triton::exceptions::Ast("Node builders - Not enough memory");
351  node->init();
352  return node;
353  }
354 
355 
356  template TRITON_EXPORT SharedAbstractNode AstContext::compound(const std::vector<SharedAbstractNode>& exprs);
357  template TRITON_EXPORT SharedAbstractNode AstContext::compound(const std::list<SharedAbstractNode>& exprs);
358 
359 
361  SharedAbstractNode node = std::make_shared<ConcatNode>(expr1, expr2);
362  if (node == nullptr)
363  throw triton::exceptions::Ast("Node builders - Not enough memory");
364  node->init();
365  return node;
366  }
367 
368 
369  template TRITON_EXPORT SharedAbstractNode AstContext::concat(const std::vector<SharedAbstractNode>& exprs);
370  template TRITON_EXPORT SharedAbstractNode AstContext::concat(const std::list<SharedAbstractNode>& exprs);
371 
372 
374  SharedAbstractNode node = std::make_shared<DecimalNode>(value, *this);
375  if (node == nullptr)
376  throw triton::exceptions::Ast("Node builders - Not enough memory");
377  node->init();
378  return node;
379  }
380 
381 
383  SharedAbstractNode node = std::make_shared<DeclareNode>(var);
384  if (node == nullptr)
385  throw triton::exceptions::Ast("Node builders - Not enough memory");
386  node->init();
387  return node;
388  }
389 
390 
392  SharedAbstractNode node = std::make_shared<DistinctNode>(expr1, expr2);
393  if (node == nullptr)
394  throw triton::exceptions::Ast("Node builders - Not enough memory");
395  node->init();
396  return node;
397  }
398 
399 
401  SharedAbstractNode node = std::make_shared<EqualNode>(expr1, expr2);
402  if (node == nullptr)
403  throw triton::exceptions::Ast("Node builders - Not enough memory");
404  node->init();
405  return node;
406  }
407 
408 
410  /* Optimization: If we extract the full size of expr, just return expr */
411  if (low == 0 && (high + 1) == expr->getBitvectorSize())
412  return expr;
413 
414  SharedAbstractNode node = std::make_shared<ExtractNode>(high, low, expr);
415 
416  if (node == nullptr)
417  throw triton::exceptions::Ast("Node builders - Not enough memory");
418 
419  node->init();
420  return node;
421  }
422 
423 
425  SharedAbstractNode node = std::make_shared<IffNode>(expr1, expr2);
426  if (node == nullptr)
427  throw triton::exceptions::Ast("Node builders - Not enough memory");
428  node->init();
429  return node;
430  }
431 
432 
434  SharedAbstractNode node = std::make_shared<IteNode>(ifExpr, thenExpr, elseExpr);
435  if (node == nullptr)
436  throw triton::exceptions::Ast("Node builders - Not enough memory");
437  node->init();
438  return node;
439  }
440 
441 
443  SharedAbstractNode node = std::make_shared<LandNode>(expr1, expr2);
444  if (node == nullptr)
445  throw triton::exceptions::Ast("Node builders - Not enough memory");
446  node->init();
447  return node;
448  }
449 
450 
451  template TRITON_EXPORT SharedAbstractNode AstContext::land(const std::vector<SharedAbstractNode>& exprs);
452  template TRITON_EXPORT SharedAbstractNode AstContext::land(const std::list<SharedAbstractNode>& exprs);
453 
454 
455  SharedAbstractNode AstContext::let(std::string alias, const SharedAbstractNode& expr2, const SharedAbstractNode& expr3) {
456  SharedAbstractNode node = std::make_shared<LetNode>(alias, expr2, expr3);
457  if (node == nullptr)
458  throw triton::exceptions::Ast("Node builders - Not enough memory");
459  node->init();
460  return node;
461  }
462 
463 
465  SharedAbstractNode node = std::make_shared<LnotNode>(expr);
466  if (node == nullptr)
467  throw triton::exceptions::Ast("Node builders - Not enough memory");
468  node->init();
469  return node;
470  }
471 
472 
474  SharedAbstractNode node = std::make_shared<LorNode>(expr1, expr2);
475  if (node == nullptr)
476  throw triton::exceptions::Ast("Node builders - Not enough memory");
477  node->init();
478  return node;
479  }
480 
481 
482  template TRITON_EXPORT SharedAbstractNode AstContext::lor(const std::vector<SharedAbstractNode>& exprs);
483  template TRITON_EXPORT SharedAbstractNode AstContext::lor(const std::list<SharedAbstractNode>& exprs);
484 
485 
487  SharedAbstractNode node = std::make_shared<ReferenceNode>(expr);
488  if (node == nullptr)
489  throw triton::exceptions::Ast("Node builders - Not enough memory");
490  node->init();
491  return node;
492  }
493 
494 
496  SharedAbstractNode node = std::make_shared<StringNode>(value, *this);
497  if (node == nullptr)
498  throw triton::exceptions::Ast("Node builders - Not enough memory");
499  node->init();
500  return node;
501  }
502 
503 
505  /* Optimization: Just return expr if the extend is zero */
506  if (sizeExt == 0)
507  return expr;
508 
509  SharedAbstractNode node = std::make_shared<SxNode>(sizeExt, expr);
510 
511  if (node == nullptr)
512  throw triton::exceptions::Ast("Node builders - Not enough memory");
513 
514  node->init();
515  return node;
516  }
517 
518 
520  // try to get node from variable pool
521  auto it = this->valueMapping.find(symVar->getName());
522  if (it != this->valueMapping.end()) {
523  auto& node = it->second.first;
524 
525  if (node->getBitvectorSize() != symVar->getSize())
526  throw triton::exceptions::Ast("Node builders - Missmatching variable size.");
527 
528  // This node already exist, just return it
529  node->init();
530  return node;
531  }
532  else {
533  // if not found, create a new variable node
534  SharedAbstractNode node = std::make_shared<VariableNode>(symVar, *this);
535  this->initVariable(symVar->getName(), 0, node);
536  if (node == nullptr)
537  throw triton::exceptions::Ast("Node builders - Not enough memory");
538  node->init();
539  return node;
540  }
541  }
542 
543 
545  /* Optimization: Just return expr if the extend is zero */
546  if (sizeExt == 0)
547  return expr;
548 
549  SharedAbstractNode node = std::make_shared<ZxNode>(sizeExt, expr);
550 
551  if (node == nullptr)
552  throw triton::exceptions::Ast("Node builders - Not enough memory");
553 
554  node->init();
555  return node;
556  }
557 
558 
559  void AstContext::initVariable(const std::string& name, const triton::uint512& value, const SharedAbstractNode& node) {
560  auto it = this->valueMapping.find(name);
561  if (it == this->valueMapping.end())
562  this->valueMapping.insert(std::make_pair(name, std::make_pair(node, value)));
563  else
564  throw triton::exceptions::Ast("Ast variable already initialized");
565  }
566 
567 
568  void AstContext::updateVariable(const std::string& name, const triton::uint512& value) {
569  auto& kv = this->valueMapping.at(name);
570  kv.second = value;
571  kv.first->init();
572  }
573 
574 
576  auto it = this->valueMapping.find(name);
577  if (it == this->valueMapping.end())
578  return nullptr;
579  else
580  return it->second.first;
581  }
582 
583 
584  const triton::uint512& AstContext::getVariableValue(const std::string& varName) const {
585  try {
586  return this->valueMapping.at(varName).second;
587  } catch (const std::out_of_range&) {
588  throw triton::exceptions::Ast("AstContext::getVariableValue(): Variable doesn't exists");
589  }
590  }
591 
592 
594  this->astRepresentation.setMode(mode);
595  }
596 
597 
599  return this->astRepresentation.getMode();
600  }
601 
602 
603  std::ostream& AstContext::print(std::ostream& stream, AbstractNode* node) {
604  return this->astRepresentation.print(stream, node);
605  }
606 
607  }; /* ast namespace */
608 }; /* triton namespace */
TRITON_EXPORT SharedAbstractNode assert_(const SharedAbstractNode &expr)
AST C++ API - assert node builder.
Definition: astContext.cpp:41
TRITON_EXPORT SharedAbstractNode iff(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - iff node builder.
Definition: astContext.cpp:424
TRITON_EXPORT SharedAbstractNode bvnor(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvnor node builder.
Definition: astContext.cpp:131
TRITON_EXPORT void setRepresentationMode(triton::uint32 mode)
Sets the representation mode for this astContext.
Definition: astContext.cpp:593
TRITON_EXPORT SharedAbstractNode string(std::string value)
AST C++ API - string node builder.
Definition: astContext.cpp:495
TRITON_EXPORT SharedAbstractNode distinct(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - distinct node builder.
Definition: astContext.cpp:391
TRITON_EXPORT const triton::uint512 & getVariableValue(const std::string &varName) const
Gets a variable value from its name.
Definition: astContext.cpp:584
TRITON_EXPORT SharedAbstractNode land(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - land node builder.
Definition: astContext.cpp:442
Abstract node.
Definition: ast.hpp:63
TRITON_EXPORT SharedAbstractNode ite(const SharedAbstractNode &ifExpr, const SharedAbstractNode &thenExpr, const SharedAbstractNode &elseExpr)
AST C++ API - ite node builder.
Definition: astContext.cpp:433
TRITON_EXPORT SharedAbstractNode let(std::string alias, const SharedAbstractNode &expr2, const SharedAbstractNode &expr3)
AST C++ API - let node builder.
Definition: astContext.cpp:455
AST Context - Used as AST builder.
Definition: astContext.hpp:49
TRITON_EXPORT SharedAbstractNode declare(const SharedAbstractNode &var)
AST C++ API - declare node builder.
Definition: astContext.cpp:382
TRITON_EXPORT SharedAbstractNode bvsdiv(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvsdiv node builder.
Definition: astContext.cpp:194
SharedAbstractNode compound(const T &exprs)
AST C++ API - compound node builder.
Definition: astContext.hpp:176
The Triton namespace.
Definition: api.cpp:225
TRITON_EXPORT SharedAbstractNode lnot(const SharedAbstractNode &expr)
AST C++ API - lnot node builder.
Definition: astContext.cpp:464
The exception class used by all AST nodes.
Definition: exceptions.hpp:341
TRITON_EXPORT SharedAbstractNode bvslt(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvslt node builder.
Definition: astContext.cpp:239
TRITON_EXPORT SharedAbstractNode bvand(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvand node builder.
Definition: astContext.cpp:68
TRITON_EXPORT SharedAbstractNode bvsrem(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvsrem node builder.
Definition: astContext.cpp:257
TRITON_EXPORT SharedAbstractNode reference(const triton::engines::symbolic::SharedSymbolicExpression &expr)
AST C++ API - reference node builder.
Definition: astContext.cpp:486
TRITON_EXPORT SharedAbstractNode bvurem(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvurem node builder.
Definition: astContext.cpp:329
std::shared_ptr< triton::ast::AbstractNode > SharedAbstractNode
Shared Abstract Node.
Definition: ast.hpp:57
TRITON_EXPORT SharedAbstractNode bvuge(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvuge node builder.
Definition: astContext.cpp:293
TRITON_EXPORT SharedAbstractNode bvnot(const SharedAbstractNode &expr)
AST C++ API - bvnot node builder.
Definition: astContext.cpp:140
TRITON_EXPORT SharedAbstractNode extract(triton::uint32 high, triton::uint32 low, const SharedAbstractNode &expr)
AST C++ API - extract node builder.
Definition: astContext.cpp:409
TRITON_EXPORT SharedAbstractNode bvxnor(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvxnor node builder.
Definition: astContext.cpp:338
TRITON_EXPORT SharedAbstractNode sx(triton::uint32 sizeExt, const SharedAbstractNode &expr)
AST C++ API - sx node builder.
Definition: astContext.cpp:504
TRITON_EXPORT ~AstContext()
Destructor.
Definition: astContext.cpp:29
TRITON_EXPORT SharedAbstractNode bvor(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvor node builder.
Definition: astContext.cpp:149
TRITON_EXPORT SharedAbstractNode bvadd(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvadd node builder.
Definition: astContext.cpp:59
TRITON_EXPORT SharedAbstractNode bvashr(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvashr node builder.
Definition: astContext.cpp:77
TRITON_EXPORT void updateVariable(const std::string &name, const triton::uint512 &value)
Updates a variable value in this context.
Definition: astContext.cpp:568
TRITON_EXPORT SharedAbstractNode bv(triton::uint512 value, triton::uint32 size)
AST C++ API - bv node builder.
Definition: astContext.cpp:50
TRITON_EXPORT void initVariable(const std::string &name, const triton::uint512 &value, const SharedAbstractNode &node)
Initializes a variable in the context.
Definition: astContext.cpp:559
TRITON_EXPORT SharedAbstractNode bvmul(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvmul node builder.
Definition: astContext.cpp:104
TRITON_EXPORT SharedAbstractNode bvsmod(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvsmod node builder.
Definition: astContext.cpp:248
TRITON_EXPORT SharedAbstractNode bvneg(const SharedAbstractNode &expr)
AST C++ API - bvneg node builder.
Definition: astContext.cpp:122
TRITON_EXPORT SharedAbstractNode concat(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - concat node builder.
Definition: astContext.cpp:360
std::shared_ptr< triton::engines::symbolic::SymbolicExpression > SharedSymbolicExpression
Shared Symbolic Expression.
Definition: ast.hpp:38
TRITON_EXPORT AstContext()
Constructor.
Definition: astContext.cpp:19
TRITON_EXPORT SharedAbstractNode zx(triton::uint32 sizeExt, const SharedAbstractNode &expr)
AST C++ API - zx node builder.
Definition: astContext.cpp:544
TRITON_EXPORT SharedAbstractNode bvxor(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvxor node builder.
Definition: astContext.cpp:347
std::uint32_t uint32
unisgned 32-bits
Definition: tritonTypes.hpp:31
TRITON_EXPORT SharedAbstractNode bvlshr(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvlshr node builder.
Definition: astContext.cpp:95
TRITON_EXPORT SharedAbstractNode bvnand(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvnand node builder.
Definition: astContext.cpp:113
TRITON_EXPORT SharedAbstractNode equal(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - equal node builder.
Definition: astContext.cpp:400
TRITON_EXPORT void setMode(triton::uint32 mode)
Sets the representation mode.
TRITON_EXPORT SharedAbstractNode bvsge(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvsge node builder.
Definition: astContext.cpp:203
TRITON_EXPORT std::ostream & print(std::ostream &stream, AbstractNode *node)
Displays the node according to the representation mode.
TRITON_EXPORT triton::uint32 getRepresentationMode(void) const
Gets the representations mode of this astContext.
Definition: astContext.cpp:598
TRITON_EXPORT SharedAbstractNode bvtrue(void)
AST C++ API - bvtrue node builder.
Definition: astContext.cpp:275
std::shared_ptr< triton::engines::symbolic::SymbolicVariable > SharedSymbolicVariable
Shared Symbolic variable.
Definition: ast.hpp:41
TRITON_EXPORT SharedAbstractNode bvrol(triton::uint32 rot, const SharedAbstractNode &expr)
AST C++ API - bvrol node builder.
Definition: astContext.cpp:158
TRITON_EXPORT SharedAbstractNode bvudiv(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvudiv node builder.
Definition: astContext.cpp:284
TRITON_EXPORT SharedAbstractNode bvult(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvult node builder.
Definition: astContext.cpp:320
TRITON_EXPORT SharedAbstractNode bvshl(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvshl node builder.
Definition: astContext.cpp:221
TRITON_EXPORT SharedAbstractNode bvule(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvule node builder.
Definition: astContext.cpp:311
TRITON_EXPORT SharedAbstractNode variable(const triton::engines::symbolic::SharedSymbolicVariable &symVar)
AST C++ API - variable node builder.
Definition: astContext.cpp:519
TRITON_EXPORT SharedAbstractNode bvugt(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvugt node builder.
Definition: astContext.cpp:302
TRITON_EXPORT AstContext & operator=(const AstContext &other)
Operator.
Definition: astContext.cpp:34
TRITON_EXPORT SharedAbstractNode bvsgt(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvsgt node builder.
Definition: astContext.cpp:212
boost::multiprecision::uint512_t uint512
unsigned 512-bits
Definition: tritonTypes.hpp:43
TRITON_EXPORT std::ostream & print(std::ostream &stream, AbstractNode *node)
Print the given node with this context representation.
Definition: astContext.cpp:603
TRITON_EXPORT SharedAbstractNode bvsub(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvsub node builder.
Definition: astContext.cpp:266
TRITON_EXPORT SharedAbstractNode bvror(triton::uint32 rot, const SharedAbstractNode &expr)
AST C++ API - bvror node builder.
Definition: astContext.cpp:176
TRITON_EXPORT SharedAbstractNode decimal(triton::uint512 value)
AST C++ API - decimal node builder.
Definition: astContext.cpp:373
TRITON_EXPORT SharedAbstractNode bvfalse(void)
AST C++ API - bvfalse node builder.
Definition: astContext.cpp:86
TRITON_EXPORT SharedAbstractNode bvsle(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - bvsle node builder.
Definition: astContext.cpp:230
SharedAbstractNode getVariableNode(const std::string &name)
Gets a variable node from its name.
Definition: astContext.cpp:575
TRITON_EXPORT triton::uint32 getMode(void) const
Returns the representation mode.
TRITON_EXPORT SharedAbstractNode lor(const SharedAbstractNode &expr1, const SharedAbstractNode &expr2)
AST C++ API - lor node builder.
Definition: astContext.cpp:473