ROSE 0.11.145.147
|
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 323 of file SymbolicExpressionParser.h.
#include <Rose/BinaryAnalysis/SymbolicExpressionParser.h>
Public Types | |
typedef Sawyer::SharedPointer< RegisterSubstituter > | Ptr |
Shared-ownership pointer. | |
typedef Sawyer::Container::BiMap< RegisterDescriptor, SymbolicExpression::Ptr > | RegToVarMap |
Public Types inherited from Rose::BinaryAnalysis::SymbolicExpressionParser::AtomExpansion | |
typedef Sawyer::SharedPointer< AtomExpansion > | Ptr |
Shared-ownership pointer to an AtomExpansion. | |
Public Types inherited from Rose::BinaryAnalysis::SymbolicExpressionParser::Expansion | |
typedef Sawyer::SharedPointer< Expansion > | Ptr |
Shared-ownership pointer to an Expansion. | |
Public Member Functions | |
SymbolicExpression::Ptr | immediateExpansion (const SymbolicExpressionParser::Token &) override |
Expand a parsed atom into some other expression. | |
SymbolicExpression::Ptr | delayedExpansion (const SymbolicExpression::Ptr &, const SymbolicExpressionParser *) override |
Substitute one expression with another. | |
InstructionSemantics::BaseSemantics::RiscOperatorsPtr | riscOperators () const |
Property: Semantic state used during delayed expansion. | |
void | riscOperators (const InstructionSemantics::BaseSemantics::RiscOperatorsPtr &ops) |
Property: Semantic state used during delayed expansion. | |
Public Member Functions inherited from Rose::BinaryAnalysis::SymbolicExpressionParser::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. | |
void | docString (const std::string &s) |
Property: Documentation string. | |
Public Member Functions inherited from Sawyer::SharedObject | |
SharedObject () | |
Default constructor. | |
SharedObject (const SharedObject &) | |
Copy constructor. | |
virtual | ~SharedObject () |
Virtual destructor. | |
SharedObject & | operator= (const SharedObject &) |
Assignment. | |
Static Public Member Functions | |
static Ptr | instance (const RegisterDictionaryPtr &) |
Allocating constructor. | |
Protected Member Functions | |
RegisterSubstituter (const RegisterDictionaryPtr ®dict) | |
typedef Sawyer::SharedPointer<RegisterSubstituter> Rose::BinaryAnalysis::SymbolicExpressionParser::RegisterSubstituter::Ptr |
Shared-ownership pointer.
See Shared ownership.
Definition at line 326 of file SymbolicExpressionParser.h.
typedef Sawyer::Container::BiMap<RegisterDescriptor, SymbolicExpression::Ptr> Rose::BinaryAnalysis::SymbolicExpressionParser::RegisterSubstituter::RegToVarMap |
Definition at line 329 of file SymbolicExpressionParser.h.
|
inlineprotected |
Definition at line 337 of file SymbolicExpressionParser.h.
|
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 350 of file SymbolicExpressionParser.h.
|
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 SymbolicExpressionParser.h.
|
overridevirtual |
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::SymbolicExpressionParser::AtomExpansion.
|
overridevirtual |
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::SymbolicExpressionParser::Expansion.