OmniMark V6's Grammar

1. OmniMark V6's Grammar

Detailed Table of Contents

1.1 Declarations

[1] program =
program type [2]?, herald use [3]?, escape declaration [4]?, default io declaration [6]?, preamble declaration [7]*, group contents [10], identified group [8]*

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

[3] herald use [1] =
DECLARE, HERALDED-NAMES

[4] escape declaration [1] [5] =
ESCAPE, constant string expression [284]

[5] escape [249] [250] [251] [252] [255] [256] [257] [258] [259] [260] [261] [262] [263] [264] [265] [266] [267] [268] [269] [271] =
the character defined to be the escape character by an escape declaration [4], or if there is no escape declaration [4], %

[6] default io declaration [1] =
DECLARE, NO-DEFAULT-IO

[7] preamble declaration [1] =
common declaration [12] |
include [31] |
naming declaration [15]

[8] identified group [1] =
GROUP, group identification [9], group contents [10] |
GROUP, "(", group identification [9], ")", group contents [10]

[9] group identification [8] =
group name set [456] |
#IMPLIED

[10] group contents [1] [8] =
(program-only declaration [11] | common declaration [12] | rule [14] | include [31])*

[11] program-only declaration [10] =
main mode declaration [338] |
main output referent declaration [339] |
main buffering declaration [340]

[12] common declaration [7] [10] =
binary input declaration [400] |
binary output declaration [401] |
catch definition [13] |
delimiter declaration [273] |
external function definition [47] |
external overloaded prefix function definition [49] |
external overloaded infix function definition [48] |
global shelf declaration [25] |
hardwired conversion operator definition [46] |
library declaration [33] |
opaque type declaration [38] |
macro definition [458] |
output break declaration [334] |
plain function predefinition [43] |
overloaded prefix function predefinition [45] |
overloaded infix function predefinition [44] |
symbol declaration [272] |
include guard declaration [32]

[13] catch definition [12] =
DECLARE, CATCH, catch name [226]

[14] rule [10] =
main process rule [34] |
element domain rule [133] |
find domain rule [204] |
line breaking rule [335] |
error rule [218]

1.1.1 Naming Declarations

[15] naming declaration [7] =
entity namecase declaration [16] |
data letters declaration [18] |
general namecase declaration [17] |
name letters declaration [19] |
newline declaration [20]

[16] entity namecase declaration [15] =
NAMECASE, ENTITY, (YES | NO)

[17] general namecase declaration [15] =
NAMECASE, GENERAL, (YES | NO)

[18] data letters declaration [15] =
DECLARE, DATA-LETTERS, constant string expression [284], constant string expression [284]? |
LETTERS, constant string expression [284], constant string expression [284]?

[19] name letters declaration [15] =
DECLARE, NAME-LETTERS, constant string expression [284], constant string expression [284]

[20] newline declaration [15] =
NEWLINE, constant string expression [284]

[21] name [32] [39] [46] [58] [59] [103] [104] [105] [111] [116] [128] [136] [148] [161] [182] [203] [226] [349] [457] [461] [462] [464] =
(letter [22] | user-defined name character [24]), (letter [22] | user-defined name character [24] | digit [23] | "." | "-" | "_")*

[22] letter [21] =
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

[23] digit [21] [393] =
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9

[24] user-defined name character [21] =
Any character used in the LETTERS declaration that is not explicitly excluded from being a name character.

1.1.2 Global Declarations

[25] global shelf declaration [12] =
GLOBAL, typed shelf identifier [421], ((AND | "&"), typed shelf identifier [421])*

1.1.3 Local Declarations

[26] local declaration [223] =
save declaration [27] |
save and clear declaration [29] |
local shelf declaration [30]

[27] save declaration [26] =
SAVE, savable object [28], ((AND | "&"), savable object [28])*

[28] savable object [27] =
mutable shelf identifier [426] |
GROUPS

[29] save and clear declaration [26] =
SAVE-CLEAR, mutable shelf identifier [426], ((AND | "&"), mutable shelf identifier [426])*

[30] local shelf declaration [26] =
LOCAL, typed shelf identifier [421], ((AND | "&"), typed shelf identifier [421])*

1.1.4 Including Source Files

[31] include [7] [10] =
INCLUDE, string [245]

[32] include guard declaration [12] =
INCLUDE-GUARD, (name [21] | string [245])

1.1.5 Accessing Text Files

[33] library declaration [12] =
LIBRARY, (constant string expression [284], constant string expression [284])+


1.2 Main Process Rules

[34] main process rule [14] =
process end rule [36] |
process rule [37] |
process start rule [35]

[35] process start rule [34] =
PROCESS-START, condition [230]?, local scope [223]

[36] process end rule [34] =
PROCESS-END, condition [230]?, local scope [223]

[37] process rule [34] =
PROCESS, condition [230]?, local scope [223]


1.3 Opaque Types

[38] opaque type declaration [12] =
DECLARE, OPAQUE, opaque type name [39], CREATED, BY, system-specific function name [50], (IN, FUNCTION-LIBRARY, system-specific function library name [51])?

[39] opaque type name [38] [46] [52] [61] [64] [72] [87] [89] [90] [92] [410] [411] [425] [426] [427] [439] =
name [21]


1.4 Functions

1.4.1 Function Definitions

[40] plain function definition =
DEFINE, function value result type [52]?, FUNCTION, function name [58], function call prototype [54], AS, local scope [223]

[41] overloaded infix function definition =
DEFINE, OVERLOADED, function value result type [52], INFIX-FUNCTION, function argument definition [60], function name [58], function argument definition [60], AS, local scope [223]

[42] overloaded prefix function definition =
DEFINE, OVERLOADED, function value result type [52], PREFIX-FUNCTION, function name [58], function argument definition [60], AS, local scope [223]

[43] plain function predefinition [12] =
DEFINE, function value result type [52]?, FUNCTION, function name [58], function call prototype [54], ELSEWHERE

[44] overloaded infix function predefinition [12] =
DEFINE, function value result type [52], INFIX-FUNCTION, function argument definition [60], function name [58], function argument definition [60], ELSEWHERE

[45] overloaded prefix function predefinition [12] =
DEFINE, function value result type [52], PREFIX-FUNCTION, function name [58], function argument definition [60], ELSEWHERE

[46] hardwired conversion operator definition [12] =
DEFINE, EXTERNAL, opaque type name [39], CONVERSION-FUNCTION, VALUE, ("(", NUMERIC-LITERAL, "|", STREAM, INTO, STREAM, ")" | COUNTER), name [21], AS, system-specific function name [50], (IN, FUNCTION-LIBRARY, system-specific function library name [51])?

[47] external function definition [12] =
DEFINE, EXTERNAL, (function value result type [52] | function target result type [53] | SOURCE)?, FUNCTION, function name [58], function call prototype [54], AS, system-specific function name [50], (IN, FUNCTION-LIBRARY, system-specific function library name [51])?

[48] external overloaded infix function definition [12] =
DEFINE, OVERLOADED, EXTERNAL, function value result type [52], INFIX-FUNCTION, function argument definition [60], function name [58], function argument definition [60], AS, system-specific function name [50], (IN, FUNCTION-LIBRARY, system-specific function library name [51])?

[49] external overloaded prefix function definition [12] =
DEFINE, OVERLOADED, EXTERNAL, function value result type [52], PREFIX-FUNCTION, function name [58], function argument definition [60], AS, system-specific function name [50], (IN, FUNCTION-LIBRARY, system-specific function library name [51])?

[50] system-specific function name [38] [46] [47] [48] [49] =
constant string expression [284]

[51] system-specific function library name [38] [46] [47] [48] [49] [89] =
constant string expression [284]

[52] function value result type [40] [41] [42] [43] [44] [45] [47] [48] [49] =
INTEGER |
INT32 |
COUNTER |
STREAM |
SWITCH |
opaque type name [39]

[53] function target result type [47] =
OUTPUT

[54] function call prototype [40] [43] [47] =
parenthesized argument set definition [56]

[55] actual function argument separator [56] [57] [81] =
"," |
function argument separator [59]

[56] parenthesized argument set definition [54] =
"(", ")" |
"(", function argument definition [60], (actual function argument separator [55], function argument definition [60])*, (actual function argument separator [55], remainder argument definition [64], (actual function argument separator [55], ".", ".", ".")?)?, ")" |
"(", remainder argument definition [64], actual function argument separator [55], ".", ".", ".", ")"

[57] unparenthesized argument set definition =
(function argument separator [59]?, function argument definition [60], (actual function argument separator [55], function argument definition [60])*, (actual function argument separator [55], remainder argument definition [64], (function argument separator [59], ".", ".", ".")?)?)? |
function argument separator [59], remainder argument definition [64], (function argument separator [59], ".", ".", ".")? |
remainder argument definition [64], function argument separator [59], ".", ".", "."

[58] function name [40] [41] [42] [43] [44] [45] [47] [48] [49] [81] [82] [91] =
name [21]

[59] function argument separator [55] [57] [82] =
name [21]

[60] function argument definition [41] [42] [44] [45] [48] [49] [56] [57] =
expression argument definition [61] |
modifiable shelf argument definition [62] |
read-only shelf argument definition [63]

[61] expression argument definition [60] =
VALUE, INTEGER, counter name [103], (OPTIONAL, (INITIAL, "{", constant numeric expression [402], "}")?)? |
VALUE, INT32, counter name [103], (OPTIONAL, (INITIAL, "{", constant numeric expression [402], "}")?)? |
VALUE, COUNTER, counter name [103], (OPTIONAL, (INITIAL, "{", constant numeric expression [402], "}")?)? |
VALUE, SWITCH, switch name [111], (OPTIONAL, (INITIAL, "{", constant test [372], "}")?)? |
VALUE, STREAM, stream name [116], (OPTIONAL, (INITIAL, "{", constant string expression [284], "}")?)? |
VALUE, opaque type name [39], opaque thing name [128], OPTIONAL?

[62] modifiable shelf argument definition [60] =
MODIFIABLE, user shelf identifier [427], OPTIONAL?

[63] read-only shelf argument definition [60] =
READ-ONLY, user shelf identifier [427], OPTIONAL?

[64] remainder argument definition [56] [57] =
REMAINDER, INTEGER, counter name [103] |
REMAINDER, INT32, counter name [103] |
REMAINDER, COUNTER, counter name [103] |
REMAINDER, SWITCH, switch name [111] |
REMAINDER, STREAM, stream name [116] |
REMAINDER, opaque type name [39], opaque thing name [128]

1.4.2 Function Body Actions

[65] return action [229] =
void return action [66] |
counter return action [67] |
buffer return action [68] |
switch return action [69] |
opaque type return action [70]

[66] void return action [65] =
RETURN

[67] counter return action [65] =
RETURN, numeric expression [384]

[68] buffer return action [65] =
RETURN, string expression [274]

[69] switch return action [65] =
RETURN, test [231] |
SUCCEED |
FAIL

[70] opaque type return action [65] =
RETURN, opaque type expression [409]

[71] argument test primary [234] =
argument shelf identifier [72], (IS | ISNT), SPECIFIED

[72] argument shelf identifier [71] =
COUNTER?, counter name [103] |
STREAM?, stream name [116] |
SWITCH?, switch name [111] |
opaque type name [39]?, opaque thing name [128]

1.4.3 Function Calls

[73] void function call [101] [229] =
function call [80]

[74] counter function call =
function call [80]

[75] switch function call =
function call [80]

[76] buffer function call [278] =
function call [80]

[77] source function call [278] =
function call [80]

[78] output function call [303] [314] =
function call [80]

[79] opaque type function call [410] =
function call [80]

[80] function call [73] [74] [75] [76] [77] [78] [79] [235] [388] =
parenthesized function call [81]

[81] parenthesized function call [80] =
function name [58], "(", (function argument expression [83], (actual function argument separator [55], function argument expression [83])*)?, ")"

[82] unparenthesized function call =
function name [58], (function argument separator [59]?, function argument primary [85], (function argument separator [59], function argument primary [85])*)?

[83] function argument expression [81] =
function argument value expression [84] |
function argument shelf reference [87]

[84] function argument value expression [83] =
numeric expression [384] |
string expression [274] |
test [231] |
opaque type expression [409]

[85] function argument primary [82] =
function argument value primary [86] |
function argument shelf reference [87]

[86] function argument value primary [85] =
numeric primary [388] |
string primary [277] |
test secondary [235] |
opaque type primary [410]

[87] function argument shelf reference [83] [85] [87] =
COUNTER?, valued counter shelf name [107], indexer [424]? |
SWITCH?, valued switch shelf name [113], indexer [424]? |
STREAM?, valued stream shelf name [118], indexer [424]? |
opaque type name [39]?, valued opaque shelf name [130], indexer [424]? |
"(", function argument shelf reference [87], ")"

1.4.4 External Function Associations

[88] set external function association action [229] =
SET, external function association enquiry [91], TO, string expression [274]

[89] set opaque creator function association action [229] =
SET, CREATOR, OF, opaque type name [39], TO, string expression [274], (IN, FUNCTION-LIBRARY, system-specific function library name [51])?

[90] set opaque creator function library association action [229] =
SET, FUNCTION-LIBRARY, OF, CREATOR, OF, opaque type name [39], TO, string expression [274]

[91] external function association enquiry [88] [279] =
(FUNCTION-LIBRARY, OF)?, (EXTERNAL-FUNCTION | EXTERNAL-OUTPUT-FUNCTION), function name [58]

[92] opaque creator function association enquiry [279] =
(FUNCTION-LIBRARY, OF)?, CREATOR, OF, opaque type name [39]

1.4.5 SGML Parsing Actions

[93] markup parse action [229] =
sgml parse action [94] |
xml parse action [96]

1.4.5.1 SGML Parse

[94] sgml parse action [93] =
DO, SGML-PARSE, sgml parse type [95], SCAN, sgml parse scanning source [101], local scope [223], DONE

[95] sgml parse type [94] =
(DOCUMENT, (WITH, ID-CHECKING, constant test [372])?, (WITH, UTF-8, test [231])?, (CREATING, dtd pool item identifier [98])? | SUBDOCUMENT, (WITH, ID-CHECKING, constant test [372])?, (WITH, UTF-8, test [231])?, (CREATING, dtd pool item identifier [98])? | INSTANCE, (WITH, DOCUMENT-ELEMENT, fragment element name string [100])?, WITH, (dtd pool item identifier [98] | CURRENT, (DTD | SGML-DTD)), (WITH, ID-CHECKING, constant test [372])?, (WITH, UTF-8, test [231])?), WITH

[96] xml parse action [93] =
DO, XML-PARSE, xml parse type [97], SCAN, sgml parse scanning source [101], local scope [223], DONE

[97] xml parse type [96] =
(DOCUMENT, (WITH, ID-CHECKING, constant test [372])?, (WITH, UTF-8, test [231])?, (CREATING, xml dtd pool item identifier [99])? | INSTANCE, (WITH, DOCUMENT-ELEMENT, fragment element name string [100])?, WITH, (xml dtd pool item identifier [99] | CURRENT, XML-DTD), (WITH, ID-CHECKING, constant test [372])?, (WITH, UTF-8, test [231])?), WITH

[98] dtd pool item identifier [95] =
(DTDS | SGML-DTDS), indexer [424]

[99] xml dtd pool item identifier [97] =
XML-DTDS, indexer [424]

1.4.5.2 SGML Parse Support

[100] fragment element name string [95] [97] =
string expression [274]

[101] sgml parse scanning source [94] [96] =
INPUT, void function call [73] |
string expression [274]

[102] dtd pool test primary [234] =
(DTDS | SGML-DTDS | XML-DTDS), (HAS | HASNT), (KEY | "^"), string primary [277]


1.5 Names

1.5.1 Counters

[103] counter name [61] [64] [72] [106] [107] [109] [427] [439] [448] [452] =
name [21]

[104] integer name [427] [444] =
name [21]

[105] bitint name [427] =
name [21]

[106] settable counter shelf name [380] [381] [382] [383] =
counter name [103]

[107] valued counter shelf name [87] [390] [425] [439] [452] =
counter name [103] |
built-in read-only counter shelf name [110]

[108] unquoted counter name [255] [256] [258] [260] [264] =
unquoted name [270] |
built-in read-only counter shelf name [110]

[109] mutable counter shelf name [383] [426] =
counter name [103]

[110] built-in read-only counter shelf name [107] [108] =
#ITEM |
#ERROR-CODE |
#CLASS |
#LINE-NUMBER |
#SGML-ERROR-COUNT |
#SGML-WARNING-COUNT |
#SGML-ERROR-TOTAL |
#SGML-WARNING-TOTAL |
#MARKUP-ERROR-COUNT |
#MARKUP-WARNING-COUNT |
#MARKUP-ERROR-TOTAL |
#MARKUP-WARNING-TOTAL

1.5.2 Switches

[111] switch name [61] [64] [72] [112] [113] [114] [427] [439] [452] =
name [21]

[112] settable switch shelf name [366] [368] =
switch name [111]

[113] valued switch shelf name [87] [425] [439] [452] =
switch name [111] |
built-in read-only switch shelf name [115]

[114] mutable switch shelf name [366] [426] =
switch name [111]

[115] built-in read-only switch shelf name [113] =
#FIRST |
#LAST

1.5.3 Streams

[116] stream name [61] [64] [72] [117] [118] [120] [121] [124] [427] [439] [452] =
name [21]

[117] settable stream shelf name [300] [314] =
stream name [116] |
built-in read-write stream shelf name [127]

[118] valued stream shelf name [87] [281] [425] [439] [452] =
stream name [116] |
built-in read-only stream shelf name [125] |
built-in read-write stream shelf name [127]

[119] unquoted stream name [259] =
unquoted name [270] |
built-in read-only stream shelf name [125] |
built-in read-write stream shelf name [127]

[120] writable stream shelf name [333] =
stream name [116] |
built-in read-write stream shelf name [127] |
built-in output stream shelf name [126]

[121] settable source shelf name =
stream name [116]

[122] valued source shelf name [214] =
built-in read-only source shelf name [123]

[123] built-in read-only source shelf name [122] =
#PROCESS-INPUT |
#MAIN-INPUT

[124] mutable stream shelf name [314] [426] =
stream name [116] |
built-in read-write stream shelf name [127]

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

[126] built-in output stream shelf name [120] =
#CONSOLE |
#ERROR |
#SUPPRESS |
#MAIN-OUTPUT |
OUTPUT |
#SGML |
#MARKUP-PARSER |
SGML

[127] built-in read-write stream shelf name [117] [118] [119] [120] [124] =
#LIBPATH |
#LIBRARY |
#LIBVALUE

1.5.4 Opaque Things

[128] opaque thing name [61] [64] [72] [132] [410] [427] [439] =
name [21]

[129] settable opaque shelf name [411] =
qualified opaque thing name [132]

[130] valued opaque shelf name [87] [425] [439] =
qualified opaque thing name [132]

[131] mutable opaque shelf name [411] [426] =
qualified opaque thing name [132]

[132] qualified opaque thing name [129] [130] [131] =
opaque thing name [128]


1.6 The Domains

1.6.1 The Element Domain

[133] element domain rule [14] =
data content rule [145] |
document end rule [143] |
document start rule [137] |
dtd end rule [140] |
dtd start rule [139] |
element rule [134] |
epilog start rule [142] |
external data entity rule [146] |
invalid data rule [155] |
marked section rule [153] |
markup note rule [156] |
markup wrapper rule [157] |
processing instruction rule [150] |
prolog end rule [141] |
prolog in error rule [144] |
sgml comment processing rule [152] |
sgml declaration end rule [138] |
translation rule [149]

[134] element rule [133] =
ELEMENT, (gi set [135] | #IMPLIED), condition [230]?, local scope [223]

[135] gi set [134] [159] [165] =
gi [136] |
"(", gi [136], ((OR | "|"), gi [136])*, ")"

[136] gi [135] [167] [172] [441] =
name [21] |
string [245]

[137] document start rule [133] =
DOCUMENT-START, condition [230]?, local scope [223]

[138] sgml declaration end rule [133] =
SGML-DECLARATION-END, condition [230]?, local scope [223]

[139] dtd start rule [133] =
DTD-START, condition [230]?, local scope [223]

[140] dtd end rule [133] =
DTD-END, condition [230]?, local scope [223]

[141] prolog end rule [133] =
PROLOG-END, condition [230]?, local scope [223]

[142] epilog start rule [133] =
EPILOG-START, condition [230]?, local scope [223]

[143] document end rule [133] =
DOCUMENT-END, condition [230]?, local scope [223]

[144] prolog in error rule [133] =
PROLOG-IN-ERROR, condition [230]?, local scope [223]

[145] data content rule [133] =
DATA-CONTENT, condition [230]?, local scope [223]

[146] external data entity rule [133] =
(EXTERNAL-DATA-ENTITY | EXTERNAL-ENTITY), (entity name set [147] | #IMPLIED), condition [230]?, local scope [223]

[147] entity name set [146] =
entity name [148] |
"(", entity name [148], ((OR | "|"), entity name [148])*, ")"

[148] entity name [147] [210] =
name [21] |
string [245]

[149] translation rule [133] =
TRANSLATE, pattern [343], condition [230]?, local scope [223]

[150] processing instruction rule [133] =
PROCESSING-INSTRUCTION, processing instruction matcher [151], condition [230]?, local scope [223]

[151] processing instruction matcher [150] =
subpattern [344] |
NAMED, subpattern [344], (VALUED, subpattern [344])? |
VALUED, subpattern [344], (NAMED, subpattern [344])?

[152] sgml comment processing rule [133] =
(SGML-COMMENT | MARKUP-COMMENT), condition [230]?, local scope [223]

[153] marked section rule [133] =
MARKED-SECTION, marked section type [154], condition [230]?, local scope [223]

[154] marked section type [153] =
INCLUDE-START |
INCLUDE-END |
RCDATA |
CDATA |
IGNORE

[155] invalid data rule [133] =
INVALID-DATA, condition [230]?, local scope [223]

[156] markup note rule [133] =
MARKUP-NOTE, (sub-category name [158] | #IMPLIED), condition [230]?, local scope [223]

[157] markup wrapper rule [133] =
MARKUP-WRAPPER, (sub-category name [158] | #IMPLIED), condition [230]?, local scope [223]

[158] sub-category name [156] [157] =
DATATYPE |
NAMESPACE |
XMLNS

1.6.1.1 Element Tests

[159] element test primary [234] =
anonymous element selector [164], (IS | ISNT), gi set [135] |
CONTENT, element identifier [162]?, (IS | ISNT), content type set [169] |
LAST, PROPER?, CONTENT, ancestry qualifier [163]?, (IS | ISNT), gi or data set [171] |
LAST, PROPER?, SUBELEMENT, ancestry qualifier [163]?, (IS | ISNT), gi set [135] |
PREVIOUS, ancestry qualifier [163]?, (IS | ISNT), gi set [135] |
STATUS, (OF, LAST, SUBELEMENT)?, ancestry qualifier [163]?, (IS | ISNT), (PROPER | INCLUSION) |
short reference map selector [191], (IS | ISNT), short reference map name set [160]

[160] short reference map name set [159] =
short reference map name [161] |
"(", short reference map name [161], ((OR | "|"), short reference map name [161])*, ")"

[161] short reference map name [160] =
name [21] |
string [245] |
#EMPTY |
#NONE

[162] element identifier [159] [176] [179] [191] [453] =
ancestry qualifier [163]

[163] ancestry qualifier [159] [162] [164] [165] [168] [390] [391] [439] =
OF, specific element selector [165]

[164] anonymous element selector [159] =
element selection class [166], ancestry qualifier [163]? |
aliased element selector [167] |
constrained element selector [168]

[165] specific element selector [163] [279] =
element selection class [166], gi set [135], ancestry qualifier [163]? |
aliased element selector [167] |
constrained element selector [168]

[166] element selection class [164] [165] =
OPEN, ELEMENT |
ANCESTOR |
PREPARENT

[167] aliased element selector [164] [165] =
CURRENT, ELEMENT, gi [136]

[168] constrained element selector [164] [165] =
DOCTYPE |
ELEMENT, ancestry qualifier [163]? |
PARENT, ancestry qualifier [163]?

[169] content type set [159] =
content type [170] |
"(", content type [170], ((OR | "|"), content type [170])*, ")"

[170] content type [169] =
ELEMENT |
MIXED |
ANY |
EMPTY |
CDATA |
RCDATA |
CONREF

[171] gi or data set [159] =
gi or data [172] |
"(", gi or data [172], ((OR | "|"), gi or data [172])*, ")"

[172] gi or data [171] =
gi [136] |
#DATA

1.6.1.2 Attribute Tests

[173] attribute test primary [234] =
qualified attribute identifier [175], (IS | ISNT), attribute type set [183]

[174] qualified attribute part identifier [176] [177] [179] [180] [188] [189] [279] [453] =
simple qualified attribute identifier [176], ((ITEM | "@"), numeric primary [388])? |
complex qualified attribute identifier [177]

[175] qualified attribute identifier [173] [283] [391] [439] [453] =
simple qualified attribute identifier [176] |
complex qualified attribute identifier [177]

[176] simple qualified attribute identifier [174] [175] [451] =
ATTRIBUTE, attribute name [182], element identifier [162]? |
DATA-ATTRIBUTE, attribute name [182] |
DATA-ATTRIBUTE, attribute name [182], OF, "(", qualified attribute part identifier [174], ")"

[177] complex qualified attribute identifier [174] [175] =
simple qualified attribute set identifier [179], indexer [424] |
DATA-ATTRIBUTE, attribute name [182], OF, qualified attribute part identifier [174]

[178] qualified attribute set identifier [391] [428] [439] =
simple qualified attribute set identifier [179] |
complex qualified attribute set identifier [180]

[179] simple qualified attribute set identifier [177] [178] [392] =
attribute subset specifier [181]?, ATTRIBUTES, element identifier [162]? |
attribute subset specifier [181]?, DATA-ATTRIBUTES |
attribute subset specifier [181]?, DATA-ATTRIBUTES, OF, "(", qualified attribute part identifier [174], ")"

[180] complex qualified attribute set identifier [178] =
attribute subset specifier [181]?, DATA-ATTRIBUTES, OF, qualified attribute part identifier [174]

[181] attribute subset specifier [179] [180] =
SPECIFIED |
NON-IMPLIED

[182] attribute name [176] [177] [440] [453] =
name [21] |
string [245]

[183] attribute type set [173] =
attribute type [184] |
"(", attribute type [184], ((OR | "|"), attribute type [184])*, ")" |
"(", attribute type [184], ((AND | "&"), attribute type [184])*, ")"

[184] attribute type [183] =
attribute specification type [185] |
attribute declaration type [186] |
attribute default type [187]

[185] attribute specification type [184] =
SPECIFIED |
DEFAULTED |
IMPLIED

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

[187] attribute default type [184] =
DECLARED-IMPLIED |
DECLARED-REQUIRED |
DECLARED-FIXED |
DECLARED-CONREF |
DECLARED-DEFAULTED |
DECLARED-CURRENT

1.6.1.3 Entity and Notation Tests

[188] entity test primary [234] =
ENTITY, (IS | ISNT), entity category set [192] |
qualified attribute part identifier [174], (IS | ISNT), entity category set [192] |
NOTATION, (OF, entity selector [189])?, (IS | ISNT), notation category set [194] |
NOTATION, (OF, entity selector [189])?, equivalence comparer [237], notation name set [202]

[189] entity selector [188] [190] =
ENTITY |
qualified attribute part identifier [174]

[190] notation selector =
NOTATION, (OF, entity selector [189])?

[191] short reference map selector [159] =
USEMAP, element identifier [162]?

[192] entity category set [188] =
entity category [193] |
"(", entity category [193], ((AND | "&"), entity category [193])*, ")" |
"(", entity category [193], ((OR | "|"), entity category [193])*, ")"

[193] entity category [192] =
external identifier type [196] |
entity type [197] |
entity class [198] |
entity scope [201] |
default entity type [199] |
anonymous entity type [200]

[194] notation category set [188] =
notation category [195]

[195] notation category [194] =
external identifier type [196]

[196] external identifier type [193] [195] =
PUBLIC |
SYSTEM |
IN-LIBRARY

[197] entity type [193] =
NDATA-ENTITY |
CDATA-ENTITY |
SDATA-ENTITY |
SUBDOC-ENTITY

[198] entity class [193] =
GENERAL |
PARAMETER

[199] default entity type [193] =
DEFAULT-ENTITY

[200] anonymous entity type [193] [210] [211] =
#CHARSET |
#CAPACITY |
#SYNTAX |
#DTD |
#DOCUMENT

[201] entity scope [193] =
INTERNAL |
EXTERNAL

[202] notation name set [188] =
notation name [203] |
"(", notation name [203], ((OR | "|"), notation name [203])*, ")"

[203] notation name [202] =
name [21] |
string [245]

1.6.2 The Find Domain

[204] find domain rule [14] =
find rule [205] |
find end rule [207] |
find start rule [206] |
external text entity rule [208]

[205] find rule [204] =
FIND, NULL?, pattern [343], condition [230]?, local scope [223]

[206] find start rule [204] =
FIND-START, condition [230]?, local scope [223]

[207] find end rule [204] =
FIND-END, condition [230]?, local scope [223]

[208] external text entity rule [204] =
EXTERNAL-TEXT-ENTITY, (extended entity name set [209] | implied entity type set [211]), condition [230]?, local scope [223]

[209] extended entity name set [208] =
extended entity name [210] |
"(", extended entity name [210], ((OR | "|"), extended entity name [210])*, ")"

[210] extended entity name [209] =
entity name [148] |
anonymous entity type [200]

[211] implied entity type set [208] =
#IMPLIED |
"(", (anonymous entity type [200], (OR | "|"))*, #IMPLIED, ((OR | "|"), anonymous entity type [200])*, ")"

1.6.2.1 Submitting and Testing

[212] submit action [229] =
SUBMIT, string expression [274]

[213] identified scanning source [278] =
named source identifier [214]

[214] named source identifier [213] =
SOURCE, valued source shelf name [122], indexer [424]?

[215] source test primary [234] =
FILE, string primary [277], EXISTS |
FILE, string primary [277], (IS | ISNT), file info enquiry set [216] |
#CURRENT-INPUT, (IS | ISNT), ATTACHED

[216] file info enquiry set [215] =
file info enquiry [217] |
"(", file info enquiry [217], ((AND | "&"), file info enquiry [217])*, ")"

[217] file info enquiry [216] =
READABLE |
WRITABLE |
FILE |
DIRECTORY

1.6.3 Exceptions

[218] error rule [14] =
(SGML-ERROR | MARKUP-ERROR), condition [230]?, LOG?, local scope [223]

[219] halt action [229] =
(HALT | HALT-EVERYTHING), (WITH, numeric expression [384])?

[220] test system action [229] =
TEST-SYSTEM, (WITH, string expression [274])?

[221] throw action [229] =
THROW, catch name [226] |
RETHROW

[222] catch test primary [234] =
catch name [226], (IS | ISNT), (CATCHABLE | THROWN)


1.7 Data and Operations on Data

1.7.1 Actions and Tests

[223] local scope [35] [36] [37] [40] [41] [42] [94] [96] [134] [137] [138] [139] [140] [141] [142] [143] [144] [145] [146] [149] [150] [152] [153] [155] [156] [157] [205] [206] [207] [208] [218] [429] [430] [434] [436] [437] [438] [442] [448] =
local declaration [26]*, action [227]*, always block [224]*, catch alternative [225]*

[224] always block [223] =
ALWAYS, action [227]*

[225] catch alternative [223] =
CATCH, catch name [226], action [227]*

[226] catch name [13] [221] [222] [225] =
#PROGRAM-ERROR |
#EXTERNAL-EXCEPTION |
name [21]

[227] action [223] [224] [225] =
using prefix [451]*, qualified action [228]

[228] qualified action [227] =
basic action [229], condition [230]?

[229] basic action [228] =
activate action [363] |
assert action [432] |
clear action [414] |
close action [304] |
copy and clear action [418] |
copy shelf action [417] |
deactivate action [364] |
decrement action [380] |
discard action [305] |
do action [429] |
do scan action [434] |
do skip action [437] |
exit action [431] |
flush action [306] |
halt action [219] |
increment action [381] |
markup parse action [93] |
new action [412] |
next group action [454] |
not reached action [433] |
open action [299] |
output action [309] |
output to action [311] |
put action [308] |
remove action [416] |
remove key action [420] |
reopen action [301] |
repeat action [430] |
repeat for action [442] |
repeat over action [438] |
repeat scan action [435] |
reset action [382] |
return action [65] |
select using counter action [448] |
set counter action [383] |
set external function association action [88] |
set opaque creator function association action [89] |
set opaque creator function library association action [90] |
set key action [419] |
set opaque thing action [411] |
set stream action [313] |
set switch action [365] |
sgml in action [341] |
sgml out action [342] |
submit action [212] |
suppress action [312] |
test system action [220] |
throw action [221] |
void function call [73]

[230] condition [35] [36] [37] [134] [137] [138] [139] [140] [141] [142] [143] [144] [145] [146] [149] [150] [152] [153] [155] [156] [157] [205] [206] [207] [208] [218] [228] [336] [337] [356] [429] [436] =
(WHEN | UNLESS), test [231]

[231] test [69] [84] [95] [97] [230] [235] [365] [432] =
test product [232], ((OR | "|"), test product [232])*

[232] test product [231] =
test factor [233], ((AND | "&"), test factor [233])*

[233] test factor [232] =
(NOT | "!")?, test comparison [234]

[234] test comparison [233] =
string test primary [291] |
numeric test primary [394] |
test secondary [235], ((equality comparer [238], test secondary [235])+ | inequality comparer [239], test secondary [235])? |
argument test primary [71] |
attribute test primary [173] |
dtd pool test primary [102] |
element test primary [159] |
entity test primary [188] |
catch test primary [222] |
pattern test primary [362] |
shelf test primary [428] |
source test primary [215] |
stream test primary [329] |
test secondary [235]

[235] test secondary [86] [234] =
switch test primary [369] |
function call [80] |
simple switch test primary [370] |
TRUE |
FALSE |
"(", test [231], ")"

[236] comparer [297] [377] [379] =
equivalence comparer [237] |
strongly ascending comparer [242] |
strongly descending comparer [243]

[237] equivalence comparer [188] [236] =
equality comparer [238] |
inequality comparer [239]

[238] equality comparer [234] [237] [240] [241] [292] [293] [294] [396] [397] [398] =
IS, EQUAL |
"="

[239] inequality comparer [234] [237] [295] [399] =
ISNT, EQUAL |
"!", "="

[240] weakly ascending comparer [292] [396] =
strongly ascending comparer [242] |
equality comparer [238]

[241] weakly descending comparer [293] [397] =
strongly descending comparer [243] |
equality comparer [238]

[242] strongly ascending comparer [236] [240] [292] [396] =
IS, LESS-THAN |
ISNT, GREATER-EQUAL |
"<" |
IS, LESS-EQUAL |
ISNT, GREATER-THAN |
"<="

[243] strongly descending comparer [236] [241] [293] [397] =
IS, GREATER-THAN |
ISNT, LESS-EQUAL |
">" |
IS, GREATER-EQUAL |
ISNT, LESS-THAN |
">="

1.7.2 Strings and Formats

1.7.2.1 String and Format Text

[244] format [278] [327] [356] =
string [245]

[245] string [31] [32] [136] [148] [161] [182] [203] [244] [290] [457] [464] =
string part [246], ("_", string part [246])*

[246] string part [245] [271] =
lit string part [247] |
lita string part [248]

[247] lit string part [246] =
""", (unescaped character [249] | escaped text [250] | described character [251] | described substring [252] | format item [254] | "'")*, """

[248] lita string part [246] =
"'", (unescaped character [249] | escaped text [250] | described character [251] | described substring [252] | format item [254] | """)*, "'"

[249] unescaped character [247] [248] =
any character that is not a """, a "'", a control character, or escape [5]

[250] escaped text [247] [248] [270] =
escape [5], (escape [5] | """ | "'" | "#" | ")")

[251] described character [247] [248] [270] =
escape [5], "_" |
escape [5], n |
escape [5], t |
escape [5], number [393], "#"

[252] described substring [247] [248] [253] [270] =
escape [5], number [393], r, "{", describing number [253], (",", describing number [253])*, "}"

[253] describing number [252] [253] =
A number in the base indicated by the number [393] in the described substring [252]. The base can be from 2 to 36 and the "digits" in each describing number [253] must be of the appropriate base (using letters, upper- or lower-case, for digit values over 9).

[254] format item [247] [248] =
alphabetic format item [255] |
binary format item [256] |
content format item [257] |
decimal format item [258] |
stream format item [259] |
roman format item [260] |
current name format item [261] |
attribute format item [262] |
pattern format item [263] |
symbol format item [264] |
break format item [265] |
start break suppress format item [266] |
end break suppress format item [267] |
other format item [268] |
macro format item [269]

[255] alphabetic format item [254] =
escape [5], (number [393], f | j | k | l | u | w)*, a, "(", unquoted counter name [108], ")"

[256] binary format item [254] =
escape [5], (number [393], f | number [393])*, b, "(", unquoted counter name [108], ")"

[257] content format item [254] =
escape [5], (h | l | s | u | z)*, c

[258] decimal format item [254] =
escape [5], (number [393], f | (k | z) | l | number [393], r | s | u | number [393])*, d, "(", unquoted counter name [108], ")"

[259] stream format item [254] =
escape [5], (number [393], f | k | l | u | e)*, g, "(", unquoted stream name [119], ")"

[260] roman format item [254] =
escape [5], (number [393], f | k | l | u)*, i, "(", unquoted counter name [108], ")"

[261] current name format item [254] =
escape [5], (e | number [393], f | k | l | o | p | u)*, q

[262] attribute format item [254] =
escape [5], (number [393], f | k | e | h | l | o | p | s | u | z)*, v, "(", unquoted name [270], ")"

[263] pattern format item [254] =
escape [5], (number [393], f | k | h | l | s | u)*, x, "(", unquoted name [270], ")"

[264] symbol format item [254] =
escape [5], (number [393], f | k)*, y, "(", unquoted counter name [108], ")"

[265] break format item [254] =
escape [5], "/"

[266] start break suppress format item [254] =
escape [5], "["

[267] end break suppress format item [254] =
escape [5], "]"

[268] other format item [254] =
escape [5], s, "_" |
escape [5], s, n |
escape [5], s, t

[269] macro format item [254] =
escape [5], (u | l)?, "@", (escape [5] | "(", unquoted name [270], ")")

[270] unquoted name [108] [119] [262] [263] [269] =
(unescaped unquoted name character [271] | escaped text [250] | described character [251] | described substring [252])+

[271] unescaped unquoted name character [270] =
any character that is not a """ if it is the delimiter surrounding the string part [246] containing the character, is not a "'" if it is the delimiter surrounding the string part [246] containing the character, is not a ")" unless preceded by escape [5], is not a control character, and which is not the escape [5] character

1.7.2.2 Formatting Declarations

[272] symbol declaration [12] =
SYMBOL, constant string expression [284]+

[273] delimiter declaration [12] =
DELIMITER, constant string expression [284]

1.7.2.3 String Expressions

[274] string expression [68] [84] [88] [89] [90] [100] [101] [212] [220] [277] [292] [293] [294] [295] [296] [297] [298] [310] [326] [341] [342] [360] [419] [424] [432] [433] [434] [435] [451] =
string product [275], ((JOIN | "||"), string product [275])*

[275] string product [274] =
string term [276], ((REPEATED | "||*"), numeric primary [388])* |
string term [276], TAKE, UNANCHORED?, pattern secondary [348] |
string term [276], DROP, UNANCHORED?, pattern secondary [348] |
REFERENT, string primary [277] |
SILENT-REFERENT, string primary [277]

[276] string term [275] =
string primary [277], (("%" | FORMAT), (string primary [277] | numeric primary [388]))*

[277] string primary [86] [102] [215] [275] [276] [279] [303] [314] [356] [366] [383] [387] [388] [390] [392] [411] [413] [424] [428] =
identifiable text factor [278] |
"(", string expression [274], ")"

[278] identifiable text factor [277] =
format [244] |
identified string value [279] |
identified scanning source [213] |
buffer function call [76] |
((BUFFERED | UNBUFFERED), (TEXT-MODE | BINARY-MODE)? | (TEXT-MODE | BINARY-MODE), (BUFFERED | UNBUFFERED)?)?, source function call [77]

[279] identified string value [278] =
qualified attribute part identifier [174] |
readable stream identifier [280] |
DATE, string primary [277] |
COMPILED-DATE, constant string primary [287] |
(KEY, OF | "^", OF), key-of pseudo-shelf item [283] |
NAME, OF, STREAM?, openable stream identifier [300] |
NAME, OF, specific element selector [165] |
PATTERN, pattern name [349] |
external function association enquiry [91] |
opaque creator function association enquiry [92] |
((BUFFERED | UNBUFFERED), (TEXT-MODE | BINARY-MODE)? | (TEXT-MODE | BINARY-MODE), (BUFFERED | UNBUFFERED)?)?, FILE, string primary [277]

[280] readable stream identifier [279] [329] =
named stream identifier [281] |
referent item identifier [282]

[281] named stream identifier [280] =
STREAM, valued stream shelf name [118], indexer [424]?

[282] referent item identifier [280] =
REFERENTS, indexer [424] |
THIS, REFERENT

[283] key-of pseudo-shelf item [279] =
shelf identifier [425], ((ITEM | "@"), numeric primary [388])? |
THIS, REFERENT |
REFERENTS, (ITEM | "@"), numeric primary [388] |
qualified attribute identifier [175]

1.7.2.4 Constant String Expressions

[284] constant string expression [4] [18] [19] [20] [33] [50] [51] [61] [272] [273] [288] [336] [337] [377] [378] [422] [423] =
constant string factor [285], ((JOIN | "||"), constant string factor [285])*

[285] constant string factor [284] [285] =
constant string term [286] |
constant string factor [285], (REPEATED | "||*"), constant numeric primary [406]

[286] constant string term [285] [286] =
constant string primary [287], constant string term [286], ("%" | FORMAT), (constant string primary [287] | constant numeric primary [406])

[287] constant string primary [279] [286] [289] [405] [406] [408] =
constant simple string primary [288] |
constant identified string value [289]

[288] constant simple string primary [287] =
constant format [290] |
"(", constant string expression [284], ")"

[289] constant identified string value [287] =
COMPILED-DATE, constant string primary [287]

[290] constant format [288] =
string [245]

1.7.2.5 String Tests

[291] string test primary [234] =
ascending string comparison [292] |
descending string comparison [293] |
equality string comparison [294] |
inequality string comparison [295] |
string match test primary [296] |
string set test primary [297]

[292] ascending string comparison [291] =
string expression [274], (equality comparer [238], string expression [274])*, strongly ascending comparer [242], string expression [274], (weakly ascending comparer [240], string expression [274])*

[293] descending string comparison [291] =
string expression [274], (equality comparer [238], string expression [274])*, strongly descending comparer [243], string expression [274], (weakly descending comparer [241], string expression [274])*

[294] equality string comparison [291] =
string expression [274], (equality comparer [238], string expression [274])+

[295] inequality string comparison [291] =
string expression [274], inequality comparer [239], string expression [274]

[296] string match test primary [291] =
string expression [274], MATCHES, UNANCHORED?, pattern secondary [348]

[297] string set test primary [291] =
string expression [274], comparer [236], UL, string expression [274] |
string expression [274], comparer [236], UL?, "(", string expression [274], ((OR | "|"), string expression [274])+, ")"

[298] string expression set =
string expression [274] |
"(", string expression [274], ((OR | "|"), string expression [274])*, ")"

1.7.3 Streams

[299] open action [229] =
OPEN, openable stream identifier [300], stream open option set [316]?, break option [328]?, AS, stream attachment [303]

[300] openable stream identifier [279] [299] [301] [307] [314] [329] =
settable stream shelf name [117], indexer [424]?

[301] reopen action [229] =
REOPEN, reopenable built-in stream name [302], stream open option set [316]?, break option [328]? |
REOPEN, openable stream identifier [300], stream open option set [316]?, break option [328]?, (AS, stream attachment [303])?

[302] reopenable built-in stream name [301] =
#CONSOLE |
#ERROR

[303] stream attachment [299] [301] =
FILE?, string primary [277] |
BUFFER |
REFERENT, string primary [277] |
output function call [78]

[304] close action [229] =
CLOSE, openable stream identifier set [307]

[305] discard action [229] =
DISCARD, openable stream identifier set [307]

[306] flush action [229] =
FLUSH, stream set [332]

[307] openable stream identifier set [304] [305] =
openable stream identifier [300], ((AND | "&"), openable stream identifier [300])* |
"(", openable stream identifier [300], ((AND | "&"), openable stream identifier [300])*, ")"

[308] put action [229] =
PUT, stream set [332], stream content source [310]

[309] output action [229] =
OUTPUT, stream content source [310]

[310] stream content source [308] [309] [313] =
string expression [274]

[311] output to action [229] =
OUTPUT-TO, stream set [332]

[312] suppress action [229] =
SUPPRESS

[313] set stream action [229] =
SET, settable stream [314], TO, stream content source [310]

[314] settable stream [313] =
BUFFER, openable stream identifier [300], protected set stream option set [320]? |
REFERENT, string primary [277], protected set stream option set [320]? |
THIS, REFERENT, protected set stream option set [320]? |
FILE, string primary [277], protected set stream option set [320]? |
output function call [78], protected set stream option set [320]? |
STREAM?, settable stream shelf name [117], protected set stream option set [320]? |
NEW, (STREAM | BUFFER)?, mutable stream shelf name [124], ((KEY | "^"), string primary [277])?, insertion point [315]?, protected set stream option set [320]?

[315] insertion point [314] [366] [383] [411] [413] =
(AFTER | BEFORE), indexer [424]

1.7.3.1 Stream Options

[316] stream open option set [299] [301] =
WITH, stream open option group [317], (WITH, stream open option group [317])*

[317] stream open option group [316] =
stream open option [324] |
"(", stream open option [324], ((AND | "&"), stream open option [324])*, ")"

[318] set stream option set =
WITH, set stream option group [319], (WITH, set stream option group [319])*

[319] set stream option group [318] =
set stream option [325] |
"(", set stream option [325], ((AND | "&"), set stream option [325])*, ")"

[320] protected set stream option set [314] =
WITH, protected set stream option group [321], (WITH, protected set stream option group [321])*

[321] protected set stream option group [320] =
stream output option [327] |
stream creation option [326] |
"(", set stream option [325], ((AND | "&"), set stream option [325])*, ")"

[322] stream output option set [333] =
WITH, stream output option group [323], (WITH, stream output option group [323])*

[323] stream output option group [322] =
stream output option [327] |
"(", stream output option [327], ((AND | "&"), stream output option [327])*, ")"

[324] stream open option [317] =
set stream option [325]

[325] set stream option [319] [321] [324] =
stream output option [327] |
break option [328] |
stream creation option [326]

[326] stream creation option [321] [325] =
TEXT-MODE |
BINARY-MODE |
REFERENTS-NOT-ALLOWED |
REFERENTS-DISPLAYED |
REFERENTS-ALLOWED, (DEFAULTING, "{", string expression [274], (",", string expression [274])?, "}")? |
DOMAIN-FREE |
BUFFERED |
UNBUFFERED

[327] stream output option [321] [323] [325] =
format [244] |
BINARY, numeric expression [384]

[328] break option [299] [301] [325] =
BREAK-WIDTH, numeric expression [384], (number [393] | TO, numeric expression [384])?

1.7.3.2 Stream Tests

[329] stream test primary [234] =
(readable stream identifier [280] | STREAM?, SGML, indexer [424]? | STREAM?, OUTPUT, indexer [424]?), (IS | ISNT), stream type set [330] |
STREAM, openable stream identifier [300], (HAS | HASNT), NAME |
#CURRENT-OUTPUT, (IS | ISNT), ATTACHED

[330] stream type set [329] =
stream type [331] |
"(", stream type [331], ((AND | "&"), stream type [331])*, ")" |
"(", stream type [331], ((OR | "|"), stream type [331])*, ")"

[331] stream type [330] =
OPEN |
CLOSED |
ATTACHED |
BUFFER |
FILE |
REFERENT |
SGML-PARSER |
MARKUP-PARSER |
EXTERNAL

1.7.3.3 Stream Identification

[332] stream set [306] [308] [311] [451] =
stream set member [333], ((AND | "&"), stream set member [333])* |
"(", stream set member [333], ((AND | "&"), stream set member [333])*, ")"

[333] stream set member [332] =
(#OUTPUT | #CURRENT-OUTPUT), stream output option set [322]? |
writable stream shelf name [120], indexer [424]?, stream output option set [322]?

1.7.3.4 Stream Declarations

[334] output break declaration [12] =
BREAK-WIDTH, constant numeric expression [402], (number [393] | TO, constant numeric expression [402])?

[335] line breaking rule [14] =
insertion break rule [336] |
replacement break rule [337]

[336] insertion break rule [335] =
INSERTION-BREAK, constant string expression [284], condition [230]?

[337] replacement break rule [335] =
REPLACEMENT-BREAK, constant string expression [284], constant string expression [284], condition [230]?

[338] main mode declaration [11] =
DECLARE, (#MAIN-INPUT | #PROCESS-INPUT | #MAIN-OUTPUT | #PROCESS-OUTPUT), HAS, (TEXT-MODE | BINARY-MODE)

[339] main output referent declaration [11] =
DECLARE, #MAIN-OUTPUT, HAS, (REFERENTS-ALLOWED | REFERENTS-NOT-ALLOWED | REFERENTS-DISPLAYED)

[340] main buffering declaration [11] =
DECLARE, (#MAIN-INPUT | #PROCESS-INPUT | #MAIN-OUTPUT | #PROCESS-OUTPUT | #ERROR), HAS, (BUFFERED | UNBUFFERED)

1.7.3.5 SGML Stream Special Actions

[341] sgml in action [229] =
SGML-IN, (string expression [274] | #NONE)

[342] sgml out action [229] =
SGML-OUT, (string expression [274] | #NONE)

1.7.4 Patterns

[343] pattern [149] [205] [436] =
subpattern [344]

[344] subpattern [151] [343] [356] [437] =
pattern product [345], ((OR | "|"), pattern product [345])*

[345] pattern product [344] [345] =
pattern factor [346], pattern product [345]? |
LOOKAHEAD, pattern product [345] |
LOOKAHEAD, NOT, pattern product [345] |
(character set [358] | character class name [357]), ("**" | "++"), ("=>", pattern name [349])?, pattern product [345]

[346] pattern factor [345] =
(pattern entity type [350] | pattern nonentity type [351])?, pattern secondary [348] |
pattern entity type [350], NAMED, pattern secondary [348], (VALUED, pattern secondary [348])? |
pattern entity type [350], VALUED, pattern secondary [348], (NAMED, pattern secondary [348])? |
pattern nonentity type [351], VALUED, pattern secondary [348]

[347] pattern tertiary =
pattern secondary [348], ("=", ">"?, pattern name [349])?

[348] pattern secondary [275] [296] [346] [347] =
pattern primary [355], occurrence indicator [352]?

[349] pattern name [279] [345] [347] [356] [362] =
name [21]

[350] pattern entity type [346] =
CDATA |
SDATA |
ENTITY

[351] pattern nonentity type [346] =
PCDATA |
NON-CDATA |
NON-SDATA |
TEXT

[352] occurrence indicator [348] =
simple occurrence indicator [353] |
complex occurrence indicator [354]

[353] simple occurrence indicator [352] =
"?" |
"+" |
"*"

[354] complex occurrence indicator [352] =
"{", numeric expression [384], "}" |
"{", numeric expression [384], TO, numeric expression [384], "}" |
"{", numeric expression [384], "}", "+"

[355] pattern primary [348] =
UL?, ul pattern primary [356]

[356] ul pattern primary [355] =
"~", string primary [277] |
format [244] |
character class name [357] |
ANOTHER?, pattern name [349] |
character set [358] |
"(", subpattern [344], condition [230]?, ")" |
"(", condition [230], ")" |
position pattern [361]

[357] character class name [345] [356] [360] =
SPACE |
BLANK |
WHITE-SPACE |
ANY |
ANY-TEXT |
LETTER |
DIGIT |
UC |
LC

[358] character set [345] [356] =
"[", character set term [359], (EXCEPT, character set term [359])?, "]"

[359] character set term [358] =
character set product [360], ((OR | "|"), character set product [360])*

[360] character set product [359] =
string expression [274], (TO, string expression [274])? |
character class name [357]

[361] position pattern [356] =
LINE-START |
LINE-END |
WORD-START |
WORD-END |
VALUE-START |
VALUE-END |
CONTENT-START |
CONTENT-END

1.7.4.1 Pattern Tests

[362] pattern test primary [234] =
PATTERN, pattern name [349], (IS | ISNT), SPECIFIED

1.7.5 Switches

1.7.5.1 Setting Switch Values

[363] activate action [229] =
ACTIVATE, switch identifier set [367]

[364] deactivate action [229] =
DEACTIVATE, switch identifier set [367]

[365] set switch action [229] =
SET, settable switch [366], TO, test [231]

[366] settable switch [365] =
SWITCH?, settable switch shelf name [112], indexer [424]? |
NEW, SWITCH?, mutable switch shelf name [114], ((KEY | "^"), string primary [277])?, insertion point [315]?

[367] switch identifier set [363] [364] =
switch identifier [368], ((AND | "&"), switch identifier [368])* |
"(", switch identifier [368], ((AND | "&"), switch identifier [368])*, ")"

[368] switch identifier [367] [371] =
settable switch shelf name [112], indexer [424]?

1.7.5.2 Switch Tests

[369] switch test primary [235] =
SWITCH, switch value identifier [371]

[370] simple switch test primary [235] =
ACTIVE, switch value identifier [371] |
ACTIVE, "(", switch value identifier [371], ((AND | "&"), switch value identifier [371])*, ")" |
ACTIVE, "(", switch value identifier [371], ((OR | "|"), switch value identifier [371])*, ")"

[371] switch value identifier [369] [370] =
switch identifier [368] |
#FIRST |
#LAST

1.7.5.3 Constant Tests

[372] constant test [61] [95] [97] [376] [423] =
constant test product [373], ((OR | "|"), constant test product [373])*

[373] constant test product [372] =
constant test factor [374], ((AND | "&"), constant test factor [374])*

[374] constant test factor [373] =
(NOT | "!")?, constant test secondary [375]

[375] constant test secondary [374] =
constant numeric test primary [379] |
constant string test primary [377] |
constant simple test primary [376]

[376] constant simple test primary [375] =
TRUE |
FALSE |
"(", constant test [372], ")"

[377] constant string test primary [375] =
constant string expression [284], (IS | ISNT), comparer [236], UL?, constant string expression set [378]

[378] constant string expression set [377] =
constant string expression [284] |
"(", constant string expression [284], ((OR | "|"), constant string expression [284])*, ")"

[379] constant numeric test primary [375] =
constant numeric expression [402], (IS | ISNT), comparer [236], constant numeric expression [402]

1.7.6 Counters and Numbers

[380] decrement action [229] =
DECREMENT, settable counter shelf name [106], indexer [424]?, (BY, numeric expression [384])?

[381] increment action [229] =
INCREMENT, settable counter shelf name [106], indexer [424]?, (BY, numeric expression [384])?

[382] reset action [229] =
RESET, settable counter shelf name [106], indexer [424]?, (TO, numeric expression [384])?

[383] set counter action [229] =
SET, settable counter shelf name [106], TO, numeric expression [384] |
SET, NEW, COUNTER?, mutable counter shelf name [109], ((KEY | "^"), string primary [277])?, insertion point [315]?, TO, numeric expression [384]

1.7.6.1 Arithmetic

[384] numeric expression [67] [84] [219] [327] [328] [354] [380] [381] [382] [383] [389] [396] [397] [398] [399] [424] [437] [445] [446] [447] [448] =
numeric product [385], (("+" | PLUS | "-" | MINUS | UNION | DIFFERENCE), numeric product [385])*

[385] numeric product [384] =
numeric factor [386], (("*" | TIMES | "/" | DIVIDE | MODULO | MASK | SHIFT), numeric factor [386])*

[386] numeric factor [385] [386] =
numeric factor prime [387], ("**", numeric factor [386])?

[387] numeric factor prime [386] =
numeric primary [388] |
string primary [277], (BASE | BINARY), numeric primary [388]

[388] numeric primary [86] [174] [275] [276] [283] [387] [388] [424] [428] [451] =
simple numeric primary [389] |
identified numeric value [390] |
string primary [277] |
("+" | "-" | NEGATE | COMPLEMENT), numeric primary [388] |
function call [80]

[389] simple numeric primary [388] =
number [393] |
"(", numeric expression [384], ")"

[390] identified numeric value [388] =
BINARY, string primary [277] |
CHILDREN, ancestry qualifier [163]? |
COUNTER, valued counter shelf name [107], indexer [424]? |
(ITEM, OF | "@"), item-of pseudo-shelf item [392] |
LENGTH, OF, string primary [277] |
(NUMBER, OF | NUMBER-OF), number-of pseudo-shelf [391] |
OCCURRENCE, ancestry qualifier [163]? |
SYSTEM-CALL, string primary [277]

[391] number-of pseudo-shelf [390] =
shelf identifier [425] |
qualified attribute identifier [175] |
qualified attribute set identifier [178] |
CURRENT, ELEMENTS, ancestry qualifier [163]? |
REFERENTS |
CURRENT, SUBDOCUMENTS

[392] item-of pseudo-shelf item [390] =
user shelf identifier [427], ((KEY | "^"), string primary [277])? |
simple qualified attribute set identifier [179], (KEY | "^"), string primary [277] |
REFERENTS, (KEY | "^"), string primary [277] |
THIS, REFERENT

[393] number [251] [252] [253] [255] [256] [258] [259] [260] [261] [262] [263] [264] [328] [334] [389] [407] [464] =
digit [23]+

1.7.6.2 Numeric Tests

[394] numeric test primary [234] =
VALUE?, full numeric test [395]

[395] full numeric test [394] =
ascending numeric comparison [396] |
descending numeric comparison [397] |
equality numeric comparison [398] |
inequality numeric comparison [399]

[396] ascending numeric comparison [395] =
numeric expression [384], (equality comparer [238], numeric expression [384])*, strongly ascending comparer [242], numeric expression [384], (weakly ascending comparer [240], numeric expression [384])*

[397] descending numeric comparison [395] =
numeric expression [384], (equality comparer [238], numeric expression [384])*, strongly descending comparer [243], numeric expression [384], (weakly descending comparer [241], numeric expression [384])*

[398] equality numeric comparison [395] =
numeric expression [384], (equality comparer [238], numeric expression [384])+

[399] inequality numeric comparison [395] =
numeric expression [384], inequality comparer [239], numeric expression [384]

1.7.6.3 Numeric Declarations

[400] binary input declaration [12] =
BINARY-INPUT, constant numeric expression [402]

[401] binary output declaration [12] =
BINARY-OUTPUT, constant numeric expression [402]

1.7.6.4 Constant Numeric Expressions

[402] constant numeric expression [61] [334] [379] [400] [401] [407] [421] [423] [450] =
constant numeric product [403], (("+" | PLUS | "-" | MINUS | UNION | DIFFERENCE), constant numeric product [403])*

[403] constant numeric product [402] =
constant numeric factor [404], (("*" | TIMES | "/" | DIVIDE | MODULO | MASK | SHIFT), constant numeric factor [404])*

[404] constant numeric factor [403] [404] =
constant numeric factor prime [405], ("**", constant numeric factor [404])?

[405] constant numeric factor prime [404] =
constant numeric primary [406] |
constant string primary [287], (BASE | BINARY), constant numeric primary [406]

[406] constant numeric primary [285] [286] [405] [406] =
constant simple numeric primary [407] |
constant identified numeric value [408] |
constant string primary [287] |
("+" | "-" | COMPLEMENT), constant numeric primary [406]

[407] constant simple numeric primary [406] =
number [393] |
"(", constant numeric expression [402], ")"

[408] constant identified numeric value [406] =
BINARY, constant string primary [287] |
LENGTH, OF, constant string primary [287]

1.7.7 Operations on Opaque Things

[409] opaque type expression [70] [84] [411] =
opaque type primary [410]

[410] opaque type primary [86] [409] =
opaque type name [39]?, opaque thing name [128], indexer [424]? |
opaque type function call [79]

[411] set opaque thing action [229] =
SET, opaque type name [39]?, settable opaque shelf name [129], indexer [424]?, TO, opaque type expression [409] |
SET, NEW, opaque type name [39]?, mutable opaque shelf name [131], ((KEY | "^"), string primary [277])?, insertion point [315]?, TO, opaque type expression [409]

1.7.8 Shelves

[412] new action [229] =
NEW, newable item identifier [413], ((AND | "&"), newable item identifier [413])*

[413] newable item identifier [412] =
mutable shelf identifier [426], ((KEY | "^"), string primary [277])?, insertion point [315]?

[414] clear action [229] =
CLEAR, movable shelf identifier [415], ((AND | "&"), movable shelf identifier [415])*

[415] movable shelf identifier [414] =
mutable shelf identifier [426] |
(DTDS | SGML-DTDS | XML-DTDS)

[416] remove action [229] =
REMOVE, mutable shelf identifier [426], indexer [424]?

[417] copy shelf action [229] =
COPY, shelf identifier [425], TO, mutable shelf identifier [426]

[418] copy and clear action [229] =
COPY-CLEAR, mutable shelf identifier [426], TO, mutable shelf identifier [426]

[419] set key action [229] =
SET, (KEY | "^"), OF, mutable shelf identifier [426], indexer [424]?, TO, string expression [274]

[420] remove key action [229] =
REMOVE, (KEY | "^"), OF, mutable shelf identifier [426], indexer [424]?

[421] typed shelf identifier [25] [30] =
user shelf identifier [427], VARIABLE, (TO, constant numeric expression [402])?, (INITIAL-SIZE, constant numeric expression [402])?, (INITIAL, "{", shelf initializer item [422], (",", shelf initializer item [422])*, "}")? |
user shelf identifier [427], (SIZE, constant numeric expression [402])?, (INITIAL, "{", shelf initializer item [422], (",", shelf initializer item [422])*, "}")?

[422] shelf initializer item [421] =
shelf initializer value [423], (WITH, (KEY | "^"), constant string expression [284])?

[423] shelf initializer value [422] =
constant numeric expression [402] |
constant string expression [284] |
UNATTACHED |
constant test [372]

[424] indexer [87] [98] [99] [177] [214] [281] [282] [300] [315] [329] [333] [366] [368] [380] [381] [382] [390] [410] [411] [416] [419] [420] [451] [452] =
(ITEM | "@"), numeric primary [388] |
(KEY | "^"), string primary [277] |
LASTMOST |
"{", string expression [274], "}" |
"[", numeric expression [384], "]"

[425] shelf identifier [283] [391] [417] =
COUNTER?, valued counter shelf name [107] |
STREAM?, valued stream shelf name [118] |
SWITCH?, valued switch shelf name [113] |
opaque type name [39]?, valued opaque shelf name [130]

[426] mutable shelf identifier [28] [29] [413] [415] [416] [417] [418] [419] [420] =
COUNTER?, mutable counter shelf name [109] |
STREAM?, mutable stream shelf name [124] |
SWITCH?, mutable switch shelf name [114] |
opaque type name [39]?, mutable opaque shelf name [131]

[427] user shelf identifier [62] [63] [392] [421] [428] =
INTEGER, integer name [104] |
INT32, bitint name [105] |
COUNTER, counter name [103] |
STREAM, stream name [116] |
SWITCH, switch name [111] |
opaque type name [39], opaque thing name [128]

1.7.9 Shelf Tests

[428] shelf test primary [234] =
user shelf identifier [427], ((ITEM | "@"), numeric primary [388])?, (IS | ISNT), KEYED |
user shelf identifier [427], (HAS | HASNT), (KEY | "^"), string primary [277] |
REFERENTS, (HAS | HASNT), (KEY | "^"), string primary [277] |
qualified attribute set identifier [178], (HAS | HASNT), (KEY | "^"), string primary [277]

1.7.10 Multi-Part Actions

[429] do action [229] =
DO, condition [230], local scope [223], (ELSE, condition [230], local scope [223])*, (ELSE, local scope [223])?, DONE |
DO, local scope [223], DONE

[430] repeat action [229] =
REPEAT, local scope [223], AGAIN

[431] exit action [229] =
EXIT

[432] assert action [229] =
ASSERT, test [231], (MESSAGE, string expression [274])?

[433] not reached action [229] =
NOT-REACHED, (MESSAGE, string expression [274])?

1.7.10.1 Scanning

[434] do scan action [229] =
DO, SCAN, string expression [274], match alternative [436]+, (ELSE, local scope [223])?, DONE

[435] repeat scan action [229] =
REPEAT, SCAN, string expression [274], match alternative [436]+, AGAIN

[436] match alternative [434] [435] =
MATCH, UNANCHORED?, NULL?, pattern [343], condition [230]?, local scope [223]

[437] do skip action [229] =
DO, SKIP, PAST, numeric expression [384], (OVER, subpattern [344])?, local scope [223], (ELSE, local scope [223])?, DONE |
DO, SKIP, OVER, subpattern [344], local scope [223], (ELSE, local scope [223])?, DONE

1.7.10.2 Iteration

[438] repeat over action [229] =
REPEAT, OVER, repeat over component [439], ((AND | "&"), repeat over component [439])*, local scope [223], AGAIN

[439] repeat over component [438] =
COUNTER?, valued counter shelf name [107], (AS, counter name [103])? |
STREAM?, valued stream shelf name [118], (AS, stream name [116])? |
SWITCH?, valued switch shelf name [113], (AS, switch name [111])? |
opaque type name [39]?, valued opaque shelf name [130], (AS, opaque thing name [128])? |
REFERENTS |
qualified attribute identifier [175], attribute alias association [440]? |
qualified attribute set identifier [178], attribute alias association [440] |
REVERSED?, CURRENT, ELEMENTS, ancestry qualifier [163]?, element alias association [441]

[440] attribute alias association [439] [451] [453] =
AS, attribute name [182]

[441] element alias association [439] =
AS, gi [136]

[442] repeat for action [229] =
REPEAT, main for part [443], local scope [223], AGAIN

[443] main for part [442] =
for part [444], from part [445]?, to part [446]?, by part [447]? |
from part [445], to part [446]?, by part [447]? |
to part [446], by part [447]? |
by part [447]

[444] for part [443] =
FOR, INTEGER, integer name [104]

[445] from part [443] =
FROM, numeric expression [384]

[446] to part [443] =
TO, numeric expression [384]

[447] by part [443] =
BY, numeric expression [384]

1.7.10.3 The Select Action

[448] select using counter action [229] =
DO, SELECT, numeric expression [384], (AS, counter name [103])?, (CASE, constant numeric range set [449], local scope [223])+, (ELSE, local scope [223])?, DONE

[449] constant numeric range set [448] =
constant numeric range [450], ((OR | "|"), constant numeric range [450])* |
"(", constant numeric range [450], ((OR | "|"), constant numeric range [450])*, ")"

[450] constant numeric range [449] =
constant numeric expression [402], (TO, constant numeric expression [402])?

1.7.10.4 The Using Prefix

[451] using prefix [227] =
USING, shelf item association [452] |
USING, REFERENTS, indexer [424] |
USING, simple qualified attribute identifier [176], (ITEM | "@"), numeric primary [388], attribute alias association [440]? |
USING, attribute for using identifier [453] |
USING, OUTPUT, AS, stream set [332] |
USING, INPUT, AS, string expression [274] |
USING, GROUP, current group set [455] |
USING, GROUP, "(", current group set [455], ")" |
USING, NESTED-REFERENTS

[452] shelf item association [451] =
COUNTER?, valued counter shelf name [107], indexer [424], (AS, counter name [103])? |
STREAM?, valued stream shelf name [118], indexer [424], (AS, stream name [116])? |
SWITCH?, valued switch shelf name [113], indexer [424], (AS, switch name [111])?

[453] attribute for using identifier [451] =
qualified attribute identifier [175], attribute alias association [440] |
ATTRIBUTE, attribute name [182], element identifier [162] |
DATA-ATTRIBUTE, attribute name [182], OF, "(", qualified attribute part identifier [174], ")" |
DATA-ATTRIBUTE, attribute name [182], OF, qualified attribute part identifier [174]

1.7.10.5 Groups

[454] next group action [229] =
NEXT, GROUP, IS, current group set [455] |
NEXT, GROUP, IS, "(", current group set [455], ")"

[455] current group set [451] [454] =
group name set [456] |
#GROUP, ((AND | "&"), group name set [456])? |
#IMPLIED

[456] group name set [9] [455] =
group name [457], ((AND | "&"), group name [457])*

[457] group name [456] =
string [245] |
name [21]


1.8 Program Writing Tools

1.8.1 Macros

[458] macro definition [12] =
MACRO, macro name [459], parameter template [460]*, IS, replacement template item [464]*, MACRO-END

[459] macro name [458] =
macro token [462]+

[460] parameter template [458] =
TOKEN, macro parameter [461], macro token [462]* |
ARG, macro parameter [461], macro token [462]+

[461] macro parameter [460] [464] =
name [21] |
delimiter token [463]

[462] macro token [459] [460] =
LITERAL?, name [21] |
LITERAL?, delimiter token [463]

[463] delimiter token [461] [462] [464] =
"(" |
")" |
"{" |
"}" |
"[" |
"]" |
"!" |
"@" |
"$" |
"%" |
"^" |
"&" |
"*" |
"-" |
"+" |
"=" |
"|" |
"\" |
"~" |
"`" |
":" |
"<" |
"," |
">" |
"." |
"?" |
"/"

[464] replacement template item [458] =
macro parameter [461] |
LITERAL?, name [21] |
LITERAL?, delimiter token [463] |
LITERAL?, number [393] |
LITERAL?, string [245]

© 2000 OmniMark Technologies Corporation All rights reserved.
ETR62, release 2, 2000/07/11.