LetNode

class LetNode(val name: TemporaryNode, val value: ExpressionNode, val protocol: ProtocolNode?, val sourceLocation: SourceLocation) : SimpleStatementNode, VariableDeclarationNode

Binding the result of an expression to a new temporary variable.

Constructors

Link copied to clipboard
fun LetNode(name: TemporaryNode, value: ExpressionNode, protocol: ProtocolNode?, sourceLocation: SourceLocation)

Functions

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

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

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): LetNode

Returns a representation of this node in the surface syntax.

Properties

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

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

Link copied to clipboard
open override val name: TemporaryNode

The variable declared by this node.

Link copied to clipboard
open override val protocol: ProtocolNode?

The protocol that should store the declared variable.

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

Extensions

Link copied to clipboard
Link copied to clipboard
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.

Link copied to clipboard
Link copied to clipboard

States that if the let node is stored at any protocol in to, it reads from only the protocols in from.

Link copied to clipboard

States that if the let node is stored at any protocol in from, it sends to only the protocols in to.