Puma Reference Manual Puma: Puma::CExprValue Class Reference



Puma::CExprValue Class Reference

Base class for syntax tree nodes representing expressions that can be resolved to a constant value (arithmetic constants and string literals). More...

#include <Puma/CExprValue.h>

Inheritance diagram for Puma::CExprValue:
Inheritance graph

List of all members.

Public Member Functions

virtual ~CExprValue ()
 Destructor.
CTypeInfoType () const
 Get the type of the value.
virtual void print (ostream &out) const =0
 Print the value on the given output stream.
virtual CConstantConstant () const
 Get a pointer to CConstant if this is an arithmetic constant.
virtual CStrLiteralStrLiteral () const
 Get a pointer to CStrLiteral if this is a string literal.
virtual CWStrLiteralWStrLiteral () const
 Get a pointer to CWStrLiteral if this is a wide string literal.

Protected Member Functions

 CExprValue (CTypeInfo *t)
 Constructor.

Detailed Description

Base class for syntax tree nodes representing expressions that can be resolved to a constant value (arithmetic constants and string literals).


Constructor & Destructor Documentation

Puma::CExprValue::CExprValue ( CTypeInfo t) [inline, protected]

Constructor.

Parameters:
tThe type of the value.
virtual Puma::CExprValue::~CExprValue ( ) [inline, virtual]

Destructor.


Member Function Documentation

virtual CConstant* Puma::CExprValue::Constant ( ) const [inline, virtual]

Get a pointer to CConstant if this is an arithmetic constant.

Reimplemented in Puma::CConstant.

virtual void Puma::CExprValue::print ( ostream &  out) const [pure virtual]

Print the value on the given output stream.

Parameters:
outThe stream on which to print.

Implemented in Puma::CConstant, Puma::CStrLiteral, and Puma::CWStrLiteral.

virtual CStrLiteral* Puma::CExprValue::StrLiteral ( ) const [inline, virtual]

Get a pointer to CStrLiteral if this is a string literal.

Reimplemented in Puma::CStrLiteral.

CTypeInfo* Puma::CExprValue::Type ( ) const [inline]

Get the type of the value.

virtual CWStrLiteral* Puma::CExprValue::WStrLiteral ( ) const [inline, virtual]

Get a pointer to CWStrLiteral if this is a wide string literal.

Reimplemented in Puma::CWStrLiteral.