transformer#
Input: abstract syntax tree – Output: (transformed) abstract syntax tree.
The transform step is essential for the processing of the manuscript. For exmaple, references and citations are resolved during this time.
The transform step is also responsible for ‘fixing up’ some syntactic sugar afforded by
RSM markup to yield a sound manuscript. For exmaple, for mathematical proofs, it is
possible to have a sequence of :step:
tags inside a parent :step:
. However, in
the final manuscript, those sub-steps will be wrapped by a rsm.nodes.SubProof
node, without the user having to manually create a :p:
tag. This wrapper node is
created during the transform step.
After the transform step, static analysis tools such as the linter may run over the manuscript.
The convention is that the manuscript will not be modified for any reason after the transform step is done. This is currently not enforced, but merely a convention, though it must at all times be followed.
The transform step is carried out by Transformer
, which simply executes in
sequence a number of routines that are all independent from each other. Since the task
of each such routine is to modify the manuscript tree, the order in which they take
place is of utmost importance.
Classes
Apply transformations to the abstract syntax tree. |
Exceptions
|