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§
- Dataset
Rule Resolver - In-memory resolver caching syntax rules, named types, and script mappings.
- DcSyntax
Rule - Root AST structure for a complete Dc syntax declaration.
- Format
Validation Info - Format metadata needed to validate format references in syntax rules (e.g.
[data:<format>]). - Format
Validation Registry - Registry of format definitions and support levels for syntax validation.
- Number
Subtype Constraint - Structured numeric format and/or range bound constraint for
[number:...]constructs. - Starter
Set - Precomputed starter token set for a named syntactic construct, derived
recursively from the CSV syntax patterns in
README-named-types.csvandcategories/*.csv. - Syntax
Action - Action invocation representing semantic translation or AST emission.
- Syntax
Diagnostic - Diagnostic message emitted during parsing or matching.
- Syntax
Element - Quantified element combining a term and its repetition quantifier.
Enums§
- Action
Arg - Argument passed to an action invocation.
- Char
Target - Target reference to a character or format entity.
- DcRole
- Classification of syntactic framing and semantic roles for Document Characters.
- DcSyntax
Expr - Pattern grammar combining sequences and alternations.
- Framing
Shape - Physical framing classification of a Document Character or Format syntax rule.
- Number
Constraint Clause - A single clause in a
&-separated[number:...]subtype constraint. - Numeric
Bound Value - Exact integer endpoint value used in
Dc 643 "Range"numeric subtype bounds (0..=u128::MAX, negative-u128, or2^128). - Pattern
Token Step - A single stepped element from a
.Semantic:Pattern&[DcShorthand]token slice. - Quantifier
- Quantifier applied to a syntax term.
- Subtype
Constraint - Structured subtype constraint on a
SyntaxTerm::NamedConstruct([<name>:<subtype>]). - Syntax
Pattern - Pattern grammar combining sequences and alternations.
- Syntax
Term - 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, orLegacySourceWhitespace). Any newly allocated Short Dc (> 634) that defines a syntax rule must use deterministicPaired,Closer,PrefixAtomArity, orPrefixArityframing.
Traits§
- Syntax
Rule Resolver - Trait providing resolution of syntax rules, named types, and script sets.
Functions§
- build_
format_ validation_ registry - Constructs a
FormatValidationRegistryfrom 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_openerandis_unary_prefix_targetto 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:PatternSyntaxPatterncompiled byparse_extension_regexback into its canonical~...~regex extension notation. - is_
extension_ regex - Returns
trueifentry(after optional"case:"prefix) is a~...~-delimited regex extension pattern. - is_
transformation_ format_ category - Returns
truewhencategory_or_scriptdenotes the.Formats:transformationdocument-transformation format category. - is_
unary_ prefix_ rule - Returns true if
ruleis 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 undercanonical_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 formatExtensionscolumn into aDcSyntaxRuleusing the common.Semantic:Patternprimitives. - 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
DatasetRuleResolverin the historical resolver cache formost_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
DcSyntaxRuleAST against database registries.