![]() |
![]() |
Base class for describing data types. More...
#include <cdatatype.h>
Public Member Functions | |
CDataType (VarDataType_t t) | |
Create data type instance. More... | |
CDataType (VarDataType_t t, list< CNode * > packedList) | |
Create data type instance. More... | |
virtual CDataType * | Clone (CObstack *heap)=0 |
Create a new copy with a deep copy. More... | |
virtual void | SetVarDataType (VarDataType_t v) |
Set declaration's variable data type. More... | |
virtual VarDataType_t | GetVarDataType () const |
Get declaration's variable data type. More... | |
virtual const char * | GetVarDataTypeName () const |
Get declaration's variable data type as a string. More... | |
virtual void | SetConst (int v) |
Set declaration's const property. More... | |
virtual int | GetConst () const |
Get declaration's const property. More... | |
virtual int | GetTwoState () const =0 |
Get declaration's 2 state property. More... | |
virtual int | GetSigned () const =0 |
Get declartion's signed property. More... | |
virtual NodeType_t | GetNodeType (void) const =0 |
Get data type. More... | |
virtual bool | Validate (string &errorMessage) |
Validate data structure. More... | |
virtual int | IsBaseWidthConstant (void) const =0 |
Determine if base width (sans packed dimensions) of declaration is constant, ie dependent upon only constants and parameters. More... | |
virtual int | IsBaseWidthVolatile (void) const =0 |
Determine if base width (sans packed dimensions) of declaration is volatile, ie depend upon parameters or variables. More... | |
virtual int | IsBaseWidthEvaluateable (void) const =0 |
Determine if base width (sans packed dimensions) of declaration can be evaluated. More... | |
virtual INT32 | GetBaseWidth (void) const =0 |
Evaluate base width (sans packed dimensions) of declaration. More... | |
virtual CNode * | GetBaseWidthExp () const =0 |
Get expression for datatype's base width (sans packed dimensions) More... | |
virtual int | IsScalar () const |
Determine if complete data structure is a scalar. More... | |
virtual int | IsVector () const =0 |
Determine if complete data structure is a vector. More... | |
virtual int | IsPacked () const =0 |
Determine if complete data structure is packed. More... | |
virtual int | IsPackedWidthConstant (void) const |
Determine if packed or vector width of declaration is constant, ie dependent upon only constants and parameters. More... | |
virtual int | IsPackedWidthVolatile (void) const |
Determine if packed or vector width of declaration is volatile, ie depend upon parameters or variables. More... | |
virtual int | IsPackedWidthEvaluateable (void) const |
Determine if packed or vector width of declaration can be evaluated. More... | |
virtual CNode * | GetPackedMsb () const |
Get expression for declaration's msb. More... | |
virtual CNode * | GetPackedLsb () const |
Get expression for declaration's lsb. More... | |
virtual CNode * | GetPackedRange () const |
Get expression for datatype's overall packed or vector range (msb/lsb) More... | |
virtual INT32 | GetPackedWidth (void) const |
Evaluate packed or vector width of declaration. More... | |
virtual CNode * | GetPackedWidthExp () const |
Get expression for datatype's overall packed or vector width. More... | |
virtual int | PackedWidthDirection (void) const |
Evaluate current decl width direction. More... | |
virtual INT32 | GetNumberOfPackedDimensions (void) const |
Get number of packed dimensions of declaration. More... | |
virtual CNode * | GetPackedMsi (INT32 dim) const |
Get expression tree for upper limit of given packed array dimension. More... | |
virtual CNode * | GetPackedLsi (INT32 dim) const |
Get expression tree for lower limit of packed array dimension. More... | |
virtual CNode * | GetPackedRange (INT32 dim) const |
Get expression for range of packed array for dimension. More... | |
virtual void | Dump (FILE *f) const =0 |
Dump data type info to file descriptor. More... | |
virtual void | PreVisit1 (int(*callback)(CNode *, void *), void *data) |
Walk tree invoking callback on each node before children have been visited. More... | |
virtual void | PostVisit1 (void(*callback)(CNode *, void *), void *data) |
Walk tree invoking callback on each node after children have been visited. More... | |
virtual void | PostSubVisit1 (CNode *(*callback)(CNode *, void *), void *data) |
Walk tree invoking callback on each node after children have been visited. More... | |
![]() | |
void * | operator new (size_t size, CObstack *stack) |
Allocate object on CObstack heap. More... | |
void | operator delete (void *object) |
Destroy object. More... | |
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. More... | |
Base class for describing data types.
CDataType::CDataType | ( | VarDataType_t | t | ) |
Create data type instance.
CDataType::CDataType | ( | VarDataType_t | t, |
list< CNode * > | packedList | ||
) |
Create data type instance.
Create a new copy with a deep copy.
heap | heap to use for allocation. |
Implemented in CSimpleType.
Perform deep copy of given object to this one This should never be call directly, only by subclasses.
heap | heap to use for allocation. |
o | declaration to copy. |
|
pure virtual |
|
pure virtual |
Evaluate base width (sans packed dimensions) of declaration.
Implemented in CSimpleType.
|
pure virtual |
Get expression for datatype's base width (sans packed dimensions)
Implemented in CSimpleType.
|
inlinevirtual |
Get declaration's const property.
|
pure virtual |
|
inlinevirtual |
Get number of packed dimensions of declaration.
Reimplemented in CSimpleType.
|
virtual |
Get expression for declaration's lsb.
Valid only for Packed and Vector declarations.
Reimplemented in CSimpleType.
Get expression tree for lower limit of packed array dimension.
dim | dimension. |
Reimplemented in CSimpleType.
|
virtual |
Get expression for declaration's msb.
Valid only for Packed and Vector declarations.
Reimplemented in CSimpleType.
Get expression tree for upper limit of given packed array dimension.
dim | dimension. |
Reimplemented in CSimpleType.
|
virtual |
Get expression for datatype's overall packed or vector range (msb/lsb)
Reimplemented in CSimpleType.
Get expression for range of packed array for dimension.
dim | dimension to get. |
Reimplemented in CSimpleType.
|
virtual |
Evaluate packed or vector width of declaration.
Reimplemented in CSimpleType.
|
virtual |
Get expression for datatype's overall packed or vector width.
Reimplemented in CSimpleType.
|
pure virtual |
|
pure virtual |
|
inlinevirtual |
Get declaration's variable data type.
|
inlinevirtual |
Get declaration's variable data type as a string.
|
pure virtual |
Determine if base width (sans packed dimensions) of declaration is constant, ie dependent upon only constants and parameters.
Implemented in CSimpleType.
|
pure virtual |
Determine if base width (sans packed dimensions) of declaration can be evaluated.
Implemented in CSimpleType.
|
pure virtual |
Determine if base width (sans packed dimensions) of declaration is volatile, ie depend upon parameters or variables.
Implemented in CSimpleType.
|
pure virtual |
Determine if complete data structure is packed.
Packed data structures can be treated as a single vector.
Implemented in CSimpleType.
|
virtual |
Determine if packed or vector width of declaration is constant, ie dependent upon only constants and parameters.
|
virtual |
Determine if packed or vector width of declaration can be evaluated.
|
virtual |
Determine if packed or vector width of declaration is volatile, ie depend upon parameters or variables.
|
virtual |
Determine if complete data structure is a scalar.
Scalars are single-bit intergal types.
|
pure virtual |
Determine if complete data structure is a vector.
Vectors are multi-bit intergal types.
Implemented in CSimpleType.
|
virtual |
Evaluate current decl width direction.
Expression must be constant.
Reimplemented in CSimpleType.
Walk tree invoking callback on each node after children have been visited.
callback may modify tree and return a modified subtree.
callback | function to be called for each node |
data | opaque argument passed to callback function |
|
virtual |
Walk tree invoking callback on each node after children have been visited.
callback | function to be called for each node |
data | opaque argument passed to callback function |
|
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.
callback | function to be called for each node |
data | opaque argument passed to callback function |
|
inlinevirtual |
Set declaration's const property.
Use to indicate type is a constant variable.
v | value to const property. |
|
inlinevirtual |
Set declaration's variable data type.
v | variable data type |
|
inlinevirtual |
Validate data structure.
errorMessage | description of validation failure |