Grammar for OmniMark 10.0

Table of Contents

Index of Productions

Notices

1 Program

[1] program unit ::=
program [2]
| module declaration [102]

[2] program [1] ::= program type [99]?, program-level declaration [107]?, preamble declaration [113]*, group member [94]*, identified group [92]*


2 Main Process Rules

[3] main process rule [95] ::=
process end rule [4]
| process rule [5]
| process start rule [6]

[4] process end rule [3] ::= PROCESS-END, condition [317]?, local scope [146]

[5] process rule [3] ::= PROCESS, condition [317]?, local scope [146]

[6] process start rule [3] ::= PROCESS-START, condition [317]?, local scope [146]


3 Markup Processing Rules

[7] markup processing rule [95] ::=
data content rule [8]
| document end rule [9]
| document start rule [10]
| dtd end rule [11]
| dtd start rule [12]
| element rule [13]
| epilog start rule [14]
| external data entity rule [15]
| invalid data rule [16]
| marked section rule [17]
| processing instruction rule [20]
| prolog end rule [21]
| prolog in error rule [22]
| sgml comment processing rule [18]
| sgml declaration end rule [23]
| translation rule [24]
| xmlns-change rule [25]

[8] data content rule [7] ::= DATA-CONTENT, condition [317]?, local scope [146]

[9] document end rule [7] ::= DOCUMENT-END, condition [317]?, local scope [146]

[10] document start rule [7] ::= DOCUMENT-START, condition [317]?, local scope [146]

[11] dtd end rule [7] ::= DTD-END, condition [317]?, local scope [146]

[12] dtd start rule [7] ::= DTD-START, condition [317]?, local scope [146]

