swirl Guide to OmniMark 5   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
     
Names

An OmniMark program consists of tokens. A token is a sequence of characters that represents a discrete item in the structure of the program.

There are four kinds of tokens in an OmniMark program:

OmniMark names must start with a letter of the Roman alphabet or a Unicode character over 127, followed by letters of the Roman alphabet, Unicode characters over 127, digits, hyphens ("-"), underscores ("_"), or periods ("."). Names are case insensitive. By default, only the characters of the Roman alphabet have defined upper and lowercase equivalents. You can define upper and lowercase equivalents for other characters with declare name-letters.

Markup names follow the naming restriction of the appropriate markup language (XML or the Reference Concrete Syntax of SGML).

All OmniMark names must be declared before they are used. Different types of names are declared in different ways:

All OmniMark names share a common name space. You cannot have a function and a catch with the same name. Function, catch, macro and group names are always global in scope. Variable names may be global or local. The same variable name can be declared in different lexical scopes. Declaring a name in a local scope hides the same name in a wider scope. Note that this applies to all names, so a local variable with the same name as a function will hide the function name in the local scope.

OmniMark names and keywords are in the same name space, so if you use an OmniMark name that is the same as a keyword, the token will be recognized as the name, not the keyword. The keyword will then be unavailable in your program. The main advantage of this behavior is that if new keywords are introduced in a later version of OmniMark, and they happen to match names you have used in your program, your program will still run properly. Generally speaking, you should not use a name that matches a keyword.

You cannot declare a keyword as a global name if you have already used that keyword as a keyword.

The hyphen character is a legitimate part of a name, so when you use it as a minus sign (-), use a space between a preceding name and the minus sign or the minus sign will be treated as part of the name.

The maximum length of an OmniMark name is 2,048 characters.

Dealing with markup names

Markup names in OmniMark programs must be valid OmniMark names. The markup names found in XML or SGML documents may not always be valid OmniMark names. For instance, if your XML document includes name spaces, your XML names will include the colon character, which is not allowed in an OmniMark name. To accommodate markup names that are not valid OmniMark names, OmniMark allows you to quote non-compliant markup names. In quoted names, restrictions on name characters do not apply, so you can use quoted names to enter XML markup names that include the colon character, or any other non-compliant SGML or XML name:

  element foo
      output "%c"

  element "bar:baz"
      output "%c"

Character set encodings

You are allowed to use Unicode characters in OmniMark names. Beware, however, that there are different encodings of Unicode characters. Only UTF-8, the most common encoding, is supported by the OmniMark compiler.

For EBCDIC systems, stick to Roman letters and "-", "_", and "." for names.

       
----

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ OMX ] [ OMX ] [ ERRORS ]

Generated: August 11, 2000 at 3:06:24 pm
If you have any comments about this section of the documentation, send email to docerrors@omnimark.com

Copyright © OmniMark Technologies Corporation, 1988-2000.