vrq
Public Member Functions

CFref Class Reference

Forward reference declaration. More...

#include <cfref.h>

Inheritance diagram for CFref:
CDecl CObject

List of all members.

Public Member Functions

 CFref (CSymbol *symbol, Coord_t *aLoc)
 Create a forward reference.
virtual CDeclClone (CObstack *heap)
 Create a clone of this declaration.
void SetDecl (CDecl *aDecl)
 Set forward declaration's actual declaration.
CDeclGetDecl (void)
 Get forward reference's actual declaration.
void SetRangeInfo (int isArray, CNode *range)
 Set range info for declaration.
CNodeGetMsb (void)
 Get msb of vector range.
CNodeGetLsb (void)
 Get lsb of vector range.
void DisableWidthInferencing ()
 Disable width inferencing.
virtual int IsWidthConstant (void)
 Determine if packed width of declaration is constant, ie dependent upon only constants and parameters.
virtual int IsWidthVolatile (void)
 Determine if packed width of declaration is volatile, ie depend upon parameters or variables.
virtual int IsWidthEvaluateable (void)
 Determine if packed width of declaration can be evaluated.
virtual INT32 GetWidth (void)
 Evaluate packed width of declaration.
virtual CNodeGetRange ()
 Get expression for declaration's range (msb/lsb).
Decl_t Direction ()
 Get direction of declaration.
void Direction (Decl_t d)
 Set direction of declaration.
void Lval (int aLval)
 Set lval flag.
int Lval ()
 Get lval flag.
void IsArray (int v)
 Set array flag.
int IsArray ()
 Get array flag.
int IndicesRangeValid ()
 Determine if range can be inferred.
void ConstrainTypes (list< Decl_t > &aTypes)
 Add a constraint on valid types for this declaration.
int IsTypeValid (Decl_t t)
 Test if a give declaration type is valid for this reference.
virtual void Dump (FILE *f)
 Dump declaration info to file descriptor.

Detailed Description

Forward reference declaration.

This class should only be used by the parser and should never appear in or be created by plugins.


Constructor & Destructor Documentation

CFref::CFref ( CSymbol symbol,
Coord_t aLoc 
)

Create a forward reference.

Parameters:
symbol declarations symbol.
aLoc file coordinates.

Member Function Documentation

virtual CDecl* CFref::Clone ( CObstack heap  )  [inline, virtual]

Create a clone of this declaration.

Parameters:
heap heap to use for allocation.
Returns:
new declaration.

Implements CDecl.

void CFref::ConstrainTypes ( list< Decl_t > &  aTypes  )  [inline]

Add a constraint on valid types for this declaration.

Note eNONE must always be in type list.

Parameters:
aTypes list of valid types (must incude eNONE).
Decl_t CFref::Direction (  )  [inline]

Get direction of declaration.

Returns:
d direction type.
void CFref::Direction ( Decl_t  d  )  [inline]

Set direction of declaration.

Parameters:
d direction type.
void CFref::DisableWidthInferencing (  )  [inline]

Disable width inferencing.

virtual void CFref::Dump ( FILE *  f  )  [virtual]

Dump declaration info to file descriptor.

Parameters:
f file descriptor.

Reimplemented from CDecl.

CDecl* CFref::GetDecl ( void   ) 

Get forward reference's actual declaration.

Returns:
actual declaration, NULL if not assigned.
CNode* CFref::GetLsb ( void   )  [virtual]

Get lsb of vector range.

Returns:
lsb expression, NULL if scalar.

Reimplemented from CDecl.

CNode* CFref::GetMsb ( void   )  [virtual]

Get msb of vector range.

Returns:
msb expression, NULL if scalar.

Reimplemented from CDecl.

virtual CNode* CFref::GetRange (  )  [virtual]

Get expression for declaration's range (msb/lsb).

Returns:
range expression, NULL if scalar.
virtual INT32 CFref::GetWidth ( void   )  [virtual]

Evaluate packed width of declaration.

Returns:
packed width of declaration.
int CFref::IndicesRangeValid (  ) 

Determine if range can be inferred.

Returns:
non-zero if range can be inferred.
void CFref::IsArray ( int  v  )  [inline]

Set array flag.

Parameters:
v non-zero if decl is an array.
int CFref::IsArray (  )  [inline]

Get array flag.

Returns:
non-zero if decl is an array.
int CFref::IsTypeValid ( Decl_t  t  )  [inline]

Test if a give declaration type is valid for this reference.

Parameters:
t declaration type to test for.
Returns:
non-zero if type is compatable with constraints.
virtual int CFref::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 CFref::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 CFref::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 CFref::Lval ( int  aLval  )  [inline]

Set lval flag.

Parameters:
aLval non-zero means decl has been used as an lval.
int CFref::Lval (  )  [inline]

Get lval flag.

Returns:
non-zero if decl has been used as an lval.
void CFref::SetDecl ( CDecl aDecl  ) 

Set forward declaration's actual declaration.

Parameters:
aDecl actual declaration for forward reference.
void CFref::SetRangeInfo ( int  isArray,
CNode range 
)

Set range info for declaration.

Parameters:
isArray non-zero if declaration is an array.
range vector range expression.

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