SourceFile

Maintains metadata (for example, file path) about an input stream and gives access to its contents.

Parameters

path

Description of where the source file came from (e.g. a file path, "stdin", etc.).

contents

File contents.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Returns a new Reader for accessing the contents of the file.

Properties

Link copied to clipboard
val length: Int

Number of Chars (unicode code units) in the file.

Link copied to clipboard

Number of lines in the file.

Link copied to clipboard

Extensions

Link copied to clipboard
fun SourceFile.compile(backend: Backend, selectionSolver: SelectionProblemSolver = defaultSelectionProblemSolver, costRegime: SimpleCostRegime = SimpleCostRegime.WAN, saveLabelConstraintGraph: (graphWriter: (Writer) -> Unit) -> Unit? = null, saveInferredLabels: File? = null, saveEstimatedCost: File? = null, saveProtocolAssignment: File? = null): ProgramNode

Similar to SourceFile.compileToKotlin, but returns a program for the interpreter.

Link copied to clipboard
fun SourceFile.compileToKotlin(fileName: String, packageName: String, backend: Backend, selectionSolver: SelectionProblemSolver = defaultSelectionProblemSolver, costRegime: SimpleCostRegime = SimpleCostRegime.WAN, saveLabelConstraintGraph: (graphWriter: (Writer) -> Unit) -> Unit? = null, saveInferredLabels: File? = null, saveEstimatedCost: File? = null, saveProtocolAssignment: File? = null): FileSpec

Compile this source file to a Kotlin program.

Link copied to clipboard
fun SourceFile.parse(protocolParsers: Map<ProtocolName, ProtocolParser<Protocol>> = defaultProtocolParsers): ProgramNode

Parses this source file and returns the AST.

fun SourceFile.parse(protocolParsers: Map<ProtocolName, ProtocolParser<Protocol>> = defaultProtocolParsers): ProgramNode

Parses this source file to IR and returns the IR.

Link copied to clipboard

Parses this source file as a security label.