FunctionDeclarationNode

class FunctionDeclarationNode(val name: FunctionNameNode, val labelParameters: Arguments<LabelVariableNode>, val parameters: Arguments<ParameterNode>, val labelConstraints: Arguments<IFCDelegationDeclarationNode>, val pcLabel: LabelNode, val body: BlockNode, val sourceLocation: SourceLocation) : TopLevelDeclarationNode

A function declaration associating a name with code.

Parameters

name

A name identifying the function.

pcLabel

Value of the program control label at the beginning of body.

parameters

A list of formal parameters.

body

Code to run when the function is called.

Constructors

Link copied to clipboard
fun FunctionDeclarationNode(name: FunctionNameNode, labelParameters: Arguments<LabelVariableNode>, parameters: Arguments<ParameterNode>, labelConstraints: Arguments<IFCDelegationDeclarationNode>, pcLabel: LabelNode, body: BlockNode, sourceLocation: SourceLocation)

Functions

Link copied to clipboard
open override fun copy(children: List<Node>): Node

Returns a shallow copy of this node where the child nodes are replaced by children.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
override fun toDocument(): Document
Link copied to clipboard

Returns a pretty representation of this Node where each descendant is decorated using metadata.

Link copied to clipboard
open override fun toSurfaceNode(metadata: Metadata): FunctionDeclarationNode

Returns a representation of this node in the surface syntax.

Properties

Link copied to clipboard
Link copied to clipboard
open override val children: Iterable<Node>

The list of all children nodes. This is empty for leaf nodes.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val sourceLocation: SourceLocation

Extensions

Link copied to clipboard

Like Node.copy, but recursively copies all descendant nodes also.

Link copied to clipboard

Returns this node and all its descendants in post order.

Link copied to clipboard

Returns all instances of T contained in this node (which may include this node).

Link copied to clipboard

A FreshNameGenerator that will avoid all Variable names in this node.