Package edu.cornell.cs.apl.viaduct.parsing

Types

ProtocolArguments
Link copied to clipboard
class ProtocolArguments

A map from argument labels to Values.

ProtocolParser
Link copied to clipboard
interface ProtocolParser<out P : Protocol>

A parser for protocols of type P.

SourceFile
Link copied to clipboard
class SourceFile

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

SourcePosition
Link copied to clipboard
data class SourcePosition(sourceFile: SourceFile, offset: Int) : Comparable<SourcePosition>

Represents a position in a source file. Positions correspond to spaces between characters rather than characters themselves.

SourceRange
Link copied to clipboard
data class SourceRange(start: SourcePosition, end: SourcePosition)

Denotes a nonempty set of consecutive characters in a source file. Empty ranges are not allowed, since there is no column number that corresponds to a single position.

Functions

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

Parses this source file and returns the AST.

fun String.parse(path: String = "<string>", protocolParsers: Map<ProtocolName, ProtocolParser<Protocol>> = defaultProtocolParsers): ProgramNode

Parses this string and returns the AST.

parseLabel
Link copied to clipboard
fun SourceFile.parseLabel(): LabelExpression

Parses this source file as a security label.

fun String.parseLabel(path: String = "<string>"): LabelExpression

Parses this string as a security label.

Properties

defaultProtocolParsers
Link copied to clipboard
val defaultProtocolParsers: PersistentMap<ProtocolName, ProtocolParser<Protocol>>