Stratego_XT Box Meta model - mn-mikke/Model-driven-Pretty-Printer-for-Xtext-Framework GitHub Wiki

The box meta-model is part of the Stratego/XT project of which the XT is a toolset for program transformation from one language to another and for other issues related to the meta-programming. Furthermore, the Stratego is a language providing rewriting rules for expressing basic transformations.

The source of the meta-model specifies the format of a textual usage as follows. The name of the operator stands at the first place and a usage of corresponding parameters follows after it. Finally, the boxes that are intended for formatting are placed at the end of this section and are enclosed in square brackets. This box meta-model is composed only from the following list of operators.

  • H - The operator aligns boxes horizontally and also inserts spacing defined by the hs parameter between boxes. The hs parameter expresses a count of given characters which will be inserted.

Operator H

  • V - The operator aligns boxes vertically and inserts spacing defined by the vs parameter between boxes. The vs parameter expresses a count of new lines which will be inserted. The operator has also the second parameter is that allows for setting indentation between the first box and the others. The is parameter expresses a count of inserted characters as well as the hs parameter of the H operator.

Operator V

  • A - The operator aligns boxes into a table and further two numeric parameters hs and vs, which are equivalent to parameters of the operators H and V, belong to it. Although, the A operator defines that a particular group of boxes will be encased into a table, it is necessary to define in which columns and rows boxes will be placed. Therefore the subsidiary operator R serves for this purpose.

Operator A

  • R - This subsidiary operator allows for defining rows of a table. Boxes that are inside of the same operator are on the same row of a table and also boxes that are at the same position inside of the operators R are in the same column of a table.