libTriton  version 0.4 build 1355
Public Member Functions | Protected Attributes | List of all members
triton::ast::AbstractNode Class Referenceabstract

Abstract node. More...

#include <ast.hpp>

Inheritance diagram for triton::ast::AbstractNode:

Public Member Functions

 AbstractNode (enum kind_e kind)
 Constructor.
 
 AbstractNode (const AbstractNode &copy)
 Constructor by copy.
 
 AbstractNode ()
 Constructor.
 
virtual ~AbstractNode ()
 Destructor.
 
enum kind_e getKind (void) const
 Returns the kind of the node.
 
triton::uint32 getBitvectorSize (void) const
 Returns the size of the node.
 
triton::uint512 getBitvectorMask (void) const
 Returns the vector mask according the size of the node.
 
bool isSigned (void) const
 According to the size of the expression, returns true if the MSB is 1.
 
bool isSymbolized (void) const
 Returns true if the tree contains a symbolic variable.
 
triton::uint512 evaluate (void) const
 Evaluates the tree.
 
std::vector< AbstractNode * > & getChilds (void)
 Returns the childs of the node.
 
std::set< AbstractNode * > & getParents (void)
 Returns the parents of node or an empty set if there is still no parent defined. More...
 
void removeParent (AbstractNode *p)
 Removes a parent node.
 
void setParent (AbstractNode *p)
 Sets a parent node.
 
void setParent (std::set< AbstractNode *> &p)
 Sets the parent nodes.
 
void setBitvectorSize (triton::uint32 size)
 Sets the size of the node.
 
void addChild (AbstractNode *child)
 Adds a child.
 
void setChild (triton::uint32 index, AbstractNode *child)
 Sets a child at an index.
 
virtual void init (void)=0
 Init stuffs like size and eval.
 
virtual void accept (AstVisitor &v)=0
 Entry point for a visitor.
 
virtual triton::uint512 hash (triton::uint32 deep)=0
 Returns the has of the tree. The hash is computed recursively on the whole tree.
 

Protected Attributes

enum kind_e kind
 The kind of the node.
 
std::vector< AbstractNode * > childs
 The childs of the node.
 
std::set< AbstractNode * > parents
 The parents of the node. Empty if there is still no parent.
 
triton::uint32 size
 The size of the node.
 
triton::uint512 eval
 The value of the tree from this root node.
 
bool symbolized
 This value is set to true if the tree contains a symbolic variable.
 

Detailed Description

Abstract node.

Definition at line 42 of file ast.hpp.

Member Function Documentation

◆ getParents()

std::set< AbstractNode * > & triton::ast::AbstractNode::getParents ( void  )

Returns the parents of node or an empty set if there is still no parent defined.

Note that if there is the AST_DICTIONARIES optimization enabled, this feature will probably not represent the real tree of your expression.

Definition at line 97 of file ast.cpp.


The documentation for this class was generated from the following files: