Skip to main content

Module ast

Module ast 

Source
Expand description

AST for the Allium specification language.

The parse tree uses a uniform block-item representation for declaration bodies: every name: value, keyword: value and let name = value within braces is a BlockItem. Semantic classification into entity fields vs relationships vs derived values, or trigger types, happens in a later pass.

Expressions are fully typed — the parser produces the rich Expr tree directly.

Structs§

Annotation
A prose annotation: @invariant Name, @guidance, @guarantee Name.
BlockDecl
A named or anonymous block: entity User { ... }, config { ... }, etc.
BlockItem
CondBlockBranch
A branch of a block-level if/else if chain.
CondBranch
ContractBinding
A single entry in a contracts: clause.
DefaultDecl
default [Type] name = value
DeferredDecl
deferred path.expression
Ident
InvariantDecl
invariant Name { expr } — top-level expression-bearing invariant
JoinField
Module
A parsed .allium file.
NamedArg
OpenQuestionDecl
open question "text"
QualifiedName
StringLiteral
TransitionEdge
A directed edge in a transition graph: from -> to.
TransitionGraph
A transition graph block: transitions field_name { edges..., terminal: states }.
UseDecl
use "path" as alias
VariantDecl
variant Name : Type { ... }
WhenClause
A when clause on a field declaration: when status = shipped | delivered.

Enums§

AnnotationKind
Prose annotation kinds.
BinaryOp
BlockItemKind
BlockKind
CallArg
ComparisonOp
ContractDirection
Direction marker for contract bindings in surfaces.
Decl
Expr
ForBinding
Binding in a for loop — either a single identifier or a destructured tuple like (a, b).
LogicalOp
StringPart