[13] element rule [7] ::= ELEMENT, (element rule name set [29] | #IMPLIED), condition [317]?, local scope [146]

[14] epilog start rule [7] ::= EPILOG-START, condition [317]?, local scope [146]

[15] external data entity rule [7] ::= (EXTERNAL-DATA-ENTITY | EXTERNAL-ENTITY), (markup name set [33] | #IMPLIED), condition [317]?, local scope [146]

[16] invalid data rule [7] ::= INVALID-DATA, condition [317]?, local scope [146]

[17] marked section rule [7] ::= MARKED-SECTION, marked section type [27], condition [317]?, local scope [146]

[18] sgml comment processing rule [7] ::= (MARKUP-COMMENT | SGML-COMMENT), condition [317]?, local scope [146]

[19] markup error rule [95] ::= (MARKUP-ERROR | SGML-ERROR), condition [317]?, LOG?, local scope [146]

[20] processing instruction rule [7] ::= PROCESSING-INSTRUCTION, processing instruction matcher [26], condition [317]?, local scope [146]

[21] prolog end rule [7] ::= PROLOG-END, condition [317]?, local scope [146]

[22] prolog in error rule [7] ::= PROLOG-IN-ERROR, condition [317]?, local scope [146]

[23] sgml declaration end rule [7] ::= SGML-DECLARATION-END, condition [317]?, local scope [146]

[24] translation rule [7] ::= TRANSLATE, pattern expression [334], condition [317]?, local scope [146]

[25] xmlns-change rule [7] ::= XMLNS-CHANGE, condition [317]?, local scope [146]

[26] processing instruction matcher [20] ::=
pattern expression [334]
| NAMED, pattern expression [334], (VALUED, pattern expression [334])?
| VALUED, pattern expression [334], (NAMED, pattern expression [334])?

[27] marked section type [17] ::=
INCLUDE-START
| INCLUDE-END
| RCDATA
| CDATA
| IGNORE

3.1 Markup Names

[28] element name set [40] [45] ::=
qualified element name [31]
| "(", qualified element name [31], ((OR | "|"), qualified element name [31])*, ")"

[29] element rule name set [13] ::=
restricted qualified element name [30]
| "(", restricted qualified element name [30], ((OR | "|"), restricted qualified element name [30])*, ")"

[30] restricted qualified element name [29] ::= (#BASE | #FULL)?, element name [32]

[31] qualified element name [28] [49] ::= (#BASE | #FULL | #XMLNS)?, element name [32]

[32] element name [30] [31] [42] ::=
markup name [34]
| "~", string primary [262]

A "~" heralds a dynamic element name, where the string primary [262] is evaluated at run-time to determine the name of the element. This form of element name [32] is allowed only in ancestry qualifier [38].

[33] markup name set [15] [66] ::=
markup name [34]
| "(", markup name [34], ((OR | "|"), markup name [34])*, ")"

[34] markup name [32] [33] [75] [76] [90] ::=
constant string literal [275]
| name [457]

[35] built-in read-only dtd shelf name [443] ::= #CURRENT-DTD

[36] built-in read-only markup source shelf name [353] [443] ::= #CONTENT

[37] built-in read-only markup-event shelf name [443] ::= #CURRENT-MARKUP-EVENT

3.2 Elements

[38] ancestry qualifier [32] [39] [40] [43] [45] [55] [70] [72] [192] [215] [241] [243] ::= OF, specific element selector [40]

[39] anonymous element selector [45] ::=
aliased element selector [42]
| constrained element selector [43]
| element selection class [41], ancestry qualifier [38]?

[40] specific element selector [38] [262] ::=
aliased element selector [42]
| constrained element selector [43]
| element selection class [41], element name set [28], ancestry qualifier [38]?

[41] element selection class [39] [40] ::=
ANCESTOR
| OPEN, ELEMENT
| PREPARENT

[42] aliased element selector [39] [40] ::= CURRENT, ELEMENT, element name [32]

[43] constrained element selector [39] [40] ::=
DOCTYPE
| ELEMENT, ancestry qualifier [38]?
| PARENT, ancestry qualifier [38]?

[44] element alias [215] ::= name [457]

3.2.1 Element Tests

[45] element test primary [322] ::=
anonymous element selector [39], (IS | ISNT), element name set [28]
| short reference map selector [55], (IS | ISNT), short reference map name set [50]
| CONTENT, ancestry qualifier [38]?, (IS | ISNT), content type set [46]
| LAST, PROPER?, CONTENT, ancestry qualifier [38]?, (IS | ISNT), element name or data set [48]
| LAST, PROPER?, SUBELEMENT, ancestry qualifier [38]?, (IS | ISNT), element name set [28]
| PREVIOUS, ancestry qualifier [38]?, (IS | ISNT), element name set [28]
| STATUS, (OF, LAST, SUBELEMENT)?, ancestry qualifier [38]?, (IS | ISNT), (PROPER | INCLUSION)

[46] content type set [45] ::=
content type [47]
| "(", content type [47], ((OR | "|"), content type [47])*, ")"

[47] content type [46] ::=
ANY
| CDATA
| CONREF
| DECLARED-EMPTY
| ELEMENT
| EMPTY
| EMPTY-TAG
| MIXED
| RCDATA

[48] element name or data set [45] ::=
element name or data [49]
| "(", element name or data [49], ((OR | "|"), element name or data [49])*, ")"

[49] element name or data [48] ::=
qualified element name [31]
| #DATA

[50] short reference map name set [45] ::=
short reference map name [51]
| "(", short reference map name [51], ((OR | "|"), short reference map name [51])*, ")"

[51] short reference map name [50] ::=
constant string literal [275]
| name [457]
| #EMPTY
| #NONE

3.3 Entity and Notation Tests

[52] entity test primary [322] ::=
qualified attribute part identifier [67], (IS | ISNT), entity category set [56]
| ENTITY, (IS | ISNT), entity category set [56]
| notation selector [54], (IS | ISNT), notation category set [58]
| notation selector [54], equivalence comparer [326], notation name set [66]

[53] entity selector [54] ::=
ENTITY
| qualified attribute part identifier [67]

[54] notation selector [52] ::= NOTATION, (OF, entity selector [53])?

[55] short reference map selector [45] ::= USEMAP, ancestry qualifier [38]?

[56] entity category set [52] ::=
entity category [57]
| "(", entity category [57], ((AND | "&"), entity category [57])*, ")"
| "(", entity category [57], ((OR | "|"), entity category [57])*, ")"

[57] entity category [56] ::=
anonymous entity type [64]
| default entity type [63]
| entity class [62]
| entity scope [65]
| entity type [61]
| external identifier type [60]

[58] notation category set [52] ::= notation category [59]

[59] notation category [58] ::= external identifier type [60]

[60] external identifier type [57] [59] ::=
PUBLIC
| SYSTEM
| IN-LIBRARY

[61] entity type [57] ::=
CDATA-ENTITY
| NDATA-ENTITY
| SDATA-ENTITY
| SUBDOC-ENTITY

[62] entity class [57] ::=
GENERAL
| PARAMETER

[63] default entity type [57] ::= DEFAULT-ENTITY

[64] anonymous entity type [57] [90] [91] ::=
#CAPACITY
| #CHARSET
| #DOCUMENT
| #DTD
| #SCHEMA
| #SYNTAX

[65] entity scope [57] ::=
INTERNAL
| EXTERNAL

[66] notation name set [52] ::= markup name set [33]

3.4 Attributes

[67] qualified attribute part identifier [52] [53] [70] [71] [72] [73] [262] ::=
complex qualified attribute identifier [71]
| simple qualified attribute identifier [70], item indexer [445]?

[68] qualified attribute identifier [82] [192] [215] [243] [264] ::=
complex qualified attribute identifier [71]
| simple qualified attribute identifier [70]

[69] qualified attribute set identifier [83] [215] [243] ::=
complex qualified attribute set identifier [73]
| simple qualified attribute set identifier [72]

[70] simple qualified attribute identifier [67] [68] [192] ::=
ATTRIBUTE, attribute name [76], ancestry qualifier [38]?
| DATA-ATTRIBUTE, attribute name [76], (OF, "(", qualified attribute part identifier [67], ")")?

[71] complex qualified attribute identifier [67] [68] ::=
simple qualified attribute set identifier [72], indexer [444]
| DATA-ATTRIBUTE, attribute name [76], OF, qualified attribute part identifier [67]

[72] simple qualified attribute set identifier [69] [71] [242] ::=
attribute subset specifier [74]?, ATTRIBUTES, ancestry qualifier [38]?
| attribute subset specifier [74]?, DATA-ATTRIBUTES, (OF, "(", qualified attribute part identifier [67], ")")?

[73] complex qualified attribute set identifier [69] ::= attribute subset specifier [74]?, DATA-ATTRIBUTES, OF, qualified attribute part identifier [67]

[74] attribute subset specifier [72] [73] ::=
NON-IMPLIED
| SPECIFIED

[75] attribute alias [215] ::= markup name [34]

[76] attribute name [70] [71] [192] [303] ::= markup name [34]

[77] attribute type set [82] ::=
attribute type [78]
| "(", attribute type [78], ((AND | "&"), attribute type [78])*, ")"
| "(", attribute type [78], ((OR | "|"), attribute type [78])*, ")"

[78] attribute type [77] ::=
attribute declaration type [80]
| attribute default type [81]
| attribute specification type [79]

[79] attribute specification type [78] ::=
DEFAULTED
| IMPLIED
| SPECIFIED

[80] attribute declaration type [78] ::=
CDATA
| ENTITY
| ENTITIES
| GROUP
| ID
| IDREF
| IDREFS
| NAME
| NAMES
| NOTATION
| NUMBER
| NUMBERS
| NMTOKEN
| NMTOKENS
| NUTOKEN
| NUTOKENS

[81] attribute default type [78] ::=
DECLARED-CONREF
| DECLARED-CURRENT
| DECLARED-DEFAULTED
| DECLARED-FIXED
| DECLARED-IMPLIED
| DECLARED-REQUIRED

3.4.1 Attribute Tests

[82] attribute test primary [322] ::= qualified attribute identifier [68], (IS | ISNT), attribute type set [77]

[83] attributes test primary [322] ::= qualified attribute set identifier [69], (HAS | HASNT), KEY, string primary [262]


4 Input Processing Rules

[84] input processing rule [95] ::=
find rule [86]
| find end rule [85]
| find start rule [87]
| external text entity rule [89]

[85] find end rule [84] ::= FIND-END, condition [317]?, local scope [146]

[86] find rule [84] ::= FIND, NULL?, pattern expression [334], condition [317]?, local scope [146]

[87] find start rule [84] ::= FIND-START, condition [317]?, local scope [146]

[88] extended entity name set [89] ::=
extended entity name [90]
| "(", extended entity name [90], ((OR | "|"), extended entity name [90])*, ")"

[89] external text entity rule [84] ::= EXTERNAL-TEXT-ENTITY, (extended entity name set [88] | implied entity type set [91]), condition [317]?, local scope [146]

[90] extended entity name [88] ::=
markup name [34]
| anonymous entity type [64]

[91] implied entity type set [89] ::=
#IMPLIED
| "(", (anonymous entity type [64], (OR | "|"))*, #IMPLIED, ((OR | "|"), anonymous entity type [64])*, ")"


5 Groups

[92] identified group [2] ::=
GROUP, group identification [93], group member [94]*
| GROUP, "(", group identification [93], ")", group member [94]*

[93] group identification [92] ::=
group name set [96]
| #IMPLIED

[94] group member [2] [92] ::=
common declaration [114]
| include [100]
| rule [95]

[95] rule [94] ::=
markup processing rule [7]
| input processing rule [84]
| line breaking rule [126]
| main process rule [3]
| markup error rule [19]

[96] group name set [93] [98] [169] ::= group name [97], ((AND | "&"), group name [97])*

[97] group name [96] ::=
constant string literal [275]
| name [457]

[98] current group set [193] ::=
group name set [96]
| #GROUP, ((AND | "&"), group name set [96])?
| #IMPLIED


6 Aided-translation Types

[99] program type [2] ::=
(CONTEXT-TRANSLATE | DOWN-TRANSLATE | UP-TRANSLATE), (WITH, (SGML | XML))?
| CROSS-TRANSLATE

The aided-translation types are deprecated in favour of the more general PROCESS programs. Each aided-translation type can be simulated using a PROCESS program and a STRING SOURCE function.


7 Source-Level Components

7.1 Including Source Files

[100] include [94] ::= INCLUDE, constant string literal [275]

[101] include guard declaration [114] ::= INCLUDE-GUARD, (constant string literal [275] | name [457])

7.2 Modules

[102] module declaration [1] ::=
MODULE, (SHARED, AS, (constant string literal [275] | name [457]))?
| MODULE, INTERFACE, SHARED, AS, (constant string literal [275] | name [457])
| MODULE, IMPLEMENTS, constant string literal [275]

[103] import declaration [114] ::=
IMPORT, constant string literal [275], EXPORT?, PREFIXED, BY, name [457], use clause [104]*, supply clause [105]*
| IMPORT, constant string literal [275], EXPORT?, UNPREFIXED, use clause [104]*, supply clause [105]*
| IMPORT, constant string literal [275], ONLY, use clause [104]+, supply clause [105]*

[104] use clause [103] ::=
EXPORT?, USE, name [457], (AS, name [457])?
| EXPORT?, USE, #CONVERSION-FUNCTIONS

[105] supply clause [103] ::= SUPPLY, name [457], (AS, name [457])?

7.3 Accessing Text Files

[106] library declaration [114] ::= LIBRARY, (constant string expression [270], constant string expression [270])+


8 Declarations

[107] program-level declaration [2] ::=
default io declaration [108]
| escape declaration [109]
| main buffering declaration [110]*
| main mode declaration [111]*
| main output referent declaration [112]

[108] default io declaration [107] ::= DECLARE, NO-DEFAULT-IO

default io declaration [108] cannot be appear in a module.

[109] escape declaration [107] [466] ::= ESCAPE, constant string primary [273]

[110] main buffering declaration [107] [112] ::= DECLARE, (#ERROR | #MAIN-INPUT | #MAIN-OUTPUT | #PROCESS-INPUT | #PROCESS-OUTPUT), HAS, (BUFFERED | UNBUFFERED)

main buffering declaration [110] cannot be appear in a module.

[111] main mode declaration [107] [112] ::= DECLARE, (#MAIN-INPUT | #MAIN-OUTPUT | #PROCESS-INPUT | #PROCESS-OUTPUT), HAS, (BINARY-MODE | TEXT-MODE)

main mode declaration [111] cannot be appear in a module.

[112] main output referent declaration [107] ::= DECLARE, #MAIN-OUTPUT, HAS, modifier literal for referents [424]

main output referent declaration [112] cannot be appear in a module.

main buffering declaration [110], main mode declaration [111] and main output referent declaration [112] consistency is verified at compile-time. main buffering declaration [110] and main mode declaration [111] can neither be duplicated, nor contradict previously-encountered declarations. Meanwhile, only one main output referent declaration [112] is allowed per program.

[113] preamble declaration [2] ::=
common declaration [114]
| global object definition [115]
| naming declaration [118]

[114] common declaration [94] [113] ::=
binary input declaration [116]
| binary output declaration [117]
| break-width declaration [125]
| delimiter declaration [300]
| import declaration [103]
| include guard declaration [101]
| library declaration [106]
| macro definition [449]
| symbol declaration [299]

[115] global object definition [113] ::=
catch definition [399]
| function definition [360]
| global shelf definition [426]
| require function definition [372]
| require shelf definition [427]
| user-defined type declaration [132]

[116] binary input declaration [114] ::= BINARY-INPUT, constant numeric expression [245]

binary input declaration [116] cannot be appear in a module.

If more than one binary input declaration [116] appears in a program, their respective constant numeric expression [245] values must be equal.

[117] binary output declaration [114] ::= BINARY-OUTPUT, constant numeric expression [245]

binary output declaration [117] cannot be appear in a module.

If more than one binary output declaration [117] appears in a program, their respective constant numeric expression [245] values must be equal.

8.1 Naming Declarations

[118] naming declaration [113] ::=
data letters declaration [119]
| entity namecase declaration [120]
| general namecase declaration [121]
| markup identification declaration [122]
| name letters declaration [123]
| newline declaration [124]

[119] data letters declaration [118] ::=
DECLARE, DATA-LETTERS, constant string expression [270], constant string expression [270]?
| LETTERS, constant string expression [270], constant string expression [270]?

data letters declaration [119] cannot be appear in a module.

[120] entity namecase declaration [118] ::= NAMECASE, ENTITY, (YES | NO)

entity namecase declaration [120] is deprecated.

[121] general namecase declaration [118] ::= NAMECASE, GENERAL, (YES | NO)

general namecase declaration [121] is deprecated.

[122] markup identification declaration [118] ::= DECLARE, MARKUP-IDENTIFICATION, (#FULL | #BASE)

[123] name letters declaration [118] ::= DECLARE, NAME-LETTERS, constant string expression [270], constant string expression [270]

[124] newline declaration [118] ::= NEWLINE, constant string expression [270]

newline declaration [124] is considered obsolete, and is disallowed in programs with modules.

8.2 Line-breaking Declarations

[125] break-width declaration [114] ::= BREAK-WIDTH, constant numeric expression [245], (number [244] | TO, constant numeric expression [245])?

break-width declaration [125] cannot be appear in a module.

[126] line breaking rule [95] ::=
insertion break rule [127]
| replacement break rule [128]

[127] insertion break rule [126] ::= INSERTION-BREAK, constant string expression [270], condition [317]?

[128] replacement break rule [126] ::= REPLACEMENT-BREAK, constant string primary [273], constant string expression [270], condition [317]?


9 Types

[129] type [361] [362] [363] [364] [365] [366] [369] [372] [377] [383] ::=
first-class type [130]
| qualified type [131]

[130] first-class type [129] [378] [379] [380] [381] [382] [427] [433] [436] ::=
user-defined type name [139]
| COUNTER
| DTD
| INTEGER
| INT32
| MARKUP-EVENT
| MARKUP-POINT-EVENT
| MARKUP-REGION-EVENT
| MARKUP-EXTERNAL-DATA-ENTITY-REFERENCE-EVENT
| MARKUP-INTERNAL-DATA-ENTITY-REFERENCE-EVENT
| MARKUP-EXTERNAL-TEXT-ENTITY-REFERENCE-EVENT
| MARKUP-INTERNAL-TEXT-ENTITY-REFERENCE-EVENT
| SGML-DTD
| STREAM
| STRING
| SWITCH
| XML-DTD

The type INT32 is a deprecated synonym for INTEGER. Its use is discouraged.

[131] qualified type [129] ::= (MARKUP | STRING), (SINK | SOURCE)

9.1 User-Defined Types

[132] user-defined type declaration [115] ::=
opaque type declaration [133]
| record type declaration [134]
| user-defined type require [137]

[133] opaque type declaration [132] ::= (DECLARE | EXPORT), ABSTRACT?, OPAQUE, user-defined type name [139], CREATED, BY, system-specific function name [469], (IN, FUNCTION-LIBRARY, system-specific library name [470])?

[134] record type declaration [132] ::= (DECLARE, ABSTRACT? | EXPORT, (AS, OPAQUE)? | EXPORT, ABSTRACT?), RECORD, user-defined type name [139], (record type inheritance clause [135]?, field declaration [136]* | ELSEWHERE)

A record type declaration [134] with an ELSEWHERE clause declares a so-called restricted type. A restricted type cannot be used in all contexts that a fully-declared type can be used.

[135] record type inheritance clause [134] ::= EXTENDS, user-defined type name [139]

user-defined type name [139] cannot be that of a restricted type.

[136] field declaration [134] ::= FIELD, shelf declaration [433]

[137] user-defined type require [132] ::= REQUIRE, OPAQUE, user-defined type name [139]

[138] record field reference [198] [215] [438] ::= user-defined type instance [143], ":", name [457]

Field dereferencing is only allowed if user-defined type instance [143] is an instance of a record type.

[139] user-defined type name [130] [133] [134] [135] [137] [142] [206] [397] ::= name [457]

[140] user-defined type expression [143] [206] [231] [393] ::=
boolean term [320], "->", user-defined type expression [140], "|", user-defined type expression [140]
| user-defined type subexpression [141]

[141] user-defined type subexpression [140] [144] ::=
argument primary [394], (user-defined infix function name [465], argument primary [394])+
| user-defined type primary [142]

[142] user-defined type primary [141] [394] ::=
user-defined type name [139], CAST, user-defined type primary [142]
| value function call [388]
| user-defined type instance [143]

[143] user-defined type instance [138] [142] ::=
shelf item reference [437]
| "(", user-defined type expression [140], ")"

[144] user-defined type test primary [322] ::= user-defined type subexpression [141], (reference comparer [145], user-defined type subexpression [141])+

[145] reference comparer [144] ::=
"=="
| "!=="


10 Actions

[146] local scope [4] [5] [6] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [85] [86] [87] [89] [199] [200] [202] [203] [206] [207] [208] [209] [214] [217] [218] [220] [221] [333] [387] ::= local declaration [429]*, action [149]*, catch alternative [148]*, always block [147]*

[147] always block [146] ::= ALWAYS, action [149]*

[148] catch alternative [146] ::= CATCH, (built-in catch invocation [406] | catch invocation [412]), action [149]*

[149] action [146] [147] [148] ::= using prefix [191]*, guarded action [150]

[150] guarded action [149] ::= basic action [151], condition [317]?

[151] basic action [150] ::=
activate action [152]
| assert action [153]
| clear action [154]
| close action [155]
| collect garbage action [156]
| copy action [157]
| copy and clear action [158]
| deactivate action [159]
| decrement action [160]
| discard action [161]
| do action [199]
| do conditional action [200]
| do markup parse action [201]
| do scan action [202]
| do select action [203]
| do select-type action [206]
| do skip action [207]
| exit action [162]
| fail action [163]
| flush action [164]
| void function call [389]
| halt action [165]
| increment action [166]
| log-message action [167]
| new action [168]
| next group action [169]
| not reached action [170]
| open action [171]
| output action [172]
| output to action [173]
| put action [174]
| remove action [175]
| remove key action [176]
| reopen action [177]
| repeat action [208]
| repeat for action [209]
| repeat over action [214]
| repeat scan action [216]
| reset action [178]
| return action [179]
| set action [180]
| set external function association action [395]
| set key action [181]
| sgml in action [182]
| sgml out action [183]
| submit action [184]
| submit-markup action [185]
| succeed action [186]
| suppress action [187]
| test system action [188]
| throw action [189]
| void action [190]

[152] activate action [151] ::= ACTIVATE, shelf item reference [437], ((AND | "&"), shelf item reference [437])*

[153] assert action [151] ::= ASSERT, boolean expression [318], (MESSAGE, expression [231])?

[154] clear action [151] ::= CLEAR, shelf reference [438], ((AND | "&"), shelf reference [438])*

[155] close action [151] ::= CLOSE, shelf item reference [437], ((AND | "&"), shelf item reference [437])*

[156] collect garbage action [151] ::= COLLECT-GARBAGE

[157] copy action [151] ::= COPY, shelf reference [438], TO, shelf reference [438]

[158] copy and clear action [151] ::= COPY-CLEAR, shelf reference [438], TO, shelf reference [438]

[159] deactivate action [151] ::= DEACTIVATE, shelf item reference [437], ((AND | "&"), shelf item reference [437])*

[160] decrement action [151] ::= DECREMENT, shelf item reference [437], (BY, numeric expression [232])?

[161] discard action [151] ::= DISCARD, shelf item reference [437], ((AND | "&"), shelf item reference [437])*

[162] exit action [151] ::= EXIT

[163] fail action [151] ::= FAIL

[164] flush action [151] ::= FLUSH, shelf item reference [437], ((AND | "&"), shelf item reference [437])*

[165] halt action [151] ::= (HALT | HALT-EVERYTHING), (WITH, numeric expression [232])?

[166] increment action [151] ::= INCREMENT, shelf item reference [437], (BY, numeric expression [232])?

[167] log-message action [151] ::= LOG-MESSAGE, string expression [257]

Previous versions of OmniMark allowed optional CLASS and SEVERITY parameters on LOG-MESSAGE. These are no longer supported.

[168] new action [151] ::=
NEW, new shelf item reference [439], ((AND | "&"), new shelf item reference [439])*
| NEW, "?", guarded new shelf item reference [440], ((AND | "&"), guarded new shelf item reference [440])*

[169] next group action [151] ::= NEXT, GROUP, IS, (group name set [96] | "(", group name set [96], ")")

[170] not reached action [151] ::= NOT-REACHED, (MESSAGE, string expression [257])?

[171] open action [151] ::= OPEN, shelf item reference [437], modifier expression [417]?, AS, string sink literal for open [357], modifier expression [417]?

A modifier expression [417] can only appear on the left-hand side or the right-hand side, but not both.

[172] output action [151] ::= OUTPUT, string source expression [359]

[173] output to action [151] ::= OUTPUT-TO, string sink expression [355]

[174] put action [151] ::= PUT, shelf item reference [437], ((AND | "&"), shelf item reference [437])*, string expression [257]

[175] remove action [151] ::= REMOVE, shelf item reference [437]

[176] remove key action [151] ::= REMOVE, KEY, OF, shelf item reference [437]

[177] reopen action [151] ::= REOPEN, shelf item reference [437], modifier expression [417]?, (AS, string sink literal for open [357], modifier expression [417]?)?

A modifier expression [417] can only appear on the left-hand side or the right-hand side, but not both.

If a right-hand side is not provided, any modifier expression [417] on the left-hand side is restricted to using the modifiers defined by modifier literal for reopen [422].

[178] reset action [151] ::= RESET, shelf item reference [437], (TO, numeric expression [232])?

[179] return action [151] ::= RETURN, expression [231]?

[180] set action [151] ::= SET, string sink primary [356], TO, expression [231]

The modifier expression [417] in string sink primary [356], if specified, is restricted to using the modifiers defined by modifier literal for set [421].

[181] set key action [151] ::= SET, KEY, OF, shelf item reference [437], TO, string expression [257]

[182] sgml in action [151] ::= SGML-IN, (string expression [257] | #NONE)

[183] sgml out action [151] ::= SGML-OUT, (string expression [257] | #NONE)

[184] submit action [151] ::= SUBMIT, string source expression [359]

[185] submit-markup action [151] ::= SUBMIT-MARKUP, markup source expression [353]

[186] succeed action [151] ::= SUCCEED

[187] suppress action [151] ::= SUPPRESS

[188] test system action [151] ::= TEST-SYSTEM, (WITH, string expression [257])?

[189] throw action [151] ::= (SIGNAL, (TO, shelf item reference [437])?)?, (THROW, throw invocation [415] | RETHROW)

[190] void action [151] ::= VOID, expression [231]


11 Using

[191] using prefix [149] ::=
using attribute association prefix [192]
| using group prefix [193]
| using input prefix [194]
| using nested-referents prefix [195]
| using output prefix [196]
| using referents association prefix [197]
| using shelf item association prefix [198]

[192] using attribute association prefix [191] ::= USING, qualified attribute identifier [68], (AS, attribute name [76])?

The alias, attribute name [76], is required if the qualified attribute identifier [68] is a simple qualified attribute identifier [70] that doesn't have an ancestry qualifier [38] (if using ATTRIBUTE) and doesn't have an OF part (if using DATA-ATTRIBUTE).

[193] using group prefix [191] ::=
USING, GROUP, current group set [98]
| USING, GROUP, "(", current group set [98], ")"

[194] using input prefix [191] ::= USING, INPUT, AS, string expression [257]

[195] using nested-referents prefix [191] ::= USING, NESTED-REFERENTS

[196] using output prefix [191] ::= USING, OUTPUT, AS, string sink expression [355]

[197] using referents association prefix [191] ::= USING, REFERENTS, indexer [444]

[198] using shelf item association prefix [191] ::= USING, shelf item reference [437], (AS, shelf alias [441])?

If shelf item reference [437] contains a shelf literal [436] or a record field reference [138], the shelf alias [441] is required.


12 Block Constructs

[199] do action [151] ::= DO, local scope [146], DONE

[200] do conditional action [151] ::= DO, condition [317], local scope [146], (ELSE, condition [317], local scope [146])*, (ELSE, local scope [146], DONE)?

[201] do markup parse action [151] ::=
do generic parse action [220]
| do sgml parse action [218]
| do xml parse action [221]

[202] do scan action [151] ::= DO, SCAN, string source expression [359], match alternative [217]+, (ELSE, local scope [146])?, DONE

[203] do select action [151] ::= DO, SELECT, numeric expression [232], (CASE, constant numeric range set [204], local scope [146])+, (ELSE, local scope [146])?, DONE

[204] constant numeric range set [203] ::=
constant numeric range [205], ((OR | "|"), constant numeric range [205])*
| "(", constant numeric range [205], ((OR | "|"), constant numeric range [205])*, ")"

[205] constant numeric range [204] ::= constant numeric expression [245], (TO, constant numeric expression [245])?

[206] do select-type action [151] ::= DO, SELECT-TYPE, user-defined type expression [140], AS, shelf alias [441], (CASE, user-defined type name [139], local scope [146])+, (ELSE, local scope [146])?, DONE

[207] do skip action [151] ::= DO, SKIP, (OVER, pattern expression [334] | PAST, numeric expression [232], (OVER, pattern expression [334])?), local scope [146], (ELSE, local scope [146])?, DONE

[208] repeat action [151] ::= REPEAT, local scope [146], AGAIN

[209] repeat for action [151] [213] ::= REPEAT, for part [210]?, from part [211]?, to part [212]?, by part [213]?, local scope [146], AGAIN

[210] for part [209] [213] ::= FOR, INTEGER, shelf alias [441]

[211] from part [209] [213] ::= FROM, numeric expression [232]

[212] to part [209] [213] ::= TO, numeric expression [232]

[213] by part [209] ::= BY, numeric expression [232]

Each optional component of the repeat for action [209] has a default value should it be absent. An absent for part [210] declares an anonymous (i.e., inaccessible) alias. An absent from part [211] defaults to one. An absent to part [212] defaults to boundless. An absent by part [213] defaults to one.

[214] repeat over action [151] [333] ::= REPEAT, OVER, repeat over component [215], ((AND | "&"), repeat over component [215])*, local scope [146], AGAIN

[215] repeat over component [214] ::=
qualified attribute identifier [68], (AS, attribute alias [75])?
| qualified attribute set identifier [69], (AS, attribute alias [75])?
| shelf reference [438], (AS, shelf alias [441])?
| REFERENTS
| REVERSED?, CURRENT, ELEMENTS, ancestry qualifier [38]?, element alias [44]

If shelf reference [438] is a shelf literal [436] or a record field reference [138], the shelf alias [441] is required.

[216] repeat scan action [151] ::= REPEAT, SCAN, string expression [257], match alternative [217]+, AGAIN

[217] match alternative [202] [216] ::= MATCH, UNANCHORED?, NULL?, pattern expression [334], condition [317]?, local scope [146]

The use of UNANCHORED is deprecated in favour of the more general "**" operator.

12.1 Markup Parse Actions

[218] do sgml parse action [201] ::= DO, SGML-PARSE, sgml parse type [219], SCAN, markup parse scanning source [230], local scope [146], DONE

[219] sgml parse type [218] ::=
(DOCUMENT | SUBDOCUMENT), id checking specifier [223]?, utf8 specifier [225]?, (CREATING, sgml dtd pseudo-shelf item [227])?
| INSTANCE, instance element specifier [224]?, sgml dtd specifier [226], id checking specifier [223]?, utf8 specifier [225]?

[220] do generic parse action [201] ::= DO, MARKUP-PARSE, markup source expression [353], local scope [146], DONE

[221] do xml parse action [201] ::= DO, XML-PARSE, xml parse type [222]?, SCAN, markup parse scanning source [230], local scope [146], DONE

If xml parse type [222] is not specified, the parse defaults to a well-formed XML parse.

[222] xml parse type [221] ::=
DOCUMENT, id checking specifier [223]?, utf8 specifier [225]?, (CREATING, xml dtd pseudo-shelf item [229])?
| INSTANCE, instance element specifier [224]?, xml dtd specifier [228], id checking specifier [223]?, utf8 specifier [225]?

[223] id checking specifier [219] [222] ::= WITH, ID-CHECKING, boolean expression [318]

[224] instance element specifier [219] [222] ::= WITH, DOCUMENT-ELEMENT, string expression [257]

[225] utf8 specifier [219] [222] ::= WITH, UTF-8, boolean expression [318]

[226] sgml dtd specifier [219] ::= WITH, (sgml dtd pseudo-shelf item [227] | CURRENT, (DTD | SGML-DTD))

[227] sgml dtd pseudo-shelf item [219] [226] ::= (DTDS | SGML-DTDS), key indexer [446]

[228] xml dtd specifier [222] ::= WITH, (xml dtd pseudo-shelf item [229] | CURRENT, XML-DTD)

[229] xml dtd pseudo-shelf item [222] [228] ::= XML-DTDS, key indexer [446]

12.1.1 Markup Parse Support

[230] markup parse scanning source [218] [221] ::=
INPUT, void function call [389]
| string source expression [359]

This particular use of the keyword INPUT is obsoleted by the introduction of string source functions. Note that with this use of the keyword INPUT, the void function call [389] must be to a void-valued function.


13 Expressions

[231] expression [153] [179] [180] [190] [377] [436] ::=
boolean expression [318]
| markup sink expression [351]
| markup source expression [353]
| numeric expression [232]
| stream expression [354]
| string expression [257]
| string sink expression [355]
| string source expression [359]
| user-defined type expression [140]

13.1 Numeric Expressions

[232] numeric expression [160] [165] [166] [178] [203] [207] [211] [212] [213] [231] [241] [343] [393] [445] ::=
boolean term [320], "->", numeric expression [232], "|", numeric expression [232]
| numeric subexpression [233]

[233] numeric subexpression [232] [252] [253] [254] [255] [259] [260] [423] [425] ::= numeric term [235], (numeric additive operator [234], numeric term [235])*

[234] numeric additive operator [233] [245] ::=
PLUS
| "+"
| MINUS
| "-"
| UNION
| DIFFERENCE

[235] numeric term [233] ::= numeric factor [237], (numeric multiplicative operator [236], numeric factor [237])*

[236] numeric multiplicative operator [235] [246] ::=
TIMES
| "*"
| DIVIDE
| "/"
| MODULO
| MASK
| SHIFT

[237] numeric factor [235] ::= numeric tertiary [238], ("**", numeric factor [237])?

[238] numeric tertiary [237] ::=
numeric secondary [240]
| string secondary [261], (numeric conversion operator [239], numeric secondary [240])?

[239] numeric conversion operator [238] [248] ::=
BASE
| BINARY

[240] numeric secondary [238] ::=
argument primary [394], (user-defined infix function name [465], argument primary [394])+
| numeric primary [241]

[241] numeric primary [240] [394] ::=
value function call [388]
| string primary [262]
| (NEGATE | "-"), numeric primary [241]
| COMPLEMENT, numeric primary [241]
| shelf item reference [437]
| BINARY, string primary [262]
| CHILDREN, ancestry qualifier [38]?
| ITEM, OF, item-of reference [242]
| LENGTH, OF, string primary [262]
| (NUMBER, OF | NUMBER-OF), number-of reference [243]
| OCCURRENCE, ancestry qualifier [38]?
| SYSTEM-CALL, string primary [262]
| number [244]
| "(", numeric expression [232], ")"

[242] item-of reference [241] ::=
shelf item reference [437]
| simple qualified attribute set identifier [72], key indexer [446]
| REFERENTS, key indexer [446]
| THIS, REFERENT

[243] number-of reference [241] ::=
qualified attribute identifier [68]
| qualified attribute set identifier [69]
| shelf reference [438]
| CURRENT, ELEMENTS, ancestry qualifier [38]?
| CURRENT, SUBDOCUMENTS
| REFERENTS

[244] number [125] [241] [249] [280] [281] [302] [303] [304] [307] [308] [312] [313] [315] [316] [425] [456] [468] ::= digit [459]+

13.1.1 Constant Numeric Expressions

[245] constant numeric expression [116] [117] [125] [205] [249] [272] [434] [435] ::= constant numeric term [246], (numeric additive operator [234], constant numeric term [246])*

[246] constant numeric term [245] ::= constant numeric factor [247], (numeric multiplicative operator [236], constant numeric factor [247])*

[247] constant numeric factor [246] ::= constant numeric secondary [248], ("**", constant numeric factor [247])?

[248] constant numeric secondary [247] ::=
constant numeric primary [249]
| constant string primary [273], numeric conversion operator [239], constant numeric primary [249]

[249] constant numeric primary [248] [271] ::=
constant string primary [273]
| (NEGATE | "-"), constant numeric primary [249]
| COMPLEMENT, constant numeric primary [249]
| BINARY, constant string primary [273]
| LENGTH, OF, constant string primary [273]
| number [244]
| "(", constant numeric expression [245], ")"

13.1.2 Numeric Tests

[250] numeric test primary [322] ::= VALUE?, full numeric test [251]

The keyword VALUE is unnecessary in this context, and its use is deprecated.

[251] full numeric test [250] ::=
ascending numeric comparison [252]
| descending numeric comparison [253]
| equality numeric comparison [254]
| inequality numeric comparison [255]

[252] ascending numeric comparison [251] ::= numeric subexpression [233], (equality comparer [327], numeric subexpression [233])*, strongly ascending comparer [331], numeric subexpression [233], (weakly ascending comparer [329], numeric subexpression [233])*

[253] descending numeric comparison [251] ::= numeric subexpression [233], (equality comparer [327], numeric subexpression [233])*, strongly descending comparer [332], numeric subexpression [233], (weakly descending comparer [330], numeric subexpression [233])*

[254] equality numeric comparison [251] ::= numeric subexpression [233], (equality comparer [327], numeric subexpression [233])+

[255] inequality numeric comparison [251] ::= numeric subexpression [233], inequality comparer [328], numeric subexpression [233]

13.1.3 Built-In Numeric Shelves

[256] built-in read-only numeric shelf name [443] ::=
#CLASS
| #ERROR-CODE
| #ITEM
| #LINE-NUMBER
| #MARKUP-ERROR-COUNT
| #MARKUP-ERROR-TOTAL
| #MARKUP-WARNING-COUNT
| #MARKUP-WARNING-TOTAL
| #SGML-ERROR-COUNT
| #SGML-ERROR-TOTAL
| #SGML-WARNING-COUNT
| #SGML-WARNING-TOTAL

13.2 String Expressions

[257] string expression [167] [170] [174] [181] [182] [183] [188] [194] [216] [224] [231] [262] [291] [359] [393] [424] [446] ::=
boolean term [320], "->", string expression [257], "|", string expression [257]
| string subexpression [258]

[258] string subexpression [257] [286] [287] [288] [289] [290] [291] ::= string term [259], ((JOIN | "||"), string term [259])*

[259] string term [258] ::=
string factor [260], ((REPEATED | "||*"), numeric subexpression [233])*
| string factor [260], TAKE, UNANCHORED?, pattern secondary [338]
| string factor [260], DROP, UNANCHORED?, pattern secondary [338]

The use of UNANCHORED is deprecated in favour of the more general "**" operator.

[260] string factor [259] ::= string secondary [261], ((FORMAT | "%"), (numeric subexpression [233] | string secondary [261]))*

[261] string secondary [238] [260] ::=
argument primary [394], (user-defined infix function name [465], argument primary [394])+
| string primary [262]

[262] string primary [32] [83] [241] [261] [263] [292] [340] [354] [358] [394] [448] ::=
stream input/output mode [265]?, value function call [388]
| constant string value [274]
| external function association enquiry [396]
| pattern name [339]
| qualified attribute part identifier [67]
| referent item reference [263]
| shelf item reference [437]
| stream input/output mode [265]?, FILE, string primary [262]
| DATE, string primary [262]
| KEY, OF, key-of reference [264]
| NAME, OF, shelf item reference [437]
| NAME, OF, specific element selector [40]
| XMLNS-NAME, (OF, specific element selector [40])?
| "~", string primary [262]
| string literal [266]
| "(", string expression [257], ")"

[263] referent item reference [262] [358] ::=
REFERENTS, indexer [444]
| THIS, REFERENT
| REFERENT, string primary [262]
| SILENT-REFERENT, string primary [262]

[264] key-of reference [262] ::=
qualified attribute identifier [68]
| shelf item reference [437]
| REFERENTS, item indexer [445]
| THIS, REFERENT

[265] stream input/output mode [262] ::=
(BUFFERED | UNBUFFERED), (TEXT-MODE | BINARY-MODE)?
| (TEXT-MODE | BINARY-MODE), (BUFFERED | UNBUFFERED)?

13.2.1 String Literals

[266] string literal [262] [340] [456] ::= string literal part [267], ("_", string literal part [267])*

[267] string literal part [266] ::=
double-quoted string literal part [268]
| single-quoted string literal part [269]

[268] double-quoted string literal part [267] ::= """, (described character [280] | described substring [281] | escaped text [279] | format item [301] | unescaped character [467] | "'")*, """

[269] single-quoted string literal part [267] ::= "'", (described character [280] | described substring [281] | escaped text [279] | format item [301] | unescaped character [467] | """)*, "'"

13.2.2 Constant String Expressions

[270] constant string expression [106] [119] [123] [124] [127] [128] [273] [299] [300] [469] [470] ::= constant string term [271], ((JOIN | "||"), constant string term [271])*

[271] constant string term [270] ::= constant string factor [272], ((REPEATED | "||*"), constant numeric primary [249])?

[272] constant string factor [271] ::= constant string primary [273], ((FORMAT | "%"), (constant numeric expression [245] | constant string primary [273]))*

[273] constant string primary [109] [128] [248] [249] [272] [274] ::=
constant string value [274]
| constant string literal [275]
| "(", constant string expression [270], ")"

[274] constant string value [262] [273] ::= COMPILED-DATE, constant string primary [273]

[275] constant string literal [34] [51] [97] [100] [101] [102] [103] [273] [348] [423] [457] ::= constant string literal part [276], ("_", constant string literal part [276])*

[276] constant string literal part [275] ::=
double-quoted constant string literal part [277]
| single-quoted constant string literal part [278]

[277] double-quoted constant string literal part [276] ::= """, (described character [280] | described substring [281] | escaped text [279] | unescaped character [467] | "'")*, """

[278] single-quoted constant string literal part [276] ::= "'", (described character [280] | described substring [281] | escaped text [279] | unescaped character [467] | """)*, "'"

[279] escaped text [268] [269] [277] [278] ::= escape [466], (escape [466] | """ | "'" | "#" | ")")

[280] described character [268] [269] [277] [278] ::=
escape [466], "_"
| escape [466], "n"
| escape [466], "t"
| escape [466], number [244], "#"

[281] described substring [268] [269] [277] [278] [468] ::= escape [466], number [244], "r", "{", describing number [468], (",", describing number [468])*, "}"

13.2.3 Stream Tests

[282] stream test primary [322] ::=
shelf item reference [437], (HAS | HASNT), NAME
| shelf item reference [437], (IS | ISNT), stream type set [283]

[283] stream type set [282] ::=
stream type [284]
| "(", stream type [284], ((AND | "&"), stream type [284])*, ")"
| "(", stream type [284], ((OR | "|"), stream type [284])*, ")"

[284] stream type [283] ::=
ATTACHED
| BUFFER
| CLOSED
| EXTERNAL
| FILE
| MARKUP-PARSER
| OPEN
| REFERENT
| SGML-PARSER

SGML-PARSER is deprecated in favour of the more general MARKUP-PARSER.

13.2.4 String Tests

[285] string test primary [322] ::=
ascending string comparison [286]
| descending string comparison [287]
| equality string comparison [288]
| inequality string comparison [289]
| string match test primary [290]
| string set test primary [291]

[286] ascending string comparison [285] ::= string subexpression [258], (equality comparer [327], string subexpression [258])*, strongly ascending comparer [331], string subexpression [258], (weakly ascending comparer [329], string subexpression [258])*

[287] descending string comparison [285] ::= string subexpression [258], (equality comparer [327], string subexpression [258])*, strongly descending comparer [332], string subexpression [258], (weakly descending comparer [330], string subexpression [258])*

[288] equality string comparison [285] ::= string subexpression [258], (equality comparer [327], string subexpression [258])+

[289] inequality string comparison [285] ::= string subexpression [258], inequality comparer [328], string subexpression [258]

[290] string match test primary [285] ::= string subexpression [258], MATCHES, UNANCHORED?, pattern secondary [338]

The use of UNANCHORED is deprecated in favour of the more general "**" operator.

[291] string set test primary [285] ::=
string subexpression [258], comparer [325], UL, string subexpression [258]
| string subexpression [258], comparer [325], UL?, "(", string expression [257], ((OR | "|"), string expression [257])*, ")"

13.2.5 Source Tests

[292] source test primary [322] ::=
FILE, string primary [262], EXISTS
| FILE, string primary [262], (IS | ISNT), file info enquiry set [293]
| #CURRENT-INPUT, (IS | ISNT), ATTACHED

[293] file info enquiry set [292] ::=
file info enquiry [294]
| "(", file info enquiry [294], ((AND | "&"), file info enquiry [294])*, ")"

[294] file info enquiry [293] ::=
DIRECTORY
| FILE
| READABLE
| WRITABLE

13.2.6 Built-In Stream Shelves

[295] built-in write-only stream shelf name [443] ::=
#CONSOLE
| #CURRENT-OUTPUT
| #ERROR
| #LOG
| #MAIN-OUTPUT
| #MARKUP-PARSER
| #OUTPUT
| #SGML
| #SUPPRESS
| #UNATTACHED
| SGML

The use of the SGML and #SGML keywords is deprecated in favour of #MARKUP-PARSER.

The use of the #OUTPUT keyword is deprecated in favour of #CURRENT-OUTPUT.

[296] built-in read-only stream shelf name [443] ::=
#ADDITIONAL-INFO
| #APPINFO
| #ARGS
| #COMMAND-LINE-NAMES
| #DOCTYPE
| #FILE-NAME
| #LANGUAGE-VERSION
| #MESSAGE
| #PLATFORM-INFO
| #RECOVERY-INFO
| #XMLNS-NAMES

[297] built-in read-write stream shelf name [443] ::=
#LIBPATH
| #LIBRARY
| #LIBVALUE

[298] built-in read-only string source shelf name [443] ::=
#CURRENT-INPUT
| #MAIN-INPUT
| #PROCESS-INPUT

13.2.7 Formatting Declarations

[299] symbol declaration [114] ::= SYMBOL, constant string expression [270]+

symbol declaration [299] cannot be appear in a module.

[300] delimiter declaration [114] ::= DELIMITER, constant string expression [270]

delimiter declaration [300] cannot be appear in a module.

13.2.8 Format Items

[301] format item [268] [269] ::=
alphabetic format item [302]
| attribute format item [303]
| binary format item [304]
| break format item [305]
| content format item [306]
| current name format item [307]
| decimal format item [308]
| end break suppress format item [309]
| macro format item [310]
| other format item [311]
| pattern format item [312]
| roman format item [313]
| start break suppress format item [314]
| stream format item [315]
| symbol format item [316]

[302] alphabetic format item [301] ::= escape [466], (number [244], "f" | "j" | "k" | "l" | "u" | "w")*, "a", "(", shelf item reference [437], ")"

[303] attribute format item [301] ::= escape [466], (number [244], "f" | "k" | "e" | "h" | "l" | "o" | "p" | "s" | "u" | "z")*, "v", "(", attribute name [76], ")"

[304] binary format item [301] ::= escape [466], (number [244], "f" | number [244])*, "b", "(", shelf item reference [437], ")"

[305] break format item [301] ::= escape [466], "/"

[306] content format item [301] ::= escape [466], ("h" | "l" | "s" | "u" | "z")*, "c"

[307] current name format item [301] ::= escape [466], ("e" | number [244], "f" | "k" | "l" | "o" | "p" | "u")*, "q"

[308] decimal format item [301] ::= escape [466], (number [244], "f" | ("k" | "z") | "l" | number [244], "r" | "s" | "u" | number [244])*, "d", "(", shelf item reference [437], ")"

[309] end break suppress format item [301] ::= escape [466], "]"

[310] macro format item [301] ::= escape [466], ("u" | "l")?, "@", (escape [466] | "(", name [457], ")")

[311] other format item [301] ::=
escape [466], "s", "_"
| escape [466], "s", "n"
| escape [466], "s", "t"
| escape [466], "e", "n"

[312] pattern format item [301] ::= escape [466], (number [244], "f" | "k" | "h" | "l" | "s" | "u")*, "x", "(", pattern name [339], ")"

pattern format item [312] is deprecated in favour of stream format item [315].

[313] roman format item [301] ::= escape [466], (number [244], "f" | "k" | "l" | "u")*, "i", "(", shelf item reference [437], ")"

[314] start break suppress format item [301] ::= escape [466], "["

[315] stream format item [301] [312] ::= escape [466], (number [244], "f" | "k" | "l" | "u" | "e")*, "g", "(", (shelf item reference [437] | pattern name [339]), ")"

[316] symbol format item [301] ::= escape [466], (number [244], "f" | "k")*, "y", "(", shelf item reference [437], ")"

13.3 Boolean Expressions

[317] condition [4] [5] [6] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [85] [86] [87] [89] [127] [128] [150] [200] [217] [340] ::= (WHEN | UNLESS), boolean expression [318]

[318] boolean expression [153] [223] [225] [231] [317] [324] [393] ::= boolean conditional [319], ((OR | "|"), boolean conditional [319])*

[319] boolean conditional [318] ::=
boolean term [320], "->", boolean conditional [319], "|", boolean conditional [319]
| boolean term [320]

[320] boolean term [140] [232] [257] [319] ::= boolean factor [321], ((AND | "&"), boolean factor [321])*

[321] boolean factor [320] ::= (NOT | "!")?, boolean tertiary [322]

[322] boolean tertiary [321] ::=
argument test primary [398]
| attribute test primary [82]
| attributes test primary [83]
| catch test primary [416]
| element test primary [45]
| entity test primary [52]
| numeric test primary [250]
| pattern test primary [350]
| shelf test primary [448]
| source test primary [292]
| stream test primary [282]
| string test primary [285]
| user-defined type test primary [144]
| boolean secondary [323], ((equality comparer [327], boolean secondary [323])+ | inequality comparer [328], boolean secondary [323])?

[323] boolean secondary [322] ::=
argument primary [394], (user-defined infix function name [465], argument primary [394])+
| boolean primary [324]

[324] boolean primary [323] [340] [394] ::=
shelf item reference [437]
| value function call [388]
| FALSE
| TRUE
| "~", boolean primary [324]
| ACTIVE, boolean primary [324]
| "(", boolean expression [318], ")"

Use of the ACTIVE keyword is unnecessary and is deprecated.

[325] comparer [291] ::=
equivalence comparer [326]
| strongly ascending comparer [331]
| strongly descending comparer [332]

[326] equivalence comparer [52] [325] ::=
equality comparer [327]
| inequality comparer [328]

[327] equality comparer [252] [253] [254] [286] [287] [288] [322] [326] [329] [330] ::=
IS, EQUAL
| "="

[328] inequality comparer [255] [289] [322] [326] ::=
ISNT, EQUAL
| "!", "="

[329] weakly ascending comparer [252] [286] ::=
equality comparer [327]
| strongly ascending comparer [331]

[330] weakly descending comparer [253] [287] ::=
equality comparer [327]
| strongly descending comparer [332]

[331] strongly ascending comparer [252] [286] [325] [329] ::=
IS, LESS-EQUAL
| ISNT, GREATER-THAN
| "<="
| IS, LESS-THAN
| ISNT, GREATER-EQUAL
| "<"

[332] strongly descending comparer [253] [287] [325] [330] ::=
IS, GREATER-EQUAL
| ISNT, LESS-THAN
| ">="
| IS, GREATER-THAN
| ISNT, LESS-EQUAL
| ">"

13.3.1 Built-In Switch Shelves

[333] built-in read-only switch shelf name [443] ::=
#FIRST
| #LAST
| #FTRACE-IS-EMITTED

#FIRST and #LAST are available only within the local scope [146] of a repeat over action [214].

13.4 Pattern Expressions

[334] pattern expression [24] [26] [86] [207] [217] [340] ::= pattern product [335], ((OR | "|"), pattern product [335])*

[335] pattern product [334] ::=
pattern factor [336], pattern product [335]?
| LOOKAHEAD, pattern product [335]
| LOOKAHEAD, NOT, pattern product [335]
| UL, pattern product [335]
| (character set [345] | character class name [344]), ("**" | "++"), ("=>", pattern name [339])?, pattern product [335]

[336] pattern factor [335] ::=
(pattern entity type [341] | pattern nonentity type [342])?, pattern tertiary [337]
| pattern entity type [341], NAMED, pattern tertiary [337], (VALUED, pattern tertiary [337])?
| pattern entity type [341], VALUED, pattern tertiary [337], (NAMED, pattern tertiary [337])?
| pattern nonentity type [342], VALUED, pattern tertiary [337]

[337] pattern tertiary [336] ::= pattern secondary [338], ("=>", pattern name [339])?

[338] pattern secondary [259] [290] [337] ::= pattern primary [340], occurrence indicator [343]?

[339] pattern name [262] [312] [315] [335] [337] [340] [350] ::= name [457]

[340] pattern primary [338] ::=
character class name [344]
| character set [345]
| string literal [266]
| positional pattern [349]
| ANOTHER?, pattern name [339]
| value function call [388]
| "~", string primary [262]
| "~", boolean primary [324]
| "(", condition [317], ")"
| "(", pattern expression [334], condition [317]?, ")"

[341] pattern entity type [336] ::=
CDATA
| SDATA
| ENTITY

[342] pattern nonentity type [336] ::=
PCDATA
| NON-CDATA
| NON-SDATA
| TEXT

[343] occurrence indicator [338] ::=
"?"
| "+"
| "*"
| "{", numeric expression [232], "}"
| "{", numeric expression [232], TO, numeric expression [232], "}"
| "{", numeric expression [232], "}", "+"

[344] character class name [335] [340] [348] ::=
ANY
| ANY-TEXT
| BLANK
| DIGIT
| LC
| LETTER
| SPACE
| UC
| WHITE-SPACE

[345] character set [335] [340] ::=
"[", character set term [347], (character set exception operator [346], character set term [347])?, "]"
| "[", character set exception operator [346], character set term [347], "]"

[346] character set exception operator [345] ::=
"\"
| EXCEPT

[347] character set term [345] ::= character set product [348], ((OR | "|"), character set product [348])*

[348] character set product [347] ::=
character class name [344]
| constant string literal [275], (TO, constant string literal [275])?

[349] positional pattern [340] ::=
CONTENT-END
| CONTENT-START
| LINE-END
| LINE-START
| VALUE-END
| VALUE-START
| WORD-END
| WORD-START

13.4.1 Pattern Tests

[350] pattern test primary [322] ::= pattern name [339], (IS | ISNT), SPECIFIED

13.5 Markup Sink Expressions

[351] markup sink expression [231] ::= string sink expression [355]

[352] markup sink primary ::= shelf item reference [437]

13.6 Markup Source Expressions

[353] markup source expression [185] [220] [231] ::=
string source expression [359]
| built-in read-only markup source shelf name [36]

13.7 Stream Expressions

[354] stream expression [231] ::=
shelf item reference [437]
| FILE, string primary [262]
| REFERENT, string primary [262]

13.8 String Sink Expressions

[355] string sink expression [173] [196] [231] [351] ::= string sink primary [356], ((AND | "&"), string sink primary [356])*

[356] string sink primary [180] [355] ::=
shelf item reference [437], modifier expression [417]?
| string sink literal [358], modifier expression [417]?

The modifier expression [417], if specified, is restricted to using the modifiers defined by modifier literal for content [423].

[357] string sink literal for open [171] [177] [358] ::=
string sink literal [358]
| BUFFER

[358] string sink literal [356] [357] ::=
FILE, string primary [262]
| REFERENT, string primary [262]
| THIS, REFERENT
| value function call [388]

The use of the FILE keyword is optional in some contexts; however its omission is deprecated in those contexts.

When THIS REFERENT appears in string sink literal for open [357], it is interpreted as a referent item reference [263], unless preceded by the FILE keyword.

The value function call [388] must be a STRING SINK-valued function.

13.9 String Source Expressions

[359] string source expression [172] [184] [202] [230] [231] [353] ::= string expression [257]


14 Functions

14.1 Function Definition

[360] function definition [115] ::=
external prefix function definition [361]
| external infix function definition [362]
| external conversion function definition [363]
| internal prefix function definition [364]
| internal infix function definition [365]
| internal conversion function definition [366]

[361] external prefix function definition [360] [382] ::= (DEFINE | EXPORT), EXTERNAL, OVERLOADED?, type [129]?, prefix function signature definition [368], external function binding [386]

[362] external infix function definition [360] [382] ::= (DEFINE | EXPORT), EXTERNAL, OVERLOADED?, type [129], infix function signature definition [369], external function binding [386]

[363] external conversion function definition [360] [382] ::= (DEFINE | EXPORT), EXTERNAL, type [129], conversion function signature definition [370], external function binding [386]

[364] internal prefix function definition [360] [382] ::= (DEFINE | EXPORT), function categorization kind [367]?, type [129]?, prefix function signature definition [368], internal function binding [387]

[365] internal infix function definition [360] [382] ::= (DEFINE | EXPORT), OVERLOADED?, type [129], infix function signature definition [369], internal function binding [387]

[366] internal conversion function definition [360] [382] ::= (DEFINE | EXPORT), type [129], conversion function signature definition [370], internal function binding [387]

[367] function categorization kind [364] ::=
DYNAMIC?, OVERLOADED
| OVERRIDING

[368] prefix function signature definition [361] [364] ::= FUNCTION, prefix function name [461], function argument list definition [373]?

[369] infix function signature definition [362] [365] ::= INFIX-FUNCTION, VALUE, type [129], name [457], infix function name [460], VALUE, type [129], name [457]

[370] conversion function signature definition [363] [366] ::= CONVERSION-FUNCTION, function argument definition [376]

[371] function name [372] [397] ::= name [457]

[372] require function definition [115] ::= REQUIRE, type [129]?, FUNCTION, function name [371], function argument list definition [373]?

[373] function argument list definition [368] [372] ::=
parenthesized function argument list definition [374]
| unparenthesized function argument list definition [375]

[374] parenthesized function argument list definition [373] ::=
"(", ")"
| "(", function argument definition [376], (argument separator [384], function argument definition [376])*, (argument separator [384], remainder shelf argument definition [381], (argument separator [384], ".", ".", ".")?, ")")?
| "(", remainder shelf argument definition [381], argument separator [384], ".", ".", ".", ")"

[375] unparenthesized function argument list definition [373] ::=
argument herald [385]?, function argument definition [376], (argument herald [385], function argument definition [376])*, (argument herald [385], remainder shelf argument definition [381], (argument herald [385], ".", ".", ".")?)?
| argument herald [385], remainder shelf argument definition [381], (argument herald [385], ".", ".", ".")?
| remainder shelf argument definition [381], argument herald [385], ".", ".", "."

[376] function argument definition [370] [374] [375] ::=
expression argument definition [377]
| modifiable shelf argument definition [378]
| read-only shelf argument definition [379]
| write-only shelf argument definition [380]
| converting argument definition [382]

[377] expression argument definition [376] [405] ::= VALUE, type [129], name [457], (OPTIONAL, (INITIAL, "{", expression [231], "}")?)?

[378] modifiable shelf argument definition [376] [405] ::= MODIFIABLE, first-class type [130], name [457], OPTIONAL?

[379] read-only shelf argument definition [376] [405] ::= READ-ONLY, first-class type [130], name [457], OPTIONAL?

[380] write-only shelf argument definition [376] [405] ::= WRITE-ONLY, first-class type [130], name [457], OPTIONAL?

[381] remainder shelf argument definition [374] [375] ::= REMAINDER, first-class type [130], name [457]

[382] converting argument definition [376] ::=
VALUE, "(", ANY, INTO, first-class type [130], ")"
| VALUE, "(", source type name [383], ((OR | "|"), source type name [383])*, INTO, first-class type [130], ")"

A converting argument definition [382] is only allowed as the first argument of an OVERLOADED external prefix function definition [361] or internal prefix function definition [364], as an argument of an OVERLOADED external infix function definition [362] or internal infix function definition [365], or as the argument of an external conversion function definition [363] or internal conversion function definition [366].

[383] source type name [382] ::=
type [129]
| NUMERIC-LITERAL

[384] argument separator [374] [390] [403] [413] ::=
argument herald [385]
| ","

[385] argument herald [375] [384] [391] [392] [404] [414] ::= name [457]

[386] external function binding [361] [362] [363] ::= AS, system-specific function name [469], (IN, FUNCTION-LIBRARY, system-specific library name [470])?

[387] internal function binding [364] [365] [366] ::=
AS, local scope [146]
| ELSEWHERE

14.2 Function Invocation

[388] value function call [142] [241] [262] [324] [340] [358] ::=
prefix function name [461], parenthesized call arguments [390]
| prefix function name [461], unparenthesized call arguments [391]

[389] void function call [151] [230] ::=
prefix function name [461], parenthesized call arguments [390]
| prefix function name [461], void unparenthesized call arguments [392]

[390] parenthesized call arguments [388] [389] [415] ::= "(", (argument expression [393], (argument separator [384], argument expression [393])*)?, ")"

[391] unparenthesized call arguments [388] [415] ::= (argument herald [385]?, argument primary [394], (argument herald [385], argument primary [394])*)?

[392] void unparenthesized call arguments [389] ::= (argument herald [385]?, argument expression [393], (argument herald [385], argument expression [393])*)?

[393] argument expression [390] [392] ::=
boolean expression [318]
| numeric expression [232]
| string expression [257]
| user-defined type expression [140]

[394] argument primary [141] [240] [261] [323] [391] ::=
numeric primary [241]
| string primary [262]
| boolean primary [324]
| user-defined type primary [142]

14.3 External Function Associations

[395] set external function association action [151] ::=
SET, external function identification [397], TO, system-specific function name [469]
| SET, FUNCTION-LIBRARY, OF, external function identification [397], TO, system-specific library name [470]

[396] external function association enquiry [262] ::= (FUNCTION-LIBRARY, OF)?, external function identification [397]

[397] external function identification [395] [396] ::=
(EXTERNAL-FUNCTION | EXTERNAL-OUTPUT-FUNCTION), function name [371]
| CREATOR, OF, user-defined type name [139]

The use of EXTERNAL-OUTPUT-FUNCTION is deprecated in favour of EXTERNAL-FUNCTION.

14.4 Function Argument Tests

[398] argument test primary [322] ::= shelf item reference [437], (IS | ISNT), SPECIFIED


15 Catch and Throw

15.1 Catch Definitions

[399] catch definition [115] ::= (DECLARE | EXPORT | REQUIRE), catch signature [400]

[400] catch signature [399] ::= CATCH, catch name [401], catch argument list definition [402]?

[401] catch name [400] [412] [415] [416] ::= name [457]

[402] catch argument list definition [400] ::=
parenthesized catch argument list definition [403]
| unparenthesized catch argument list definition [404]

[403] parenthesized catch argument list definition [402] ::=
"(", ")"
| "(", catch argument definition [405], (argument separator [384], catch argument definition [405])*, ")"

[404] unparenthesized catch argument list definition [402] ::= argument herald [385]?, catch argument definition [405], (argument herald [385], catch argument definition [405])*

[405] catch argument definition [403] [404] ::=
expression argument definition [377]
| modifiable shelf argument definition [378]
| read-only shelf argument definition [379]
| write-only shelf argument definition [380]

15.2 Throws

[406] built-in catch invocation [148] ::=
external-exception invocation [407]
| program-error invocation [408]
| markup-start invocation [409]
| markup-end invocation [410]
| markup-point invocation [411]

[407] external-exception invocation [406] ::= #EXTERNAL-EXCEPTION, (IDENTITY, name [457])?, (MESSAGE, name [457])?, (LOCATION, name [457])?

All three arguments to external-exception invocation [407] are strings.

[408] program-error invocation [406] ::= #PROGRAM-ERROR, (CODE, name [457])?, (MESSAGE, name [457])?, (LOCATION, name [457])?

The first argument to program-error invocation [408] is the numeric error code.

[409] markup-start invocation [406] ::= #MARKUP-START, name [457]

The argument to markup-start invocation [409] is the event record instance, of type MARKUP-EVENT.

[410] markup-end invocation [406] ::= #MARKUP-END, name [457]

The argument to markup-end invocation [410] is the event record instance, of type MARKUP-EVENT.

[411] markup-point invocation [406] ::= #MARKUP-POINT, name [457]

The argument to markup-point invocation [411] is the event record instance, of type MARKUP-EVENT.

[412] catch invocation [148] ::=
catch name [401], parenthesized invocation arguments [413]
| catch name [401], unparenthesized invocation arguments [414]

[413] parenthesized invocation arguments [412] ::= "(", (name [457], (argument separator [384], name [457])*)?, ")"

[414] unparenthesized invocation arguments [412] ::= (argument herald [385]?, name [457], (argument herald [385], name [457])*)?

[415] throw invocation [189] ::=
catch name [401], parenthesized call arguments [390]
| catch name [401], unparenthesized call arguments [391]

15.3 Catch Tests

[416] catch test primary [322] ::= (catch name [401] | #EXTERNAL-EXCEPTION | #PROGRAM-ERROR | #MARKUP-START | #MARKUP-END | #MARKUP-POINT), (IS | ISNT), (CATCHABLE | THROWN)


16 Stream Modifiers

[417] modifier expression [171] [177] [180] [356] ::=
WITH, modifier literal [419], (WITH, modifier literal [419])*
| WITH, modifier subexpression [418]

[418] modifier subexpression [417] ::= "(", modifier literal [419], ((AND | "&"), modifier literal [419])*, ")"

[419] modifier literal [417] [418] ::= modifier literal for open [420]

[420] modifier literal for open [419] ::=
modifier literal for set [421]
| BINARY-MODE
| BUFFERED
| TEXT-MODE
| UNBUFFERED

[421] modifier literal for set [180] [420] ::=
modifier literal for reopen [422]
| APPEND

[422] modifier literal for reopen [177] [421] ::=
modifier literal for content [423]
| modifier literal for referents [424]
| modifier literal for break-width [425]

[423] modifier literal for content [356] [422] ::=
constant string literal [275]
| BINARY, numeric subexpression [233]
| DOMAIN-FREE

The DOMAIN-FREE modifier is deprecated, and its use has no effect.

[424] modifier literal for referents [112] [422] ::=
REFERENTS-ALLOWED, (DEFAULTING, "{", string expression [257], (",", string expression [257])?, "}")?
| REFERENTS-DISPLAYED
| REFERENTS-NOT-ALLOWED

[425] modifier literal for break-width [422] ::= BREAK-WIDTH, numeric subexpression [233], (number [244] | TO, numeric subexpression [233])?


17 Shelves

17.1 Shelf Definitions

[426] global shelf definition [115] ::= EXPORT?, global shelf class [428], shelf declaration [433], ((AND | "&"), shelf declaration [433])*

[427] require shelf definition [115] ::= REQUIRE, global shelf class [428], first-class type [130], shelf name [442]

[428] global shelf class [426] [427] ::=
CONSTANT
| DOMAIN-BOUND?, GLOBAL

[429] local declaration [146] ::=
global shelf save declaration [430]
| groups save declaration [431]
| local shelf declaration [432]

[430] global shelf save declaration [429] ::= (SAVE | SAVE-CLEAR), shelf name [442], ((AND | "&"), shelf name [442])*

[431] groups save declaration [429] ::= SAVE, GROUPS

[432] local shelf declaration [429] ::= LOCAL, shelf declaration [433], ((AND | "&"), shelf declaration [433])*

[433] shelf declaration [136] [426] [432] [436] ::= first-class type [130], shelf name [442], (fixed-size shelf declaration [435] | variable-size shelf declaration [434])?, (INITIAL, shelf literal [436])?

[434] variable-size shelf declaration [433] ::= VARIABLE, (TO, constant numeric expression [245])?, (INITIAL-SIZE, constant numeric expression [245])?

[435] fixed-size shelf declaration [433] ::= SIZE, constant numeric expression [245]

[436] shelf literal [198] [215] [433] [438] ::= "{", (expression [231] | UNATTACHED), "}"

When a shelf literal [436] appears in a shelf declaration [433], the number of initializers in expression [231] must match the declared size of the shelf, if any.

When a shelf literal [436] appears in a weak context, it must be preceded by a first-class type [130] herald.

The special literal UNATTACHED can only be used in the initializer for a STREAM shelf.

17.2 Shelf References

[437] shelf item reference [143] [152] [155] [159] [160] [161] [164] [166] [171] [174] [175] [176] [177] [178] [181] [189] [198] [241] [242] [262] [264] [282] [302] [304] [308] [313] [315] [316] [324] [352] [354] [356] [398] ::=
shelf reference [438], indexer [444]?
| NEW, new shelf item reference [439]
| NEW, "?", guarded new shelf item reference [440]

[438] shelf reference [154] [157] [158] [215] [243] [437] [439] [440] [448] ::=
shelf name [442]
| shelf literal [436]
| record field reference [138]

[439] new shelf item reference [168] [437] ::= shelf reference [438], key indexer [446]?, ((AFTER | BEFORE), indexer [444])?

[440] guarded new shelf item reference [168] [437] ::= shelf reference [438], key indexer [446]

[441] shelf alias [198] [206] [210] [215] ::= name [457]

[442] shelf name [427] [430] [433] [438] ::=
name [457]
| built-in shelf name [443]

[443] built-in shelf name [442] ::=
built-in read-only dtd shelf name [35]
| built-in read-only numeric shelf name [256]
| built-in read-only markup source shelf name [36]
| built-in read-only markup-event shelf name [37]
| built-in read-only string source shelf name [298]
| built-in read-only stream shelf name [296]
| built-in read-write stream shelf name [297]
| built-in write-only stream shelf name [295]
| built-in read-only switch shelf name [333]

[444] indexer [71] [197] [263] [437] [439] ::=
item indexer [445]
| key indexer [446]
| lastmost indexer [447]

[445] item indexer [67] [264] [444] [448] ::= "[", numeric expression [232], "]"

[446] key indexer [227] [229] [242] [439] [440] [444] ::= "{", string expression [257], "}"

[447] lastmost indexer [444] ::= LASTMOST

17.3 Shelf Tests

[448] shelf test primary [322] ::=
shelf reference [438], item indexer [445]?, (IS | ISNT), KEYED
| shelf reference [438], (HAS | HASNT), KEY, string primary [262]
| REFERENTS, (HAS | HASNT), KEY, string primary [262]


18 Macros

[449] macro definition [114] ::= MACRO, macro name [450], parameter template [451]*, IS, replacement template item [456]*, MACRO-END

[450] macro name [449] ::= macro token [453]+

[451] parameter template [449] ::=
ARG, macro parameter [452], macro token [453]+
| TOKEN, macro parameter [452], macro token [453]*

[452] macro parameter [451] [453] [456] ::=
delimiter token [454]
| name [457]

[453] macro token [450] [451] ::= LITERAL?, macro parameter [452]

[454] delimiter token [452] [456] ::=
infix function name [460]
| delimiter character [455]

[455] delimiter character [454] ::= "(" | ")" | "{" | "}" | "[" | "]" | "`" | ":" | "."

[456] replacement template item [449] ::=
macro parameter [452]
| LITERAL?, string literal [266]
| LITERAL?, delimiter token [454]
| LITERAL?, name [457]
| LITERAL?, number [244]


19 Lexeme Productions

[457] name [34] [44] [51] [97] [101] [102] [103] [104] [105] [138] [139] [310] [339] [369] [371] [377] [378] [379] [380] [381] [385] [401] [407] [408] [409] [410] [411] [413] [414] [441] [442] [452] [456] [460] [461] ::= letter [458], (digit [459] | letter [458] | user-defined name character [???] | "." | "-" | "_")* | "#", constant string literal [275]

[458] letter [457] ::= "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z"

[459] digit [244] [457] ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"

[460] infix function name [369] [454] [465] ::= infix function start character [462], function following character [464]* | name [457]

[461] prefix function name [368] [388] [389] ::= prefix function start character [463], function following character [464]* | name [457]

[462] infix function start character [460] ::= function following character [464] | prefix function start character [463]

[463] prefix function start character [461] [462] ::= "!" | "-" | "+" | "%" | "?" | "/" | "~" | "$" | "\" | "@" | "^" | ","

[464] function following character [460] [461] [462] ::= "*" | "=" | "|" | "<" | ">" | "&"


20 Dynamically-Defined Lexical Tokens

[465] user-defined infix function name [141] [240] [261] [323] ::= Any infix function name [460] defined in a program rather than by OmniMark, and which are not overloadings of operators defined by OmniMark to be overloadable.

[466] escape [279] [280] [281] [302] [303] [304] [305] [306] [307] [308] [309] [310] [311] [312] [313] [314] [315] [316] [467] ::= The escape [466] character is defined by an escape declaration [109]. If there is no escape declaration [109], the escape character is "%".

[467] unescaped character [268] [269] [277] [278] ::= An unescaped character [467] is any character that is not a "'", a """, a control character, or escape [466].

[468] describing number [281] ::= A describing number [468] is a number in the base indicated by the number [244] non-terminal in the described substring [281] production. The base can range from two to 36; the digits in each describing number [468] must be of the appropriate base, using letters (upper- or lower-case) for digit values over nine.

[469] system-specific function name [133] [386] [395] ::= A system-specific function name [469] is implemented as a constant string expression [270].

[470] system-specific library name [133] [386] [395] ::= A system-specific library name [470] is implemented as a constant string expression [270].

[471] user-defined data character ::= A user-defined data character [471] is any character that appears in a DATA-LETTERS declaration that is not explicitly excluded from being a name character.

Copyright © Stilo Corporation, 2003-2012. All rights reserved.
ETR62, 2012/4/10