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. - Block
Decl - A named or anonymous block:
entity User { ... },config { ... }, etc. - Block
Item - Cond
Block Branch - A branch of a block-level
if/else ifchain. - Cond
Branch - Contract
Binding - A single entry in a
contracts:clause. - Default
Decl default [Type] name = value- Deferred
Decl deferred path.expression- Ident
- Invariant
Decl invariant Name { expr }— top-level expression-bearing invariant- Join
Field - Module
- A parsed
.alliumfile. - Named
Arg - Open
Question Decl open question "text"- Qualified
Name - String
Literal - Transition
Edge - A directed edge in a transition graph:
from -> to. - Transition
Graph - A transition graph block:
transitions field_name { edges..., terminal: states }. - UseDecl
use "path" as alias- Variant
Decl variant Name : Type { ... }- When
Clause - A
whenclause on a field declaration:when status = shipped | delivered.
Enums§
- Annotation
Kind - Prose annotation kinds.
- Binary
Op - Block
Item Kind - Block
Kind - CallArg
- Comparison
Op - Contract
Direction - Direction marker for contract bindings in surfaces.
- Decl
- Expr
- ForBinding
- Binding in a
forloop — either a single identifier or a destructured tuple like(a, b). - Logical
Op - String
Part