expression_integer Class Reference

#include <integer.h>

Inheritance diagram for expression_integer:

expression expression_integer_compile expression_integer_pretty expression_integer_compile_enumerated List of all members.

Public Member Functions

virtual ~expression_integer ()
 expression_integer (const rcstring &value)
 expression_integer (const rcstring &value, const location &locn)
 expression_integer (long value)
 expression_integer (long value, const location &locn)
long get_value () const

Protected Member Functions

type::pointer get_type () const
bool is_lvalue () const
int get_precedence () const
side_effect_t has_side_effect () const
bool is_constant () const
long get_integer_value () const

Private Member Functions

 expression_integer ()
 expression_integer (const expression_integer &)
expression_integeroperator= (const expression_integer &)

Private Attributes

long value

Detailed Description

The expression_integer class is used to represent an integer-valued constant expression node.

Definition at line 31 of file integer.h.


Constructor & Destructor Documentation

virtual expression_integer::~expression_integer (  )  [virtual]

The destructor.

expression_integer::expression_integer ( const rcstring value  ) 

The constructor.

Parameters:
value the content of the integer constant.

expression_integer::expression_integer ( const rcstring value,
const location locn 
)

The constructor.

Parameters:
value the content of the integer constant.
locn The source location of the constant

expression_integer::expression_integer ( long  value  ) 

The constructor.

Parameters:
value the content of the integer constant.

expression_integer::expression_integer ( long  value,
const location locn 
)

The constructor.

Parameters:
value the content of the integer constant.
locn the source location of the constant

expression_integer::expression_integer (  )  [private]

The default constructor. Do not use.

expression_integer::expression_integer ( const expression_integer  )  [private]

The copy constructor. Do not use.


Member Function Documentation

long expression_integer::get_value (  )  const [inline]

The get_value method is used to obtain the value of the integer constant. It is raw data, you willprobably need to escape it if you are going to print it.

Definition at line 81 of file integer.h.

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

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

Implements expression.

Reimplemented in expression_integer_compile_enumerated.

bool expression_integer::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.

int expression_integer::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.

side_effect_t expression_integer::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.

bool expression_integer::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.

long expression_integer::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_integer& expression_integer::operator= ( const expression_integer  )  [private]

The assignment operator. Do not use.


Member Data Documentation

long expression_integer::value [private]

The value instance variable is used to remember the content of the integer constant.

Definition at line 107 of file integer.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