![]() |
|
Base class for describing declaration objects. More...
#include <cdecl.h>
Public Types | |
| enum | Flag { eFLAG_NONE = 0, eFLAG_PRAGMA = 1, eFLAG_ARRAY = 2, eFLAG_VECTOR = 4 } |
Public Member Functions | |
| virtual int | IsWidthConstant (void) |
| Determine if width of declaration is constant, ie dependent upon only constants and parameters. | |
| virtual int | IsWidthVolatile (void) |
| Determine if width of declaration is volatile, ie depend upon parameters or variables. | |
| virtual int | IsWidthEvaluateable (void) |
| Determine if width of declaration can be evaluated. | |
| virtual INT32 | GetWidth (void) |
| Evaluate width of declaration. | |
| virtual CNode * | GetWidthExp (void) |
| Get expression representing width of declaration. | |
| virtual int | WidthDirection (void) |
| Evaluate current decl width direction. | |
| virtual INT32 | GetMsbInt (void) |
| Evaluate the msb of the declaration. | |
| virtual CNode * | GetMsb () |
| Get expression for declaration's msb. | |
| virtual CNode * | GetRange () |
| Get expression for declaration's range (msb/lsb). | |
| virtual void | SetRange (CNode *n) |
| Set declaration's range (msb/lsb). | |
| virtual INT32 | GetLsbInt (void) |
| Evaluate the lsb of the declaration. | |
| virtual CNode * | GetLsb () |
| Get expression for declaration's lsb. | |
| virtual INT32 | GetNumberOfDimensions (void) |
| Get number of dimension of declaration. | |
| virtual CNode * | GetMsi (INT32 dim) |
| Get expression tree for upper limit of array dimension. | |
| virtual CNode * | GetLsi (INT32 dim) |
| Get expression tree for lower limit of array dimension. | |
| virtual void | SetNumberOfDimensions (INT32 dim) |
| Set number of dimensions for declaration. | |
| virtual CNode * | GetIndex (INT32 dim) |
| Get expression for limit of array for dimension. | |
| virtual void | SetIndex (INT32 dim, CNode *v) |
| Set expression for limits of array for declaration. | |
| virtual void | SetSigned (int v) |
| Set declartion's signed property. | |
| virtual int | GetSigned () |
| Get declartion's signed 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. | |
| virtual 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, Flag flags) | |
| Create instance of declaration. | |
| void | Copy (const CDecl &o) |
| Perform deep copy of given object to this one This should never be call directly, only by subclasses. | |
| CDecl (const CDecl &o) | |
| Copy constructor to do deep copy. | |
Base class for describing declaration objects.
| enum CDecl::Flag |
Create instance of declaration.
This should never be call directly.
| aSymbol | declaration for symbol. | |
| aLoc | file coordinates of declaration. | |
| aType | declaration type. | |
| flags | list of supported constructs. |
| CDecl::CDecl | ( | const CDecl & | o | ) | [inline, protected] |
Copy constructor to do deep copy.
This should never be called directly.
| o | declaration to copy. |
| void CDecl::Copy | ( | const CDecl & | o | ) | [protected] |
Perform deep copy of given object to this one This should never be call directly, only by subclasses.
| 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.
| Decl_t CDecl::GetClass | ( | void | ) | [inline] |
Get class of declaration.
| Coord_t* CDecl::GetCoord | ( | void | ) | [inline] |
Get file coordinates for declaration.
Get expression for limit of array for dimension.
| dim | dimension to get. |
| virtual CNode* CDecl::GetLsb | ( | ) | [virtual] |
Get expression for declaration's lsb.
Reimplemented in CFref.
| virtual INT32 CDecl::GetLsbInt | ( | void | ) | [virtual] |
Evaluate the lsb of the declaration.
Get expression tree for lower limit of array dimension.
| dim | dimension. |
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 | ( | ) | [virtual] |
Get expression for declaration's msb.
Reimplemented in CFref.
| virtual INT32 CDecl::GetMsbInt | ( | void | ) | [virtual] |
Evaluate the msb of the declaration.
Get expression tree for upper limit of array dimension.
| dim | dimension. |
| const char* CDecl::GetName | ( | void | ) | [inline] |
Shortcut to get declaration's name.
| virtual NodeType_t CDecl::GetNodeType | ( | void | ) | [inline, virtual] |
| virtual INT32 CDecl::GetNumberOfDimensions | ( | void | ) | [inline, virtual] |
Get number of dimension of declaration.
| CNode* CDecl::GetPragmas | ( | ) | [inline] |
Get declaration pragmas.
| virtual CNode* CDecl::GetRange | ( | ) | [inline, virtual] |
Get expression for declaration's range (msb/lsb).
Reimplemented in CFref.
| virtual int CDecl::GetScalared | ( | ) | [inline, virtual] |
| virtual int CDecl::GetSigned | ( | ) | [inline, virtual] |
Get declartion's signed property.
| CSymbol* CDecl::GetSymbol | ( | void | ) | [inline] |
Get declaration's symbol.
| Decl_t CDecl::GetType | ( | void | ) | [inline] |
| virtual int CDecl::GetVectored | ( | ) | [inline, virtual] |
| virtual INT32 CDecl::GetWidth | ( | void | ) | [virtual] |
| virtual CNode* CDecl::GetWidthExp | ( | void | ) | [virtual] |
| 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 | ) | [virtual] |
Determine if width of declaration is constant, ie dependent upon only constants and parameters.
Reimplemented in CParam.
| virtual int CDecl::IsWidthEvaluateable | ( | void | ) | [virtual] |
| virtual int CDecl::IsWidthVolatile | ( | void | ) | [virtual] |
Determine if width of declaration is volatile, ie depend upon parameters or variables.
Reimplemented in CParam.
| virtual void CDecl::PostVisit1 | ( | void(*)(CNode *, void *) | func, | |
| void * | data | |||
| ) | [virtual] |
| virtual void CDecl::PreVisit1 | ( | int(*)(CNode *, void *) | func, | |
| void * | data | |||
| ) | [virtual] |
| void CDecl::SetAttributes | ( | CNode * | attr | ) | [inline] |
Set declarations's attributes.
| attr | attribute list. |
| void CDecl::SetCoord | ( | Coord_t * | aLoc | ) | [inline] |
Set declaration coordinate.
| aLoc | set file coordinates for declaration |
| void CDecl::SetDeclStatementCreated | ( | void | ) | [inline] |
Set declaration statement created attribute.
Set expression for limits of array for declaration.
| dim | dimension to set. | |
| v | range expression for limit. |
| virtual void CDecl::SetNumberOfDimensions | ( | INT32 | dim | ) | [inline, virtual] |
Set number of dimensions for declaration.
| dim | number of dimensions. |
| void CDecl::SetPragmas | ( | CNode * | p | ) | [inline] |
Set declaration pragmas.
| p | pragma list. |
| virtual void CDecl::SetRange | ( | CNode * | n | ) | [virtual] |
Set declaration's range (msb/lsb).
| n | range expression or NULL |
| virtual void CDecl::SetScalared | ( | int | v | ) | [inline, virtual] |
Set declartion's scalared property.
| v | value of scalared property. |
Reimplemented in CNet.
| virtual void CDecl::SetSigned | ( | int | v | ) | [inline, virtual] |
Set declartion's signed property.
| v | value of signed property. |
| void CDecl::SetSymbol | ( | CSymbol * | aSymbol | ) | [inline] |
Set declaration's symbol.
| aSymbol | new symbol for declaration. |
| virtual void CDecl::SetVectored | ( | int | v | ) | [inline, virtual] |
Set declartion's vectored property.
| v | value of vectored property. |
Reimplemented in CNet.
| virtual int CDecl::WidthDirection | ( | void | ) | [virtual] |
Evaluate current decl width direction.
Expression must be constant.
Reimplemented in CParam.
1.6.1