Skip to main content

Module ast

Module ast 

Source
Expand description

Abstract syntax tree for .blog source text.

These types mirror the surface syntax before lowering into a BlockGraph: references are still unresolved (block ids or position literals) and every node carries a source Span for diagnostics.

Structs§

BitOutputDef
out name = expr
BlockDef
A block definition: <id>: <kind> <pos> [...].
BranchRegionDef
branch <name> { false { ... } true { ... } }
FeedbackDef
feedback <targets> [if <expr>]
FeedbackTargetDef
A single Pauli correction site within a FeedbackDef.
ImportDef
import "path" as name
InstanceDef
name: definition @ [x, y, z] [rotate X|Y|Z degrees]
LetDef
<name> = <expr>
MeasureDef
<name> = measure <ref> or <name> = measure <ref> -> <dir>
ModularSourceFile
A BLOG file containing named module definitions.
ModuleDef
module name { ... }
PipeDef
A pipe definition connecting a source to either an explicit destination or a direction.
QuantumPortDef
in|out name: resource-type = block-id
ResolveDef
resolve <ref-or-branch-name> if <expr>
SourceFile
Standalone BLOG source grouped by statement kind.
Span
Byte-offset span in source text.
Spanned
Value with source location.

Enums§

ActionStmt
An action statement.
BlockKindAst
A parsed block kind, before the two-endpoint kinds are resolved with their movement vectors.
BranchArmStmt
A block or pipe inside one explicit branch arm.
ConnectEndpointAst
A parent-local block ID or named connection endpoint.
ConnectStmt
A module connection statement.
DataStmt
A graph statement.
Expr
A boolean expression over measurement-outcome variables, with spanned sub-expressions.
InterfaceStmt
A module interface statement.
MeasureTargetAst
Unresolved measure target — either a node reference or an edge (node reference + direction).
PipeDst
A pipe destination: an explicit endpoint reference or a step direction.
PortDirectionAst
Direction of one declared quantum module port.
Ref
Unresolved reference — block ID or position literal.
ResolveTargetDef
A selective-block reference or a named branch region.