Package edu.cornell.cs.apl.viaduct.syntax.surface

The abstract syntax of the surface language.

Types

AssertionNode
Link copied to clipboard
class AssertionNode(condition: ExpressionNode, sourceLocation: SourceLocation, comment: String?) : StatementNode

Asserting that a condition is true, and failing otherwise.

AtomicExpressionNode
Link copied to clipboard
sealed class AtomicExpressionNode : ExpressionNode

An expression that requires no computation to reduce to a value.

BlockNode
Link copied to clipboard
class BlockNode : StatementNode, List<StatementNode>

A sequence of statements.

BreakNode
Link copied to clipboard
class BreakNode(jumpLabel: JumpLabelNode?, sourceLocation: SourceLocation, comment: String?) : StatementNode

Breaking out of a loop.

ConstructorCallNode
Link copied to clipboard
class ConstructorCallNode(className: ClassNameNode, typeArguments: Arguments<ValueTypeNode>, labelArguments: Arguments<Located<LabelExpression>>?, protocol: ProtocolNode?, arguments: Arguments<ExpressionNode>, sourceLocation: SourceLocation) : ExpressionNode

Call to an object constructor. Used for out parameter initialization.

DeclarationNode
Link copied to clipboard
class DeclarationNode(variable: ObjectVariableNode, initializer: ExpressionNode, sourceLocation: SourceLocation, comment: String?) : SimpleStatementNode

Constructing a new object and binding it to a variable.

DeclassificationNode
Link copied to clipboard
class DeclassificationNode(expression: ExpressionNode, fromLabel: LabelNode?, toLabel: LabelNode, sourceLocation: SourceLocation) : DowngradeNode

Revealing the result of an expression (reducing confidentiality).

DowngradeNode
Link copied to clipboard
sealed class DowngradeNode : ExpressionNode

Reducing the confidentiality or increasing the integrity of the result of an expression.

EndorsementNode
Link copied to clipboard
class EndorsementNode(expression: ExpressionNode, fromLabel: LabelNode, toLabel: LabelNode?, sourceLocation: SourceLocation) : DowngradeNode

Trusting the result of an expression (increasing integrity).

ExpressionArgumentNode
Link copied to clipboard
class ExpressionArgumentNode(expression: ExpressionNode, sourceLocation: SourceLocation) : FunctionArgumentNode

Function argument that is an expression.

ExpressionNode
Link copied to clipboard
sealed class ExpressionNode : Node

A computation that produces a result.

ForLoopNode
Link copied to clipboard
class ForLoopNode(initialize: SimpleStatementNode, guard: ExpressionNode, update: SimpleStatementNode, body: BlockNode, jumpLabel: JumpLabelNode?, sourceLocation: SourceLocation, comment: String?) : LoopNode

A for loop.

FunctionArgumentNode
Link copied to clipboard
sealed class FunctionArgumentNode : Node

Arguments to functions.

FunctionCallNode
Link copied to clipboard
class FunctionCallNode(name: FunctionNameNode, arguments: Arguments<FunctionArgumentNode>, sourceLocation: SourceLocation, comment: String?) : SimpleStatementNode

Function call.

FunctionDeclarationNode
Link copied to clipboard
class FunctionDeclarationNode(name: FunctionNameNode, pcLabel: LabelNode?, parameters: Arguments<ParameterNode>, body: BlockNode, sourceLocation: SourceLocation, comment: String?) : TopLevelDeclarationNode

A function declaration associating a name with code.

FunctionReturnArgumentNode
Link copied to clipboard
sealed class FunctionReturnArgumentNode : FunctionArgumentNode

Out arguments to functions.

HostDeclarationNode
Link copied to clipboard
class HostDeclarationNode(name: HostNode, authority: LabelNode, sourceLocation: SourceLocation, comment: String?) : TopLevelDeclarationNode

Declaration of a participant and their authority.

IfNode
Link copied to clipboard
class IfNode(guard: ExpressionNode, thenBranch: BlockNode, elseBranch: BlockNode, sourceLocation: SourceLocation, comment: String?) : StatementNode

Executing statements conditionally.

InfiniteLoopNode
Link copied to clipboard
class InfiniteLoopNode(body: BlockNode, jumpLabel: JumpLabelNode?, sourceLocation: SourceLocation, comment: String?) : LoopNode

Executing a statement until a break statement is encountered.

