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

#include <CSemExpr.h>

Classes

struct  SubObj
 

Public Member Functions

 CSemExpr (ErrorSink &, CStructure *scope)
 
CTypeInfo * resolveExpr (CTree *expr, CTree *base=(CTree *) 0)
 
void resolveInit (CObjectInfo *, CTree *, CTree *, bool=false)
 
CTypeInfo * resolve (CTree *, CTree *)
 
CTypeInfo * resolve (CT_SimpleName *, CTree *)
 
CTypeInfo * resolve (CT_String *, CTree *)
 
CTypeInfo * resolve (CT_WideString *, CTree *)
 
CTypeInfo * resolve (CT_CmpdLiteral *, CTree *)
 
CTypeInfo * resolve (CT_Bool *, CTree *)
 
CTypeInfo * resolve (CT_Character *, CTree *)
 
CTypeInfo * resolve (CT_WideCharacter *, CTree *)
 
CTypeInfo * resolve (CT_Integer *, CTree *)
 
CTypeInfo * resolve (CT_Float *, CTree *)
 
CTypeInfo * resolve (CT_BracedExpr *, CTree *)
 
CTypeInfo * resolve (CT_BinaryExpr *, CTree *)
 
CTypeInfo * resolve (CT_UnaryExpr *, CTree *)
 
CTypeInfo * resolve (CT_AddrExpr *, CTree *)
 
CTypeInfo * resolve (CT_DerefExpr *, CTree *)
 
CTypeInfo * resolve (CT_PostfixExpr *, CTree *)
 
CTypeInfo * resolve (CT_IndexExpr *, CTree *)
 
CTypeInfo * resolve (CT_SizeofExpr *, CTree *)
 
CTypeInfo * resolve (CT_AlignofExpr *, CTree *)
 
CTypeInfo * resolve (CT_OffsetofExpr *, CTree *)
 
CTypeInfo * resolve (CT_IfThenExpr *, CTree *)
 
CTypeInfo * resolve (CT_CastExpr *, CTree *)
 
CTypeInfo * resolve (CT_CallExpr *, CTree *)
 
CTypeInfo * resolve (CT_MembPtrExpr *, CTree *)
 
CTypeInfo * binary_rel (CT_BinaryExpr *)
 
CTypeInfo * binary_ass (CT_BinaryExpr *)
 
CTypeInfo * binary_log (CT_BinaryExpr *)
 
CTypeInfo * binary_and (CT_BinaryExpr *)
 
CTypeInfo * binary_equ (CT_BinaryExpr *)
 
CTypeInfo * binary_mul (CT_BinaryExpr *)
 
CTypeInfo * binary_add (CT_BinaryExpr *)
 
CTypeInfo * binary_shift (CT_BinaryExpr *)
 
CTypeInfo * binary_comma (CT_BinaryExpr *)
 
CTypeInfo * apply_binary_op (CTree *, int)
 
CTypeInfo * applyImplicitConv (CTree *expr, CTree *base, CTypeInfo *type)
 
void overflow (CTree *, int, bool &) const
 
int scan_character (CTree *, LONG_LONG &) const
 
LONG_LONG next_character (const char *&, bool &) const
 
CTypeInfo * cond_expr_type (CT_IfThenExpr *node, CTypeInfo *t1, CTree *op1, CTypeInfo *t2, CTree *op2, CTypeInfo *t3, CTree *op3)
 

Static Public Member Functions

static bool isConstExpr (CTree *, bool=false)
 
static bool isConstIntExpr (CTree *)
 
static bool isConstantMembPtr (CTree *node)
 
static bool isLvalue (CTree *)
 
static void passOnConstant (CTree *node, CTree *base, CTypeInfo *t1)
 
static CTypeInfo * cast_to (CTypeInfo *, CTree *, CTree *, bool=true)
 
static CTypeInfo * promote (CTree *, CTree *)
 
static CObjectInfo * findObject (CTree *, bool const_expr=false)
 
static bool isPtrToObj (CTypeInfo *, unsigned long=0)
 
static bool isModifiable (CTypeInfo *, unsigned long=0)
 
static bool compatible (CTypeInfo *, CTypeInfo *, CConstant *value=0)
 
static bool compatibleBase (CTypeInfo *, CTypeInfo *, CConstant *value=0)
 

Protected Types

enum  SemObjType {
  CLASS ,
  UNION ,
  ENUM ,
  TYPEDEF ,
  FCT ,
  ATTRIB ,
  ARG ,
  TAG ,
  NON_TAG ,
  ANY
}
 

Protected Member Functions

void resolveInit (CObjectInfo *, CTree *, CTree *, bool, Stack< SubObj > &)
 
void singleExprInit (CTree *, CTree *, CTypeInfo *, bool)
 
void findFirst (CTree *, CTypeInfo *&, CObjectInfo *&, CObjectInfo *&, CObjectInfo *, Stack< SubObj > &, bool) const
 
void findNext (CTree *, CTypeInfo *&, CObjectInfo *&, CObjectInfo *&, CObjectInfo *, Stack< SubObj > &, bool) const
 
