ROSE  0.9.10.91
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Rose::BinaryAnalysis::SymbolicExprParser::RegisterSubstituter Class Reference

Description

Expand register name to placeholder variables.

The problem with RegisterToValue is that the expansion from register name to register value occurs at parsing time, and parsing is a relatively slow operation. Therefore, this class takes a slightly different approach: at parsing time, register names are replaced by symbolic variables (placeholders), and information is returned about how these placeholders map to register names. Then, at a later time, a substition can be run to replace the placeholders with the register values.

Definition at line 286 of file BinarySymbolicExprParser.h.

#include <BinarySymbolicExprParser.h>

Inheritance diagram for Rose::BinaryAnalysis::SymbolicExprParser::RegisterSubstituter:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::SymbolicExprParser::RegisterSubstituter:
Collaboration graph
[legend]

Public Types

typedef Sawyer::SharedPointer< RegisterSubstituterPtr
 Shared-ownership pointer. More...
 
typedef Sawyer::Container::BiMap< RegisterDescriptor, SymbolicExpr::PtrRegToVarMap
 
- Public Types inherited from Rose::BinaryAnalysis::SymbolicExprParser::AtomExpansion
typedef Sawyer::SharedPointer< AtomExpansionPtr
 Shared-ownership pointer to an AtomExpansion. More...
 
- Public Types inherited from Rose::BinaryAnalysis::SymbolicExprParser::Expansion
typedef Sawyer::SharedPointer< ExpansionPtr
 Shared-ownership pointer to an Expansion. More...
 

Public Member Functions

SymbolicExpr::Ptr substitute (const SymbolicExpr::Ptr &, const InstructionSemantics2::BaseSemantics::RiscOperatorsPtr &) const
 Substitute register values for placeholders. More...
 
SymbolicExpr::Ptr operator() (const SymbolicExprParser::Token &) ROSE_OVERRIDE
 Operator to expand the symbol into an expression tree. More...
 
- Public Member Functions inherited from Rose::BinaryAnalysis::SymbolicExprParser::Expansion
const std::string & title () const
 Property: Title to use for documentation.
 
void title (const std::string &s)
 Property: Title to use for documentation.
 
const std::string & docString () const
 Property: Documentation string. More...
 
void docString (const std::string &s)
 Property: Documentation string. More...
 
- Public Member Functions inherited from Sawyer::SharedObject
 SharedObject ()
 Default constructor. More...
 
 SharedObject (const SharedObject &)
 Copy constructor. More...
 
virtual ~SharedObject ()
 Virtual destructor. More...
 
SharedObjectoperator= (const SharedObject &)
 Assignment. More...
 

Static Public Member Functions

static Ptr instance (const RegisterDictionary *)
 Allocating constructor. More...
 

Protected Member Functions

 RegisterSubstituter (const RegisterDictionary *regdict)
 

Member Typedef Documentation

Shared-ownership pointer.

See Shared ownership.

Definition at line 289 of file BinarySymbolicExprParser.h.

Member Function Documentation

static Ptr Rose::BinaryAnalysis::SymbolicExprParser::RegisterSubstituter::instance ( const RegisterDictionary )
static

Allocating constructor.

SymbolicExpr::Ptr Rose::BinaryAnalysis::SymbolicExprParser::RegisterSubstituter::substitute ( const SymbolicExpr::Ptr ,
const InstructionSemantics2::BaseSemantics::RiscOperatorsPtr  
) const

Substitute register values for placeholders.

Uses the information that was saved during parsing in order to find the placeholders in the specified symbolic expression and replace them with the register values read from the semantic state. If substitutions were made, then a new symbolic expression is returned, otherwise the argument is returned unmodified.

SymbolicExpr::Ptr Rose::BinaryAnalysis::SymbolicExprParser::RegisterSubstituter::operator() ( const SymbolicExprParser::Token name)
virtual

Operator to expand the symbol into an expression tree.

The width in bits is either the width specified in square brackets for the symbol, or zero. Functors are all called for each symbol, and the first one to return non-null is the one that's used to generate the symbolic expression.

Implements Rose::BinaryAnalysis::SymbolicExprParser::AtomExpansion.


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