Skip to content

Aliases

Leon Starr edited this page Jul 30, 2026 · 1 revision

An alias is a short local handle for one instance so that other instances in the same file can point at it without repeating its identifying values.

Two grammar terms are involved, one to declare an alias and one to use it:

row = (word SP+)? '{' ... '}' ...
at_val = '@' word

The alias is declared by writing a word before the opening brace of a row, and used by writing @ and that word in a value position of some other row.

An example

Bank declares three aliases, L, P and F:

Bank
Name | Passenger load time | Block clear time | Max close attempts | Average cabin speed | Average stop duration
--
L { [Lower Floors] [4.0] [2.0] [25] [7.0] [9.0] }
P { [Penthouse]    [4.0] [2.0] [25] [7.0] [9.0] }
F { [Freight]      [7.0] [5.0] [25] [5.0] [14.0] }
--

Shaft then uses them in its R1>Bank column:

Shaft
ID | In service | R1>Bank
--
{ [S1] [true] @L }
{ [S4] [true] @P }
{ [S6] [true] @F }
--

Writing @L instead of [Lower Floors] is a modest saving here, but the same mechanism does real work when the referenced class has a multi-attribute identifier. Bank Level is identified by a bank and a floor together, and its alias PPH lets Top Bank Level reference the pair with a single value. See References.

What can be an alias

An alias must be a single word:

word = iword / lword
iword = r'[A-Z][A-Za-z0-9]*'
lword = r'[a-z][a-z]*'

So either an initial cap followed by any mix of letters and digits, or all lowercase letters with no digits. L, PPH, LFP2 and Foo2 are all valid. foo is valid, but foo2 is not, because lword stops at letters. An alias cannot contain a space or an underscore, which is what distinguishes it from a name.

Note that aliases share this rule with nothing else in the grammar — class, attribute and scenario names are multi-word icaps_names instead.

Only where needed

Most rows have no alias. It is worth declaring one only on instances that something else in the file refers to, which is why the Floor and Cabin populations carry none while Bank and Bank Level alias every row.

Aliases are local to the sip file. They are a convenience for writing the population down and are not part of the model, so there is no expectation that they match anything in the xcm file.

Unresolved aliases

The parser does not resolve aliases and does not check that a referenced alias was ever declared. A row containing @nosuch parses cleanly and the name is handed through untouched, so tying references back to the rows that declared them is the consumer's job. In the result an alias appears as the row's alias field, which is None on rows that do not declare one, and a reference appears as {'ref to': 'L'}. See Parser output.

Clone this wiki locally