vrq
Public Member Functions | Static Public Member Functions
CFunction Class Reference

Declaration object for functions and tasks. More...

#include <cfunction.h>

Inheritance diagram for CFunction:
CBlock CDecl CObject

List of all members.

Public Member Functions

 CFunction (CSymbol *symbol, Coord_t *aLoc, int automatic)
 Create function/task declaration object.
virtual void Dump (FILE *f)
 Dump function info to file descriptor.
virtual vector< CPortDir * > * GetPortDirList ()
 Get array of port declarations.
void SetTrailingLabel (CSymbol *label)
 Set trailing function label.
CSymbolGetTrailingLabel ()
 Get trailing function label.
void SetPorts (CNode *n)
 Set function port list.
CNodeGetPorts ()
 Get function port list.
int InlinePortDecls ()
 Get inline declaration attribute.
void InlinePortDecls (int v)
 Set inline declaration attribute.
void SetOutput (CDecl *output)
 Set output declaration for function.
CDeclGetOutput ()
 Get output declaration.
int GetAutomatic ()
 Get automatic attribute.

Static Public Member Functions

static int Width (CSymbol *symbol, CNode *args, CBlock *block)
 Get width of function.
static CNodeWidthExp (CSymbol *symbol, CNode *args, CBlock *block)
 Get width of function as an expression.
static int WidthConstant (CSymbol *symbol, CNode *args, CBlock *block)
 Determine if width of function is constant.
static int WidthVolatile (CSymbol *symbol, CNode *args, CBlock *block)
 Determine if width of function is volatile.
static int WidthEvaluateable (CSymbol *symbol, CNode *args, CBlock *block)
 Determine if width of function is evaluateable.
static NodeType_t Type (CSymbol *symbol, CNode *args, CBlock *block)
 Determine if type of result of function.
static int Evaluateable (CSymbol *symbol, CNode *args, CBlock *block)
 Determine if function can be evaluated.
static void EvalVector (CVector &v, CSymbol *symbol, CNode *args, CBlock *block)
 Evaluate function as a vector and return result.
static double EvalReal (CSymbol *symbol, CNode *args, CBlock *block)
 Evaluate function as a real and return result.

Detailed Description

Declaration object for functions and tasks.


Constructor & Destructor Documentation

CFunction::CFunction ( CSymbol symbol,
Coord_t aLoc,
int  automatic 
)

Create function/task declaration object.

Parameters:
symbolname of function/task.
aLocfile coordinates of declaration.
automaticnon-zero if function is automatic.

Member Function Documentation

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

Dump function info to file descriptor.

Parameters:
ffile descriptor.

Reimplemented from CBlock.

static double CFunction::EvalReal ( CSymbol symbol,
CNode args,
CBlock block 
) [static]

Evaluate function as a real and return result.

Parameters:
symbolname of function.
argsfunction argument list
blockscope of function instantation
Returns:
result of function evaluation
static int CFunction::Evaluateable ( CSymbol symbol,
CNode args,
CBlock block 
) [static]

Determine if function can be evaluated.

Parameters:
symbolname of function.
argsfunction argument list
blockscope of function instantation
Returns:
non-zero if function can be evaluated
static void CFunction::EvalVector ( CVector v,
CSymbol symbol,
CNode args,
CBlock block 
) [static]

Evaluate function as a vector and return result.

Parameters:
vcontainer for result
symbolname of function.
argsfunction argument list
blockscope of function instantation
int CFunction::GetAutomatic ( ) [inline, virtual]

Get automatic attribute.

Returns:
non-zero if function has been declare with automatic attribute.

Reimplemented from CDecl.

CDecl* CFunction::GetOutput ( ) [inline]

Get output declaration.

Returns:
output declaration.
virtual vector<CPortDir*>* CFunction::GetPortDirList ( ) [virtual]

Get array of port declarations.

Returns:
vector of portdir declarations.

Reimplemented from CBlock.

CNode* CFunction::GetPorts ( ) [inline]

Get function port list.

Returns:
port list.

Get trailing function label.

Returns:
trail function label
int CFunction::InlinePortDecls ( ) [inline]

Get inline declaration attribute.

Returns:
non-zero if port declarations are inline.
void CFunction::InlinePortDecls ( int  v) [inline]

Set inline declaration attribute.

Parameters:
vnon-zero if port declarations are inline.
void CFunction::SetOutput ( CDecl output) [inline]

Set output declaration for function.

Parameters:
outputoutput declaration.
void CFunction::SetPorts ( CNode n) [inline]

Set function port list.

Parameters:
nport list.
void CFunction::SetTrailingLabel ( CSymbol label) [inline]

Set trailing function label.

Parameters:
labeltrailing function label
static NodeType_t CFunction::Type ( CSymbol symbol,
CNode args,
CBlock block 
) [static]

Determine if type of result of function.

Todo:
This routine needs to be implemented to support proper evaluation of constant functions.
Parameters:
symbolname of function.
argsfunction argument list
blockscope of function instantation
Returns:
type of return result of function.
static int CFunction::Width ( CSymbol symbol,
CNode args,
CBlock block 
) [static]

Get width of function.

Todo:
This routine needs to be implemented to support proper evaluation of constant functions.
Parameters:
symbolname of function.
argsfunction argument list
blockscope of function instantation
Returns:
width of function.
static int CFunction::WidthConstant ( CSymbol symbol,
CNode args,
CBlock block 
) [static]

Determine if width of function is constant.

ie dependent upon constants and parameters only.

Todo:
This routine needs to be implemented to support proper evaluation of constant functions.
Parameters:
symbolname of function.
argsfunction argument list
blockscope of function instantation
Returns:
non-zero of function's width is constant.
static int CFunction::WidthEvaluateable ( CSymbol symbol,
CNode args,
CBlock block 
) [static]

Determine if width of function is evaluateable.

Todo:
This routine needs to be implemented to support proper evaluation of constant functions.
Parameters:
symbolname of function.
argsfunction argument list
blockscope of function instantation
Returns:
non-zero of function's width is evaluateable.
static CNode* CFunction::WidthExp ( CSymbol symbol,
CNode args,
CBlock block 
) [static]

Get width of function as an expression.

Todo:
This routine needs to be implemented to support proper evaluation of constant functions.
Parameters:
symbolname of function.
argsfunction argument list
blockscope of function instantation
Returns:
width expression.
static int CFunction::WidthVolatile ( CSymbol symbol,
CNode args,
CBlock block 
) [static]

Determine if width of function is volatile.

ie dependent upon variables and parameters.

Todo:
This routine needs to be implemented to support proper evaluation of constant functions.
Parameters:
symbolname of function.
argsfunction argument list
blockscope of function instantation
Returns:
non-zero of function's width is volatile.

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