|
|||||
Shelf heralds | |||||
Prerequisite Concepts |
Heralds are keywords that precede a variable name and indicate its type.
Versions of OmniMark prior to V3 required all uses of a shelf or pattern name to be heralded to indicate the variable type. This allowed programmers to omit variable declarations for small simple programs.
OmniMark V3 requires variable declarations so that heralds may be omitted. This is more useful for larger programs where variable declarations are often present anyway.
OmniMark V3 can run V2 programs when the declare heralded-names
declaration is placed after the translation type using the -herald
command-line argument.
The following can be used as heralds:
counter
, switch
, and stream
declare opaque
pattern
for pattern variables
Type heralds are always required, even with V3:
sgml-error
rule pattern variables class
, message
, additional-info
, recovery-info
, file-name
, and line-number
global
and local
shelf declarations
Type heralds are always prohibited after any action keyword that behaves as a type herald, even with V2. (In other words, it is illegal to herald a variable name twice.) These keywords are:
In all other cases, type heralds are required when:
declare heralded-names
is specified
-herald
is specified on the command line
If none of the above cases apply, type heralds are optional.
Prerequisite Concepts Arrays Heralds |
---- |