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

Abstract node. More...

#include <ast.hpp>

Inherits enable_shared_from_this< AbstractNode >.

Inherited by triton::ast::AssertNode, triton::ast::BvaddNode, triton::ast::BvandNode, triton::ast::BvashrNode, triton::ast::BvlshrNode, triton::ast::BvmulNode, triton::ast::BvnandNode, triton::ast::BvnegNode, triton::ast::BvNode, triton::ast::BvnorNode, triton::ast::BvnotNode, triton::ast::BvorNode, triton::ast::BvrolNode, triton::ast::BvrorNode, triton::ast::BvsdivNode, triton::ast::BvsgeNode, triton::ast::BvsgtNode, triton::ast::BvshlNode, triton::ast::BvsleNode, triton::ast::BvsltNode, triton::ast::BvsmodNode, triton::ast::BvsremNode, triton::ast::BvsubNode, triton::ast::BvudivNode, triton::ast::BvugeNode, triton::ast::BvugtNode, triton::ast::BvuleNode, triton::ast::BvultNode, triton::ast::BvuremNode, triton::ast::BvxnorNode, triton::ast::BvxorNode, triton::ast::CompoundNode, triton::ast::ConcatNode, triton::ast::DeclareNode, triton::ast::DistinctNode, triton::ast::EqualNode, triton::ast::ExtractNode, triton::ast::IffNode, triton::ast::IntegerNode, triton::ast::IteNode, triton::ast::LandNode, triton::ast::LetNode, triton::ast::LnotNode, triton::ast::LorNode, triton::ast::ReferenceNode, triton::ast::StringNode, triton::ast::SxNode, triton::ast::VariableNode, and triton::ast::ZxNode.

Public Member Functions

TRITON_EXPORT AbstractNode (triton::ast::ast_e type, AstContext &ctxt)
virtual TRITON_EXPORT ~AbstractNode ()
TRITON_EXPORT AstContextgetContext (void) const
 Access to its context.
TRITON_EXPORT triton::ast::ast_e getType (void) const
 Returns the type of the node.
TRITON_EXPORT triton::uint32 getBitvectorSize (void) const
 Returns the size of the node.
TRITON_EXPORT triton::uint512 getBitvectorMask (void) const
 Returns the vector mask according the size of the node.
TRITON_EXPORT bool isSigned (void) const
 According to the size of the expression, returns true if the MSB is 1.
TRITON_EXPORT bool isSymbolized (void) const
 Returns true if the tree contains a symbolic variable.
TRITON_EXPORT bool isLogical (void) const
 Returns true if it's a logical node.
TRITON_EXPORT bool equalTo (const SharedAbstractNode &) const
 Returns true if the current tree is equal to the second one.
virtual TRITON_EXPORT triton::uint512 evaluate (void) const
 Evaluates the tree.
void initParents (void)
 Initializes parents.
TRITON_EXPORT std::vector< SharedAbstractNode > & getChildren (void)
 Returns the children of the node.
TRITON_EXPORT std::vector< SharedAbstractNodegetParents (void)
 Returns the parents of node or an empty set if there is still no parent defined.
TRITON_EXPORT void removeParent (AbstractNode *p)
 Removes a parent node.
TRITON_EXPORT void setParent (AbstractNode *p)
 Sets a parent node.
TRITON_EXPORT void setParent (std::set< AbstractNode *> &p)
 Sets the parent nodes.
TRITON_EXPORT void setBitvectorSize (triton::uint32 size)
 Sets the size of the node.
TRITON_EXPORT void addChild (const SharedAbstractNode &child)
 Adds a child.
TRITON_EXPORT void setChild (triton::uint32 index, const SharedAbstractNode &child)
 Sets a child at an index.
TRITON_EXPORT std::string str (void) const
 Returns the string representation of the node.
virtual TRITON_EXPORT void init (void)=0
 Init stuffs like size and eval.
virtual TRITON_EXPORT triton::uint512 hash (triton::uint32 deep) const =0
 Returns the has of the tree. The hash is computed recursively on the whole tree.

Protected Attributes

triton::ast::ast_e type
 The type of the node.
std::vector< SharedAbstractNodechildren
 The children of the node.
std::map< AbstractNode *, std::pair< triton::uint32, WeakAbstractNode > > parents
triton::uint32 size
 The size of the node.
triton::uint512 eval
 The value of the tree from this root node.
bool symbolized
 True if the tree contains a symbolic variable.
bool logical
 True if it's a logical node.
 Contect use to create this node.

Detailed Description

Abstract node.

Definition at line 64 of file ast.hpp.

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