void pushSubObj (CTypeInfo *&, CObjectInfo *&, Stack< SubObj > &) const
 
void popSubObj (CTypeInfo *&, CObjectInfo *&, CObjectInfo *&, Stack< SubObj > &) const
 
CObjectInfo * nextMember (CStructure *, CObjectInfo *) const
 
CObjectInfo * lookup (CT_SimpleName *, SemObjType, bool=false) const
 
CObjectInfo * lookup (const char *, CStructure *, SemObjType, bool, unsigned long int) const
 
CObjectInfo * Type (const char *, CStructure *, SemObjType, unsigned long int) const
 
CObjectInfo * Attribute (const char *, CStructure *, unsigned long int) const
 
CObjectInfo * Function (const char *, CStructure *, unsigned long int) const
 
bool known_here (CObjectInfo *, unsigned long int) const
 

Protected Attributes

ErrorSink & err
 
CStructure * current_scope
 
int conv_to_ptr
 

Member Enumeration Documentation

◆ SemObjType

Enumerator
CLASS 
UNION 
ENUM 
TYPEDEF 
FCT 
ATTRIB 
ARG 
TAG 
NON_TAG 
ANY 

Constructor & Destructor Documentation

◆ CSemExpr()

Puma::CSemExpr::CSemExpr ( ErrorSink &  e,
CStructure *  scope 
)
inline

Member Function Documentation

◆ apply_binary_op()

CTypeInfo * Puma::CSemExpr::apply_binary_op ( CTree *  ,
int   
)

◆ applyImplicitConv()

CTypeInfo * Puma::CSemExpr::applyImplicitConv ( CTree *  expr,
CTree *  base,
CTypeInfo *  type 
)

◆ Attribute()

CObjectInfo * Puma::CSemExpr::Attribute ( const char *  ,
CStructure *  ,
unsigned long int   
) const
protected

◆ binary_add()

CTypeInfo * Puma::CSemExpr::binary_add ( CT_BinaryExpr *  )

◆ binary_and()

CTypeInfo * Puma::CSemExpr::binary_and ( CT_BinaryExpr *  )

◆ binary_ass()

CTypeInfo * Puma::CSemExpr::binary_ass ( CT_BinaryExpr *  )

◆ binary_comma()

CTypeInfo * Puma::CSemExpr::binary_comma ( CT_BinaryExpr *  )

◆ binary_equ()

CTypeInfo * Puma::CSemExpr::binary_equ ( CT_BinaryExpr *  )

◆ binary_log()

CTypeInfo * Puma::CSemExpr::binary_log ( CT_BinaryExpr *  )

◆ binary_mul()

CTypeInfo * Puma::CSemExpr::binary_mul ( CT_BinaryExpr *  )

◆ binary_rel()

CTypeInfo * Puma::CSemExpr::binary_rel ( CT_BinaryExpr *  )

◆ binary_shift()

CTypeInfo * Puma::CSemExpr::binary_shift ( CT_BinaryExpr *  )

◆ cast_to()

static CTypeInfo * Puma::CSemExpr::cast_to ( CTypeInfo *  ,
CTree *  ,
CTree *  ,
bool  = true 
)
static

◆ compatible()

static bool Puma::CSemExpr::compatible ( CTypeInfo *  ,
CTypeInfo *  ,
CConstant *  value = 0 
)
static

◆ compatibleBase()

bool Puma::CSemExpr::compatibleBase ( CTypeInfo *  t1,
CTypeInfo *  t2,
CConstant *  value = 0 
)
inlinestatic

◆ cond_expr_type()

CTypeInfo * Puma::CSemExpr::cond_expr_type ( CT_IfThenExpr *  node,
CTypeInfo *  t1,
CTree *  op1,
CTypeInfo *  t2,
CTree *  op2,
CTypeInfo *  t3,
CTree *  op3 
)

◆ findFirst()

void Puma::CSemExpr::findFirst ( CTree *  ,
CTypeInfo *&  ,
CObjectInfo *&  ,
CObjectInfo *&  ,
CObjectInfo *  ,
Stack< SubObj > &  ,
bool   
) const
protected

◆ findNext()

void Puma::CSemExpr::findNext ( CTree *  ,
CTypeInfo *&  ,
CObjectInfo *&  ,
CObjectInfo *&  ,
CObjectInfo *  ,
Stack< SubObj > &  ,
bool   
) const
protected

◆ findObject()

static CObjectInfo * Puma::CSemExpr::findObject ( CTree *  ,
bool  const_expr = false 
)
static

◆ Function()

CObjectInfo * Puma::CSemExpr::Function ( const char *  ,
CStructure *  ,
unsigned long int   
) const
protected

◆ isConstantMembPtr()

static bool Puma::CSemExpr::isConstantMembPtr ( CTree *  node)
static

◆ isConstExpr()

static bool Puma::CSemExpr::isConstExpr ( CTree *  ,
bool  = false 
)
static

◆ isConstIntExpr()

static bool Puma::CSemExpr::isConstIntExpr ( CTree *  )
static

◆ isLvalue()

static bool Puma::CSemExpr::isLvalue ( CTree *  )
static

◆ isModifiable()

