vrq

CDataType Class Reference

Base class for describing data types. More...

#include <cdatatype.h>

Inheritance diagram for CDataType:
CObject CSimpleType

List of all members.

Public Member Functions

 CDataType (VarDataType_t t)
 Create data type instance.
virtual CDataTypeClone (CObstack *heap)=0
 Create a new copy with a deep copy.
virtual void SetVarDataType (VarDataType_t v)
 Set declaration's variable data type.
virtual VarDataType_t GetVarDataType () const
 Get declaration's variable data type.
virtual void SetConst (int v)
 Set declaration's const property.
virtual int GetConst () const
 Get declaration's const property.
virtual int GetTwoState () const =0
 Get declaration's 2 state property.
virtual int GetSigned () const =0
 Get declartion's signed property.
virtual NodeType_t GetNodeType (void) const =0
 Get data type.
virtual int IsPacked () const =0
 Determine if complete data structure is packed.
virtual CNodeGetPackedRange () const =0
 Get expression for datatype's overall packed range (msb/lsb).
virtual void Dump (FILE *f) const =0
 Dump data type info to file descriptor.
virtual void PreVisit1 (int(*callback)(CNode *, void *), void *data)=0
 Walk tree invoking callback on each node before children have been visited.
virtual void PostVisit1 (void(*callback)(CNode *, void *), void *data)=0
 Walk tree invoking callback on each node after children have been visited.
virtual void PostSubVisit1 (CNode *(*callback)(CNode *, void *), void *data)=0
 Walk tree invoking callback on each node after children have been visited.

Protected Member Functions

void Copy (CObstack *heap, const CDataType &o)
 Perform deep copy of given object to this one This should never be call directly, only by subclasses.

Detailed Description

Base class for describing data types.


Constructor & Destructor Documentation

CDataType::CDataType ( VarDataType_t  t  ) 

Create data type instance.


Member Function Documentation

virtual CDataType* CDataType::Clone ( CObstack heap  )  [pure virtual]

Create a new copy with a deep copy.

Parameters:
heap heap to use for allocation.

Implemented in CSimpleType.

void CDataType::Copy ( CObstack heap,
const CDataType o 
) [protected]

Perform deep copy of given object to this one This should never be call directly, only by subclasses.

Parameters:
heap heap to use for allocation.
o declaration to copy.

Reimplemented in CSimpleType.

virtual void CDataType::Dump ( FILE *  f  )  const [pure virtual]

Dump data type info to file descriptor.

Parameters:
f file descriptor.

Implemented in CSimpleType.

virtual int CDataType::GetConst (  )  const [inline, virtual]

Get declaration's const property.

Returns:
value of const property.
virtual NodeType_t CDataType::GetNodeType ( void   )  const [pure virtual]

Get data type.

Returns:
node type

Implemented in CSimpleType.

virtual CNode* CDataType::GetPackedRange (  )  const [pure virtual]

Get expression for datatype's overall packed range (msb/lsb).

Returns:
range expression, NULL if scalar.

Implemented in CSimpleType.

virtual int CDataType::GetSigned (  )  const [pure virtual]

Get declartion's signed property.

Returns:
value of signed property.

Implemented in CSimpleType.

virtual int CDataType::GetTwoState (  )  const [pure virtual]

Get declaration's 2 state property.

Returns:
value of 2 state property.

Implemented in CSimpleType.

virtual VarDataType_t CDataType::GetVarDataType (  )  const [inline, virtual]

Get declaration's variable data type.

Returns:
value of signed property.
virtual int CDataType::IsPacked (  )  const [pure virtual]

Determine if complete data structure is packed.

Returns:
non-zero if complete data structure is packed.

Implemented in CSimpleType.

virtual void CDataType::PostSubVisit1 ( CNode *(*)(CNode *, void *)  callback,
void *  data 
) [pure virtual]

Walk tree invoking callback on each node after children have been visited.

callback may modify tree and return a modified subtree.

Parameters:
callback function to be called for each node
data opaque argument passed to callback function
Returns:
modified child subtree.

Implemented in CSimpleType.

virtual void CDataType::PostVisit1 ( void(*)(CNode *, void *)  callback,
void *  data 
) [pure virtual]

Walk tree invoking callback on each node after children have been visited.

Parameters:
callback function to be called for each node
data opaque argument passed to callback function

Implemented in CSimpleType.

virtual void CDataType::PreVisit1 ( int(*)(CNode *, void *)  callback,
void *  data 
) [pure virtual]

Walk tree invoking callback on each node before children have been visited.

callback can terminate transversal early. callback returns 0 to terminate transversal early.

Parameters:
callback function to be called for each node
data opaque argument passed to callback function

Implemented in CSimpleType.

virtual void CDataType::SetConst ( int  v  )  [inline, virtual]

Set declaration's const property.

Use to indicate type is a constant variable.

Parameters:
v value to const property.
virtual void CDataType::SetVarDataType ( VarDataType_t  v  )  [inline, virtual]

Set declaration's variable data type.

Parameters:
v variable data type

The documentation for this class was generated from the following file:

Generated on 3 Apr 2010 for vrq by  doxygen 1.6.1