Polaris: NonBinaryExpr Class Reference

NonBinaryExpr Class Reference

An expression containing two or more arguments. More...

#include <NonBinaryExpr.h>

Inheritance diagram for NonBinaryExpr:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 NonBinaryExpr (OP_TYPE o, const Type &e)
 Constructor for a NonBinaryExpr with no args.
 NonBinaryExpr (OP_TYPE o, const Type &e, Expression *exp1, Expression *exp2=0, Expression *exp3=0, Expression *exp4=0, Expression *exp5=0)
 Constructor for a NonBinaryExpr with up to five args.
 NonBinaryExpr (OP_TYPE o, const Type &e, List< Expression > *list)
 Creates a new NonBinaryExpr object with the expressions in 'list' as its arguments.
 NonBinaryExpr (const NonBinaryExpr &e)
 Copy constructor.
virtual ~NonBinaryExpr ()
 Virtual destructor.
NonBinaryExproperator= (const NonBinaryExpr &)
 Copy assignment.
virtual void relink_eptrs (ProgramUnit &p)
 Change pointers in a NonBinaryExpr to point within the given ProgramUnit.
virtual Expressionclone () const
 Return a copy of myself.
virtual const List< Expression > & arg_list () const
virtual List< Expression > & arg_list ()
 Return a reference to list of all expression arguments of myself.
virtual const RefList< Expression > * arg_refs () const
 Return a list of references to all expression arguments of myself.
virtual int structures_OK () const
 Return 1 if my structures are in a valid state.
virtual void convert (BinRep &exprSet, Symtab &symtab)
 Read in the values of my fields and my subexpressions from the given BinRep object.
virtual void print_debug (ostream &o, Boolean debug) const
 debug indicates whether it should contain extra fields
virtual Expressionmember_ref (const Symbol *)
 See Expression.h.
virtual int exchange_expr (VDL &vdl)
 Create a node in the "expression" member and return the index.

Protected Member Functions

virtual Expression_fold_top (void)
virtual Expression_divides_evenly (const Symbol *)
virtual Expression_divide_by_int (int &)
virtual int _gcd (void) const
virtual Expression_distribute_top (void)
virtual Boolean _args_are_equal (Expression &, Boolean consider_side_effects)
virtual Expression_combine_top ()
virtual void _backup_aux ()

Protected Attributes

List< Expression_arg_list

Friends

class ExprTable

Detailed Description

An expression containing two or more arguments.

Polaris Expression

See also:
Expression/NonBinaryExpr.h

Expression/NonBinaryExpr.h

Expression/Expression.cc

Description

A NonBinaryExpr is an expression that can have a variable number of arguments. These arguments are accessed through the method arg_list(). A NonBinaryExpr can be one of several kinds of expressions. The most common of these are are ADD_OP (+), MULT_OP (*), AND_OP (.AND.), and OR_OP (.OR.). In most cases, NonBinaryExprs are commutative.

Definition at line 34 of file NonBinaryExpr.h.


Constructor & Destructor Documentation

NonBinaryExpr::NonBinaryExpr OP_TYPE  o,
const Type e
[inline]
 

Constructor for a NonBinaryExpr with no args.

< nothing to do

Definition at line 113 of file NonBinaryExpr.h.

References e.

Referenced by _fold_divisible_in_mult(), _fold_divisible_in_plus(), and clone().

NonBinaryExpr::NonBinaryExpr OP_TYPE  o,
const Type e,
Expression exp1,
Expression exp2 = 0,
Expression exp3 = 0,
Expression exp4 = 0,
Expression exp5 = 0
[inline]
 

Constructor for a NonBinaryExpr with up to five args.

NonBinaryExpr::NonBinaryExpr OP_TYPE  o,
const Type e,
List< Expression > *  list
 

Creates a new NonBinaryExpr object with the expressions in 'list' as its arguments.

'list' is deleted automatically, so the user must NOT delete 'list' after the call to this constructor.

Definition at line 5938 of file Expression.cc.

References _arg_list, Iterator< T >::current(), e, List< T >::ins_last(), and Iterator< T >::valid().

NonBinaryExpr::NonBinaryExpr const NonBinaryExpr e  )  [inline]
 

Copy constructor.

Definition at line 139 of file NonBinaryExpr.h.

References _arg_list, Expression::arg_list(), and e.

NonBinaryExpr::~NonBinaryExpr  )  [virtual]
 

Virtual destructor.

... nothing to do

Definition at line 5927 of file Expression.cc.


Member Function Documentation

NonBinaryExpr & NonBinaryExpr::operator= const NonBinaryExpr  ) 
 

Copy assignment.

Definition at line 5948 of file Expression.cc.

References _arg_list, Expression::arg_list(), and e.

void NonBinaryExpr::relink_eptrs ProgramUnit p  )  [virtual]
 

Change pointers in a NonBinaryExpr to point within the given ProgramUnit.

Reimplemented from Expression.

Definition at line 6116 of file Expression.cc.

Referenced by Data::relink_ptrs().

Expression * NonBinaryExpr::clone  )  const [virtual]
 

Return a copy of myself.

Implements Expression.

Reimplemented in CommaExpr.

Definition at line 5933 of file Expression.cc.

References NonBinaryExpr().

const List< Expression > & NonBinaryExpr::arg_list  )  const [virtual]
 

... List of no arguments

Reimplemented from Expression.

Definition at line 5957 of file Expression.cc.

References _arg_list.

Referenced by _create_data_assigns(), _fold_top(), and _init_non_local_vars().

List< Expression > & NonBinaryExpr::arg_list  )  [virtual]
 

Return a reference to list of all expression arguments of myself.

... List of no arguments

Reimplemented from Expression.

