Skip to content

Base elements

These are base diagram elements and are automatically added if omitted since they represent the whole diagram, start and end thereof respectively.

Diagram

The root element of a railroad diagram is the Diagram element. If the input does not start with a Diagram, then one is automatically inserted at the root and will include all the elements in the input as its sub-elements.

Syntax

Diagram:
    ...
{
    "element": "Diagram",
    "items": [
        ...
    ]
}
element: Diagram
items:
- ...

Start

Start is an element that represents the start of the diagram. If it is not explicitly added, it will be inserted as the first element. It can take an optional label as a property with all three parsers, and an optional type property in JSON and YAML.

Syntax

Without a label:

Start:

Without a label:

Start: my label

Without a label:

{
    "element": "Start"
}

With a label:

{
    "element": "Start",
    "label": "my label"
}

With the sql type:

{
    "element": "Start",
    "type": "sql"
}

Without a label:

element: Start

With a label

element: Start
label: my label

With the sql type:

element: Start
type: sql

Properties

  • label: a string
  • type: one of simple, complex or sql. Setting this property at the element level will override what is specified in the parameter file.

Output

Without a label

my label

With a label

With sql type

End

End is symmetric with Start and represents the end of the diagram. If it is not explicitly added, it will be inserted as the last element. It can take an optional type as a property in JSON and YAML.

Syntax

End:

Without a label:

{
    "element": "End"
}

With sql type:

{
    "element": "End",
    "type": "sql"
}

Without a label:

element: End

With sql type:

element: End
type: sql

Properties

  • type: one of simple, complex or sql. Setting this property at the element level will override what is specified in the parameter file.

Output

Without a label

With sql type