expression_boolean Class Reference

#include <boolean.h>

Inheritance diagram for expression_boolean:

expression expression_boolean_compile expression_boolean_pretty List of all members.

Public Member Functions

virtual ~expression_boolean ()
 expression_boolean (bool value)
 expression_boolean (bool value, const location &where)
bool get_value () const

Protected Member Functions

bool is_constant () const
int get_precedence () const
type::pointer get_type () const
bool is_lvalue () const
side_effect_t has_side_effect () const
void logical_traversal (int pprec, label::pointer &true_branch, label::pointer &false_branch, bool fall_through_preference)
long get_integer_value () const

Private Member Functions

 expression_boolean ()
 expression_boolean (const expression_boolean &)
expression_booleanoperator= (const expression_boolean &)

Private Attributes

bool value

Detailed Description

The expression_boolean class is used to represent an abstract boolean constant valued expression.

Definition at line 30 of file boolean.h.


Constructor & Destructor Documentation

virtual expression_boolean::~expression_boolean (  )  [virtual]

The destructor.

expression_boolean::expression_boolean ( bool  value  ) 

The constructor.

expression_boolean::expression_boolean ( bool  value,
const location where 
)

The constructor.

expression_boolean::expression_boolean (  )  [private]

The default constructor. Do not use.

expression_boolean::expression_boolean ( const expression_boolean  )  [private]

The copy constructor. Do not use.


Member Function Documentation

bool expression_boolean::get_value (  )  const [inline]

The get_value method is used to obtrain the value of this constant expression.

Definition at line 53 of file boolean.h.

bool expression_boolean::is_constant (  )  const [protected, virtual]

The is_constant method may be used to determine whether this expression node is a constant, or this tree would evaluate to a constant.

The default implementation is conservative, and always returns false.

Returns:
bool; true if constant, false if not.

Reimplemented from expression.

int expression_boolean::get_precedence (  )  const [protected, virtual]

The get_precedence method is used to obtain the precedence of this expression node.

The highest precedence has the highest absolute value, the lowest precedence gets the lowest absolute value.

Implements expression.

type::pointer expression_boolean::get_type (  )  const [protected, virtual]

The get_type method is used to get the type of this expression.

Implements expression.

bool expression_boolean::is_lvalue (  )  const [protected, virtual]

The is_lvalue method is used to determine whether or not this expression is suitable to appear on the left hand side of an assignment expression.

Implements expression.

side_effect_t expression_boolean::has_side_effect (  )  const [protected, virtual]

The has_side_effect method is used to determine if an expression has any effect. It is used by the parse to produce "statement with no effect" warnings.

Implements expression.

void expression_boolean::logical_traversal ( int  pprec,
label::pointer true_branch,
label::pointer false_branch,
bool  fall_through_preference 
) [protected]

Reimplemented in expression_boolean_compile, and expression_boolean_pretty.

long expression_boolean::get_integer_value (  )  const [protected, virtual]

The get_integer_value method is used to obtain the integer value of an expression node. It is an error, and the results are undefined (probably rm -rf or worse), if this is not a constant integer expression node.

Reimplemented from expression.

expression_boolean& expression_boolean::operator= ( const expression_boolean  )  [private]

The assignment operator. Do not use.


Member Data Documentation

bool expression_boolean::value [private]

The value instance variable is used to remember the value of this constant boolean expression.

Definition at line 83 of file boolean.h.


The documentation for this class was generated from the following file:
Generated on Sun Feb 25 01:27:11 2007 for UCSDp-SystemCrossCompiler by  doxygen 1.5.1