InputNode
Link copied to clipboard
class InputNode(type: ValueTypeNode, host: HostNode, sourceLocation: SourceLocation) : ExpressionNode

An external input.

KeywordStyle
Link copied to clipboard
object KeywordStyle : Style

The display style used for the keyword in the language.

LetNode
Link copied to clipboard
class LetNode(temporary: TemporaryNode, value: ExpressionNode, protocol: ProtocolNode?, sourceLocation: SourceLocation, comment: String?) : SimpleStatementNode

Binding the result of an expression to a new temporary variable.

LiteralNode
Link copied to clipboard
class LiteralNode(value: Value, sourceLocation: SourceLocation) : AtomicExpressionNode

A literal constant.

LoopNode
Link copied to clipboard
sealed class LoopNode : StatementNode

A loop statement.

Node
Link copied to clipboard
abstract class Node : HasSourceLocation, PrettyPrintable

A node in the abstract syntax tree of a surface level program.

ObjectDeclarationArgumentNode
Link copied to clipboard
class ObjectDeclarationArgumentNode(variable: ObjectVariableNode, sourceLocation: SourceLocation) : FunctionReturnArgumentNode

Declaration of a new object as a return argument of a function.

ObjectReferenceArgumentNode
Link copied to clipboard
class ObjectReferenceArgumentNode(variable: ObjectVariableNode, sourceLocation: SourceLocation) : FunctionArgumentNode

Function argument that is an object reference (e.g. &a in the surface syntax).

OperatorApplicationNode
Link copied to clipboard
class OperatorApplicationNode(operator: Operator, arguments: Arguments<ExpressionNode>, sourceLocation: SourceLocation) : ExpressionNode

An n-ary operator applied to n arguments.

OutParameterArgumentNode
Link copied to clipboard
class OutParameterArgumentNode(parameter: ObjectVariableNode, sourceLocation: SourceLocation) : FunctionReturnArgumentNode

Out parameter initialized as an out parameter to a function call.

OutParameterInitializationNode
Link copied to clipboard
class OutParameterInitializationNode(name: ObjectVariableNode, rhs: ExpressionNode, sourceLocation: SourceLocation, comment: String?) : SimpleStatementNode

Initialization for an out parameter.

OutputNode
Link copied to clipboard
class OutputNode(message: ExpressionNode, host: HostNode, sourceLocation: SourceLocation, comment: String?) : SimpleStatementNode

An external output.

ParameterNode
Link copied to clipboard
class ParameterNode(name: ObjectVariableNode, parameterDirection: ParameterDirection, className: ClassNameNode, typeArguments: Arguments<ValueTypeNode>, labelArguments: Arguments<LabelNode>?, protocol: ProtocolNode?, sourceLocation: SourceLocation, comment: String?) : Node

A parameter to a function declaration.

ProgramNode
Link copied to clipboard
class ProgramNode : Node, List<TopLevelDeclarationNode>

Represents a surface level program which is a sequence of top level declarations.

QueryNode
Link copied to clipboard
class QueryNode(variable: ObjectVariableNode, query: QueryNameNode, arguments: Arguments<ExpressionNode>, sourceLocation: SourceLocation) : ExpressionNode

A query method applied to an object.

ReadNode
Link copied to clipboard
class ReadNode(temporary: TemporaryNode) : AtomicExpressionNode

Reading the value stored in a temporary.

SimpleStatementNode
Link copied to clipboard
sealed class SimpleStatementNode : StatementNode

A statement that is not a combination of other statements, and that does not affect control flow.

SkipNode
Link copied to clipboard
class SkipNode(sourceLocation: SourceLocation, comment: String?) : SimpleStatementNode

A statement that does nothing.

StatementNode
Link copied to clipboard
sealed class StatementNode : Node

A computation with side effects.

TopLevelDeclarationNode
Link copied to clipboard
sealed class TopLevelDeclarationNode : Node

A declaration at the top level of a file.

UpdateNode
Link copied to clipboard
class UpdateNode(variable: ObjectVariableNode, update: UpdateNameNode, arguments: Arguments<ExpressionNode>, sourceLocation: SourceLocation, comment: String?) : SimpleStatementNode

An update method applied to an object.

WhileLoopNode
Link copied to clipboard
class WhileLoopNode(guard: ExpressionNode, body: BlockNode, jumpLabel: JumpLabelNode?, sourceLocation: SourceLocation, comment: String?) : LoopNode

Executing a statement repeatedly as long as a condition is true.