The MMT Language and System

Processors

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.

</table>
abstract interface main implementation(s) </tr>
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"
interpretation Interpreter (Importer) input formatpair of parser and checker
new TwoStepInterpreter(
  new KeywordBasedParser(new NotationBasedParser),
  new MMTStructureChecker(new RuleBasedChecker)
)
"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"