SourceFile
class 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
Functions
Link copied to clipboard
Returns a new Reader for accessing the contents of the file.
Properties
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.