Definition at line 5963 of file Expression.cc.

References _arg_list.

const RefList< Expression > * NonBinaryExpr::arg_refs  )  const [virtual]
 

Return a list of references to all expression arguments of myself.

This method is outdated. Use arg_list() instead.

Reimplemented from Expression.

Definition at line 5969 of file Expression.cc.

References _arg_list, Iterator< T >::current(), RefList< T >::ins_last(), and Iterator< T >::valid().

int NonBinaryExpr::structures_OK  )  const [virtual]
 

Return 1 if my structures are in a valid state.

Implements Expression.

Reimplemented in CommaExpr.

Definition at line 5981 of file Expression.cc.

References True.

virtual void NonBinaryExpr::convert BinRep exprSet,
Symtab symtab
[virtual]
 

Read in the values of my fields and my subexpressions from the given BinRep object.

Convert(BinRep) expects the BinRep to be referencing an expression set of the same type as the expression. On return, all data from the expression set has been inserted into the appropriate fields in the expression object. NOTE that this converts the expression to an intermediate form which may contain TableExpr objects.

Implements Expression.

Reimplemented in CommaExpr.

virtual void NonBinaryExpr::print_debug ostream &  o,
Boolean  debug
const [virtual]
 

debug indicates whether it should contain extra fields

Implements Expression.

Reimplemented in CommaExpr.

Expression * NonBinaryExpr::member_ref const Symbol  )  [virtual]
 

See Expression.h.

Reimplemented from Expression.

Definition at line 11576 of file Expression.cc.

References _arg_list, Expression::base_variable_ref(), Iterator< T >::current(), MULT_OP, Expression::op(), and Iterator< T >::valid().

int NonBinaryExpr::exchange_expr VDL vdl  )  [virtual]
 

Create a node in the "expression" member and return the index.

Reimplemented from Expression.

Reimplemented in CommaExpr.

Definition at line 5988 of file Expression.cc.

References _arg_list, ADD_OP, AND_OP, COLON_OP, Iterator< T >::current(), EQV_OP, Expression::exchange_expr(), BinRep::find_ref(), Set< T >::ins(), List< T >::ins_last(), MULT_OP, NEQV_OP, OR_OP, BinRep::to_tuple(), and Iterator< T >::valid().

Expression * NonBinaryExpr::_fold_top void   )  [protected, virtual]
 

... Do nothing

Reimplemented from Expression.

Definition at line 9733 of file Expression.cc.

References _expr_can_contain_omega(), _simplify_options, ADD_OP, AND_OP, arg_list(), Iterator< T >::current(), EQV_OP, Mutator< T >::grab(), MULT_OP, NEQV_OP, OMEGA_OP, Expression::op(), OR_OP, and Iterator< T >::valid().

Referenced by _divide_by_int().

Expression * NonBinaryExpr::_divides_evenly const Symbol  )  [protected, virtual]
 

Reimplemented from Expression.

Definition at line 10691 of file Expression.cc.

Expression * NonBinaryExpr::_divide_by_int int &  divisor  )  [protected, virtual]
 

... Do nothing

Reimplemented from Expression.

Definition at line 10719 of file Expression.cc.

References _arg_list, Expression::_divide_by_int(), _fold_top(), _gcd(), _lgcd(), _standardize_top(), ADD_OP, Iterator< T >::current(), List< T >::modify(), MULT_OP, Expression::op(), and Iterator< T >::valid().

int NonBinaryExpr::_gcd void   )  const [protected, virtual]
 

... Do nothing

Reimplemented from Expression.

Definition at line 11521 of file Expression.cc.

References _arg_list, Expression::_gcd(), _lgcd(), ADD_OP, Iterator< T >::current(), MULT_OP, Expression::op(), and Iterator< T >::valid().

Referenced by _divide_by_int().

Expression * NonBinaryExpr::_distribute_top void   )  [protected, virtual]
 

... Convert a product of sums into a sum of products

... Convert into conjunctive normal form (AND of OR's)

... Do nothing

Reimplemented from Expression.

Definition at line 11681 of file Expression.cc.

References _simplify_options, ADD_OP, AND_OP, INTEGER_TYPE, MULT_OP, Expression::op(), OR_OP, and Expression::type().

Boolean NonBinaryExpr::_args_are_equal Expression ,
Boolean  consider_side_effects
[protected, virtual]
 

Reimplemented from Expression.

Definition at line 8558 of file Expression.cc.

References e, and _find_info::find_match().

Expression * NonBinaryExpr::_combine_top void   )  [protected, virtual]
 

... Do nothing

Reimplemented from Expression.

Definition at line 11890 of file Expression.cc.

References _simplify_options, ADD_OP, AND_OP, MULT_OP, Expression::op(), and OR_OP.

void NonBinaryExpr::_backup_aux  )  [protected, virtual]
 

... Recursively call for all children which contain wildcards

Reimplemented from Expression.

Definition at line 7632 of file Expression.cc.

References _arg_list, Iterator< T >::current(), and Iterator< T >::valid().


Friends And Related Function Documentation

friend class ExprTable [friend]
 

Reimplemented in CommaExpr.

Definition at line 35 of file NonBinaryExpr.h.


Member Data Documentation

List<Expression> NonBinaryExpr::_arg_list [protected]
 

Definition at line 81 of file NonBinaryExpr.h.

Referenced by _backup_aux(), _divide_by_int(), _gcd(), arg_list(), arg_refs(), exchange_expr(), member_ref(), NonBinaryExpr(), and operator=().


The documentation for this class was generated from the following files:
 © 1995-2005 University of Illinois, Urbana-Champaign. All rights reserved.  Fri Mar 25 23:07:51 2005