Package-level declarations

Types

Link copied to clipboard
class ArrayType(val elementType: ValueTypeNode, val shape: Arguments<IndexExpressionNode>) : Type
Link copied to clipboard
Link copied to clipboard

A sequence of circuit statements.

Link copied to clipboard
class CircuitDeclarationNode(val name: FunctionNameNode, val protocol: ProtocolNode, val bounds: Arguments<BoundParameterNode>, val inputs: Arguments<ParameterNode>, val outputs: Arguments<ParameterNode>, val body: CircuitBlockNode, val sourceLocation: SourceLocation) : TopLevelDeclarationNode

A simple block of statements with no control flow, all on one protocol

Link copied to clipboard
Link copied to clipboard
sealed class ExpressionNode : Node

A computation that produces a result.

Link copied to clipboard
class HostDeclarationNode(val name: HostNode, val sourceLocation: SourceLocation) : TopLevelDeclarationNode

Declaration of a participant and their authority.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Binding the result of an expression to a variable. Note that scalars are represented as arrays of dimension zero: val x = 5 ===> val x[] = 5

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

A literal constant.

Link copied to clipboard
class LookupNode(variable: VariableNode, indices: Arguments<IndexExpressionNode>, val sourceLocation: SourceLocation) : PureExpressionNode
Link copied to clipboard
Link copied to clipboard
class OperatorApplicationNode(val operator: Operator, val arguments: Arguments<PureExpressionNode>, val sourceLocation: SourceLocation) : PureExpressionNode

An n-ary operator applied to n arguments.

Link copied to clipboard
class OperatorNode(val operator: Operator, val sourceLocation: SourceLocation) : Node
Link copied to clipboard
class ParameterNode(val name: VariableNode, val type: ArrayTypeNode, val protocol: ProtocolNode, val sourceLocation: SourceLocation) : Node, VariableDeclarationNode

A parameter to a function declaration.

Link copied to clipboard
class ProgramNode(val declarations: PersistentList<TopLevelDeclarationNode>, val sourceLocation: SourceLocation) : Node, List<TopLevelDeclarationNode>

The circuit representation of a program.

Link copied to clipboard
Link copied to clipboard
class ReduceNode(val operator: OperatorNode, val defaultValue: PureExpressionNode, val indices: Arguments<IndexParameterNode>, val body: PureExpressionNode, val sourceLocation: SourceLocation) : PureExpressionNode
Link copied to clipboard
class ReferenceNode(val name: VariableNode, val sourceLocation: SourceLocation) : IndexExpressionNode
Link copied to clipboard
class ReturnNode(val values: Arguments<PureExpressionNode>, val sourceLocation: SourceLocation) : StatementNode
Link copied to clipboard
sealed class StatementNode : Node

A computation with side effects.

Link copied to clipboard

A declaration at the top level of a file.

Link copied to clipboard
data class Variable(val name: String) : Name

A variable is a name that stands for a value or an object instance.

Link copied to clipboard

A node that declares a Variable.

Link copied to clipboard

Functions

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

Parses this source file to IR and returns the IR.

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

Parses this string and returns the AST.