vms-9f6: real LIB$TABLE_PARSE / LIB$TPARSE TPARSE engine (RTL prereq for MMK + vms-486) - #409
Merged
Merged
Conversation
…for MMK + vms-486) Replace the 14-line SS$_UNSUPPORTED stub in src/libvms/rtl/lib_tparse.c with a real TPARSE finite-state parser, and export the previously-missing lib$table_parse symbol (plus the lib$tparse alias MMK relies on). Engine (clean-room from the public VSI RTL Library Reference LIB$TABLE_PARSE semantics — no VSI source/binaries): ordered per-state transitions matching literal chars, case-blind keywords (with optional TPA$M_ABBREV abbreviation), the TPA$_ special classes (LAMBDA/EOS/ANY/BLANK/ALPHA/DIGIT/SYMBOL/STRING/ DECIMAL/OCTAL/HEX/UIC), and subexpression calls; token/number capture into the TPA block; action-routine callbacks that receive the block address and whose even (failure) return REJECTS the transition and backtracks (MMK's CHECK_GNU/ CHECK_COND gate pattern); TPA$M_BLANKS inter-token blank skipping; and TPA$_EXIT/TPA$_FAIL/next-state dispatch. The in-memory state/key table LAYOUT is not published by VSI, so tpadef.h defines OVMX's own representation (TPA_GRAMMAR/TPA_STATE/TPA_TRAN), labelled an OVMX design choice per Rule 8. This is the C table format the parse_tables.mar -> C port (vms-486) will target; behaviour, not table bytes, is what matches VMS. Wiring: - rtl/lib_tparse.c added to src/libvms/CMakeLists.txt and to the LIST in src/vmslink/mk_libvms_shr.sh (the vector is nm-generated, so both lib$-names auto-export). Verified: OVMX_LINK_NATIVE x86_64 link_native_graph builds all 9 artifacts (EM_X86_64, zero DT_NEEDED) and LIBVMS$SHR.EXE's .vms$sv now carries lib$table_parse + lib$tparse. - lib$table_parse declared in lib$routines.h alongside lib$tparse. Test: tests/libvms/test_lib_tparse.c drives five real grammars (UIC parser, a SET/SHOW command language, action-driven backtracking, a subexpression, and keyword abbreviation) through lib$table_parse and asserts status + action side effects (23 assertions, all pass). Full Debug ctest: 100% (156 tests, 0 fail). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
baron-3dl
added a commit
that referenced
this pull request
Aug 13, 2026
#445) Bump OVMX_PRODUCT_VERSION V0.4 → V0.4-1. 24 PRs / 32 commits since V0.4, packed across dimensions (point release toward the 0.5 milestone): self-host (R7) #409 lib$tparse · #411 CLI$ compiled-CLD · #413 sys$setddir #414 lib$get_foreign · #415 sys$filescan (RTL foundation) #418 parse_tables.mar→C (spine #2) · #429 LIBRARIAN.EXE+.OLB (spine #3) #435 shareable-vector freeze (GSMATCH stability) authenticity #421 veracity rubric (Q1 oracle-source/Q2 real-inject) · #424 30 oracle-pinned constants #433 rmsdef.h 74 fabricated RMS codes → oracle UX/DCL/RMS #422 SHOW CLUSTER real membership · #441 DCL per-@-level local scope #442 RMS XAB dates → VMS 1858-epoch quadword networking #419 virtio NIC (user-mode default + opt-in tap/bridge) docs #423 clustering release train + swept: other threads' merged work on main since V0.4 Clustering config-authoring UX (vms-098) + its public-manual grounding gate remain 0.5 (minor) deliverables — not triggered by this point cut. Co-authored-by: alice <alice@workspace.local> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
vms-9f6 -- replace the lib_tparse.c stub with a real TPARSE engine
Parent:
vms-801(source-compat / RTL coverage). Unblocks the P2 gap in theself-host MMK spine (
docs/design-self-host-mmk-spine.md1.3):lib$table_parsewas absent and
lib$tparsewas a 14-lineSS$_UNSUPPORTEDstub. This blocksparse_tables.mar-> C (vms-486) and native MMK.What changed
src/libvms/rtl/lib_tparse.c-- real TPARSE finite-state engine. Orderedper-state transitions matching literal chars, case-blind keywords (optional
TPA$M_ABBREV), theTPA$_special classes (LAMBDA/EOS/ANY/BLANK/ALPHA/DIGIT/SYMBOL/STRING/DECIMAL/OCTAL/HEX/UIC), and subexpression calls; token/number
capture into the TPA block; action-routine callbacks that get the block address
and whose even (failure) return rejects the transition and backtracks (MMK's
CHECK_GNU/CHECK_CONDgate pattern);TPA$M_BLANKSinter-token blank skipping;TPA$_EXIT/TPA$_FAIL/next-state dispatch. Exports bothlib$table_parseand the
lib$tparsealias.src/libvms/include/tpadef.h-- OVMX C table format (TPA_GRAMMAR/TPA_STATE/TPA_TRAN, action typedef). The state/key table byte layout is unpublished byVSI, so this is labelled an OVMX design choice per Rule 8. It is the format
vms-486 will target; observable behaviour, not table bytes, is what matches VMS.
src/libvms/include/lib$routines.h-- declarelib$table_parse.src/libvms/CMakeLists.txt+src/vmslink/mk_libvms_shr.sh-- addrtl/lib_tparse(the shr vector isnm-generated, so both names auto-export).Clean-room (Rule 8)
Semantics derived only from the public VSI OpenVMS RTL Library Reference
(LIB$TABLE_PARSE / LIB$TPARSE, the TPA$ token classes, the action-routine TPA
block). No VSI/HPE source or binaries consulted.
Tests
tests/libvms/test_lib_tparse.c-- five real grammars (UIC parser, aSET/SHOW command language, action-driven backtracking, a subexpression, keyword
abbreviation) driven through
lib$table_parse, asserting status + action sideeffects. 23 assertions, all pass.
ctest: 100% (156 tests, 0 failed) (11 e2e Skipped, pre-existing).OVMX_LINK_NATIVE, x86_64link_native_graph):9 artifacts, all EM_X86_64, zero DT_NEEDED;
LIBVMS$SHR.EXE.vms$svnow carrieslib$table_parse+lib$tparse.Not merged; work item not closed here.
🤖 Generated with Claude Code