vrq
Public Member Functions | List of all members
CParam Class Reference

Declaration object for parameters. More...

#include <cparam.h>

Inheritance diagram for CParam:
CDecl CObject

Public Member Functions

 CParam (CSymbol *symbol, Coord_t *aLoc, Decl_t type, CDataType *dataType)
 Create parameter declaration. More...
 
virtual CDeclClone (CObstack *heap)
 Create a clone of this declaration. More...
 
void Specify (int v)
 Set specify attribute. More...
 
int Specify (void)
 Get specify attribute. More...
 
void SetExpression (CNode *aExp)
 Set expression assigned to parameter. More...
 
CNodeGetExpression (void)
 Get expression assigned to parameter. More...
 
virtual NodeType_t GetNodeType (void)
 Get node expression type. More...
 
virtual int IsWidthConstant (void)
 Determine if packed width of declaration is constant, ie dependent upon only constants and parameters. More...
 
virtual int IsWidthVolatile (void)
 Determine if packed width of declaration is volatile, ie depend upon parameters or variables. More...
 
virtual int IsWidthEvaluateable (void)
 Determine if packed width of declaration can be evaluated. More...
 
virtual INT32 GetWidth (void)
 Evaluate packed width of declaration. More...
 
virtual CNodeGetWidthExp (void)
 Get expression representing width of declaration. More...
 
virtual CNodeGetMsb ()
 Get expression for declaration's msb. More...
 
virtual CNodeGetLsb ()
 Get expression for declaration's lsb. More...
 
virtual void Dump (FILE *f)
 Dump parameter declaration info to file descriptor. More...
 
void SetInlined (int v)
 Set inlined attribute. More...
 
int GetInlined ()
 Get inlined attribute. More...
 
- Public Member Functions inherited from CDecl
virtual void SetDataType (CDataType *dt)
 Set declartion's data type property. More...
 
virtual CDataTypeGetDataType ()
 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 CNodeGetWidthExp (void) const
 Get expression representing width of declaration. 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 CNodeGetUnpackedMsi (INT32 dim)
 Get expression tree for upper limit of given packed array dimension. More...
 
virtual CNodeGetUnpackedLsi (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 CNodeGetUnpackedRange (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...
 
CNodeGetAttributes ()
 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...
 
void SetCoord (Coord_t *aLoc)
 Set declaration coordinate. More...
 
Coord_tGetCoord (void)
 Get file coordinates for declaration. 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...
 
CSymbolGetSymbol (void)
 Get declaration's symbol. More...
 
void SetPragmas (CNode *p)
 Set declaration pragmas. More...
 
CNodeGetPragmas ()
 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...
 

Additional Inherited Members

- Public Types inherited from CDecl
enum  Flag { eFLAG_NONE = 0, eFLAG_PRAGMA = 1, eFLAG_ARRAY = 2, eFLAG_DATATYPE = 4 }
 
- Static Public Member Functions inherited from CDecl
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 inherited from CDecl
 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...
 

Detailed Description

Declaration object for parameters.

Constructor & Destructor Documentation

CParam::CParam ( CSymbol symbol,
Coord_t aLoc,
Decl_t  type,
CDataType dataType 
)

Create parameter declaration.

Parameters
symbolname of declaration.
aLocfile coordinates.
typedeclaration type: eLOCALPARAM, ePARAM.
dataTypeparameter data type

Member Function Documentation

virtual CDecl* CParam::Clone ( CObstack heap)
virtual

Create a clone of this declaration.

Parameters
heapheap to use for allocation.
Returns
new declaration.

Implements CDecl.

virtual void CParam::Dump ( FILE *  f)
virtual

Dump parameter declaration info to file descriptor.

Parameters
ffile descriptor.

Reimplemented from CDecl.

CNode* CParam::GetExpression ( void  )

Get expression assigned to parameter.

Returns
expression assigned to parameter.
int CParam::GetInlined ( )
inline

Get inlined attribute.

Returns
v non-zero if parameter declaration was inlined in module definition.
virtual CNode* CParam::GetLsb ( )
virtual

Get expression for declaration's lsb.

Returns
lsb expression, NULL if scalar.

Reimplemented from CDecl.

virtual CNode* CParam::GetMsb ( )
virtual

Get expression for declaration's msb.

Returns
msb expression, NULL if scalar.

Reimplemented from CDecl.

virtual NodeType_t CParam::GetNodeType ( void  )
virtual

Get node expression type.

Returns
expression type.
virtual INT32 CParam::GetWidth ( void  )
virtual

Evaluate packed width of declaration.

Returns
packed width of declaration.
virtual CNode* CParam::GetWidthExp ( void  )
virtual

Get expression representing width of declaration.

Returns
expression representing width of declaration.
virtual int CParam::IsWidthConstant ( void  )
virtual

Determine if packed width of declaration is constant, ie dependent upon only constants and parameters.

Returns
non-zero of packed width of declaration is constant.
virtual int CParam::IsWidthEvaluateable ( void  )
virtual

Determine if packed width of declaration can be evaluated.

Returns
non-zero of packed width of declaration can be evaluated.
virtual int CParam::IsWidthVolatile ( void  )
virtual

Determine if packed width of declaration is volatile, ie depend upon parameters or variables.

Returns
non-zero of packed width of declaration is volatile.
void CParam::SetExpression ( CNode aExp)

Set expression assigned to parameter.

Parameters
aExpvalue expression.
void CParam::SetInlined ( int  v)
inline

Set inlined attribute.

Parameters
vnon-zero if parameter declaration was inlined in module definition.
void CParam::Specify ( int  v)
inline

Set specify attribute.

Parameters
vnon-zero if declaration is a specparam.
int CParam::Specify ( void  )
inline

Get specify attribute.

Returns
non-zero if declaration is a specparam.

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