CFunction Class Reference
Declaration object for functions and tasks.
More...
#include <cfunction.h>
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 | SetPorts (CNode *n) |
| Set function port list.
|
CNode * | GetPorts () |
| 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.
|
CDecl * | GetOutput () |
| 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 CNode * | WidthExp (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:
-
| symbol | name of function/task. |
| aLoc | file coordinates of declaration. |
| automatic | non-zero if function is automatic. |
Member Function Documentation
virtual void CFunction::Dump |
( |
FILE * |
f |
) |
[virtual] |
Dump function info to file descriptor.
- Parameters:
-
Reimplemented from CBlock.
static double CFunction::EvalReal |
( |
CSymbol * |
symbol, |
|
|
CNode * |
args, |
|
|
CBlock * |
block | |
|
) |
| | [static] |
Evaluate function as a real and return result.
- Parameters:
-
| symbol | name of function. |
| args | function argument list |
| block | scope 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:
-
| symbol | name of function. |
| args | function argument list |
| block | scope of function instantation |
- Returns:
- non-zero if function can be evaluated
Evaluate function as a vector and return result.
- Parameters:
-
| v | container for result |
| symbol | name of function. |
| args | function argument list |
| block | scope 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.
void CFunction::InlinePortDecls |
( |
int |
v |
) |
[inline] |
Set inline declaration attribute.
- Parameters:
-
| v | non-zero if port declarations are inline. |
int CFunction::InlinePortDecls |
( |
|
) |
[inline] |
Get inline declaration attribute.
- Returns:
- non-zero if port declarations are inline.
void CFunction::SetOutput |
( |
CDecl * |
output |
) |
[inline] |
Set output declaration for function.
- Parameters:
-
| output | output declaration. |
void CFunction::SetPorts |
( |
CNode * |
n |
) |
[inline] |
Set function port list.
- Parameters:
-
Determine if type of result of function.
- Todo:
- This routine needs to be implemented to support proper evaluation of constant functions.
- Parameters:
-
| symbol | name of function. |
| args | function argument list |
| block | scope of function instantation |
- Returns:
- type of return result of function.
Get width of function.
- Todo:
- This routine needs to be implemented to support proper evaluation of constant functions.
- Parameters:
-
| symbol | name of function. |
| args | function argument list |
| block | scope 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:
-
| symbol | name of function. |
| args | function argument list |
| block | scope 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:
-
| symbol | name of function. |
| args | function argument list |
| block | scope of function instantation |
- Returns:
- non-zero of function's width is evaluateable.
Get width of function as an expression.
- Todo:
- This routine needs to be implemented to support proper evaluation of constant functions.
- Parameters:
-
| symbol | name of function. |
| args | function argument list |
| block | scope 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:
-
| symbol | name of function. |
| args | function argument list |
| block | scope of function instantation |
- Returns:
- non-zero of function's width is volatile.
The documentation for this class was generated from the following file: