[1] program unit ::=
program [2]
| module declaration [101]
[2] program [1] ::= program type [98]?, program-level declaration [106]?, preamble declaration [112]*, group member [93]*, identified group [91]*
[3] main process rule [94] ::=
process end rule [4]
| process rule [5]
| process start rule [6]
[4] process end rule [3] ::= PROCESS-END, condition [314]?, local scope [143]
[5] process rule [3] ::= PROCESS, condition [314]?, local scope [143]
[6] process start rule [3] ::= PROCESS-START, condition [314]?, local scope [143]
[7] markup processing rule [94] ::=
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 [314]?, local scope [143]
[9] document end rule [7] ::= DOCUMENT-END, condition [314]?, local scope [143]
[10] document start rule [7] ::= DOCUMENT-START, condition [314]?, local scope [143]
[11] dtd end rule [7] ::= DTD-END, condition [314]?, local scope [143]
[12] dtd start rule [7] ::= DTD-START, condition [314]?, local scope [143]
[13] element rule [7] ::= ELEMENT, (element rule name set [29] | #IMPLIED), condition [314]?, local scope [143]
[14] epilog start rule [7] ::= EPILOG-START, condition [314]?, local scope [143]
[15] external data entity rule [7] ::= (EXTERNAL-DATA-ENTITY | EXTERNAL-ENTITY), (markup name set [33] | #IMPLIED), condition [314]?, local scope [143]
[16] invalid data rule [7] ::= INVALID-DATA, condition [314]?, local scope [143]
[17] marked section rule [7] ::= MARKED-SECTION, marked section type [27], condition [314]?, local scope [143]
[18] sgml comment processing rule [7] ::= (MARKUP-COMMENT | SGML-COMMENT), condition [314]?, local scope [143]
[19] markup error rule [94] ::= (MARKUP-ERROR | SGML-ERROR), condition [314]?, LOG?, local scope [143]
[20] processing instruction rule [7] ::= PROCESSING-INSTRUCTION, processing instruction matcher [26], condition [314]?, local scope [143]
[21] prolog end rule [7] ::= PROLOG-END, condition [314]?, local scope [143]
[22] prolog in error rule [7] ::= PROLOG-IN-ERROR, condition [314]?, local scope [143]
[23] sgml declaration end rule [7] ::= SGML-DECLARATION-END, condition [314]?, local scope [143]
[24] translation rule [7] ::= TRANSLATE, pattern expression [331], condition [314]?, local scope [143]
[25] xmlns-change rule [7] ::= XMLNS-CHANGE, condition [314]?, local scope [143]
[26] processing instruction matcher [20] ::=
pattern expression [331]
| NAMED, pattern expression [331], (VALUED, pattern expression [331])?
| VALUED, pattern expression [331], (NAMED, pattern expression [331])?
[27] marked section type [17] ::=
INCLUDE-START
| INCLUDE-END
| RCDATA
| CDATA
| IGNORE
[28] element name set [39] [44] ::=
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] [48] ::= (#BASE | #FULL | #XMLNS)?, element name [32]
[32] element name [30] [31] [41] ::=
markup name [34]
| "~", string primary [259]
A "~" heralds a dynamic element name, where the string primary [259] is evaluated at run-time to determine the name of the element. This form of element name [32] is allowed only in ancestry qualifier [37].
[33] markup name set [15] [65] ::=
markup name [34]
| "(", markup name [34], ((OR | "|"), markup name [34])*, ")"
[34] markup name [32] [33] [74] [75] [89] ::=
constant string literal [272]
| name [454]
[35] built-in read-only markup source shelf name [350] [440] ::= #CONTENT
[36] built-in read-only markup-event shelf name [440] ::= #CURRENT-MARKUP-EVENT
[37] ancestry qualifier [32] [38] [39] [42] [44] [54] [69] [71] [189] [212] [238] [240] ::= OF, specific element selector [39]
[38] anonymous element selector [44] ::=
aliased element selector [41]
| constrained element selector [42]
| element selection class [40], ancestry qualifier [37]?
[39] specific element selector [37] [259] ::=
aliased element selector [41]
| constrained element selector [42]
| element selection class [40], element name set [28], ancestry qualifier [37]?
[40] element selection class [38] [39] ::=
ANCESTOR
| OPEN, ELEMENT
| PREPARENT
[41] aliased element selector [38] [39] ::= CURRENT, ELEMENT, element name [32]
[42] constrained element selector [38] [39] ::=
DOCTYPE
| ELEMENT, ancestry qualifier [37]?
| PARENT, ancestry qualifier [37]?
[43] element alias [212] ::= name [454]
[44] element test primary [319] ::=
anonymous element selector [38], (IS | ISNT), element name set [28]
| short reference map selector [54], (IS | ISNT), short reference map name set [49]
| CONTENT, ancestry qualifier [37]?, (IS | ISNT), content type set [45]
| LAST, PROPER?, CONTENT, ancestry qualifier [37]?, (IS | ISNT), element name or data set [47]
| LAST, PROPER?, SUBELEMENT, ancestry qualifier [37]?, (IS | ISNT), element name set [28]
| PREVIOUS, ancestry qualifier [37]?, (IS | ISNT), element name set [28]
| STATUS, (OF, LAST, SUBELEMENT)?, ancestry qualifier [37]?, (IS | ISNT), (PROPER | INCLUSION)
[45] content type set [44] ::=
content type [46]
| "(", content type [46], ((OR | "|"), content type [46])*, ")"
[46] content type [45] ::=
ANY
| CDATA
| CONREF
| DECLARED-EMPTY
| ELEMENT
| EMPTY
| EMPTY-TAG
| MIXED
| RCDATA
[47] element name or data set [44] ::=
element name or data [48]
| "(", element name or data [48], ((OR | "|"), element name or data [48])*, ")"
[48] element name or data [47] ::=
qualified element name [31]
| #DATA
[49] short reference map name set [44] ::=
short reference map name [50]
| "(", short reference map name [50], ((OR | "|"), short reference map name [50])*, ")"
[50] short reference map name [49] ::=
constant string literal [272]
| name [454]
| #EMPTY
| #NONE
[51] entity test primary [319] ::=
qualified attribute part identifier [66], (IS | ISNT), entity category set [55]
| ENTITY, (IS | ISNT), entity category set [55]
| notation selector [53], (IS | ISNT), notation category set [57]
| notation selector [53], equivalence comparer [323], notation name set [65]
[52] entity selector [53] ::=
ENTITY
| qualified attribute part identifier [66]
[53] notation selector [51] ::= NOTATION, (OF, entity selector [52])?
[54] short reference map selector [44] ::= USEMAP, ancestry qualifier [37]?
[55] entity category set [51] ::=
entity category [56]
| "(", entity category [56], ((AND | "&"), entity category [56])*, ")"
| "(", entity category [56], ((OR | "|"), entity category [56])*, ")"
[56] entity category [55] ::=
anonymous entity type [63]
| default entity type [62]
| entity class [61]
| entity scope [64]
| entity type [60]
| external identifier type [59]
[57] notation category set [51] ::= notation category [58]
[58] notation category [57] ::= external identifier type [59]
[59] external identifier type [56] [58] ::=
PUBLIC
| SYSTEM
| IN-LIBRARY
[60] entity type [56] ::=
CDATA-ENTITY
| NDATA-ENTITY
| SDATA-ENTITY
| SUBDOC-ENTITY
[61] entity class [56] ::=
GENERAL
| PARAMETER
[62] default entity type [56] ::= DEFAULT-ENTITY
[63] anonymous entity type [56] [89] [90] ::=
#CAPACITY
| #CHARSET
| #DOCUMENT
| #DTD
| #SCHEMA
| #SYNTAX
[64] entity scope [56] ::=
INTERNAL
| EXTERNAL
[65] notation name set [51] ::= markup name set [33]
[66] qualified attribute part identifier [51] [52] [69] [70] [71] [72] [259] ::=
complex qualified attribute identifier [70]
| simple qualified attribute identifier [69], item indexer [442]?
[67] qualified attribute identifier [81] [189] [212] [240] [261] ::=
complex qualified attribute identifier [70]
| simple qualified attribute identifier [69]
[68] qualified attribute set identifier [82] [212] [240] ::=
complex qualified attribute set identifier [72]
| simple qualified attribute set identifier [71]
[69] simple qualified attribute identifier [66] [67] [189] ::=
ATTRIBUTE, attribute name [75], ancestry qualifier [37]?
| DATA-ATTRIBUTE, attribute name [75], (OF, "(", qualified attribute part identifier [66], ")")?
[70] complex qualified attribute identifier [66] [67] ::=
simple qualified attribute set identifier [71], indexer [441]
| DATA-ATTRIBUTE, attribute name [75], OF, qualified attribute part identifier [66]
[71] simple qualified attribute set identifier [68] [70] [239] ::=
attribute subset specifier [73]?, ATTRIBUTES, ancestry qualifier [37]?
| attribute subset specifier [73]?, DATA-ATTRIBUTES, (OF, "(", qualified attribute part identifier [66], ")")?
[72] complex qualified attribute set identifier [68] ::= attribute subset specifier [73]?, DATA-ATTRIBUTES, OF, qualified attribute part identifier [66]
[73] attribute subset specifier [71] [72] ::=
NON-IMPLIED
| SPECIFIED
[74] attribute alias [212] ::= markup name [34]
[75] attribute name [69] [70] [189] [300] ::= markup name [34]
[76] attribute type set [81] ::=
attribute type [77]
| "(", attribute type [77], ((AND | "&"), attribute type [77])*, ")"
| "(", attribute type [77], ((OR | "|"), attribute type [77])*, ")"
[77] attribute type [76] ::=
attribute declaration type [79]
| attribute default type [80]
| attribute specification type [78]
[78] attribute specification type [77] ::=
DEFAULTED
| IMPLIED
| SPECIFIED
[79] attribute declaration type [77] ::=
CDATA
| ENTITY
| ENTITIES
| GROUP
| ID
| IDREF
| IDREFS
| NAME
| NAMES
| NOTATION
| NUMBER
| NUMBERS
| NMTOKEN
| NMTOKENS
| NUTOKEN
| NUTOKENS
[80] attribute default type [77] ::=
DECLARED-CONREF
| DECLARED-CURRENT
| DECLARED-DEFAULTED
| DECLARED-FIXED
| DECLARED-IMPLIED
| DECLARED-REQUIRED
[81] attribute test primary [319] ::= qualified attribute identifier [67], (IS | ISNT), attribute type set [76]
[82] attributes test primary [319] ::= qualified attribute set identifier [68], (HAS | HASNT), KEY, string primary [259]
[83] input processing rule [94] ::=
find rule [85]
| find end rule [84]
| find start rule [86]
| external text entity rule [88]
[84] find end rule [83] ::= FIND-END, condition [314]?, local scope [143]
[85] find rule [83] ::= FIND, NULL?, pattern expression [331], condition [314]?, local scope [143]
[86] find start rule [83] ::= FIND-START, condition [314]?, local scope [143]
[87] extended entity name set [88] ::=
extended entity name [89]
| "(", extended entity name [89], ((OR | "|"), extended entity name [89])*, ")"
[88] external text entity rule [83] ::= EXTERNAL-TEXT-ENTITY, (extended entity name set [87] | implied entity type set [90]), condition [314]?, local scope [143]
[89] extended entity name [87] ::=
markup name [34]
| anonymous entity type [63]
[90] implied entity type set [88] ::=
#IMPLIED
| "(", (anonymous entity type [63], (OR | "|"))*, #IMPLIED, ((OR | "|"), anonymous entity type [63])*, ")"
[91] identified group [2] ::=
GROUP, group identification [92], group member [93]*
| GROUP, "(", group identification [92], ")", group member [93]*
[92] group identification [91] ::=
group name set [95]
| #IMPLIED
[93] group member [2] [91] ::=
common declaration [113]
| include [99]
| rule [94]
[94] rule [93] ::=
markup processing rule [7]
| input processing rule [83]
| line breaking rule [125]
| main process rule [3]
| markup error rule [19]
[95] group name set [92] [97] [166] ::= group name [96], ((AND | "&"), group name [96])*
[96] group name [95] ::=
constant string literal [272]
| name [454]
[97] current group set [190] ::=
group name set [95]
| #GROUP, ((AND | "&"), group name set [95])?
| #IMPLIED
[98] 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.
[99] include [93] ::= INCLUDE, constant string literal [272]
[100] include guard declaration [113] ::= INCLUDE-GUARD, (constant string literal [272] | name [454])
[101] module declaration [1] ::=
MODULE, (SHARED, AS, (constant string literal [272] | name [454]))?
| MODULE, INTERFACE, SHARED, AS, (constant string literal [272] | name [454])
| MODULE, IMPLEMENTS, constant string literal [272]
[102] import declaration [113] ::=
IMPORT, constant string literal [272], EXPORT?, PREFIXED, BY, name [454], use clause [103]*, supply clause [104]*
| IMPORT, constant string literal [272], EXPORT?, UNPREFIXED, use clause [103]*, supply clause [104]*
| IMPORT, constant string literal [272], ONLY, use clause [103]+, supply clause [104]*
[103] use clause [102] ::=
EXPORT?, USE, name [454], (AS, name [454])?
| EXPORT?, USE, #CONVERSION-FUNCTIONS
[104] supply clause [102] ::= SUPPLY, name [454], (AS, name [454])?
[105] library declaration [113] ::= LIBRARY, (constant string expression [267], constant string expression [267])+
[106] program-level declaration [2] ::=
default io declaration [107]
| escape declaration [108]
| main buffering declaration [109]*
| main mode declaration [110]*
| main output referent declaration [111]
[107] default io declaration [106] ::= DECLARE, NO-DEFAULT-IO
default io declaration [107] cannot be appear in a module.
[108] escape declaration [106] [463] ::= ESCAPE, constant string primary [270]
[109] main buffering declaration [106] [111] ::= DECLARE, (#ERROR | #MAIN-INPUT | #MAIN-OUTPUT | #PROCESS-INPUT | #PROCESS-OUTPUT), HAS, (BUFFERED | UNBUFFERED)
main buffering declaration [109] cannot be appear in a module.
[110] main mode declaration [106] [111] ::= DECLARE, (#MAIN-INPUT | #MAIN-OUTPUT | #PROCESS-INPUT | #PROCESS-OUTPUT), HAS, (BINARY-MODE | TEXT-MODE)
main mode declaration [110] cannot be appear in a module.
[111] main output referent declaration [106] ::= DECLARE, #MAIN-OUTPUT, HAS, modifier literal for referents [421]
main output referent declaration [111] cannot be appear in a module.
main buffering declaration [109], main mode declaration [110] and main output referent declaration [111] consistency is verified at compile-time. main buffering declaration [109] and main mode declaration [110] can neither be duplicated, nor contradict previously-encountered declarations. Meanwhile, only one main output referent declaration [111] is allowed per program.
[112] preamble declaration [2] ::=
common declaration [113]
| global object definition [114]
| naming declaration [117]
[113] common declaration [93] [112] ::=
binary input declaration [115]
| binary output declaration [116]
| break-width declaration [124]
| delimiter declaration [297]
| import declaration [102]
| include guard declaration [100]
| library declaration [105]
| macro definition [446]
| symbol declaration [296]
[114] global object definition [112] ::=
catch definition [396]
| function definition [357]
| global shelf definition [423]
| require function definition [369]
| require shelf definition [424]
| user-defined type declaration [131]
[115] binary input declaration [113] ::= BINARY-INPUT, constant numeric expression [242]
binary input declaration [115] cannot be appear in a module.
If more than one binary input declaration [115] appears in a program, their respective constant numeric expression [242] values must be equal.
[116] binary output declaration [113] ::= BINARY-OUTPUT, constant numeric expression [242]
binary output declaration [116] cannot be appear in a module.
If more than one binary output declaration [116] appears in a program, their respective constant numeric expression [242] values must be equal.
[117] naming declaration [112] ::=
data letters declaration [118]
| entity namecase declaration [119]
| general namecase declaration [120]
| markup identification declaration [121]
| name letters declaration [122]
| newline declaration [123]
[118] data letters declaration [117] ::=
DECLARE, DATA-LETTERS, constant string expression [267], constant string expression [267]?
| LETTERS, constant string expression [267], constant string expression [267]?
data letters declaration [118] cannot be appear in a module.
[119] entity namecase declaration [117] ::= NAMECASE, ENTITY, (YES | NO)
entity namecase declaration [119] is deprecated.
[120] general namecase declaration [117] ::= NAMECASE, GENERAL, (YES | NO)
general namecase declaration [120] is deprecated.
[121] markup identification declaration [117] ::= DECLARE, MARKUP-IDENTIFICATION, (#FULL | #BASE)
[122] name letters declaration [117] ::= DECLARE, NAME-LETTERS, constant string expression [267], constant string expression [267]
[123] newline declaration [117] ::= NEWLINE, constant string expression [267]
newline declaration [123] is considered obsolete, and is disallowed in programs with modules.
[124] break-width declaration [113] ::= BREAK-WIDTH, constant numeric expression [242], (number [241] | TO, constant numeric expression [242])?
break-width declaration [124] cannot be appear in a module.
[125] line breaking rule [94] ::=
insertion break rule [126]
| replacement break rule [127]
[126] insertion break rule [125] ::= INSERTION-BREAK, constant string expression [267], condition [314]?
[127] replacement break rule [125] ::= REPLACEMENT-BREAK, constant string primary [270], constant string expression [267], condition [314]?
[128] type [358] [359] [360] [361] [362] [363] [366] [369] [374] [380] ::=
first-class type [129]
| qualified type [130]
[129] first-class type [128] [375] [376] [377] [378] [379] [424] [430] [433] ::=
user-defined type name [137]
| COUNTER
| 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
| STREAM
| STRING
| SWITCH
The type INT32 is a deprecated synonym for INTEGER. Its use is discouraged.
[130] qualified type [128] ::= (MARKUP | STRING), (SINK | SOURCE)
[131] user-defined type declaration [114] ::=
opaque type declaration [132]
| record type declaration [133]
| user-defined type require [136]
[132] opaque type declaration [131] ::= (DECLARE | EXPORT), OPAQUE, user-defined type name [137], CREATED, BY, system-specific function name [466], (IN, FUNCTION-LIBRARY, system-specific library name [467])?
[133] record type declaration [131] ::= (DECLARE | EXPORT, (AS, OPAQUE)?), RECORD, user-defined type name [137], (record type inheritance clause [134]?, field declaration [135]* | ELSEWHERE)
A record type declaration [133] 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.
[134] record type inheritance clause [133] ::= EXTENDS, user-defined type name [137]
user-defined type name [137] cannot be that of a restricted type.
[135] field declaration [133] ::= FIELD, shelf declaration [430]
[136] user-defined type require [131] ::= REQUIRE, OPAQUE, user-defined type name [137]
[137] user-defined type name [129] [132] [133] [134] [136] [140] [203] [394] ::= name [454]
[138] user-defined type expression [203] [228] [390] ::=
boolean term [317], "->", user-defined type expression [138], "|", user-defined type expression [138]
| user-defined type subexpression [139]
[139] user-defined type subexpression [138] [141] ::=
argument primary [391], (user-defined infix function name [462], argument primary [391])+
| user-defined type primary [140]
[140] user-defined type primary [139] [391] ::=
user-defined type name [137], CAST, user-defined type primary [140]
| value function call [385]
| shelf item reference [434]
[141] user-defined type test primary [319] ::= user-defined type subexpression [139], (reference comparer [142], user-defined type subexpression [139])+
[142] reference comparer [141] ::=
"=="
| "!=="
[143] local scope [4] [5] [6] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [84] [85] [86] [88] [196] [197] [199] [200] [203] [204] [205] [206] [211] [214] [215] [217] [218] [330] [384] ::= local declaration [426]*, action [146]*, catch alternative [145]*, always block [144]*
[144] always block [143] ::= ALWAYS, action [146]*
[145] catch alternative [143] ::= CATCH, (built-in catch invocation [403] | catch invocation [409]), action [146]*
[146] action [143] [144] [145] ::= using prefix [188]*, guarded action [147]
[147] guarded action [146] ::= basic action [148], condition [314]?
[148] basic action [147] ::=
activate action [149]
| assert action [150]
| clear action [151]
| close action [152]
| collect garbage action [153]
| copy action [154]
| copy and clear action [155]
| deactivate action [156]
| decrement action [157]
| discard action [158]
| do action [196]
| do conditional action [197]
| do markup parse action [198]
| do scan action [199]
| do select action [200]
| do select-type action [203]
| do skip action [204]
| exit action [159]
| fail action [160]
| flush action [161]
| void function call [386]
| halt action [162]
| increment action [163]
| log-message action [164]
| new action [165]
| next group action [166]
| not reached action [167]
| open action [168]
| output action [169]
| output to action [170]
| put action [171]
| remove action [172]
| remove key action [173]
| reopen action [174]
| repeat action [205]
| repeat for action [206]
| repeat over action [211]
| repeat scan action [213]
| reset action [175]
| return action [176]
| set action [177]
| set external function association action [392]
| set key action [178]
| sgml in action [179]
| sgml out action [180]
| submit action [181]
| submit-markup action [182]
| succeed action [183]
| suppress action [184]
| test system action [185]
| throw action [186]
| void action [187]
[149] activate action [148] ::= ACTIVATE, shelf item reference [434], ((AND | "&"), shelf item reference [434])*
[150] assert action [148] ::= ASSERT, boolean expression [315], (MESSAGE, expression [228])?
[151] clear action [148] ::= CLEAR, shelf reference [435], ((AND | "&"), shelf reference [435])*
[152] close action [148] ::= CLOSE, shelf item reference [434], ((AND | "&"), shelf item reference [434])*
[153] collect garbage action [148] ::= COLLECT-GARBAGE
[154] copy action [148] ::= COPY, shelf reference [435], TO, shelf reference [435]
[155] copy and clear action [148] ::= COPY-CLEAR, shelf reference [435], TO, shelf reference [435]
[156] deactivate action [148] ::= DEACTIVATE, shelf item reference [434], ((AND | "&"), shelf item reference [434])*
[157] decrement action [148] ::= DECREMENT, shelf item reference [434], (BY, numeric expression [229])?
[158] discard action [148] ::= DISCARD, shelf item reference [434], ((AND | "&"), shelf item reference [434])*
[159] exit action [148] ::= EXIT
[160] fail action [148] ::= FAIL
[161] flush action [148] ::= FLUSH, shelf item reference [434], ((AND | "&"), shelf item reference [434])*
[162] halt action [148] ::= (HALT | HALT-EVERYTHING), (WITH, numeric expression [229])?
[163] increment action [148] ::= INCREMENT, shelf item reference [434], (BY, numeric expression [229])?
[164] log-message action [148] ::= LOG-MESSAGE, string expression [254], (CLASS, string expression [254])?, (SEVERITY, numeric expression [229])?
[165] new action [148] ::=
NEW, new shelf item reference [436], ((AND | "&"), new shelf item reference [436])*
| NEW, "?", guarded new shelf item reference [437], ((AND | "&"), guarded new shelf item reference [437])*
[166] next group action [148] ::= NEXT, GROUP, IS, (group name set [95] | "(", group name set [95], ")")
[167] not reached action [148] ::= NOT-REACHED, (MESSAGE, string expression [254])?
[168] open action [148] ::= OPEN, shelf item reference [434], modifier expression [414]?, AS, string sink literal for open [354], modifier expression [414]?
A modifier expression [414] can only appear on the left-hand side or the right-hand side, but not both.
[169] output action [148] ::= OUTPUT, string source expression [356]
[170] output to action [148] ::= OUTPUT-TO, string sink expression [352]
[171] put action [148] ::= PUT, shelf item reference [434], ((AND | "&"), shelf item reference [434])*, string expression [254]
[172] remove action [148] ::= REMOVE, shelf item reference [434]
[173] remove key action [148] ::= REMOVE, KEY, OF, shelf item reference [434]
[174] reopen action [148] ::= REOPEN, shelf item reference [434], modifier expression [414]?, (AS, string sink literal for open [354], modifier expression [414]?)?
A modifier expression [414] 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 [414] on the left-hand side is restricted to using the modifiers defined by modifier literal for reopen [419].
[175] reset action [148] ::= RESET, shelf item reference [434], (TO, numeric expression [229])?
[176] return action [148] ::= RETURN, expression [228]?
[177] set action [148] ::= SET, string sink primary [353], TO, expression [228]
The modifier expression [414] in string sink primary [353], if specified, is restricted to using the modifiers defined by modifier literal for set [418].
[178] set key action [148] ::= SET, KEY, OF, shelf item reference [434], TO, string expression [254]
[179] sgml in action [148] ::= SGML-IN, (string expression [254] | #NONE)
[180] sgml out action [148] ::= SGML-OUT, (string expression [254] | #NONE)
[181] submit action [148] ::= SUBMIT, string source expression [356]
[182] submit-markup action [148] ::= SUBMIT-MARKUP, markup source expression [350]
[183] succeed action [148] ::= SUCCEED
[184] suppress action [148] ::= SUPPRESS
[185] test system action [148] ::= TEST-SYSTEM, (WITH, string expression [254])?
[186] throw action [148] ::= (SIGNAL, (TO, shelf item reference [434])?)?, (THROW, throw invocation [412] | RETHROW)
[187] void action [148] ::= VOID, expression [228]
[188] using prefix [146] ::=
using attribute association prefix [189]
| using group prefix [190]
| using input prefix [191]
| using nested-referents prefix [192]
| using output prefix [193]
| using referents association prefix [194]
| using shelf item association prefix [195]
[189] using attribute association prefix [188] ::= USING, qualified attribute identifier [67], (AS, attribute name [75])?
The alias, attribute name [75], is required if the qualified attribute identifier [67] is a simple qualified attribute identifier [69] that doesn't have an ancestry qualifier [37] (if using ATTRIBUTE) and doesn't have an OF part (if using DATA-ATTRIBUTE).
[190] using group prefix [188] ::=
USING, GROUP, current group set [97]
| USING, GROUP, "(", current group set [97], ")"
[191] using input prefix [188] ::= USING, INPUT, AS, string expression [254]
[192] using nested-referents prefix [188] ::= USING, NESTED-REFERENTS
[193] using output prefix [188] ::= USING, OUTPUT, AS, string sink expression [352]
[194] using referents association prefix [188] ::= USING, REFERENTS, indexer [441]
[195] using shelf item association prefix [188] ::= USING, shelf item reference [434], (AS, shelf alias [438])?
If shelf item reference [434] contains a shelf literal [433], the shelf alias [438] is required.
[196] do action [148] ::= DO, local scope [143], DONE
[197] do conditional action [148] ::= DO, condition [314], local scope [143], (ELSE, condition [314], local scope [143])*, (ELSE, local scope [143], DONE)?
[198] do markup parse action [148] ::=
do generic parse action [217]
| do sgml parse action [215]
| do xml parse action [218]
[199] do scan action [148] ::= DO, SCAN, string source expression [356], match alternative [214]+, (ELSE, local scope [143])?, DONE
[200] do select action [148] ::= DO, SELECT, numeric expression [229], (CASE, constant numeric range set [201], local scope [143])+, (ELSE, local scope [143])?, DONE
[201] constant numeric range set [200] ::=
constant numeric range [202], ((OR | "|"), constant numeric range [202])*
| "(", constant numeric range [202], ((OR | "|"), constant numeric range [202])*, ")"
[202] constant numeric range [201] ::= constant numeric expression [242], (TO, constant numeric expression [242])?
[203] do select-type action [148] ::= DO, SELECT-TYPE, user-defined type expression [138], AS, shelf alias [438], (CASE, user-defined type name [137], local scope [143])+, (ELSE, local scope [143])?, DONE
[204] do skip action [148] ::= DO, SKIP, (OVER, pattern expression [331] | PAST, numeric expression [229], (OVER, pattern expression [331])?), local scope [143], (ELSE, local scope [143])?, DONE
[205] repeat action [148] ::= REPEAT, local scope [143], AGAIN
[206] repeat for action [148] [210] ::= REPEAT, for part [207]?, from part [208]?, to part [209]?, by part [210]?, local scope [143], AGAIN
[207] for part [206] [210] ::= FOR, INTEGER, shelf alias [438]
[208] from part [206] [210] ::= FROM, numeric expression [229]
[209] to part [206] [210] ::= TO, numeric expression [229]
[210] by part [206] ::= BY, numeric expression [229]
Each optional component of the repeat for action [206] has a default value should it be absent. An absent for part [207] declares an anonymous (i.e., inaccessible) alias. An absent from part [208] defaults to one. An absent to part [209] defaults to boundless. An absent by part [210] defaults to one.
[211] repeat over action [148] [330] ::= REPEAT, OVER, repeat over component [212], ((AND | "&"), repeat over component [212])*, local scope [143], AGAIN
[212] repeat over component [211] ::=
qualified attribute identifier [67], (AS, attribute alias [74])?
| qualified attribute set identifier [68], (AS, attribute alias [74])?
| shelf reference [435], (AS, shelf alias [438])?
| REFERENTS
| REVERSED?, CURRENT, ELEMENTS, ancestry qualifier [37]?, element alias [43]
If shelf reference [435] is a shelf literal [433], the shelf alias [438] is required.
[213] repeat scan action [148] ::= REPEAT, SCAN, string expression [254], match alternative [214]+, AGAIN
[214] match alternative [199] [213] ::= MATCH, UNANCHORED?, NULL?, pattern expression [331], condition [314]?, local scope [143]
The use of UNANCHORED is deprecated in favour of the more general "**" operator.
[215] do sgml parse action [198] ::= DO, SGML-PARSE, sgml parse type [216], SCAN, markup parse scanning source [227], local scope [143], DONE
[216] sgml parse type [215] ::=
(DOCUMENT | SUBDOCUMENT), id checking specifier [220]?, utf8 specifier [222]?, (CREATING, sgml dtd pseudo-shelf item [224])?
| INSTANCE, instance element specifier [221]?, sgml dtd specifier [223], id checking specifier [220]?, utf8 specifier [222]?
[217] do generic parse action [198] ::= DO, MARKUP-PARSE, markup source expression [350], local scope [143], DONE
[218] do xml parse action [198] ::= DO, XML-PARSE, xml parse type [219]?, SCAN, markup parse scanning source [227], local scope [143], DONE
If xml parse type [219] is not specified, the parse defaults to a well-formed XML parse.
[219] xml parse type [218] ::=
DOCUMENT, id checking specifier [220]?, utf8 specifier [222]?, (CREATING, xml dtd pseudo-shelf item [226])?
| INSTANCE, instance element specifier [221]?, xml dtd specifier [225], id checking specifier [220]?, utf8 specifier [222]?
[220] id checking specifier [216] [219] ::= WITH, ID-CHECKING, boolean expression [315]
[221] instance element specifier [216] [219] ::= WITH, DOCUMENT-ELEMENT, string expression [254]
[222] utf8 specifier [216] [219] ::= WITH, UTF-8, boolean expression [315]
[223] sgml dtd specifier [216] ::= WITH, (sgml dtd pseudo-shelf item [224] | CURRENT, (DTD | SGML-DTD))
[224] sgml dtd pseudo-shelf item [216] [223] ::= (DTDS | SGML-DTDS), key indexer [443]
[225] xml dtd specifier [219] ::= WITH, (xml dtd pseudo-shelf item [226] | CURRENT, XML-DTD)
[226] xml dtd pseudo-shelf item [219] [225] ::= XML-DTDS, key indexer [443]
[227] markup parse scanning source [215] [218] ::=
INPUT, void function call [386]
| string source expression [356]
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 [386] must be to a void-valued function.
[228] expression [150] [176] [177] [187] [374] [433] ::=
boolean expression [315]
| markup sink expression [348]
| markup source expression [350]
| numeric expression [229]
| stream expression [351]
| string expression [254]
| string sink expression [352]
| string source expression [356]
| user-defined type expression [138]
[229] numeric expression [157] [162] [163] [164] [175] [200] [204] [208] [209] [210] [228] [238] [340] [390] [442] ::=
boolean term [317], "->", numeric expression [229], "|", numeric expression [229]
| numeric subexpression [230]
[230] numeric subexpression [229] [249] [250] [251] [252] [256] [257] [420] [422] ::= numeric term [232], (numeric additive operator [231], numeric term [232])*
[231] numeric additive operator [230] [242] ::=
PLUS
| "+"
| MINUS
| "-"
| UNION
| DIFFERENCE
[232] numeric term [230] ::= numeric factor [234], (numeric multiplicative operator [233], numeric factor [234])*
[233] numeric multiplicative operator [232] [243] ::=
TIMES
| "*"
| DIVIDE
| "/"
| MODULO
| MASK
| SHIFT
[234] numeric factor [232] ::= numeric tertiary [235], ("**", numeric factor [234])?
[235] numeric tertiary [234] ::=
numeric secondary [237]
| string secondary [258], (numeric conversion operator [236], numeric secondary [237])?
[236] numeric conversion operator [235] [245] ::=
BASE
| BINARY
[237] numeric secondary [235] ::=
argument primary [391], (user-defined infix function name [462], argument primary [391])+
| numeric primary [238]
[238] numeric primary [237] [391] ::=
value function call [385]
| string primary [259]
| (NEGATE | "-"), numeric primary [238]
| COMPLEMENT, numeric primary [238]
| shelf item reference [434]
| BINARY, string primary [259]
| CHILDREN, ancestry qualifier [37]?
| ITEM, OF, item-of reference [239]
| LENGTH, OF, string primary [259]
| (NUMBER, OF | NUMBER-OF), number-of reference [240]
| OCCURRENCE, ancestry qualifier [37]?
| SYSTEM-CALL, string primary [259]
| number [241]
| "(", numeric expression [229], ")"
[239] item-of reference [238] ::=
shelf item reference [434]
| simple qualified attribute set identifier [71], key indexer [443]
| REFERENTS, key indexer [443]
| THIS, REFERENT
[240] number-of reference [238] ::=
qualified attribute identifier [67]
| qualified attribute set identifier [68]
| shelf reference [435]
| CURRENT, ELEMENTS, ancestry qualifier [37]?
| CURRENT, SUBDOCUMENTS
| REFERENTS
[241] number [124] [238] [246] [277] [278] [299] [300] [301] [304] [305] [309] [310] [312] [313] [422] [453] [465] ::= digit [456]+
[242] constant numeric expression [115] [116] [124] [202] [246] [269] [431] [432] ::= constant numeric term [243], (numeric additive operator [231], constant numeric term [243])*
[243] constant numeric term [242] ::= constant numeric factor [244], (numeric multiplicative operator [233], constant numeric factor [244])*
[244] constant numeric factor [243] ::= constant numeric secondary [245], ("**", constant numeric factor [244])?
[245] constant numeric secondary [244] ::=
constant numeric primary [246]
| constant string primary [270], numeric conversion operator [236], constant numeric primary [246]
[246] constant numeric primary [245] [268] ::=
constant string primary [270]
| (NEGATE | "-"), constant numeric primary [246]
| COMPLEMENT, constant numeric primary [246]
| BINARY, constant string primary [270]
| LENGTH, OF, constant string primary [270]
| number [241]
| "(", constant numeric expression [242], ")"
[247] numeric test primary [319] ::= VALUE?, full numeric test [248]
The keyword VALUE is unnecessary in this context, and its use is deprecated.
[248] full numeric test [247] ::=
ascending numeric comparison [249]
| descending numeric comparison [250]
| equality numeric comparison [251]
| inequality numeric comparison [252]
[249] ascending numeric comparison [248] ::= numeric subexpression [230], (equality comparer [324], numeric subexpression [230])*, strongly ascending comparer [328], numeric subexpression [230], (weakly ascending comparer [326], numeric subexpression [230])*
[250] descending numeric comparison [248] ::= numeric subexpression [230], (equality comparer [324], numeric subexpression [230])*, strongly descending comparer [329], numeric subexpression [230], (weakly descending comparer [327], numeric subexpression [230])*
[251] equality numeric comparison [248] ::= numeric subexpression [230], (equality comparer [324], numeric subexpression [230])+
[252] inequality numeric comparison [248] ::= numeric subexpression [230], inequality comparer [325], numeric subexpression [230]
[253] built-in read-only numeric shelf name [440] ::=
#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
[254] string expression [164] [167] [171] [178] [179] [180] [185] [191] [213] [221] [228] [259] [288] [356] [390] [421] [443] ::=
boolean term [317], "->", string expression [254], "|", string expression [254]
| string subexpression [255]
[255] string subexpression [254] [283] [284] [285] [286] [287] [288] ::= string term [256], ((JOIN | "||"), string term [256])*
[256] string term [255] ::=
string factor [257], ((REPEATED | "||*"), numeric subexpression [230])*
| string factor [257], TAKE, UNANCHORED?, pattern secondary [335]
| string factor [257], DROP, UNANCHORED?, pattern secondary [335]
The use of UNANCHORED is deprecated in favour of the more general "**" operator.
[257] string factor [256] ::= string secondary [258], ((FORMAT | "%"), (numeric subexpression [230] | string secondary [258]))*
[258] string secondary [235] [257] ::=
argument primary [391], (user-defined infix function name [462], argument primary [391])+
| string primary [259]
[259] string primary [32] [82] [238] [258] [260] [289] [337] [351] [355] [391] [445] ::=
stream input/output mode [262]?, value function call [385]
| constant string value [271]
| external function association enquiry [393]
| pattern name [336]
| qualified attribute part identifier [66]
| referent item reference [260]
| shelf item reference [434]
| stream input/output mode [262]?, FILE, string primary [259]
| DATE, string primary [259]
| KEY, OF, key-of reference [261]
| NAME, OF, shelf item reference [434]
| NAME, OF, specific element selector [39]
| XMLNS-NAME, (OF, specific element selector [39])?
| "~", string primary [259]
| string literal [263]
| "(", string expression [254], ")"
[260] referent item reference [259] [355] ::=
REFERENTS, indexer [441]
| THIS, REFERENT
| REFERENT, string primary [259]
| SILENT-REFERENT, string primary [259]
[261] key-of reference [259] ::=
qualified attribute identifier [67]
| shelf item reference [434]
| REFERENTS, item indexer [442]
| THIS, REFERENT
[262] stream input/output mode [259] ::=
(BUFFERED | UNBUFFERED), (TEXT-MODE | BINARY-MODE)?
| (TEXT-MODE | BINARY-MODE), (BUFFERED | UNBUFFERED)?
[263] string literal [259] [337] [453] ::= string literal part [264], ("_", string literal part [264])*
[264] string literal part [263] ::=
double-quoted string literal part [265]
| single-quoted string literal part [266]
[265] double-quoted string literal part [264] ::= """, (described character [277] | described substring [278] | escaped text [276] | format item [298] | unescaped character [464] | "'")*, """
[266] single-quoted string literal part [264] ::= "'", (described character [277] | described substring [278] | escaped text [276] | format item [298] | unescaped character [464] | """)*, "'"
[267] constant string expression [105] [118] [122] [123] [126] [127] [270] [296] [297] [466] [467] ::= constant string term [268], ((JOIN | "||"), constant string term [268])*
[268] constant string term [267] ::= constant string factor [269], ((REPEATED | "||*"), constant numeric primary [246])?
[269] constant string factor [268] ::= constant string primary [270], ((FORMAT | "%"), (constant numeric expression [242] | constant string primary [270]))*
[270] constant string primary [108] [127] [245] [246] [269] [271] ::=
constant string value [271]
| constant string literal [272]
| "(", constant string expression [267], ")"
[271] constant string value [259] [270] ::= COMPILED-DATE, constant string primary [270]
[272] constant string literal [34] [50] [96] [99] [100] [101] [102] [270] [345] [420] [454] ::= constant string literal part [273], ("_", constant string literal part [273])*
[273] constant string literal part [272] ::=
double-quoted constant string literal part [274]
| single-quoted constant string literal part [275]
[274] double-quoted constant string literal part [273] ::= """, (described character [277] | described substring [278] | escaped text [276] | unescaped character [464] | "'")*, """
[275] single-quoted constant string literal part [273] ::= "'", (described character [277] | described substring [278] | escaped text [276] | unescaped character [464] | """)*, "'"
[276] escaped text [265] [266] [274] [275] ::= escape [463], (escape [463] | """ | "'" | "#" | ")")
[277] described character [265] [266] [274] [275] ::=
escape [463], "_"
| escape [463], "n"
| escape [463], "t"
| escape [463], number [241], "#"
[278] described substring [265] [266] [274] [275] [465] ::= escape [463], number [241], "r", "{", describing number [465], (",", describing number [465])*, "}"
[279] stream test primary [319] ::=
shelf item reference [434], (HAS | HASNT), NAME
| shelf item reference [434], (IS | ISNT), stream type set [280]
[280] stream type set [279] ::=
stream type [281]
| "(", stream type [281], ((AND | "&"), stream type [281])*, ")"
| "(", stream type [281], ((OR | "|"), stream type [281])*, ")"
[281] stream type [280] ::=
ATTACHED
| BUFFER
| CLOSED
| EXTERNAL
| FILE
| MARKUP-PARSER
| OPEN
| REFERENT
| SGML-PARSER
SGML-PARSER is deprecated in favour of the more general MARKUP-PARSER.
[282] string test primary [319] ::=
ascending string comparison [283]
| descending string comparison [284]
| equality string comparison [285]
| inequality string comparison [286]
| string match test primary [287]
| string set test primary [288]
[283] ascending string comparison [282] ::= string subexpression [255], (equality comparer [324], string subexpression [255])*, strongly ascending comparer [328], string subexpression [255], (weakly ascending comparer [326], string subexpression [255])*
[284] descending string comparison [282] ::= string subexpression [255], (equality comparer [324], string subexpression [255])*, strongly descending comparer [329], string subexpression [255], (weakly descending comparer [327], string subexpression [255])*
[285] equality string comparison [282] ::= string subexpression [255], (equality comparer [324], string subexpression [255])+
[286] inequality string comparison [282] ::= string subexpression [255], inequality comparer [325], string subexpression [255]
[287] string match test primary [282] ::= string subexpression [255], MATCHES, UNANCHORED?, pattern secondary [335]
The use of UNANCHORED is deprecated in favour of the more general "**" operator.
[288] string set test primary [282] ::=
string subexpression [255], comparer [322], UL, string subexpression [255]
| string subexpression [255], comparer [322], UL?, "(", string expression [254], ((OR | "|"), string expression [254])*, ")"
[289] source test primary [319] ::=
FILE, string primary [259], EXISTS
| FILE, string primary [259], (IS | ISNT), file info enquiry set [290]
| #CURRENT-INPUT, (IS | ISNT), ATTACHED
[290] file info enquiry set [289] ::=
file info enquiry [291]
| "(", file info enquiry [291], ((AND | "&"), file info enquiry [291])*, ")"
[291] file info enquiry [290] ::=
DIRECTORY
| FILE
| READABLE
| WRITABLE
[292] built-in write-only stream shelf name [440] ::=
#CONSOLE
| #CURRENT-OUTPUT
| #ERROR
| #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.
[293] built-in read-only stream shelf name [440] ::=
#ADDITIONAL-INFO
| #APPINFO
| #ARGS
| #COMMAND-LINE-NAMES
| #DOCTYPE
| #FILE-NAME
| #LANGUAGE-VERSION
| #MESSAGE
| #PLATFORM-INFO
| #RECOVERY-INFO
| #XMLNS-NAMES
[294] built-in read-write stream shelf name [440] ::=
#LIBPATH
| #LIBRARY
| #LIBVALUE
[295] built-in read-only string source shelf name [440] ::=
#CURRENT-INPUT
| #MAIN-INPUT
| #PROCESS-INPUT
[296] symbol declaration [113] ::= SYMBOL, constant string expression [267]+
symbol declaration [296] cannot be appear in a module.
[297] delimiter declaration [113] ::= DELIMITER, constant string expression [267]
delimiter declaration [297] cannot be appear in a module.
[298] format item [265] [266] ::=
alphabetic format item [299]
| attribute format item [300]
| binary format item [301]
| break format item [302]
| content format item [303]
| current name format item [304]
| decimal format item [305]
| end break suppress format item [306]
| macro format item [307]
| other format item [308]
| pattern format item [309]
| roman format item [310]
| start break suppress format item [311]
| stream format item [312]
| symbol format item [313]
[299] alphabetic format item [298] ::= escape [463], (number [241], "f" | "j" | "k" | "l" | "u" | "w")*, "a", "(", shelf item reference [434], ")"
[300] attribute format item [298] ::= escape [463], (number [241], "f" | "k" | "e" | "h" | "l" | "o" | "p" | "s" | "u" | "z")*, "v", "(", attribute name [75], ")"
[301] binary format item [298] ::= escape [463], (number [241], "f" | number [241])*, "b", "(", shelf item reference [434], ")"
[302] break format item [298] ::= escape [463], "/"
[303] content format item [298] ::= escape [463], ("h" | "l" | "s" | "u" | "z")*, "c"
[304] current name format item [298] ::= escape [463], ("e" | number [241], "f" | "k" | "l" | "o" | "p" | "u")*, "q"
[305] decimal format item [298] ::= escape [463], (number [241], "f" | ("k" | "z") | "l" | number [241], "r" | "s" | "u" | number [241])*, "d", "(", shelf item reference [434], ")"
[306] end break suppress format item [298] ::= escape [463], "]"
[307] macro format item [298] ::= escape [463], ("u" | "l")?, "@", (escape [463] | "(", name [454], ")")
[308] other format item [298] ::=
escape [463], "s", "_"
| escape [463], "s", "n"
| escape [463], "s", "t"
| escape [463], "e", "n"
[309] pattern format item [298] ::= escape [463], (number [241], "f" | "k" | "h" | "l" | "s" | "u")*, "x", "(", pattern name [336], ")"
pattern format item [309] is deprecated in favour of stream format item [312].
[310] roman format item [298] ::= escape [463], (number [241], "f" | "k" | "l" | "u")*, "i", "(", shelf item reference [434], ")"
[311] start break suppress format item [298] ::= escape [463], "["
[312] stream format item [298] [309] ::= escape [463], (number [241], "f" | "k" | "l" | "u" | "e")*, "g", "(", (shelf item reference [434] | pattern name [336]), ")"
[313] symbol format item [298] ::= escape [463], (number [241], "f" | "k")*, "y", "(", shelf item reference [434], ")"
[314] condition [4] [5] [6] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [84] [85] [86] [88] [126] [127] [147] [197] [214] [337] ::= (WHEN | UNLESS), boolean expression [315]
[315] boolean expression [150] [220] [222] [228] [314] [321] [390] ::= boolean conditional [316], ((OR | "|"), boolean conditional [316])*
[316] boolean conditional [315] ::=
boolean term [317], "->", boolean conditional [316], "|", boolean conditional [316]
| boolean term [317]
[317] boolean term [138] [229] [254] [316] ::= boolean factor [318], ((AND | "&"), boolean factor [318])*
[318] boolean factor [317] ::= (NOT | "!")?, boolean tertiary [319]
[319] boolean tertiary [318] ::=
argument test primary [395]
| attribute test primary [81]
| attributes test primary [82]
| catch test primary [413]
| element test primary [44]
| entity test primary [51]
| numeric test primary [247]
| pattern test primary [347]
| shelf test primary [445]
| source test primary [289]
| stream test primary [279]
| string test primary [282]
| user-defined type test primary [141]
| boolean secondary [320], ((equality comparer [324], boolean secondary [320])+ | inequality comparer [325], boolean secondary [320])?
[320] boolean secondary [319] ::=
argument primary [391], (user-defined infix function name [462], argument primary [391])+
| boolean primary [321]
[321] boolean primary [320] [337] [391] ::=
shelf item reference [434]
| value function call [385]
| FALSE
| TRUE
| "~", boolean primary [321]
| ACTIVE, boolean primary [321]
| "(", boolean expression [315], ")"
Use of the ACTIVE keyword is unnecessary and is deprecated.
[322] comparer [288] ::=
equivalence comparer [323]
| strongly ascending comparer [328]
| strongly descending comparer [329]
[323] equivalence comparer [51] [322] ::=
equality comparer [324]
| inequality comparer [325]
[324] equality comparer [249] [250] [251] [283] [284] [285] [319] [323] [326] [327] ::=
IS, EQUAL
| "="
[325] inequality comparer [252] [286] [319] [323] ::=
ISNT, EQUAL
| "!", "="
[326] weakly ascending comparer [249] [283] ::=
equality comparer [324]
| strongly ascending comparer [328]
[327] weakly descending comparer [250] [284] ::=
equality comparer [324]
| strongly descending comparer [329]
[328] strongly ascending comparer [249] [283] [322] [326] ::=
IS, LESS-EQUAL
| ISNT, GREATER-THAN
| "<="
| IS, LESS-THAN
| ISNT, GREATER-EQUAL
| "<"
[329] strongly descending comparer [250] [284] [322] [327] ::=
IS, GREATER-EQUAL
| ISNT, LESS-THAN
| ">="
| IS, GREATER-THAN
| ISNT, LESS-EQUAL
| ">"
[330] built-in read-only switch shelf name [440] ::=
#FIRST
| #LAST
| #FTRACE-IS-EMITTED
#FIRST and #LAST are available only within the local scope [143] of a repeat over action [211].
[331] pattern expression [24] [26] [85] [204] [214] [337] ::= pattern product [332], ((OR | "|"), pattern product [332])*
[332] pattern product [331] ::=
pattern factor [333], pattern product [332]?
| LOOKAHEAD, pattern product [332]
| LOOKAHEAD, NOT, pattern product [332]
| UL, pattern product [332]
| (character set [342] | character class name [341]), ("**" | "++"), ("=>", pattern name [336])?, pattern product [332]
[333] pattern factor [332] ::=
(pattern entity type [338] | pattern nonentity type [339])?, pattern tertiary [334]
| pattern entity type [338], NAMED, pattern tertiary [334], (VALUED, pattern tertiary [334])?
| pattern entity type [338], VALUED, pattern tertiary [334], (NAMED, pattern tertiary [334])?
| pattern nonentity type [339], VALUED, pattern tertiary [334]
[334] pattern tertiary [333] ::= pattern secondary [335], ("=>", pattern name [336])?
[335] pattern secondary [256] [287] [334] ::= pattern primary [337], occurrence indicator [340]?
[336] pattern name [259] [309] [312] [332] [334] [337] [347] ::= name [454]
[337] pattern primary [335] ::=
character class name [341]
| character set [342]
| string literal [263]
| positional pattern [346]
| ANOTHER?, pattern name [336]
| value function call [385]
| "~", string primary [259]
| "~", boolean primary [321]
| "(", condition [314], ")"
| "(", pattern expression [331], condition [314]?, ")"
[338] pattern entity type [333] ::=
CDATA
| SDATA
| ENTITY
[339] pattern nonentity type [333] ::=
PCDATA
| NON-CDATA
| NON-SDATA
| TEXT
[340] occurrence indicator [335] ::=
"?"
| "+"
| "*"
| "{", numeric expression [229], "}"
| "{", numeric expression [229], TO, numeric expression [229], "}"
| "{", numeric expression [229], "}", "+"
[341] character class name [332] [337] [345] ::=
ANY
| ANY-TEXT
| BLANK
| DIGIT
| LC
| LETTER
| SPACE
| UC
| WHITE-SPACE
[342] character set [332] [337] ::=
"[", character set term [344], (character set exception operator [343], character set term [344])?, "]"
| "[", character set exception operator [343], character set term [344], "]"
[343] character set exception operator [342] ::=
"\"
| EXCEPT
[344] character set term [342] ::= character set product [345], ((OR | "|"), character set product [345])*
[345] character set product [344] ::=
character class name [341]
| constant string literal [272], (TO, constant string literal [272])?
[346] positional pattern [337] ::=
CONTENT-END
| CONTENT-START
| LINE-END
| LINE-START
| VALUE-END
| VALUE-START
| WORD-END
| WORD-START
[347] pattern test primary [319] ::= pattern name [336], (IS | ISNT), SPECIFIED
[348] markup sink expression [228] ::= string sink expression [352]
[349] markup sink primary ::= shelf item reference [434]
[350] markup source expression [182] [217] [228] ::=
string source expression [356]
| built-in read-only markup source shelf name [35]
[351] stream expression [228] ::=
shelf item reference [434]
| FILE, string primary [259]
| REFERENT, string primary [259]
[352] string sink expression [170] [193] [228] [348] ::= string sink primary [353], ((AND | "&"), string sink primary [353])*
[353] string sink primary [177] [352] ::=
shelf item reference [434], modifier expression [414]?
| string sink literal [355], modifier expression [414]?
The modifier expression [414], if specified, is restricted to using the modifiers defined by modifier literal for content [420].
[354] string sink literal for open [168] [174] [355] ::=
string sink literal [355]
| BUFFER
[355] string sink literal [353] [354] ::=
FILE, string primary [259]
| REFERENT, string primary [259]
| THIS, REFERENT
| value function call [385]
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 [354], it is interpreted as a referent item reference [260], unless preceded by the FILE keyword.
The value function call [385] must be a STRING SINK-valued function.
[356] string source expression [169] [181] [199] [227] [228] [350] ::= string expression [254]
[357] function definition [114] ::=
external prefix function definition [358]
| external infix function definition [359]
| external conversion function definition [360]
| internal prefix function definition [361]
| internal infix function definition [362]
| internal conversion function definition [363]
[358] external prefix function definition [357] [379] ::= (DEFINE | EXPORT), EXTERNAL, OVERLOADED?, type [128]?, prefix function signature definition [365], external function binding [383]
[359] external infix function definition [357] [379] ::= (DEFINE | EXPORT), EXTERNAL, OVERLOADED?, type [128], infix function signature definition [366], external function binding [383]
[360] external conversion function definition [357] [379] ::= (DEFINE | EXPORT), EXTERNAL, type [128], conversion function signature definition [367], external function binding [383]
[361] internal prefix function definition [357] [379] ::= (DEFINE | EXPORT), function categorization kind [364]?, type [128]?, prefix function signature definition [365], internal function binding [384]
[362] internal infix function definition [357] [379] ::= (DEFINE | EXPORT), OVERLOADED?, type [128], infix function signature definition [366], internal function binding [384]
[363] internal conversion function definition [357] [379] ::= (DEFINE | EXPORT), type [128], conversion function signature definition [367], internal function binding [384]
[364] function categorization kind [361] ::=
DYNAMIC?, OVERLOADED
| OVERRIDING
[365] prefix function signature definition [358] [361] ::= FUNCTION, prefix function name [458], function argument list definition [370]?
[366] infix function signature definition [359] [362] ::= INFIX-FUNCTION, VALUE, type [128], name [454], infix function name [457], VALUE, type [128], name [454]
[367] conversion function signature definition [360] [363] ::= CONVERSION-FUNCTION, function argument definition [373]
[368] function name [369] [394] ::= name [454]
[369] require function definition [114] ::= REQUIRE, type [128]?, FUNCTION, function name [368], function argument list definition [370]?
[370] function argument list definition [365] [369] ::=
parenthesized function argument list definition [371]
| unparenthesized function argument list definition [372]
[371] parenthesized function argument list definition [370] ::=
"(", ")"
| "(", function argument definition [373], (argument separator [381], function argument definition [373])*, (argument separator [381], remainder shelf argument definition [378], (argument separator [381], ".", ".", ".")?, ")")?
| "(", remainder shelf argument definition [378], argument separator [381], ".", ".", ".", ")"
[372] unparenthesized function argument list definition [370] ::=
argument herald [382]?, function argument definition [373], (argument herald [382], function argument definition [373])*, (argument herald [382], remainder shelf argument definition [378], (argument herald [382], ".", ".", ".")?)?
| argument herald [382], remainder shelf argument definition [378], (argument herald [382], ".", ".", ".")?
| remainder shelf argument definition [378], argument herald [382], ".", ".", "."
[373] function argument definition [367] [371] [372] ::=
expression argument definition [374]
| modifiable shelf argument definition [375]
| read-only shelf argument definition [376]
| write-only shelf argument definition [377]
| converting argument definition [379]
[374] expression argument definition [373] [402] ::= VALUE, type [128], name [454], (OPTIONAL, (INITIAL, "{", expression [228], "}")?)?
[375] modifiable shelf argument definition [373] [402] ::= MODIFIABLE, first-class type [129], name [454], OPTIONAL?
[376] read-only shelf argument definition [373] [402] ::= READ-ONLY, first-class type [129], name [454], OPTIONAL?
[377] write-only shelf argument definition [373] [402] ::= WRITE-ONLY, first-class type [129], name [454], OPTIONAL?
[378] remainder shelf argument definition [371] [372] ::= REMAINDER, first-class type [129], name [454]
[379] converting argument definition [373] ::=
VALUE, "(", ANY, INTO, first-class type [129], ")"
| VALUE, "(", source type name [380], ((OR | "|"), source type name [380])*, INTO, first-class type [129], ")"
A converting argument definition [379] is only allowed as the first argument of an OVERLOADED external prefix function definition [358] or internal prefix function definition [361], as an argument of an OVERLOADED external infix function definition [359] or internal infix function definition [362], or as the argument of an external conversion function definition [360] or internal conversion function definition [363].
[380] source type name [379] ::=
type [128]
| NUMERIC-LITERAL
[381] argument separator [371] [387] [400] [410] ::=
argument herald [382]
| ","
[382] argument herald [372] [381] [388] [389] [401] [411] ::= name [454]
[383] external function binding [358] [359] [360] ::= AS, system-specific function name [466], (IN, FUNCTION-LIBRARY, system-specific library name [467])?
[384] internal function binding [361] [362] [363] ::=
AS, local scope [143]
| ELSEWHERE
[385] value function call [140] [238] [259] [321] [337] [355] ::=
prefix function name [458], parenthesized call arguments [387]
| prefix function name [458], unparenthesized call arguments [388]
[386] void function call [148] [227] ::=
prefix function name [458], parenthesized call arguments [387]
| prefix function name [458], void unparenthesized call arguments [389]
[387] parenthesized call arguments [385] [386] [412] ::= "(", (argument expression [390], (argument separator [381], argument expression [390])*)?, ")"
[388] unparenthesized call arguments [385] [412] ::= (argument herald [382]?, argument primary [391], (argument herald [382], argument primary [391])*)?
[389] void unparenthesized call arguments [386] ::= (argument herald [382]?, argument expression [390], (argument herald [382], argument expression [390])*)?
[390] argument expression [387] [389] ::=
boolean expression [315]
| numeric expression [229]
| string expression [254]
| user-defined type expression [138]
[391] argument primary [139] [237] [258] [320] [388] ::=
numeric primary [238]
| string primary [259]
| boolean primary [321]
| user-defined type primary [140]
[392] set external function association action [148] ::=
SET, external function identification [394], TO, system-specific function name [466]
| SET, FUNCTION-LIBRARY, OF, external function identification [394], TO, system-specific library name [467]
[393] external function association enquiry [259] ::= (FUNCTION-LIBRARY, OF)?, external function identification [394]
[394] external function identification [392] [393] ::=
(EXTERNAL-FUNCTION | EXTERNAL-OUTPUT-FUNCTION), function name [368]
| CREATOR, OF, user-defined type name [137]
The use of EXTERNAL-OUTPUT-FUNCTION is deprecated in favour of EXTERNAL-FUNCTION.
[395] argument test primary [319] ::= shelf item reference [434], (IS | ISNT), SPECIFIED
[396] catch definition [114] ::= (DECLARE | EXPORT | REQUIRE), catch signature [397]
[397] catch signature [396] ::= CATCH, catch name [398], catch argument list definition [399]?
[398] catch name [397] [409] [412] [413] ::= name [454]
[399] catch argument list definition [397] ::=
parenthesized catch argument list definition [400]
| unparenthesized catch argument list definition [401]
[400] parenthesized catch argument list definition [399] ::=
"(", ")"
| "(", catch argument definition [402], (argument separator [381], catch argument definition [402])*, ")"
[401] unparenthesized catch argument list definition [399] ::= argument herald [382]?, catch argument definition [402], (argument herald [382], catch argument definition [402])*
[402] catch argument definition [400] [401] ::=
expression argument definition [374]
| modifiable shelf argument definition [375]
| read-only shelf argument definition [376]
| write-only shelf argument definition [377]
[403] built-in catch invocation [145] ::=
external-exception invocation [404]
| program-error invocation [405]
| markup-start invocation [406]
| markup-end invocation [407]
| markup-point invocation [408]
[404] external-exception invocation [403] ::= #EXTERNAL-EXCEPTION, (IDENTITY, name [454])?, (MESSAGE, name [454])?, (LOCATION, name [454])?
All three arguments to external-exception invocation [404] are strings.
[405] program-error invocation [403] ::= #PROGRAM-ERROR, (CODE, name [454])?, (MESSAGE, name [454])?, (LOCATION, name [454])?
The first argument to program-error invocation [405] is the numeric error code.
[406] markup-start invocation [403] ::= #MARKUP-START, name [454]
The argument to markup-start invocation [406] is the event record instance, of type MARKUP-EVENT.
[407] markup-end invocation [403] ::= #MARKUP-END, name [454]
The argument to markup-end invocation [407] is the event record instance, of type MARKUP-EVENT.
[408] markup-point invocation [403] ::= #MARKUP-POINT, name [454]
The argument to markup-point invocation [408] is the event record instance, of type MARKUP-EVENT.
[409] catch invocation [145] ::=
catch name [398], parenthesized invocation arguments [410]
| catch name [398], unparenthesized invocation arguments [411]
[410] parenthesized invocation arguments [409] ::= "(", (name [454], (argument separator [381], name [454])*)?, ")"
[411] unparenthesized invocation arguments [409] ::= (argument herald [382]?, name [454], (argument herald [382], name [454])*)?
[412] throw invocation [186] ::=
catch name [398], parenthesized call arguments [387]
| catch name [398], unparenthesized call arguments [388]
[413] catch test primary [319] ::= (catch name [398] | #EXTERNAL-EXCEPTION | #PROGRAM-ERROR | #MARKUP-START | #MARKUP-END | #MARKUP-POINT), (IS | ISNT), (CATCHABLE | THROWN)
[414] modifier expression [168] [174] [177] [353] ::=
WITH, modifier literal [416], (WITH, modifier literal [416])*
| WITH, modifier subexpression [415]
[415] modifier subexpression [414] ::= "(", modifier literal [416], ((AND | "&"), modifier literal [416])*, ")"
[416] modifier literal [414] [415] ::= modifier literal for open [417]
[417] modifier literal for open [416] ::=
modifier literal for set [418]
| BINARY-MODE
| BUFFERED
| TEXT-MODE
| UNBUFFERED
[418] modifier literal for set [177] [417] ::=
modifier literal for reopen [419]
| APPEND
[419] modifier literal for reopen [174] [418] ::=
modifier literal for content [420]
| modifier literal for referents [421]
| modifier literal for break-width [422]
[420] modifier literal for content [353] [419] ::=
constant string literal [272]
| BINARY, numeric subexpression [230]
| DOMAIN-FREE
The DOMAIN-FREE modifier is deprecated, and its use has no effect.
[421] modifier literal for referents [111] [419] ::=
REFERENTS-ALLOWED, (DEFAULTING, "{", string expression [254], (",", string expression [254])?, "}")?
| REFERENTS-DISPLAYED
| REFERENTS-NOT-ALLOWED
[422] modifier literal for break-width [419] ::= BREAK-WIDTH, numeric subexpression [230], (number [241] | TO, numeric subexpression [230])?
[423] global shelf definition [114] ::= EXPORT?, global shelf class [425], shelf declaration [430], ((AND | "&"), shelf declaration [430])*
[424] require shelf definition [114] ::= REQUIRE, global shelf class [425], first-class type [129], shelf name [439]
[425] global shelf class [423] [424] ::=
CONSTANT
| DOMAIN-BOUND?, GLOBAL
[426] local declaration [143] ::=
global shelf save declaration [427]
| groups save declaration [428]
| local shelf declaration [429]
[427] global shelf save declaration [426] ::= (SAVE | SAVE-CLEAR), shelf name [439], ((AND | "&"), shelf name [439])*
[428] groups save declaration [426] ::= SAVE, GROUPS
[429] local shelf declaration [426] ::= LOCAL, shelf declaration [430], ((AND | "&"), shelf declaration [430])*
[430] shelf declaration [135] [423] [429] [433] ::= first-class type [129], shelf name [439], (fixed-size shelf declaration [432] | variable-size shelf declaration [431])?, (INITIAL, shelf literal [433])?
[431] variable-size shelf declaration [430] ::= VARIABLE, (TO, constant numeric expression [242])?, (INITIAL-SIZE, constant numeric expression [242])?
[432] fixed-size shelf declaration [430] ::= SIZE, constant numeric expression [242]
[433] shelf literal [195] [212] [430] [435] ::= "{", (expression [228] | UNATTACHED), "}"
When a shelf literal [433] appears in a shelf declaration [430], the number of initializers in expression [228] must match the declared size of the shelf, if any.
When a shelf literal [433] appears in a weak context, it must be preceded by a first-class type [129] herald.
The special literal UNATTACHED can only be used in the initializer for a STREAM shelf.
[434] shelf item reference [140] [149] [152] [156] [157] [158] [161] [163] [168] [171] [172] [173] [174] [175] [178] [186] [195] [238] [239] [259] [261] [279] [299] [301] [305] [310] [312] [313] [321] [349] [351] [353] [395] ::=
shelf reference [435], indexer [441]?
| NEW, new shelf item reference [436]
| NEW, "?", guarded new shelf item reference [437]
[435] shelf reference [151] [154] [155] [212] [240] [434] [436] [437] [445] ::=
shelf name [439]
| shelf literal [433]
[436] new shelf item reference [165] [434] ::= shelf reference [435], key indexer [443]?, ((AFTER | BEFORE), indexer [441])?
[437] guarded new shelf item reference [165] [434] ::= shelf reference [435], key indexer [443]
[438] shelf alias [195] [203] [207] [212] ::= name [454]
[439] shelf name [424] [427] [430] [435] ::=
name [454]
| built-in shelf name [440]
[440] built-in shelf name [439] ::=
built-in read-only numeric shelf name [253]
| built-in read-only markup source shelf name [35]
| built-in read-only markup-event shelf name [36]
| built-in read-only string source shelf name [295]
| built-in read-only stream shelf name [293]
| built-in read-write stream shelf name [294]
| built-in write-only stream shelf name [292]
| built-in read-only switch shelf name [330]
[441] indexer [70] [194] [260] [434] [436] ::=
item indexer [442]
| key indexer [443]
| lastmost indexer [444]
[442] item indexer [66] [261] [441] [445] ::= "[", numeric expression [229], "]"
[443] key indexer [224] [226] [239] [436] [437] [441] ::= "{", string expression [254], "}"
[444] lastmost indexer [441] ::= LASTMOST
[445] shelf test primary [319] ::=
shelf reference [435], item indexer [442]?, (IS | ISNT), KEYED
| shelf reference [435], (HAS | HASNT), KEY, string primary [259]
| REFERENTS, (HAS | HASNT), KEY, string primary [259]
[446] macro definition [113] ::= MACRO, macro name [447], parameter template [448]*, IS, replacement template item [453]*, MACRO-END
[447] macro name [446] ::= macro token [450]+
[448] parameter template [446] ::=
ARG, macro parameter [449], macro token [450]+
| TOKEN, macro parameter [449], macro token [450]*
[449] macro parameter [448] [450] [453] ::=
delimiter token [451]
| name [454]
[450] macro token [447] [448] ::= LITERAL?, macro parameter [449]
[451] delimiter token [449] [453] ::=
infix function name [457]
| delimiter character [452]
[452] delimiter character [451] ::= "(" | ")" | "{" | "}" | "[" | "]" | "`" | ":" | "."
[453] replacement template item [446] ::=
macro parameter [449]
| LITERAL?, string literal [263]
| LITERAL?, delimiter token [451]
| LITERAL?, name [454]
| LITERAL?, number [241]
[454] name [34] [43] [50] [96] [100] [101] [102] [103] [104] [137] [307] [336] [366] [368] [374] [375] [376] [377] [378] [382] [398] [404] [405] [406] [407] [408] [410] [411] [438] [439] [449] [453] [457] [458] ::= (letter [455] | user-defined name character [468]), (digit [456] | letter [455] | user-defined name character [468] | "." | "-" | "_")* | "#", constant string literal [272]
[455] letter [454] ::= "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"
[456] digit [241] [454] ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
[457] infix function name [366] [451] [462] ::= infix function start character [459], function following character [461]* | name [454]
[458] prefix function name [365] [385] [386] ::= prefix function start character [460], function following character [461]* | name [454]
[459] infix function start character [457] ::= function following character [461] | prefix function start character [460]
[460] prefix function start character [458] [459] ::= "!" | "-" | "+" | "%" | "?" | "/" | "~" | "$" | "\" | "@" | "^" | ","
[461] function following character [457] [458] [459] ::= "*" | "=" | "|" | "<" | ">" | "&"
[462] user-defined infix function name [139] [237] [258] [320] ::= Any infix function name [457] defined in a program rather than by OmniMark, and which are not overloadings of operators defined by OmniMark to be overloadable.
[463] escape [276] [277] [278] [299] [300] [301] [302] [303] [304] [305] [306] [307] [308] [309] [310] [311] [312] [313] [464] ::= The escape [463] character is defined by an escape declaration [108]. If there is no escape declaration [108], the escape character is "%".
[464] unescaped character [265] [266] [274] [275] ::= An unescaped character [464] is any character that is not a "'", a """, a control character, or escape [463].
[465] describing number [278] ::= A describing number [465] is a number in the base indicated by the number [241] non-terminal in the described substring [278] production. The base can range from two to 36; the digits in each describing number [465] must be of the appropriate base, using letters (upper- or lower-case) for digit values over nine.
[466] system-specific function name [132] [383] [392] ::= A system-specific function name [466] is implemented as a constant string expression [267].
[467] system-specific library name [132] [383] [392] ::= A system-specific library name [467] is implemented as a constant string expression [267].
[468] user-defined name character [454] ::= A user-defined name character [468] is any character that appears in a LETTERS declaration that is not explicitly excluded from being a name character.
Copyright © Stilo Corporation, 2003-2010. All rights reserved.
ETR62, 2010/8/30