Elsa Ast Type Function

From MozillaWiki
Jump to: navigation, search

Function is a Ast type node (without any subtype nodes). Function is a record.

Record Data Fields

Subtype Nodes (Subclasses)

Function has no subtype nodes.

Comments

Please make your modifications only below, because the content above will be regenerated automatically from time to time.

Field content

nameAndParams 
Name. Parameters can be accessed easier via funcType.function_type_params.
function_inits 
nonempty only for constructors: member initialization list
implicitlyDefined 
true, if compiler generated function (default constructor of similar)

Location

Function nodes don't have a sourceLoc field, but the syntax nodes above Function nodes do.

Function name

To obtain the function name go to the declarator via nameAndParams and extract the name of the declarator_var. Variable name and declarator variable are always present, as far as I can tell.

Parameters

To access the variable nodes for the function parameters follow funcType.function_type_params. For nonstatic methods, this contains the this pointer, which actually has a reference type (with variable_name __receiver).