ROSE  0.9.11.42
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 326 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 immediateExpansion (const SymbolicExprParser::Token &) ROSE_OVERRIDE
 Expand a parsed atom into some other expression. More...
 
SymbolicExpr::Ptr delayedExpansion (const SymbolicExpr::Ptr &, const SymbolicExprParser *) ROSE_OVERRIDE
 Substitute one expression with another. More...
 
InstructionSemantics2::BaseSemantics::RiscOperatorsPtr riscOperators () const
 Property: Semantic state used during delayed expansion. More...
 
void riscOperators (const InstructionSemantics2::BaseSemantics::RiscOperatorsPtr &ops)
 Property: Semantic state used during delayed expansion. 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 329 of file BinarySymbolicExprParser.h.

Member Function Documentation

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

Allocating constructor.

InstructionSemantics2::BaseSemantics::RiscOperatorsPtr Rose::BinaryAnalysis::SymbolicExprParser::RegisterSubstituter::riscOperators ( ) const
inline

Property: Semantic state used during delayed expansion.

This property holds a pointer to the semantic operators and its current state that's used during the second phase of expansion (delayedExpansion).

Definition at line 353 of file BinarySymbolicExprParser.h.

void Rose::BinaryAnalysis::SymbolicExprParser::RegisterSubstituter::riscOperators ( const InstructionSemantics2::BaseSemantics::RiscOperatorsPtr ops)
inline

Property: Semantic state used during delayed expansion.

This property holds a pointer to the semantic operators and its current state that's used during the second phase of expansion (delayedExpansion).

Definition at line 356 of file BinarySymbolicExprParser.h.

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

Expand a parsed atom into some other expression.

This method takes a token parsed from the input and optionally replaces it with some other expression. For instance, a subclass that recognizes the token "true" would replace it with a single-bit constant 1. If this object does not recognize the token, it should return a null pointer. This phase of expansion occurs immediately during parsing; a second phase may occur later.

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

SymbolicExpr::Ptr Rose::BinaryAnalysis::SymbolicExprParser::RegisterSubstituter::delayedExpansion ( const SymbolicExpr::Ptr src,
const SymbolicExprParser parser 
)
virtual

Substitute one expression with another.

This second phase of expansion occurs after parsing (perhaps much later) and is able to dynamically replace the given expression with some other expression. For instance, if this object recognizes register names, it it might replace the register names with variables in the first phase, and during the second phase read register values from a provided state.

If the input expression does not need to be substituted, then this function should return the original expression.

Reimplemented from Rose::BinaryAnalysis::SymbolicExprParser::Expansion.


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