Section 9 of 51
63. Parser
Stable section ID: S05-CON-008-SECTION-9 · 20 content blocks
The Parser converts the token stream into a structured representation according to the formal grammar of the applicable BDL version.
It shall recognize:
documents;
manifests;
modules;
packages;
declarations;
expressions;
relationships;
constraints;
profiles;
state definitions;
imports;
annotations;
extension structures.
The BDL grammar shall avoid unresolved ambiguity. Where multiple interpretations are syntactically possible, the language specification shall define deterministic precedence or require explicit source clarification.
The Parser shall construct the Abstract Syntax Tree while preserving source locations, comments where required, import context, and syntax-level annotations.
Parser error recovery may be used to provide useful diagnostics, but recovered regions shall be marked. The compiler shall not generate safety-significant outputs from a source whose parse required unresolved interpretation.
The Parser shall detect incomplete constructs, unexpected tokens, prohibited nesting, invalid declaration order where order is meaningful, and use of unsupported language features.
Syntactic acceptance shall not resolve names, validate units, establish component compatibility, or determine engineering correctness.