Polaris: UnaryExpr Class Reference

UnaryExpr Class Reference

An expression with a single argument. More...

#include <UnaryExpr.h>

Inheritance diagram for UnaryExpr:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 UnaryExpr (OP_TYPE o, const Type &e, Expression *expr_exp)
 UnaryExpr (const UnaryExpr &e)
virtual ~UnaryExpr ()
 UnaryExpr code:.
UnaryExproperator= (const UnaryExpr &)
virtual const Expressionexpr_guarded () const
virtual Expressionexpr_guarded ()
 Return a reference to the argument.
virtual void expr (Expression *)
 Set the argument to the given expression.
virtual Boolean expr_valid () const
 Return true if the argument is valid.
virtual Expressiongrab_expr ()
 Relinquish my ownership of my argument and return it.
virtual Expressionclone () const
 Return a copy of myself.
virtual Boolean args_are_non_null () const
 Return true if the unary or binary expression doesn't have any non-NULL subexpression arguments.
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
 See Expression.h.
virtual int exchange_expr (VDL &vdl)
 Create a node in the "expression" member and return the index.

Protected Member Functions

 UnaryExpr (OP_TYPE o, const Type &e)
const Expression_expr_guarded () const
Expression_expr_guarded ()
void _expr (Expression *)
Boolean _expr_valid () const
Expression_grab_expr ()
virtual Expression_fold_top (void)
virtual Boolean _args_are_equal (Expression &, Boolean consider_side_effects)
virtual void relink_eptrs (ProgramUnit &p)
 Change the pointers in the UnaryExpr to point into the given ProgramUnit.
virtual void _backup_aux ()

Friends

class ExprTable

Detailed Description

An expression with a single argument.

Polaris Expression

See also:
Expression/UnaryExpr.h

Expression/UnaryExpr.h

Expression/Expression.cc

Description

A UnaryExpr is a expression with a single argument. This argument is accessed through the expr() methods. A UnaryExpr can be one of several kinds of expressions. The most common of these are are U_MINUS_OP (-) and NOT_OP (.NOT.).

Definition at line 33 of file UnaryExpr.h.


Constructor & Destructor Documentation

UnaryExpr::UnaryExpr OP_TYPE  o,
const Type e,
Expression expr_exp
[inline]
 

< nothing to do

Definition at line 100 of file UnaryExpr.h.

References e, and null_to_omega().

Referenced by clone().

UnaryExpr::UnaryExpr const UnaryExpr e  )  [inline]
 

Definition at line 107 of file UnaryExpr.h.

References e, and List< T >::fix_size().

UnaryExpr::~UnaryExpr  )  [virtual]
 

UnaryExpr code:.

... nothing to do

Definition at line 6984 of file Expression.cc.

UnaryExpr::UnaryExpr OP_TYPE  o,
const Type e
[inline, protected]
 

< nothing to do

Definition at line 93 of file UnaryExpr.h.

References e.


Member Function Documentation

UnaryExpr & UnaryExpr::operator= const UnaryExpr  ) 
 

Definition at line 6990 of file Expression.cc.

References _expr(), _expr_valid(), _grab_expr(), DistributeExpr::clone(), and e.

Referenced by ReturnStarExpr::operator=().

const Expression & UnaryExpr::expr_guarded  )  const [virtual]
 

Reimplemented from Expression.

Definition at line 7015 of file Expression.cc.

References _expr_guarded().

Referenced by _backup_aux().

Expression & UnaryExpr::expr_guarded  )  [virtual]
 

Return a reference to the argument.

Reimplemented from Expression.

Definition at line 7021 of file Expression.cc.

References _expr_guarded().

void UnaryExpr::expr Expression  )  [virtual]
 

Set the argument to the given expression.

Reimplemented from Expression.

Definition at line 7009 of file Expression.cc.

References _expr(), and e.

Boolean UnaryExpr::expr_valid  )  const [virtual]
 

Return true if the argument is valid.

Reimplemented from Expression.

Definition at line 7027 of file Expression.cc.

References _expr_valid().

Expression * UnaryExpr::grab_expr  )  [virtual]
 

Relinquish my ownership of my argument and return it.

My argument will now be marked as invalid.

Reimplemented from Expression.

