MMT uses several abstractions for processing content. Implementations can be provided as extensions and are chosen based on appropriate identifiers (e.g., the format to which a parser is applicable).
Each abstraction comes with at least one main implementation, which is parametrized by a set of rules. This allows a second (simpler but less flexible) way to customize MMT by supplying a different set of rules. The type of rule depends on the processor (e.g., notations for a parser).
All processors are divided into three kinds. One kind handles structure (e.g., declarations) and one objects. The third kind pairs up a structure and an object processor.
abstract interface | main implementation(s) | |||||||
---|---|---|---|---|---|---|---|---|
process | level | class (extends) | identified by | input | output | class | parametrized by set of | identifier |
parsing | objects | ObjectParser | string with some extra data | object | NotationBasedParser | notations in scope | ||
structure | StructureParser | stream with some extra data | document | KeywordBasedParser | keyword handlers | |||
both | Parser | input format | new KeywordBasedParser(new NotationBasedParser) |
"mmt" | ||||
checking | objects | ObjectChecker | object with unknown parts | object with unknown parts inferred | RuleBasedChecker | typing rules in scope | ||
structure | StructureChecker | structural element | nothing | MMTStructureChecker | not parametrized | |||
both | Checker | id | new MMTStructureChecker(new RuleBasedChecker) |
"mmt" | ||||
simplification | objects | ObjectSimplifier | object | simplified object | RuleBasedSimplifier | simplification rules in scope | ||
structure | StructureSimplifier | structural element | list of declarations | ElaborationBasedSimplifier | structural features in scope | |||
both | Simplifier | id | new ElaborationBasedSimplifier(new RuleBasedSimplifier) |
"mmt" | ||||
interpretation | Interpreter (Importer) | input format | triple of parser, checker, and simplifier |
new TwoStepInterpreter( new KeywordBasedParser(new NotationBasedParser), new MMTStructureChecker(new RuleBasedChecker), new ElaborationBasedSimplifier(new RuleBasedSimplifier) ) |
"mmt" | |||
presentation | objects | ObjectPresenter | object | according to format | NotationBasedPresenter MathMLPresenter | notations in scope | ||
structure | StructurePresenter | structural element | according to format | MMTStructurePresenter HTMLPresenter | not parametrized | |||
both | Presenter (Exporter) | output format |
new MMTStructurePresenter(new NotationBasedPresenter) new HTMLPresenter(new MathMLPresenter) |
"present-text-notations" "html" |