![]() |
|
Base class for describing declaration objects. More...
#include <cdecl.h>
Public Types | |
| enum | Flag { eFLAG_NONE = 0, eFLAG_PRAGMA = 1, eFLAG_ARRAY = 2, eFLAG_DATATYPE = 4 } |
Public Member Functions | |
| virtual CDecl * | Clone (CObstack *heap)=0 |
| Create a deep copy of declaration. More... | |
| virtual void | SetDataType (CDataType *dt) |
| Set declartion's data type property. More... | |
| virtual CDataType * | GetDataType () |
| Get declartion's data type property. More... | |
| virtual void | SetWireAttr (Wire_t v) |
| Set declaration's wire attribute. More... | |
| virtual Wire_t | GetWireAttr () |
| Get declartion's wire type property. More... | |
| virtual int | IsWidthConstant (void) const |
| Determine if packed width of declaration is constant, ie dependent upon only constants and parameters. More... | |
| virtual int | IsWidthVolatile (void) const |
| Determine if packed width of declaration is volatile, ie depend upon parameters or variables. More... | |
| virtual int | IsWidthEvaluateable (void) const |
| Determine if packed width of declaration can be evaluated. More... | |
| virtual INT32 | GetWidth (void) const |
| Evaluate packed width of declaration. More... | |
| virtual CNode * | GetWidthExp (void) const |
| Get expression representing width of declaration. More... | |
| virtual CNode * | GetMsb () const |
| Get expression for declaration's msb. More... | |
| virtual CNode * | GetLsb () const |
| Get expression for declaration's lsb. More... | |
| virtual int | WidthDirection (void) const |
| Evaluate current decl width direction. More... | |
| virtual INT32 | GetNumberOfUnpackedDimensions (void) |
| Get number of unpacked dimensions of declaration. More... | |
| virtual CNode * | GetUnpackedMsi (INT32 dim) |
| Get expression tree for upper limit of given packed array dimension. More... | |
| virtual CNode * | GetUnpackedLsi (INT32 dim) |
| Get expression tree for lower limit of unpacked array dimension. More... | |
| virtual void | SetNumberOfUnpackedDimensions (INT32 dim) |
| Set number of unpacked dimensions for declaration. More... | |
| virtual CNode * | GetUnpackedRange (INT32 dim) |
| Get expression for range of array for dimension. More... | |
| virtual void | SetUnpackedRange (INT32 dim, CNode *v) |
| Set expression for range of unpacked array for declaration. More... | |
| virtual void | SetConstAttr (int v) |
| Set declaration's const attribute. More... | |
| virtual int | GetConstAttr () |
| Get declaration's const attribute. More... | |
| virtual void | SetVarAttr (int v) |
| Set declaration's var attribute. More... | |
| virtual int | GetVarAttr () |
| Get declaration's var attribute. More... | |
| virtual void | SetAutomatic (int v) |
| Set declaration's automatic property. More... | |
| virtual int | GetAutomatic () |
| Get declaration's automatic property. More... | |
| virtual void | SetVectored (int v) |
| Set declartion's vectored property. More... | |
| virtual int | GetVectored () |
| Get declartion's vectored property. More... | |
| virtual void | SetScalared (int v) |
| Set declartion's scalared property. More... | |
| virtual int | GetScalared () |
| Get declartion's scalared property. More... | |
| void | SetAttributes (CNode *attr) |
| Set declarations's attributes. More... | |
| CNode * | GetAttributes () |
| Get declaration's attributes. More... | |
| int | HasAttribute (char *name, CNode *n=NULL, int init=1) |
| Determine if declaration has the given attribute. More... | |
| NodeType_t | GetNodeType (void) |
| Get node type of decl. More... | |
| Decl_t | GetClass (void) |
| Get class of declaration. More... | |
| void | SetDeclStatementCreated (void) |
| Set declaration statement created attribute. More... | |
| int | DeclStatementCreated (void) |
| Get declaration statement create attibute. More... | |
| Decl_t | GetType (void) |
| Get declaration type. More... | |
| const char * | GetTypeName (void) |
| Get declaration type as a string. More... | |
| void | SetCoord (Coord_t *aLoc) |
| Set declaration coordinate. More... | |
| Coord_t * | GetCoord (void) |
| Get file coordinates for declaration. More... | |
| virtual void | Dump (FILE *f) |
| Dump declaration info to file descriptor. More... | |
| virtual void | DumpDeclInfo (FILE *f) |
| Dump declaration name, type and location to file descriptor. More... | |
| const char * | GetName (void) |
| Shortcut to get declaration's name. More... | |
| void | SetSymbol (CSymbol *aSymbol) |
| Set declaration's symbol. More... | |
| CSymbol * | GetSymbol (void) |
| Get declaration's symbol. More... | |
| void | SetPragmas (CNode *p) |
| Set declaration pragmas. More... | |
| CNode * | GetPragmas () |
| Get declaration pragmas. More... | |
| virtual void | PreVisit1 (int(*func)(CNode *, void *), void *data) |
| virtual void | PostVisit1 (void(*func)(CNode *, void *), void *data) |
| virtual void | PostSubVisit1 (CNode *(*func)(CNode *, void *), void *data) |
Public Member Functions inherited from CObject | |
| void * | operator new (size_t size, CObstack *stack) |
| Allocate object on CObstack heap. More... | |
| void | operator delete (void *object) |
| Destroy object. More... | |
Static Public Member Functions | |
| static Flag | Or (Flag f1, Flag f2) |
| static Flag | Or (Flag f1, Flag f2, Flag f3) |
| static void | GetMembers (Decl_t type, list< Decl_t > &result) |
| Get a list of members of the given declaration class/type. More... | |
Protected Member Functions | |
| CDecl (CSymbol *aSymbol, Coord_t *aLoc, Decl_t aType, CDataType *dataType, Flag flags) | |
| Create instance of declaration. More... | |
| void | Copy (CObstack *heap, const CDecl &o) |
| Perform deep copy of given object to this one This should never be call directly, only by subclasses. More... | |
Base class for describing declaration objects.
| enum CDecl::Flag |
|
inlineprotected |
Create instance of declaration.
This should never be call directly.
| aSymbol | declaration for symbol. |
| aLoc | file coordinates of declaration. |
| aType | declaration type. |
| dataType | declaration data type |
| flags | list of supported constructs. |
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. |
|
inline |
Get declaration statement create attibute.
|
inlinevirtual |
|
inlinevirtual |
Dump declaration name, type and location to file descriptor.
| f | file descriptor. |
|
inline |
Get declaration's attributes.
|
inlinevirtual |
Get declaration's automatic property.
Reimplemented in CFunction.
|
inline |
Get class of declaration.
|
inlinevirtual |
Get declaration's const attribute.
|
inline |
Get file coordinates for declaration.
|
inlinevirtual |
Get declartion's data type property.
|
inlinevirtual |
Get a list of members of the given declaration class/type.
| type | type/class of declaration. |
| result | list to return members. |
|
inlinevirtual |
|
inline |
Shortcut to get declaration's name.
|
inline |
Get node type of decl.
|
inlinevirtual |
Get number of unpacked dimensions of declaration.
|
inline |
Get declaration pragmas.
|
inlinevirtual |
|
inline |
Get declaration's symbol.
|
inline |
Get declaration type.
|
inline |
Get declaration type as a string.
Get expression tree for lower limit of unpacked array dimension.
| dim | dimension. |
Get expression tree for upper limit of given packed array dimension.
| dim | dimension. |
Get expression for range of array for dimension.
| dim | dimension to get. |
|
inlinevirtual |
Get declaration's var attribute.
|
inlinevirtual |
|
inlinevirtual |
Evaluate packed width of declaration.
|
inlinevirtual |
Get expression representing width of declaration.
Reimplemented in CGenvar.
|
inlinevirtual |
Get declartion's wire type property.
| int CDecl::HasAttribute | ( | char * | name, |
| CNode * | n = NULL, |
||
| int | init = 1 |
||
| ) |
Determine if declaration has the given attribute.
| name | name of attribute to search for. |
| n | don't supply this argument. |
| init | don't supply this argument. |
|
inlinevirtual |
Determine if packed width of declaration is constant, ie dependent upon only constants and parameters.
|
inlinevirtual |
Determine if packed width of declaration can be evaluated.
Reimplemented in CGenvar.
|
inlinevirtual |
Determine if packed width of declaration is volatile, ie depend upon parameters or variables.
Reimplemented in CPortDir.
|
virtual |
Reimplemented in CPortDir.
|
virtual |
Reimplemented in CPortDir.
|
inline |
Set declarations's attributes.
| attr | attribute list. |
|
inlinevirtual |
Set declaration's automatic property.
Use to indicate type is a automatic variable.
| v | value to automatic property. |
|
inlinevirtual |
Set declaration's const attribute.
Use to indicate type is a constant variable.
| v | value to const attribute. |
|
inline |
Set declaration coordinate.
| aLoc | set file coordinates for declaration |
|
inlinevirtual |
Set declartion's data type property.
| dt | new data type property. |
|
inline |
Set declaration statement created attribute.
|
inlinevirtual |
Set number of unpacked dimensions for declaration.
| dim | number of unpacked dimensions. |
|
inline |
Set declaration pragmas.
| p | pragma list. |
|
inlinevirtual |
|
inline |
Set declaration's symbol.
| aSymbol | new symbol for declaration. |
Set expression for range of unpacked array for declaration.
| dim | dimension to set. |
| v | range expression for limit. |
|
inlinevirtual |
Set declaration's var attribute.
Use to indicate type was declared with var keyword.
| v | value to var attribute. |
|
inlinevirtual |
|
inlinevirtual |
Set declaration's wire attribute.
| v | wire type |
|
inlinevirtual |
Evaluate current decl width direction.
Expression must be constant.
1.8.13