This section defines the LTM syntax using a formal extended BNF grammar. The token types are defined separately further below. The lexical token types defined below use Perl-style regular expressions for their definitions. This is to avoid problems caused by the fact that a colon is allowed in topic IDs. The colon is no longer allowed as a name start character, since otherwise a single colon could be both a name and a separator.
All tokens are case-sensitive.
Character encoding handling All LTM files are to be processed as if they were composed of Unicode characters. Files may be in any encoding, but if that encoding is not ISO 8859-1 it should be declared using the encoding production. If the encoding declaration appears in the file it must appear at the very beginning. Support for this construct is optional, but all processors must allow it to be present and at least ignore it. Processing and references Any topic referred to by its ID in an LTM file is considered to exist, even if it is never defined anywhere by an explicit occurrence of the topic production with that topic.