ModelPrinter

class ModelPrinter

Pretty-printer for KerML/SysML models back to textual syntax.

Note that the printer primarily assumes that the model is representable in textual syntax, and does not check if some elements can be printed or not, or ignores some elements that are otherwise to represent in the textual syntax. However, elements that are required by the textual syntax, but are missing in the model, will raise RuntimeError.

Members defined in ModelPrinter (5 members)

force_formatting

RW

Whether to ignore syside-format ignore pragmas and format such elements regardless

format

RW

Format options used by this printer

mode

RW

Current language mode of this printer

kerml

Create a printer for KerML.

sysml

Create a printer for SysML.

Attributes

property force_formatting: bool

Whether to ignore syside-format ignore pragmas and format such elements regardless

property format: syside.FormatOptions

Format options used by this printer

property mode: syside.PrintMode

Current language mode of this printer

Methods

static kerml(format: syside.FormatOptions = ..., force_formatting: bool = False, reference_printer: syside.ReferencePrinter = ...) syside.ModelPrinter

Create a printer for KerML.

reference_printer is only used for synthetic references, otherwise the original reference segments will be printed.

static sysml(format: syside.FormatOptions = ..., force_formatting: bool = False, reference_printer: syside.ReferencePrinter = ...) syside.ModelPrinter

Create a printer for SysML.

reference_printer is only used for synthetic references, otherwise the original reference segments will be printed.

Used in