Module ast

Module ast 

Source
Expand description

Abstract Syntax Tree (AST) definitions for the Document Character (Dc) syntax DSL.

Structs§

DcSyntaxRule
Root AST structure for a complete Dc syntax declaration.
NumberSubtypeConstraint
Structured numeric format and/or range bound constraint for [number:...] constructs.
SyntaxAction
Action invocation representing semantic translation or AST emission.
SyntaxDiagnostic
Diagnostic message emitted during parsing or matching.
SyntaxElement
Quantified element combining a term and its repetition quantifier.

Enums§

ActionArg
Argument passed to an action invocation.
CharTarget
Target reference to a character or format entity.
FramingShape
Physical framing classification of a Document Character or Format syntax rule.
NumericBoundValue
Exact integer endpoint value used in Dc 643 "Range" numeric subtype bounds (0..=u128::MAX, negative -u128, or 2^128).
Quantifier
Quantifier applied to a syntax term.
SubtypeConstraint
Structured subtype constraint on a SyntaxTerm::NamedConstruct ([<name>:<subtype>]).
SyntaxPattern
Pattern grammar combining sequences and alternations.
SyntaxTerm
Syntactic term in a Dc syntax rule.

Constants§

MAX_LEGACY_FRAMING_SHORT_DC_ID
Highest Short Dc ID permitted to use legacy framing shapes (PrefixVariableArity, Infix, or LegacySourceWhitespace). Any newly allocated Short Dc (> 634) that defines a syntax rule must use deterministic Paired, Closer, PrefixAtomArity, or PrefixArity framing.

Functions§

classify_rule_framing_shape
Classifies the physical framing shape of a Document Character or Format rule without external subframe lookups.
classify_rule_framing_shape_with
Classifies the physical framing shape of a Document Character or Format rule, using closer_for_opener and is_unary_prefix_target to identify inline subframes.
is_unary_prefix_rule
Returns true if rule is a 1-argument prefix rule (:~ <1 ExactOne NamedConstruct>).
normalize_syntax_pattern
Normalizes a syntax pattern by converting explicit references to the defining character’s Short ID (or any equivalent ID) into SyntaxTerm::SelfChar (~), and mapping target references to their canonical equivalents under canonical_map.