Skip to main content

Module merge

Module merge 

Source
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§

GrammarMergeAlternative
An explicit alternative kept by the merge.
GrammarMergeDecision
One merge decision with its justification.
GrammarMergeError
Malformed merge input, or an incomplete merge in assert_merge_complete.
GrammarMergeFailure
A required equivalence the merge could not establish.
GrammarMergeNomination
A candidate match nominated by a heuristic.
GrammarMergeOptions
Optional inputs of merge_grammars.
GrammarMergeResult
The result of merge_grammars.
GrammarMergeSource
One grammar taking part in a merge.
GrammarRenameError
A refused rename.
MergedGrammarGroup
The merged grammar of one language edition.
RenamedGrammar
A renamed grammar and its source aliases.
RuleAlias
Maps a canonical rule name back to its original source name.

Enums§

GrammarMergeAlternativeReason
Why the merge kept several options instead of choosing silently.
GrammarMergeDecisionKind
What the merge decided about one class of rules.
GrammarMergeFailureKind
Kind of a merge failure.
GrammarMergeFailureReason
Why a required equivalence was not established.
GrammarMergeNominationBasis
Why two rules were nominated as a possible match.
GrammarMergeNominationOutcome
Whether a nomination was confirmed by the structural proof.
GrammarRenameErrorKind
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.