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

The abstract syntax of the internal language.

Types

AssertionNode
Link copied to clipboard
class AssertionNode(condition: AtomicExpressionNode, sourceLocation: SourceLocation) : StatementNode

Asserting that a condition is true, and failing otherwise.

AtomicExpressionNode
Link copied to clipboard
sealed class AtomicExpressionNode : PureExpressionNode

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) : ControlNode

Breaking out of a loop.

CommunicationNode
Link copied to clipboard
interface CommunicationNode : HasSourceLocation, PrettyPrintable

An external input or an output.

ControlNode
Link copied to clipboard
sealed class ControlNode : StatementNode

A statement that affects control flow.

DeclarationNode
Link copied to clipboard
class DeclarationNode(name: ObjectVariableNode, className: ClassNameNode, typeArguments: Arguments<ValueTypeNode>, labelArguments: Arguments<LabelNode>?, arguments: Arguments<AtomicExpressionNode>, protocol: ProtocolNode?, sourceLocation: SourceLocation) : SimpleStatementNode, ObjectDeclaration

Constructing a new object and binding it to a variable.

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

Revealing the result of an expression (reducing confidentiality).

DowngradeNode
Link copied to clipboard
sealed class DowngradeNode : PureExpressionNode

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

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

Trusting the result of an expression (increasing integrity).

ExpressionArgumentNode
Link copied to clipboard
class ExpressionArgumentNode(expression: AtomicExpressionNode, sourceLocation: SourceLocation) : FunctionInputArgumentNode
ExpressionNode
Link copied to clipboard
sealed class ExpressionNode : Node

A computation that produces a result.

FunctionArgumentNode
Link copied to clipboard
sealed class FunctionArgumentNode : Node
FunctionCallNode
Link copied to clipboard
class FunctionCallNode(name: FunctionNameNode, arguments: Arguments<FunctionArgumentNode>, sourceLocation: SourceLocation) : ControlNode

Function call.

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

A function declaration associating a name with code.

FunctionInputArgumentNode
Link copied to clipboard
sealed class FunctionInputArgumentNode : FunctionArgumentNode
FunctionOutputArgumentNode
Link copied to clipboard
sealed class FunctionOutputArgumentNode : FunctionArgumentNode
HostDeclarationNode
Link copied to clipboard
class HostDeclarationNode(name: HostNode, authority: LabelNode, sourceLocation: SourceLocation) : TopLevelDeclarationNode

Declaration of a participant and their authority.

IfNode
Link copied to clipboard
class IfNode(guard: AtomicExpressionNode, thenBranch: BlockNode, elseBranch: BlockNode, sourceLocation: SourceLocation) : ControlNode

Executing statements conditionally.

InfiniteLoopNode
Link copied to clipboard
class InfiniteLoopNode(body: BlockNode, jumpLabel: JumpLabelNode, sourceLocation: SourceLocation) : ControlNode

A loop that is executed until a break statement is encountered.

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

An external input.

LetNode
Link copied to clipboard
class LetNode(temporary: TemporaryNode, value: ExpressionNode, protocol: ProtocolNode?, sourceLocation: SourceLocation) : 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.

Metadata
Link copied to clipboard
typealias Metadata = Map<Node, PrettyPrintable>

Metadata information per node.

Node
Link copied to clipboard
abstract class Node : TreeNode<Node> , HasSourceLocation, PrettyPrintable

A node in the intermediate language abstract syntax tree.

ObjectDeclaration
Link copied to clipboard
interface ObjectDeclaration
ObjectDeclarationArgumentNode
Link copied to clipboard
class ObjectDeclarationArgumentNode(name: ObjectVariableNode, sourceLocation: SourceLocation) : FunctionOutputArgumentNode
ObjectReferenceArgumentNode
Link copied to clipboard
class ObjectReferenceArgumentNode(variable: ObjectVariableNode, sourceLocation: SourceLocation) : FunctionInputArgumentNode
OperatorApplicationNode
Link copied to clipboard
class OperatorApplicationNode(operator: Operator, arguments: Arguments<AtomicExpressionNode>, sourceLocation: SourceLocation) : PureExpressionNode

An n-ary operator applied to n arguments.

OutParameterArgumentNode
Link copied to clipboard
class OutParameterArgumentNode(parameter: ObjectVariableNode, sourceLocation: SourceLocation) : FunctionOutputArgumentNode
OutParameterConstructorInitializerNode
Link copied to clipboard
class OutParameterConstructorInitializerNode(className: ClassNameNode, typeArguments: Arguments<ValueTypeNode>, labelArguments: Arguments<LabelNode>?, arguments: Arguments<AtomicExpressionNode>, sourceLocation: SourceLocation) : OutParameterInitializerNode
OutParameterExpressionInitializerNode
Link copied to clipboard
class OutParameterExpressionInitializerNode(expression: AtomicExpressionNode, sourceLocation: SourceLocation) : OutParameterInitializerNode
OutParameterInitializationNode
Link copied to clipboard
class OutParameterInitializationNode(name: ObjectVariableNode, initializer: OutParameterInitializerNode, sourceLocation: SourceLocation) : SimpleStatementNode
OutParameterInitializerNode
Link copied to clipboard
sealed class OutParameterInitializerNode : Node
OutputNode
Link copied to clipboard
class OutputNode(message: AtomicExpressionNode, host: HostNode, sourceLocation: SourceLocation) : SimpleStatementNode, CommunicationNode

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) : Node, ObjectDeclaration

A parameter to a function declaration.

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

The intermediate level representation of a program.

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

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.

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<AtomicExpressionNode>, sourceLocation: SourceLocation) : SimpleStatementNode

An update method applied to an object.

Functions

deepCopy
Link copied to clipboard
fun Node.deepCopy(): Node

Like Node.copy, but recursively copies all descendant nodes also.