bool Puma::CSemExpr::isModifiable ( CTypeInfo *  type,
unsigned long  pos = 0 
)
inlinestatic

◆ isPtrToObj()

bool Puma::CSemExpr::isPtrToObj ( CTypeInfo *  type,
unsigned long  pos = 0 
)
inlinestatic

◆ known_here()

bool Puma::CSemExpr::known_here ( CObjectInfo *  ,
unsigned long int   
) const
protected

◆ lookup() [1/2]

CObjectInfo * Puma::CSemExpr::lookup ( const char *  ,
CStructure *  ,
SemObjType  ,
bool  ,
unsigned long int   
) const
protected

◆ lookup() [2/2]

CObjectInfo * Puma::CSemExpr::lookup ( CT_SimpleName *  ,
SemObjType  ,
bool  = false 
) const
protected

◆ next_character()

LONG_LONG Puma::CSemExpr::next_character ( const char *&  ,
bool &   
) const

◆ nextMember()

CObjectInfo * Puma::CSemExpr::nextMember ( CStructure *  ,
CObjectInfo *   
) const
protected

◆ overflow()

void Puma::CSemExpr::overflow ( CTree *  ,
int  ,
bool &   
) const

◆ passOnConstant()

static void Puma::CSemExpr::passOnConstant ( CTree *  node,
CTree *  base,
CTypeInfo *  t1 
)
static

◆ popSubObj()

void Puma::CSemExpr::popSubObj ( CTypeInfo *&  ,
CObjectInfo *&  ,
CObjectInfo *&  ,
Stack< SubObj > &   
) const
protected

◆ promote()

static CTypeInfo * Puma::CSemExpr::promote ( CTree *  ,
CTree *   
)
static

◆ pushSubObj()

void Puma::CSemExpr::pushSubObj ( CTypeInfo *&  ,
CObjectInfo *&  ,
Stack< SubObj > &   
) const
protected

◆ resolve() [1/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_AddrExpr *  ,
CTree *   
)

◆ resolve() [2/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_AlignofExpr *  ,
CTree *   
)

◆ resolve() [3/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_BinaryExpr *  ,
CTree *   
)

◆ resolve() [4/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_Bool *  ,
CTree *   
)

◆ resolve() [5/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_BracedExpr *  ,
CTree *   
)

◆ resolve() [6/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_CallExpr *  ,
CTree *   
)

◆ resolve() [7/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_CastExpr *  ,
CTree *   
)

◆ resolve() [8/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_Character *  ,
CTree *   
)

◆ resolve() [9/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_CmpdLiteral *  ,
CTree *   
)

◆ resolve() [10/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_DerefExpr *  ,
CTree *   
)

◆ resolve() [11/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_Float *  ,
CTree *   
)

◆ resolve() [12/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_IfThenExpr *  ,
CTree *   
)

◆ resolve() [13/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_IndexExpr *  ,
CTree *   
)

◆ resolve() [14/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_Integer *  ,
CTree *   
)

◆ resolve() [15/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_MembPtrExpr *  ,
CTree *   
)

◆ resolve() [16/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_OffsetofExpr *  ,
CTree *   
)

◆ resolve() [17/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_PostfixExpr *  ,
CTree *   
)

◆ resolve() [18/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_SimpleName *  ,
CTree *   
)

◆ resolve() [19/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_SizeofExpr *  ,
CTree *   
)

◆ resolve() [20/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_String *  ,
CTree *   
)

◆ resolve() [21/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_UnaryExpr *  ,
CTree *   
)

◆ resolve() [22/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_WideCharacter *  ,
CTree *   
)

◆ resolve() [23/24]

CTypeInfo * Puma::CSemExpr::resolve ( CT_WideString *  ,
CTree *   
)

◆ resolve() [24/24]

CTypeInfo * Puma::CSemExpr::resolve ( CTree *  ,
CTree *   
)

◆ resolveExpr()

CTypeInfo * Puma::CSemExpr::resolveExpr ( CTree *  expr,
CTree *  base = (CTree *) 0 
)

◆ resolveInit() [1/2]

void Puma::CSemExpr::resolveInit ( CObjectInfo *  ,
CTree *  ,
CTree *  ,
bool  ,
Stack< SubObj > &   
)
protected

◆ resolveInit() [2/2]

void Puma::CSemExpr::resolveInit ( CObjectInfo *  ,
CTree *  ,
CTree *  ,
bool  = false 
)

◆ scan_character()

int Puma::CSemExpr::scan_character ( CTree *  ,
LONG_LONG &   
) const

◆ singleExprInit()

void Puma::CSemExpr::singleExprInit ( CTree *  ,
CTree *  ,
CTypeInfo *  ,
bool   
)
protected

◆ Type()

CObjectInfo * Puma::CSemExpr::Type ( const char *  ,
CStructure *  ,
SemObjType  ,
unsigned long int   
) const
protected

Member Data Documentation

◆ conv_to_ptr

int Puma::CSemExpr::conv_to_ptr
protected

◆ current_scope

CStructure* Puma::CSemExpr::current_scope
protected

◆ err

ErrorSink& Puma::CSemExpr::err
protected