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
createReader
Link copied to clipboard
Returns a new Reader for accessing the contents of the file.
Properties
Extensions
compile
Link copied to clipboard
fun SourceFile.compile(backend: Backend, costRegime: SimpleCostRegime = SimpleCostRegime.WAN, saveLabelConstraintGraph: (graphWriter: (Writer) -> Unit) -> Unit? = null, saveInferredLabels: File? = null, saveEstimatedCost: File? = null, saveProtocolAssignment: File? = null): ProgramNode
Content copied to clipboard
Similar to SourceFile.compileToKotlin, but returns a program for the interpreter.
compileToKotlin
Link copied to clipboard
fun SourceFile.compileToKotlin(fileName: String, packageName: String, backend: Backend, costRegime: SimpleCostRegime = SimpleCostRegime.WAN, saveLabelConstraintGraph: (graphWriter: (Writer) -> Unit) -> Unit? = null, saveInferredLabels: File? = null, saveEstimatedCost: File? = null, saveProtocolAssignment: File? = null): FileSpec
Content copied to clipboard
Compile this source file to a Kotlin program.
parse
Link copied to clipboard
fun SourceFile.parse(protocolParsers: Map<ProtocolName, ProtocolParser<Protocol>> = defaultProtocolParsers): ProgramNode
Content copied to clipboard
Parses this source file and returns the AST.
parseLabel
Link copied to clipboard
Parses this source file as a security label.