ROSE  0.9.9.109
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::Cursor Class Reference

Description

Iterates over valid subdomains whose inputs are valid.

This is intended to be used in a "for" loop inside a RISC operation, such as:

SValuePtr retval(a->get_width());
for (Cursor c(this, a, b); !c.at_end(); c.next())
retval->set_subvalue(c->idx(), c->add(a, b));
}
}

This RiscOperator's before() and after() methods are automatically invoked around the body of the "for" loop by the Cursor constructor and next() methods.

Definition at line 368 of file MultiSemantics2.h.

#include <MultiSemantics2.h>

Collaboration diagram for Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::Cursor:
Collaboration graph
[legend]

Public Types

typedef std::vector< SValuePtrInputs
 

Public Member Functions

 Cursor (RiscOperators *ops, const SValuePtr &arg1=SValuePtr(), const SValuePtr &arg2=SValuePtr(), const SValuePtr &arg3=SValuePtr())
 
 Cursor (RiscOperators *ops, const Inputs &inputs)
 
bool at_end () const
 Returns true when the cursor has gone past the last valid subdomain. More...
 
void next ()
 Advance to the next valid subdomain. More...
 
size_t idx () const
 Return the subdomain index for the current cursor position. More...
 
BaseSemantics::RiscOperatorsPtr operator-> () const
 Return the subdomain for the current cursor position. More...
 
BaseSemantics::RiscOperatorsPtr operator* () const
 Return the subdomain for the current cursor position. More...
 
BaseSemantics::SValuePtr operator() (const BaseSemantics::SValuePtr &) const
 Returns subdomain value of its multidomain argument. More...
 

Static Public Member Functions

static Inputs inputs (const BaseSemantics::SValuePtr &arg1=BaseSemantics::SValuePtr(), const BaseSemantics::SValuePtr &arg2=BaseSemantics::SValuePtr(), const BaseSemantics::SValuePtr &arg3=BaseSemantics::SValuePtr())
 Class method to construct the array of inputs from a variable number of arguments. More...
 

Protected Member Functions

void init (const SValuePtr &arg1, const SValuePtr &arg2, const SValuePtr &arg3)
 
void init ()
 
void skip_invalid ()
 
bool inputs_are_valid () const
 

Protected Attributes

RiscOperatorsops_
 
Inputs inputs_
 
size_t idx_
 

Member Function Documentation

static Inputs Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::Cursor::inputs ( const BaseSemantics::SValuePtr arg1 = BaseSemantics::SValuePtr(),
const BaseSemantics::SValuePtr arg2 = BaseSemantics::SValuePtr(),
const BaseSemantics::SValuePtr arg3 = BaseSemantics::SValuePtr() 
)
static

Class method to construct the array of inputs from a variable number of arguments.

This is used only by the SUBDOMAINS macro in the MultiSemantics source code so that the input values can be passed as a parenthesized group as the macro's second argument.

bool Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::Cursor::at_end ( ) const

Returns true when the cursor has gone past the last valid subdomain.

void Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::Cursor::next ( )

Advance to the next valid subdomain.

size_t Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::Cursor::idx ( ) const

Return the subdomain index for the current cursor position.

BaseSemantics::RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::Cursor::operator-> ( ) const

Return the subdomain for the current cursor position.

BaseSemantics::RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::Cursor::operator* ( ) const

Return the subdomain for the current cursor position.

BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::Cursor::operator() ( const BaseSemantics::SValuePtr ) const

Returns subdomain value of its multidomain argument.


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