as.field.decl: Find appropriate sub-node

Description Usage Arguments Value Author(s) References See Also

View source: R/navigate.R

Description

These functions attempt to search the given node in a sensible manner to find the relevant sub-node as indicated by the name of the function. Fror example, as.parm.decl will search a GCC::Node::function_decl and find the first GCC::Node::parm_decl node, if it exists.

These are meant as convenience functions to find map from a high-level object to the first node of the target type so that we can then iterate over the nodes, starting at that one.

Usage

1
2
3
4
5
6
as.field.decl(x, follow = TRUE, acceptableTypes =
                 c("GCC::Node::field_decl", "GCC::Node::var_decl",
                 "GCC::Node::const_decl"))
as.record.type(x, stopOnFail = TRUE)
as.parm.decl(x)
as.type.decl(x)

Arguments

x

a reference to a Perl GCC::Node object obtained from parsing the translation unit.

stopOnFail

a logical value indicating whether to generate an error if the node could not be mapped to a record_type or simply return NULL

follow

(logical) controls whether to jump from the given node to one of its elements to find the definition of the field.

acceptableTypes

a character vector giving the names of the classes that are legitimate nodes for a field.

Value

A reference to a Perl GCC::Node object or an error.

Author(s)

Duncan Temple Lang <duncan@wald.ucdavis.edu>

References

http://www.omegahat.org/RGccTranslationUnit

See Also

parseTU


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