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. | |
virtual void | SetDataType (CDataType *dt) |
Set declartion's data type property. | |
virtual CDataType * | GetDataType () |
Get declartion's data type property. | |
virtual void | SetWireAttr (Wire_t v) |
Set declaration's wire attribute. | |
virtual Wire_t | GetWireAttr () |
Get declartion's wire type property. | |
virtual int | IsWidthConstant (void) const |
Determine if packed width of declaration is constant, ie dependent upon only constants and parameters. | |
virtual int | IsWidthVolatile (void) const |
Determine if packed width of declaration is volatile, ie depend upon parameters or variables. | |
virtual int | IsWidthEvaluateable (void) const |
Determine if packed width of declaration can be evaluated. | |
virtual INT32 | GetWidth (void) const |
Evaluate packed width of declaration. | |
virtual CNode * | GetWidthExp (void) const |
Get expression representing width of declaration. | |
virtual CNode * | GetMsb () const |
Get expression for declaration's msb. | |
virtual CNode * | GetLsb () const |
Get expression for declaration's lsb. | |
virtual int | WidthDirection (void) const |
Evaluate current decl width direction. | |
virtual INT32 | GetNumberOfUnpackedDimensions (void) |
Get number of unpacked dimensions of declaration. | |
virtual CNode * | GetUnpackedMsi (INT32 dim) |
Get expression tree for upper limit of given packed array dimension. | |
virtual CNode * | GetUnpackedLsi (INT32 dim) |
Get expression tree for lower limit of unpacked array dimension. | |
virtual void | SetNumberOfUnpackedDimensions (INT32 dim) |
Set number of unpacked dimensions for declaration. | |
virtual CNode * | GetUnpackedRange (INT32 dim) |
Get expression for range of array for dimension. | |
virtual void | SetUnpackedRange (INT32 dim, CNode *v) |
Set expression for range of unpacked array for declaration. | |
virtual void | SetConstAttr (int v) |
Set declaration's const attribute. | |
virtual int | GetConstAttr () |
Get declaration's const attribute. | |
virtual void | SetVarAttr (int v) |
Set declaration's var attribute. | |
virtual int | GetVarAttr () |
Get declaration's var attribute. | |
virtual void | SetAutomatic (int v) |
Set declaration's automatic property. | |
virtual int | GetAutomatic () |
Get declaration's automatic property. | |
virtual void | SetVectored (int v) |
Set declartion's vectored property. | |
virtual int | GetVectored () |
Get declartion's vectored property. | |
virtual void | SetScalared (int v) |
Set declartion's scalared property. | |
virtual int | GetScalared () |
Get declartion's scalared property. | |
void | SetAttributes (CNode *attr) |
Set declarations's attributes. | |
CNode * | GetAttributes () |
Get declaration's attributes. | |
int | HasAttribute (char *name, CNode *n=NULL, int init=1) |
Determine if declaration has the given attribute. | |
NodeType_t | GetNodeType (void) |
Get node type of decl. | |
Decl_t | GetClass (void) |
Get class of declaration. | |
void | SetDeclStatementCreated (void) |
Set declaration statement created attribute. | |
int | DeclStatementCreated (void) |
Get declaration statement create attibute. | |
Decl_t | GetType (void) |
Get declaration type. | |
void | SetCoord (Coord_t *aLoc) |
Set declaration coordinate. | |
Coord_t * | GetCoord (void) |
Get file coordinates for declaration. | |
virtual void | Dump (FILE *f) |
Dump declaration info to file descriptor. | |
virtual void | DumpDeclInfo (FILE *f) |
Dump declaration name, type and location to file descriptor. | |
const char * | GetName (void) |
Shortcut to get declaration's name. | |
void | SetSymbol (CSymbol *aSymbol) |
Set declaration's symbol. | |
CSymbol * | GetSymbol (void) |
Get declaration's symbol. | |
void | SetPragmas (CNode *p) |
Set declaration pragmas. | |
CNode * | GetPragmas () |
Get declaration pragmas. | |
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) |
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. | |
Protected Member Functions | |
CDecl (CSymbol *aSymbol, Coord_t *aLoc, Decl_t aType, CDataType *dataType, Flag flags) | |
Create instance of declaration. | |
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. |
Base class for describing declaration objects.
enum CDecl::Flag |
CDecl::CDecl | ( | CSymbol * | aSymbol, | |
Coord_t * | aLoc, | |||
Decl_t | aType, | |||
CDataType * | dataType, | |||
Flag | flags | |||
) | [inline, protected] |
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. |
int CDecl::DeclStatementCreated | ( | void | ) | [inline] |
Get declaration statement create attibute.
virtual void CDecl::Dump | ( | FILE * | f | ) | [inline, virtual] |
virtual void CDecl::DumpDeclInfo | ( | FILE * | f | ) | [inline, virtual] |
Dump declaration name, type and location to file descriptor.
f | file descriptor. |
CNode* CDecl::GetAttributes | ( | ) | [inline] |
Get declaration's attributes.
virtual int CDecl::GetAutomatic | ( | ) | [inline, virtual] |
Get declaration's automatic property.
Reimplemented in CFunction.
Decl_t CDecl::GetClass | ( | void | ) | [inline] |
Get class of declaration.
virtual int CDecl::GetConstAttr | ( | ) | [inline, virtual] |
Get declaration's const attribute.
Coord_t* CDecl::GetCoord | ( | void | ) | [inline] |
Get file coordinates for declaration.
virtual CDataType* CDecl::GetDataType | ( | ) | [inline, virtual] |
Get declartion's data type property.
virtual CNode* CDecl::GetLsb | ( | void | ) | const [inline, virtual] |
Get a list of members of the given declaration class/type.
type | type/class of declaration. | |
result | list to return members. |
virtual CNode* CDecl::GetMsb | ( | void | ) | const [inline, virtual] |
const char* CDecl::GetName | ( | void | ) | [inline] |
Shortcut to get declaration's name.
NodeType_t CDecl::GetNodeType | ( | void | ) | [inline] |
virtual INT32 CDecl::GetNumberOfUnpackedDimensions | ( | void | ) | [inline, virtual] |
Get number of unpacked dimensions of declaration.
CNode* CDecl::GetPragmas | ( | ) | [inline] |
Get declaration pragmas.
virtual int CDecl::GetScalared | ( | ) | [inline, virtual] |
CSymbol* CDecl::GetSymbol | ( | void | ) | [inline] |
Get declaration's symbol.
Decl_t CDecl::GetType | ( | void | ) | [inline] |
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. |
virtual int CDecl::GetVarAttr | ( | ) | [inline, virtual] |
Get declaration's var attribute.
virtual int CDecl::GetVectored | ( | ) | [inline, virtual] |
virtual INT32 CDecl::GetWidth | ( | void | ) | const [inline, virtual] |
Evaluate packed width of declaration.
virtual CNode* CDecl::GetWidthExp | ( | void | ) | const [inline, virtual] |
Get expression representing width of declaration.
Reimplemented in CGenvar.
virtual Wire_t CDecl::GetWireAttr | ( | ) | [inline, virtual] |
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. |
virtual int CDecl::IsWidthConstant | ( | void | ) | const [inline, virtual] |
Determine if packed width of declaration is constant, ie dependent upon only constants and parameters.
virtual int CDecl::IsWidthEvaluateable | ( | void | ) | const [inline, virtual] |
Determine if packed width of declaration can be evaluated.
Reimplemented in CGenvar.
virtual int CDecl::IsWidthVolatile | ( | void | ) | const [inline, virtual] |
Determine if packed width of declaration is volatile, ie depend upon parameters or variables.
Reimplemented in CPortDir.
virtual void CDecl::PostVisit1 | ( | void(*)(CNode *, void *) | func, | |
void * | data | |||
) | [virtual] |
Reimplemented in CPortDir.
virtual void CDecl::PreVisit1 | ( | int(*)(CNode *, void *) | func, | |
void * | data | |||
) | [virtual] |
Reimplemented in CPortDir.
void CDecl::SetAttributes | ( | CNode * | attr | ) | [inline] |
Set declarations's attributes.
attr | attribute list. |
virtual void CDecl::SetAutomatic | ( | int | v | ) | [inline, virtual] |
Set declaration's automatic property.
Use to indicate type is a automatic variable.
v | value to automatic property. |
virtual void CDecl::SetConstAttr | ( | int | v | ) | [inline, virtual] |
Set declaration's const attribute.
Use to indicate type is a constant variable.
v | value to const attribute. |
void CDecl::SetCoord | ( | Coord_t * | aLoc | ) | [inline] |
Set declaration coordinate.
aLoc | set file coordinates for declaration |
virtual void CDecl::SetDataType | ( | CDataType * | dt | ) | [inline, virtual] |
Set declartion's data type property.
dt | new data type property. |
void CDecl::SetDeclStatementCreated | ( | void | ) | [inline] |
Set declaration statement created attribute.
virtual void CDecl::SetNumberOfUnpackedDimensions | ( | INT32 | dim | ) | [inline, virtual] |
Set number of unpacked dimensions for declaration.
dim | number of unpacked dimensions. |
void CDecl::SetPragmas | ( | CNode * | p | ) | [inline] |
Set declaration pragmas.
p | pragma list. |
virtual void CDecl::SetScalared | ( | int | v | ) | [inline, virtual] |
Set declartion's scalared property.
v | value of scalared property. |
Reimplemented in CNet.
void CDecl::SetSymbol | ( | CSymbol * | aSymbol | ) | [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. |
virtual void CDecl::SetVarAttr | ( | int | v | ) | [inline, virtual] |
Set declaration's var attribute.
Use to indicate type was declared with var keyword.
v | value to var attribute. |
virtual void CDecl::SetVectored | ( | int | v | ) | [inline, virtual] |
Set declartion's vectored property.
v | value of vectored property. |
Reimplemented in CNet.
virtual void CDecl::SetWireAttr | ( | Wire_t | v | ) | [inline, virtual] |
Set declaration's wire attribute.
v | wire type |
virtual int CDecl::WidthDirection | ( | void | ) | const [inline, virtual] |
Evaluate current decl width direction.
Expression must be constant.