LetNode

class LetNode(temporary: TemporaryNode, value: ExpressionNode, protocol: ProtocolNode?, sourceLocation: SourceLocation) : SimpleStatementNode

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

Constructors

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

Functions

copy
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.

toDocument
Link copied to clipboard
override fun toDocument(): Document
toDocumentWithMetadata
Link copied to clipboard
fun toDocumentWithMetadata(metadata: Metadata): Document

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

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

Returns a representation of this node in the surface syntax.

Properties

children
Link copied to clipboard
open override val children: Iterable<ExpressionNode>
protocol
Link copied to clipboard
val protocol: ProtocolNode?
sourceLocation
Link copied to clipboard
open override val sourceLocation: SourceLocation
temporary
Link copied to clipboard
val temporary: TemporaryNode
value
Link copied to clipboard
val value: ExpressionNode

Extensions

readsFrom
Link copied to clipboard
fun LetNode.readsFrom(nameAnalysis: NameAnalysis, to: Set<Protocol>, from: Set<Protocol>): SelectionConstraint

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

sendsTo
Link copied to clipboard
fun LetNode.sendsTo(nameAnalysis: NameAnalysis, from: Set<Protocol>, to: Set<Protocol>): SelectionConstraint

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