Skip to main content

Module model

Module model 

Source
Expand description

The structured counterpart to crate::describe(): an instance and its grammar as typed, JSON-serialisable data, so tools and tests can consume the grammar programmatically.

Mirrors the canonical TypeScript tabnas.debug.model() and its exported types in ts/src/debug.ts (DebugModel, DebugTokenInfo, DebugTokenSet, DebugAltInfo, DebugRuleInfo, DebugRuleEdges, DebugLexMatcher, DebugConfigInfo, DebugPluginInfo). The serde field names match the TS field names and the Go JSON tags, so a model decoded from any runtime is comparable with the others — the claim test/spec/model.tsv pins.

Structs§

DebugAltInfo
The structured form of a single rule alternate — the data behind the ALTS text of crate::describe().
DebugConfigInfo
The key parser settings: start rule, finish flag, safe-key, and the built-in per-lexer enable flags.
DebugLexMatcher
One lexer matcher, in priority order.
DebugModel
The full structured description of an instance: the token table, token sets, rules and alternates as data, the rule-reference graph, lexer matchers, config, plugins, and the ABNF text.
DebugPluginInfo
One applied plugin: its name, and its options when the instance holds a bag for it.
DebugRuleEdges
One rule’s outgoing edges in the rule-reference graph: the distinct push/replace rule-name targets of its open and close alternates (function-valued targets recorded as <fn>).
DebugRuleInfo
One rule: its name and its open/close alternates as structured data.
DebugTokenInfo
One row of the token table: the token’s tin (token identification number), its name, and — for fixed (literal) tokens — the source text it matches.
DebugTokenSet
A named token set and its member tins.

Enums§

DebugSeqItem
One lookahead position of an alternate’s token sequence: a single token name, or the several names a multi-token position accepts.

Functions§

model
Build the structured model of parser.