Korin API

Conversion

Table of Contents

Namespaces

Rule
Step

Interfaces

NodeRule
A rule for one structure at a time. Rules that look at every line of a record are grouped in {@see Rule\Nodes}, which walks each record once for all of them.
Rule
One conversion rule. It changes one record at a time, so that a conversion can stream: what it must know about the whole input comes from the Prepass, which runs only when a rule needs it.
Step
A conversion between two adjacent versions of the chain 5.5 ↔ 5.5.1 ↔ 7.0, with 5.5.5 attached to 5.5.1 (SPEC section 7): its rules, applied in order to each record.

Classes

Context
What a rule may use besides the record it converts: the options, the prepass, new xrefs and records, and the loss report. Losses are located in the source document: the document being converted is a copy of it, so a node keeps its id; a node added during the conversion is located at its nearest ancestor from the source, a line that could not be parsed at the structure it is in (the path of a file-level one is empty).
ConversionResult
The conversion output and what could not be carried over. The converted document is read from the output only when it is asked for: writing a conversion needs only output(). The output is fixed when the conversion ends; editing document() does not change it.
Converter
Converts a document to another version along the chain of adjacent versions (SPEC section 7).
Loss
One entry of a loss report: data the target version cannot hold as it was. The path and the line are those of the source document. Messages never quote more than a short fragment.
LossReport
Everything a conversion could not carry over as it was, in the order it was found. Empty when upgrading. The JSON form is that of the corpus loss reports (losses.<version>.json).
Prepass
Facts about the whole input that rules need before they see the first record (SPEC section 7, "Streaming conversion"): from the document here, from a lexer-only pass in convertFile().
Steps
The conversion steps of the library, one per direction between adjacent versions.

Enums

LossPolicy
What a conversion does with data the target version has no structure for.
StoredAs
How the data of a loss report entry was kept in the output.
On this page

Search results