Description Usage Arguments Value Author(s) References See Also Examples
This function processes the translation unit nodes and finds
the enumeration definitions, i.e. the symbolic constants that are
defined at the C/C++ level using the enum
keyword.
The result are named values of numerical values. In some cases,
the enumeration collection has a name by way of a typedef.
Additionally, some enumeration collections are simple
"sequence" of values (some times not contiguous) which is used
primarily to differentiate the values. It acts like a factor.
In other cases, the values are intended to be OR'ed together
in C to indicate one or more combined states. These are
bitwise values.
This function attempts to guess which type an enumeration
definition falls into and
returns the information in the appropriate class, i.e.
EnumerationDefinition
or BitwiseEnumerationDefinition
.
The function then returns the collection of both named and anonymous enumeration collections which can be used to create corresponding variables for use in R.
1 2 3 | computeGlobalEnumConstants(tu = NULL, enums = getEnumerations(tu, files),
files = character(),
defs = DefinitionContainer(tu), anonymousOnly = FALSE)
|
tu |
the translation unit nodes obtained from a call to |
enums |
the list of TU nodes that define the enumeration definitions of interest. |
files |
a character vector giving the names of the files in which
the enumeration definitions of interest are located. This is used when
calculating the default value of |
defs |
a DefinitionContainer that is used for resolving the values of the different types and nodes with the TU. |
anonymousOnly |
a logical value indicating whether we only want the anonymous, i.e. not typedef'ed enumeration collection definitions. |
An object of class TopLevelEnumDefs
.
This is a list in which entry is an object
of class EnumerationDefinition
,
with some being BitwiseEnumerationDefinition
objects identifying bitwise enumerations.
Duncan Temple Lang
The GCC compiler suite
1 2 3 4 5 6 7 8 9 10 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.