getVariables: Find variables in a translation unit and where global...

View source: R/collectors.R

getVariablesR Documentation

Find variables in a translation unit and where global variables are referenced

Description

These find variables being used in the translation unit.

Usage

getVariables(file, fileFilter = character(), visitor = genVariablesCollector(), ...)
findGlobalUse(tu, visitor = globalUseVisitor(), ...)

Arguments

file, tu

the name of a source file or an already parsed translation unit

fileFilter

a character vector. This is used to identify the files/directories of interest and to identify the cursors we want in the results. This can be a single string that is a regular expression. Alternatively, it can be a vector of directory or file names. For a vector of values, we check which correspond to actual file or directory names. For these, we filter the cursors based on whether they are in the specified file names, within files in the specified directories. For elements that are not files or directories, we use these as regular expressions. This mechanism allows us to include cursors by explicit file name, explicit directory, or by regular expression.

visitor

a visitor function or visitor object of class S4CursorVisitor-class or RefCursorVisitor-class.

...

additional arguments that are passed to createTU to parse a source file

Author(s)

Duncan Temple Lang

References

libclang http://clang.llvm.org/doxygen/group__CINDEX.html


omegahat/RClangSimple documentation built on Aug. 17, 2024, 10:23 a.m.