Description Usage Arguments Value Author(s) References See Also Examples
This function is the workhorse for processing the nodes in different
ways. This function takes care of looping over the sequence of nodes
and uses a predicate function type
to determine if the
function is of interest.
1 | nodeIterator(node, op, type = TRUEp, verbose = FALSE, addPrefix = FALSE)
|
node |
the node from which to start the iteration. This can be an arbitrary node in the array of translation unit nodes. |
op |
the function to process the node. If this returns NULL, the value is discared. Otherwise, it is added to the list of results. An attempt is made to compute the name of the give node to identify the element in the resulting list. This function can of course work on other nodes aside
from the one it is passed. And it can store information in its
own environment rather than relying on the construction of the
appropriate list by |
type |
a function or the class name(s) of the type of node to
process.
If this is a character vector of class names, The function is called for each node in the sequence. If it
returns |
verbose |
a logical value with |
addPrefix |
(logical) passed to |
A list with an element for each node processed. For each such node, the name of the element in the list is taken from the "name" attribute of the node, if available.
Duncan Temple Lang <duncan@wald.ucdavis.edu>
http://www.omegahat.org/RGCCTranslationUnit
getAllDeclarations
getGlobalVariables
getFunctions
getClassNodes
These functions are all implemented using nodeIterator
.
1 2 3 | tu = parseTU(system.file("examples", "myFun.cpp.tu", package = "RGCCTranslationUnit"))
nodeIterator(tu[[4]], function(node) node[["INDEX"]])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.