Definition at line 7033 of file Expression.cc.

References _grab_expr().

Expression * UnaryExpr::clone  )  const [virtual]
 

Return a copy of myself.

Implements Expression.

Reimplemented in ReturnStarExpr.

Definition at line 7003 of file Expression.cc.

References UnaryExpr().

Boolean UnaryExpr::args_are_non_null  )  const [virtual]
 

Return true if the unary or binary expression doesn't have any non-NULL subexpression arguments.

Reimplemented from Expression.

Definition at line 7039 of file Expression.cc.

References _expr_valid().

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

... List of no arguments

Reimplemented from Expression.

Definition at line 7045 of file Expression.cc.

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

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

... List of no arguments

Reimplemented from Expression.

Definition at line 7051 of file Expression.cc.

const RefList< Expression > * UnaryExpr::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 7057 of file Expression.cc.

References _expr_guarded(), _expr_valid(), and RefList< T >::ins_last().

int UnaryExpr::structures_OK  )  const [virtual]
 

Return 1 if my structures are in a valid state.

Implements Expression.

Reimplemented in ReturnStarExpr.

Definition at line 7068 of file Expression.cc.

References True.

virtual void UnaryExpr::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 ReturnStarExpr.

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

See Expression.h.

Implements Expression.

Reimplemented in ReturnStarExpr.

int UnaryExpr::exchange_expr VDL vdl  )  [virtual]
 

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

Reimplemented from Expression.

Reimplemented in ReturnStarExpr.

Definition at line 7075 of file Expression.cc.

References Expression::exchange_expr(), BinRep::find_ref(), Set< T >::ins(), List< T >::ins_last(), NOT_OP, PAREN_OP, BinRep::to_tuple(), U_MINUS_OP, and U_PLUS_OP.

const Expression & UnaryExpr::_expr_guarded  )  const [inline, protected]
 

Definition at line 121 of file UnaryExpr.h.

References List< T >::valid().

Referenced by _args_are_equal(), _fold_top(), arg_refs(), expr_guarded(), and relink_eptrs().

Expression & UnaryExpr::_expr_guarded  )  [inline, protected]
 

Definition at line 130 of file UnaryExpr.h.

References List< T >::valid().

void UnaryExpr::_expr Expression  )  [inline, protected]
 

Definition at line 115 of file UnaryExpr.h.

References e, List< T >::modify(), and null_to_omega().

Referenced by expr(), and operator=().

Boolean UnaryExpr::_expr_valid  )  const [inline, protected]
 

Definition at line 139 of file UnaryExpr.h.

References List< T >::valid().

Referenced by _args_are_equal(), _fold_top(), arg_refs(), args_are_non_null(), expr_valid(), operator=(), and relink_eptrs().

Expression * UnaryExpr::_grab_expr  )  [inline, protected]
 

Definition at line 145 of file UnaryExpr.h.

References List< T >::grab().

Referenced by _fold_top(), grab_expr(), and operator=().

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

... Do nothing

Reimplemented from Expression.

Definition at line 9649 of file Expression.cc.

References _expr_can_contain_omega(), _expr_guarded(), _expr_valid(), _grab_expr(), _simplify_options, NOT_OP, OMEGA_OP, Expression::op(), PAREN_OP, U_MINUS_OP, and U_PLUS_OP.

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

Reimplemented from Expression.

Definition at line 8522 of file Expression.cc.

References _expr_guarded(), _expr_valid(), e, Expression::expr_guarded(), Expression::expr_valid(), and wildcard_compare_args().

void UnaryExpr::relink_eptrs ProgramUnit p  )  [protected, virtual]
 

Change the pointers in the UnaryExpr to point into the given ProgramUnit.

Reimplemented from Expression.

Definition at line 7176 of file Expression.cc.

References _expr_guarded(), _expr_valid(), and Expression::relink_eptrs().

void UnaryExpr::_backup_aux  )  [protected, virtual]
 

... Recursively call for all children which contain wildcards

Reimplemented from Expression.

Definition at line 7616 of file Expression.cc.

References Expression::_backup(), and expr_guarded().


Friends And Related Function Documentation

friend class ExprTable [friend]
 

Definition at line 34 of file UnaryExpr.h.


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:08:37 2005