Expand description
Deterministic, meaning-aware merging of grammars from several sources, and binding-aware renaming of grammar rules.
This mirrors js/src/grammar-merge.js: both runtimes normalize rule
definitions the same way, prove equivalence by the same recursive structural
bisimulation and print the same canonical definitions, so their decisions
agree.
Structs§
- Grammar
Merge Alternative - An explicit alternative kept by the merge.
- Grammar
Merge Decision - One merge decision with its justification.
- Grammar
Merge Error - Malformed merge input, or an incomplete merge in
assert_merge_complete. - Grammar
Merge Failure - A required equivalence the merge could not establish.
- Grammar
Merge Nomination - A candidate match nominated by a heuristic.
- Grammar
Merge Options - Optional inputs of
merge_grammars. - Grammar
Merge Result - The result of
merge_grammars. - Grammar
Merge Source - One grammar taking part in a merge.
- Grammar
Rename Error - A refused rename.
- Merged
Grammar Group - The merged grammar of one language edition.
- Renamed
Grammar - A renamed grammar and its source aliases.
- Rule
Alias - Maps a canonical rule name back to its original source name.
Enums§
- Grammar
Merge Alternative Reason - Why the merge kept several options instead of choosing silently.
- Grammar
Merge Decision Kind - What the merge decided about one class of rules.
- Grammar
Merge Failure Kind - Kind of a merge failure.
- Grammar
Merge Failure Reason - Why a required equivalence was not established.
- Grammar
Merge Nomination Basis - Why two rules were nominated as a possible match.
- Grammar
Merge Nomination Outcome - Whether a nomination was confirmed by the structural proof.
- Grammar
Rename Error Kind - Why a rename was refused.
Constants§
- GRAMMAR_
MERGE_ METHOD - How an accepted equivalence is justified.
Functions§
- assert_
merge_ complete - Fails when a merge left a required equivalence unresolved.
- assert_
merge_ shares - Fails when a group of two or more sources shares no rule between them: such a merge only concatenates its sources side by side.
- merge_
grammars - Merges grammars of several sources without user interaction.
- normalized_
rule_ definition - The canonical text of a rule definition after meaning-aware normalization.
- rename_
grammar_ rule - Renames one rule and every reference to it.
- restore_
source_ names - Renames canonical rule names back to their source names for export.
- shared_
rule_ decisions - The decisions of a merge group that share a rule between its sources: the merged and reconciled classes with members of more than one source.