Add src/compiler/parser.s: a two-pass declaration-level parser. Pass 1
parses interfaces, classes (with implements lists, fields, and method
headers), and exactly one program, records top-level types in a bank-1
table, tracks block structure inside method and program bodies, and reports
syntax and duplicate-name errors with recovery. Pass 2 replays the source
and reports type references that name no declared interface or class, so
forward references work.
src/compiler/parser.s, src/common/parser.incsrc/common/diagcat.inc (appended entries), docs/diagnostics.mdtests/parser/scripts/build-parser-test.ps1, scripts/verify-parser-test.ps1docs/architecture.md, docs/memory-map.mdplanning/claims/E03-S01.mdbuild/noprog.n8 reports
PROGRAM EXPECTED; a second or late declaration is an ordering error.forward.n8 and
decls.n8 use types before declaring them and pass; unknown.n8 reports
exactly its four truly unknown names. Swapping the pass order (checking
references first) fails 6 accepted fixtures, so pass 2 is what makes
forward references work.order.n8 (late class, late duplicate interface) and recover.n8
(five independent errors) match their full expected diagnostic lists
exactly; eofclass.n8 shows end-of-file errors are not cascaded.line_cont.n8 and multi_stmt.n8 need expression and
statement parsing, which E03-S03's own criteria cover; the test lists them
as pending and confirms they raise no false diagnostics meanwhile.line_cont.n8 and multi_stmt.n8 need the statement
and expression grammar that E03-S03 owns (“Rejects multiple statements per
line and cross-line expressions”); the test lists them as pending E03-S03
and checks that they raise no false diagnostics meanwhile.var
locals already share one duplicate-checked scope here because
dup_decl.n8 needs it.ok_msg - messages was 0; and method print() was rejected because
print is a keyword. The last is a spec conflict, resolved by D121
(proposed).scripts/verify-parser-test.ps1 (pass plus pass-order mutation),
scripts/build-diag-test.ps1 catalog check.src/compiler/parser.s, src/common/parser.inc,
src/common/diagcat.inc, docs/diagnostics.md, tests/parser/,
scripts/build-parser-test.ps1, scripts/verify-parser-test.ps1,
docs/architecture.md, docs/memory-map.md, docs/decisions.md (D121),
this claim.implements accepts a
class name until interface conformance (E03-S06); statement lines are only
skimmed, so a block keyword inside a skimmed expression is not possible
today but must stay so when E03-S03 lands.Powered by TurnKey Linux.