Parser-class: Class "GCC::TranslationUnit::Parser" A convenience class for...

Description Objects from the Class Extends Methods Author(s) References See Also

Description

This class is merely a convience class that is used to represent in R the result of parsing a translation unit from GCC using Perl tools. The class identifies a reference to a Perl array of nodes. We typically get this array via a call to readTU and then we access elements of the array by "following"nodes based on the INDEX field of another node. These INDEX values are strings that identify the nominal index of the element of interest. However, these need to be converted to the actual index by adding 1 to the integer value. The purpose of this class is to provide a method that handles indexing by these INDEX strings which does the necessary conversion. This makes the manipulation of the node paths easier at an interactive level.

Objects from the Class

A virtual Class: No objects may be created from it.

Extends

Class "oldClass", directly. This is an old-style, S3 class that is used simply to provide a method for [[.

Methods

Currently, there are methods for accessing individual elements using the position or the node name. These take into account the extra first element in the Perl array that requires us to add one to the node name to get the actual index in the array.

The other two methods defined for this class are lapply and sapply. These hide the details how we loop over the Perl array. They might be better defined for PerlArray references directly in the RSPerl package.

Author(s)

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

References

http://www.omegahat.org/RGCCTranslationUnit

See Also

readTU The internal function getIndex which returns the actual integer index of a node along with its string identifier which is one less.


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