PUMA Library Reference Manual
Loading...
Searching...
No Matches
Puma::CExprValue Class Referenceabstract

#include <Puma/CExprValue.h>

+ Inheritance diagram for Puma::CExprValue:

Description

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

Public Member Functions

virtual ~CExprValue ()
 Destructor.
 
CTypeInfoType () const
 Get the type of the value.
 
virtual void print (std::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.
 

Constructor & Destructor Documentation

◆ CExprValue()

Puma::CExprValue::CExprValue ( CTypeInfo * t)
inlineprotected

Constructor.

Parameters
tThe type of the value.

◆ ~CExprValue()

virtual Puma::CExprValue::~CExprValue ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ Constant()

virtual CConstant * Puma::CExprValue::Constant ( ) const
inlinevirtual

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

Reimplemented in Puma::CConstant.

◆ print()

virtual void Puma::CExprValue::print ( std::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.

◆ StrLiteral()

virtual CStrLiteral * Puma::CExprValue::StrLiteral ( ) const
inlinevirtual

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

Reimplemented in Puma::CStrLiteral.

◆ Type()

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

Get the type of the value.

◆ WStrLiteral()

virtual CWStrLiteral * Puma::CExprValue::WStrLiteral ( ) const
inlinevirtual

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

Reimplemented in Puma::CWStrLiteral.