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. More...
 
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. More...
 
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. More...
 
CNodeVector2EList (const vector< CNode * > &v)
 Converts a vector array of CNode* into a linked ELIST of the elements. More...
 
CNodeList2EList (list< CNode * > &v)
 Converts a list of CNode* into a linked ELIST of the elements. More...
 
int ListCount (CNode *n, NodeOp_t op)
 Walks a list/elist of nodes and counts the number of node with the specified operation. More...
 
int ListCount (CNode *n)
 Walks a list/elist of nodes and counts the number of non-list nodes. More...
 
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. More...
 

Detailed Description

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
codeListparse tree to anaylse.
allModulesadd all module declarations to set.
topLevelModulesadd all toplevel module declarations to set.
leafModulesadd all leaf module declarations to set.
undefinedModulesadd undefined module declarations to set.
module2Commentsmap 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
ntree to traverse.
opoperation to search for.
argNumberargument number to return.
vcontainter 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
ntree to traverse.
excludeOpsoperations to exclude from search
vcontainter to return results.
CNode* List2EList ( list< CNode * > &  v)
inline

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

Parameters
vlist 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
ntree to traverse.
excludeOpsoperations to exclude from search
vcontainter 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
ntree to traverse.
opoperation 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
ntree 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
vvector array to convert.
Returns
linked ELIST of elements