getVariables: Find the translation unit nodes corresponding to variable...

Description Usage Arguments Value Author(s) See Also Examples

Description

This function searches a translation object in R for nodes that correspond to variable declarations. This returns the raw nodes. These can then be resolved to get complete descriptions of the variables and their data types.

Usage

1
getVariables(dcls, addNames = TRUE, ...)

Arguments

dcls

the translation unit object as returned by parseTU.

addNames

a logical value indicating whether to compute the names of the variables and put them on the resulting list

...

additional parameters for methods

Value

A list whose elements are objects of class GCC::Node::var_decl.

Author(s)

Duncan Temple Lang

See Also

parseTU resolveType

Examples

1
2
3
4
5
 tu = parseTU(system.file("examples", "struct.c.t00.tu", package = "RGCCTranslationUnit"))
 v = getVariables(tu)
 names(v)

 vars = lapply(v, resolveType, tu)

omegahat/RGCCTranslationUnit documentation built on May 24, 2019, 1:53 p.m.