Tokenised alphabet and grammar

If you type cmd-h with the 'option' key down you have the option to display the alphabet in its "tokenised" form. A tokenised alphabet/grammar/glossary is useful to show whatever the compiler has been able to understand. It is displayed in a multi-purpose window called the "Trace" window.


Fig.11 Tokenised alphabet in the "Trace" window

The tokenised alphabet actually displays the entire mapping of homomorphism notated ' *' that was partly defined in the original alphabet (see §2.4). Predefined symbols '-' and '_' represent silences and prolongations respectively. These are not modified by any homomorphism. Other symbols are specific to this "-ho.abc1" alphabet. Homomorphism ' *' changes 'a' to 'a'', but 'a'' remains unchanged. Symbol 'chik' is also not affected by the transformation. (See §2.4 or reference manual §4.1 to understand homomorphisms.)

Looking carefully at the alphabet you may notice that a new terminal symbol 'sync' has been appended: it was not in the original file "-ho.abc1". The symbol was actually found between single quotes in the grammar, and therefore appended at compile time. Similarly, out-time sound-objects between angle brackets <<>> may contain terminal symbols that BP2 creates at compile time.

The tokenised grammar is shown Fig.12.


Fig.12 Tokenised grammar in "Trace" window

All rules have been numbered and contain weights. (See an explanation of weights in reference manual §4.6) Rules that were not assigned explicit weights appear with default weight <127>, a value that fits well with MIDI parameters.

Also note that commentaries [between square brackets] or lines starting with double slashes have been left out.

Rule numbering has no real effect on computation. For instance, the order in which rules are scanned in "ORD" grammars (see reference manual §4.4) is always their actual order of occurrence in the grammar. Nevertheless, BP2 renumbers subgrammars and rules at compile time. These numbers are used for conditional jumps found in grammar procedures (see §8.1 of reference manual).