vrq
Functions

Node Utilities

Functions

template<class T >
void ArgList2Vector (CNode *n, NodeOp_t op, int argNumber, vector< T > &v)
 Walks a list of nodes and collects the specified augments of a given node type.
void EList2VectorExclude (CNode *n, const set< NodeOp_t > &excludeOps, vector< CNode * > &v)
 Walks an expression elist of nodes and collects the subtrees that don't match the given node types.
void List2VectorExclude (CNode *n, const set< NodeOp_t > &excludeOps, vector< CNode * > &v)
 Walks an expression list of nodes and collects the subtrees that don't match the given node types.
CNodeVector2EList (const vector< CNode * > &v)
 Converts a vector array of CNode* into a linked ELIST of the elements.
CNodeList2EList (list< CNode * > &v)
 Converts a list of CNode* into a linked ELIST of the elements.
int ListCount (CNode *n, NodeOp_t op)
 Walks a list/elist of nodes and counts the number of node with the specified operation.
int ListCount (CNode *n)
 Walks a list/elist of nodes and counts the number of non-list nodes.
void AnalyseModules (CNode *codeList, set< CModule * > &allModules, set< CModule * > &topLevelModules, set< CModule * > &leafModules, set< CModule * > &undefinedModules, map< CModule *, CNode * > &module2Comments)
 Analyse module declarations in parse tree.

Function Documentation

void AnalyseModules ( CNode codeList,
set< CModule * > &  allModules,
set< CModule * > &  topLevelModules,
set< CModule * > &  leafModules,
set< CModule * > &  undefinedModules,
map< CModule *, CNode * > &  module2Comments 
)

Analyse module declarations in parse tree.

Parameters:
codeList parse tree to anaylse.
allModules add all module declarations to set.
topLevelModules add all toplevel module declarations to set.
leafModules add all leaf module declarations to set.
undefinedModules add undefined module declarations to set.
module2Comments map to load associating all comments before module with the given module.
template<class T >
void ArgList2Vector ( CNode n,
NodeOp_t  op,
int  argNumber,
vector< T > &  v 
)

Walks a list of nodes and collects the specified augments of a given node type.

Results are returned as elements of an stl vector.

Parameters:
n tree to traverse.
op operation to search for.
argNumber argument number to return.
v containter to return results.
void EList2VectorExclude ( CNode n,
const set< NodeOp_t > &  excludeOps,
vector< CNode * > &  v 
) [inline]

Walks an expression elist of nodes and collects the subtrees that don't match the given node types.

Results are returned as elements of an stl vector.

Parameters:
n tree to traverse.
excludeOps operations to exclude from search
v containter to return results.
CNode* List2EList ( list< CNode * > &  v  )  [inline]

Converts a list of CNode* into a linked ELIST of the elements.

Parameters:
v list to convert.
Returns:
linked ELIST of elements
void List2VectorExclude ( CNode n,
const set< NodeOp_t > &  excludeOps,
vector< CNode * > &  v 
) [inline]

Walks an expression list of nodes and collects the subtrees that don't match the given node types.

Results are returned as elements of an stl vector.

Parameters:
n tree to traverse.
excludeOps operations to exclude from search
v containter to return results.
int ListCount ( CNode n,
NodeOp_t  op 
) [inline]

Walks a list/elist of nodes and counts the number of node with the specified operation.

Parameters:
n tree to traverse.
op operation to search for.
Returns:
number of nodes matching op.
int ListCount ( CNode n  )  [inline]

Walks a list/elist of nodes and counts the number of non-list nodes.

Parameters:
n tree to traverse.
Returns:
number of nodes matching op.
CNode* Vector2EList ( const vector< CNode * > &  v  )  [inline]

Converts a vector array of CNode* into a linked ELIST of the elements.

Parameters:
v vector array to convert.
Returns:
linked ELIST of elements