-
Notifications
You must be signed in to change notification settings - Fork 0
Names
The sip grammar uses a small set of lexical rules for names, shared with the other Model Integration parsers:
delim = r'[ _]' // Delimiter used inside of names
word = iword / lword
state_name = word (delim word)* r'\?'?
icaps_name = iword (delim word)*
iword = r'[A-Z][A-Za-z0-9]*' // Initial cap word
lword = r'[a-z][a-z]*' // Lower case only word
rnum = r'O?R[1-9][0-9]*' // Relationship number
The workhorse. It is used for the Scenario name, the Class name, attribute names in the Column header and the target class of a reference.
The first word must start with an uppercase letter. Later words may either start uppercase or be entirely
lowercase, which is what makes both conventions available: Average cabin speed for an attribute and
Accessible Shaft Level for a class. Digits are allowed after the first character of a word, so Three Bank1
and Shaft ID are fine.
Words are separated by a single space or a single underscore. Exactly one — Accessible Shaft with two spaces
is a parse error. This means names cannot be padded out to align them, so any column alignment in a sip file has
to happen inside the braces of a row where padding is allowed.
A bare word is either an iword or an lword and appears in two places: as an
alias, and as a component of a state name.
Note the asymmetry between the two word types. An iword allows digits and mixed case after its first
character, so LFP2 and Foo2 are words. An lword is lowercase letters only, so foo is a word but foo2
is not.
Used only for Initial states. It differs from an icaps_name in two ways: it may start with a lowercase
letter, and it may end with a ?. Both accommodate real state model naming — NO TRANSFER and Door closed?.
A relationship number: the letter R followed by a number with no leading zero, optionally prefixed with O
to mark an ordinal relationship.
That is the letter O, not a zero.
An rnum appears in a reference column as R1>Bank, and on a row as the qualifier of an assigner state,
R53> NO TRANSFER. Note that the two use different spacing: no space around the > in a reference column, a
required single space after the > in an initial state.
There is no case folding anywhere in the grammar or the parser. A name is reported exactly as written, so
Lock requested and Lock Requested are two different attribute names as far as anything downstream is
concerned.
Copyright 2025-2026 © Leon Starr under MIT Open Source License