Module syntax

Module syntax 

Source
Expand description

Document Character (Dc) syntax Domain Specific Language (DSL) module.

Provides AST definitions, lexer/parser, semantic and cross-reference validators, and resilient tag-soup pattern matchers for evaluating and processing DcText documents.

Modules§

ast
Abstract Syntax Tree (AST) definitions for the Document Character (Dc) syntax DSL.
data_constraint
Data constraint parsing shared by the Dc syntax parser and validator.
parser
Parser and lexer implementation for the Document Character (Dc) syntax DSL.
resolver
Rule and named type resolution trait and dataset implementation.
role
Document Character (Dc) syntactic and semantic role classifications.
validator
Semantic validator and cross-reference checker for Dc syntax AST trees.

Structs§

DatasetRuleResolver
In-memory resolver caching syntax rules, named types, and script mappings.
DcSyntaxRule
Root AST structure for a complete Dc syntax declaration.
FormatValidationInfo
Format metadata needed to validate format references in syntax rules (e.g. [data:<format>]).
FormatValidationRegistry
Registry of format definitions and support levels for syntax validation.
NumberSubtypeConstraint
Structured numeric format and/or range bound constraint for [number:...] constructs.
StarterSet
Precomputed starter token set for a named syntactic construct, derived recursively from the CSV syntax patterns in README-named-types.csv and categories/*.csv.
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.
DcRole
Classification of syntactic framing and semantic roles for Document Characters.
DcSyntaxExpr
Pattern grammar combining sequences and alternations.
FramingShape
Physical framing classification of a Document Character or Format syntax rule.
NumberConstraintClause
A single clause in a &-separated [number:...] subtype constraint.
NumericBoundValue
Exact integer endpoint value used in Dc 643 "Range" numeric subtype bounds (0..=u128::MAX, negative -u128, or 2^128).
PatternTokenStep
A single stepped element from a .Semantic:Pattern &[DcShorthand] token slice.
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.

Traits§

SyntaxRuleResolver
Trait providing resolution of syntax rules, named types, and script sets.

Functions§

build_format_validation_registry
Constructs a FormatValidationRegistry from parsed format definitions.
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.
default_syntax_resolver
Returns the lazily loaded shared default syntax resolver instance.
detect_container_closer
extract_container_header_elements
extract_trailing_after_closer
format_extension_regex_pattern
Formats a .Semantic:Pattern SyntaxPattern compiled by parse_extension_regex back into its canonical ~...~ regex extension notation.
is_extension_regex
Returns true if entry (after optional "case:" prefix) is a ~...~-delimited regex extension pattern.
is_transformation_format_category
Returns true when category_or_script denotes the .Formats:transformation document-transformation format category.
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.
parse_data_constraint
Parses an optional format and decoded byte count for a data construct.
parse_dc_syntax
Parses a complete Dc syntax rule declaration string (e.g. ":~ [^248 255]+ 248").
parse_extension_regex
Parses a ~...~-delimited regular expression from the format Extensions column into a DcSyntaxRule using the common .Semantic:Pattern primitives.
parse_number_constraint
Parses a [number:...] subtype constraint into its &-separated clauses.
parse_target_token
Parses a target token strictly according to canonical shorthand formatting rules:
register_historical_syntax_resolver
Registers a pre-built DatasetRuleResolver in the historical resolver cache for most_recent_node_id (Dc 641 "Global graph system block most recent node ID at time of document creation").
syntax_resolver_at_most_recent
Returns a shared syntax resolver reflecting the System-block graph state as of most_recent_node_id (Dc 641 "Global graph system block most recent node ID at time of document creation").
validate_dc_syntax
Validates a parsed DcSyntaxRule AST against database registries.