CRoutineDefinition-class: Class "CRoutineDefinition"

Description Objects from the Class Slots Methods Author(s) See Also Examples

Description

This hierarchy of classes from CodeDefinition to RFunctionDefinition and CRoutineDefinition are used as a simple representation of text that is code for a particular function/routine entity.

Objects from the Class

Use the constructor functions CRoutineDefinition and RFunctionDefinition to create an instance of the appropriate class. These take care of fixing the code to indent "appropriately" and put it into a single string. See the internal function formatCode for how this is done if you want to enhance it.

Slots

code:

Object of class "character" giving the name of the routine, i.e. how one would call it and not the declaration.

name:

Object of class "character" the entire code for the routine in a single string

prototype:

Object of class "character" that provides the prototype or declaration for the routine that would be put in a header/include file.

Methods

No methods defined with class "CRoutineDefinition" in the signature.

Author(s)

Duncan Temple Lang

See Also

The internal function formatCode can be used to format code.

Examples

1
2
3
4
5
CRoutineDefinition("square", c("double", 
                               "square(double x)", 
                               "{",
                               "return( x  * x);",
                               "}"))

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