ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
numericExprAnn Class Reference

Numeric expression. More...

#include <broadway_expr.h>

Inheritance diagram for numericExprAnn:
Collaboration diagram for numericExprAnn:

Public Member Functions

virtual ~numericExprAnn ()
 Right-hand side expression. More...
 
 numericExprAnn (const parserID *lhs, int line)
 Create a constant test. More...
 
virtual void lookup (propertyAnn *default_property, procedureAnn *procedure, Annotations *annotations)
 Create a numeric assignment. More...
 
virtual void print (std::ostream &out)
 Report method. More...
 
- Public Member Functions inherited from exprAnn
 exprAnn (Broadway::Operator op, int line)
 Create a new expression. More...
 
Broadway::Operator op () const
 Operator. More...
 
- Public Member Functions inherited from Ann
 Ann (int line)
 
int line () const
 

Private Attributes

std::string _lhs_name
 Left-hand side variable name. More...
 
REF annVariable_lhs
 Left-hand side variable. More...
 

Detailed Description

Numeric expression.

There are basically three kinds of numeric expressions, distinguished by operator:

  1. Evaluate. These expressions have no side-effects and are only used for querying the constant analysis. There is no left-hand side variable. In the test() method, we cast the result to boolean to decide whether or not the test is true. In the report() method, we print out the value.
  2. Is_Constant. These expressions are used to test whether a variable is constant or not, when we don't care about any specific value. We use the left-hand side variable to hold the variable to test.
  3. Assign. These expressions are only used in the constant analysis to update the constant propagation information. The left-hand side is the variable to update, and the expression provides the new value.

Definition at line 448 of file broadway_expr.h.

Constructor & Destructor Documentation

virtual numericExprAnn::~numericExprAnn ( )
inlinevirtual

Right-hand side expression.

Create a numeric evaluation

These expressions are only used for test expressions and reports.

Definition at line 473 of file broadway_expr.h.

numericExprAnn::numericExprAnn ( const parserID lhs,
int  line 
)

Create a constant test.

In the test() method, this kind of expression evaluates to true if the left-hand side value has a constant value.

Member Function Documentation

virtual void numericExprAnn::lookup ( propertyAnn default_property,
procedureAnn procedure,
Annotations annotations 
)
virtual

Create a numeric assignment.

Here, the expression is evaluated and assigned to the left-hand side variable. This kind of object is only used in the built-in "constants" analysis, to allow updating of the constant propagation information.

Implements exprAnn.

virtual void numericExprAnn::print ( std::ostream &  out)
virtual

Report method.

Interpret the expression as an informational query (for the report annotations). Write the result out to the given stream. Print method

Display the expression using the annotation syntax.

Implements exprAnn.

Member Data Documentation

std::string numericExprAnn::_lhs_name
private

Left-hand side variable name.

Definition at line 454 of file broadway_expr.h.

REF annVariable* numericExprAnn::_lhs
private

Left-hand side variable.

Definition at line 458 of file broadway_expr.h.


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