ProgramNode
The intermediate level representation of a program.
Instances are created by elaborated.
Constructors
ProgramNode
Link copied to clipboard
fun ProgramNode(declarations: List<TopLevelDeclarationNode>, sourceLocation: SourceLocation)
Content copied to clipboard
Functions
contains
Link copied to clipboard
open operator override fun contains(element: TopLevelDeclarationNode): Boolean
Content copied to clipboard
containsAll
Link copied to clipboard
open override fun containsAll(elements: Collection<TopLevelDeclarationNode>): Boolean
Content copied to clipboard
forEach
Link copied to clipboard
get
Link copied to clipboard
indexOf
Link copied to clipboard
iterator
Link copied to clipboard
lastIndexOf
Link copied to clipboard
listIterator
Link copied to clipboard
open override fun listIterator(index: Int): ListIterator<TopLevelDeclarationNode>
Content copied to clipboard
parallelStream
Link copied to clipboard
spliterator
Link copied to clipboard
stream
Link copied to clipboard
toDocument
Link copied to clipboard
toDocumentWithMetadata
Link copied to clipboard
toSurfaceNode
Link copied to clipboard
Returns a representation of this node in the surface syntax.
Properties
children
Link copied to clipboard
declarations
Link copied to clipboard
functionMap
Link copied to clipboard
functions
Link copied to clipboard
hostDeclarations
Link copied to clipboard
sourceLocation
Link copied to clipboard
Extensions
annotateWithProtocols
Link copied to clipboard
fun ProgramNode.annotateWithProtocols(assignment: ProtocolAssignment): ProgramNode
Content copied to clipboard
Annotate parameters, declarations, and let nodes with protocols.
check
Link copied to clipboard
Performs all static checks on this program.
compileToKotlin
Link copied to clipboard
fun ProgramNode.compileToKotlin(fileName: String, packageName: String, codeGenerators: List<(context: CodeGeneratorContext) -> CodeGenerator>, protocolComposer: ProtocolComposer): FileSpec
Content copied to clipboard
isAssignmentAnnotated
Link copied to clipboard
main
Link copied to clipboard
Returns the declaration of mainFunction function in this program.
specialize
Link copied to clipboard
Returns an AST where every call site is specialized into new functions as much as possible. This allows for the most liberal protocol selection possible, at the cost of redundancy. The specializer will not specialize (mutually) recursive functions to prevent unbounded specialization.