Skip to content

Commit 917a5c7

Browse files
authored
Merge pull request #1732 from michaelhkay/1720-grammar-simplification
1720 grammar simplification
2 parents b16ba65 + b1ac4d9 commit 917a5c7

File tree

5 files changed

+356
-1399
lines changed

5 files changed

+356
-1399
lines changed

specifications/grammar-40/grammar.dtd

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
or via an XSLT stylesheet or other transformation, may generate
77
a parser compiler specification such as for YACC or JavaCC.
88
9-
Norm and Scott moved this file, and added an explicit prefix, as part of the
10-
transition toward a unified build process for last call and beyond. This involved
11-
moving the location of the CVS repository, For earlier history information,
12-
see /WWW/XML/Group/xpath-query-src/grammar.dtd
9+
In 2025 Michael Kay simplified the DTD to remove parts that were no
10+
longer used or maintained.
1311
1412
=========================================================================-->
1513
<!-- The root element of the definition -->
16-
<!ELEMENT g:grammar ((g:language)+, (g:start)+,
17-
(g:exprProduction | g:production | g:exposition-production)+
18-
, g:token*, (g:state-list)?)>
14+
<!ELEMENT g:grammar (
15+
g:language+,
16+
g:start+,
17+
g:production+,
18+
g:token*)>
1919
<!ATTLIST g:grammar
2020
xmlns:g CDATA #FIXED "http://www.w3.org/2001/03/XPath/grammar"
2121
>
@@ -146,44 +146,44 @@ see /WWW/XML/Group/xpath-query-src/grammar.dtd
146146
process-value (no | yes) #IMPLIED
147147
>
148148

149-
<!-- Talk to FS folks about what this is really supposed to mean. -sb -->
149+
<!--<!-\- Talk to FS folks about what this is really supposed to mean. -sb -\->
150150
<!ELEMENT g:emph (#PCDATA)>
151151
<!ATTLIST g:emph
152152
ignoreCase CDATA #IMPLIED
153153
if IDREFS #IMPLIED
154154
not-if IDREFS #IMPLIED
155155
>
156-
156+
-->
157157

158158
<!--=================== Lexical State Transitions =================== -->
159159

160-
<!ELEMENT g:state-list (g:state)+>
160+
<!--<!ELEMENT g:state-list (g:state)+>
161161
<!ATTLIST g:state-list
162162
if IDREFS #IMPLIED
163163
not-if IDREFS #IMPLIED
164164
>
165-
166-
<!ELEMENT g:state (g:description?, g:transition+)>
165+
-->
166+
<!--<!ELEMENT g:state (g:description?, g:transition+)>
167167
<!ATTLIST g:state
168168
name ID #REQUIRED
169169
if IDREFS #IMPLIED
170170
not-if IDREFS #IMPLIED
171171
show (yes | no) #IMPLIED
172-
>
172+
>-->
173173

174-
<!ELEMENT g:tref EMPTY>
174+
<!--<!ELEMENT g:tref EMPTY>
175175
<!ATTLIST g:tref
176176
name IDREF #REQUIRED
177177
if IDREFS #IMPLIED
178178
not-if IDREFS #IMPLIED
179179
show (yes | no) #IMPLIED
180-
>
180+
>-->
181181

182-
<!ELEMENT g:description ANY>
182+
<!--<!ELEMENT g:description ANY>
183183
<!ATTLIST g:description
184184
if IDREFS #IMPLIED
185185
not-if IDREFS #IMPLIED
186-
>
186+
>-->
187187

188188
<!-- Define a transition for a token or set of tokens.
189189
Attributes:
@@ -194,36 +194,36 @@ see /WWW/XML/Group/xpath-query-src/grammar.dtd
194194
used for the action.
195195
action -> State stack action.
196196
-->
197-
<!ELEMENT g:transition (g:description?, g:tref+)>
197+
<!--<!ELEMENT g:transition (g:description?, g:tref+)>
198198
<!ATTLIST g:transition
199199
if IDREFS #IMPLIED
200200
not-if IDREFS #IMPLIED
201201
next-state IDREF #IMPLIED
202202
action CDATA #IMPLIED
203-
>
203+
>-->
204204

205205
<!--=================== Parser Production Specifications ===============-->
206206
<!-- A production that defines a "cascade" of productions that define
207207
operator precedence.
208208
name -> the ID of the production.
209209
if -> space separated list of tokens for conditional processing.
210210
-->
211-
<!ELEMENT g:exprProduction (g:level+)>
211+
<!--<!ELEMENT g:exprProduction (g:level+)>
212212
<!ATTLIST g:exprProduction
213213
name ID #REQUIRED
214214
if IDREFS #IMPLIED
215215
not-if IDREFS #IMPLIED
216216
node-type (void | string | StepExpr | FTUnaryNot | UnaryExpr) #IMPLIED
217217
condition CDATA #IMPLIED
218-
>
218+
>-->
219219

220-
<!ELEMENT g:level (g:postfix | g:binary | g:prefix | g:primary)+>
220+
<!--<!ELEMENT g:level (g:postfix | g:binary | g:prefix | g:primary)+>
221221
<!ATTLIST g:level
222222
if IDREFS #IMPLIED
223223
not-if IDREFS #IMPLIED
224224
node-type (void | string | StepExpr | FTUnaryNot | UnaryExpr) #IMPLIED
225225
level-user-action CDATA #IMPLIED
226-
>
226+
>-->
227227

228228
<!-- Basic non-terminal production.
229229
name -> the ID of the production.
@@ -251,7 +251,7 @@ see /WWW/XML/Group/xpath-query-src/grammar.dtd
251251
subtract-reg-expr CDATA #IMPLIED
252252
>
253253

254-
<!ELEMENT g:exposition-production (g:optional | g:ref | g:xref | g:choice | g:sequence | g:zeroOrMore | g:oneOrMore | g:string)+>
254+
<!--<!ELEMENT g:exposition-production (g:optional | g:ref | g:xref | g:choice | g:sequence | g:zeroOrMore | g:oneOrMore | g:string)+>
255255
<!ATTLIST g:exposition-production
256256
name CDATA #REQUIRED
257257
if IDREFS #IMPLIED
@@ -262,7 +262,7 @@ see /WWW/XML/Group/xpath-query-src/grammar.dtd
262262
whitespace-spec (not-significant | significant | explicit) #IMPLIED
263263
comment-id CDATA #IMPLIED
264264
xgc-id CDATA #IMPLIED
265-
>
265+
>-->
266266

267267
<!-- Defines a binary operator.
268268
name -> the ID of the production.
@@ -275,55 +275,55 @@ see /WWW/XML/Group/xpath-query-src/grammar.dtd
275275
</choice>
276276
</binary>
277277
-->
278-
<!ELEMENT g:binary (g:ref | g:xref | g:choice | g:string | g:sequence)>
278+
<!--<!ELEMENT g:binary (g:ref | g:xref | g:choice | g:string | g:sequence)>
279279
<!ATTLIST g:binary
280280
name ID #REQUIRED
281281
if IDREFS #IMPLIED
282282
not-if IDREFS #IMPLIED
283283
prefix-seq-type CDATA #IMPLIED
284284
condition CDATA #IMPLIED
285285
process-value (no | yes) #IMPLIED
286-
>
286+
>-->
287287

288-
<!ELEMENT g:postfix (g:ref | g:xref | g:optional | g:sequence | g:string)+>
288+
<!--<!ELEMENT g:postfix (g:ref | g:xref | g:optional | g:sequence | g:string)+>
289289
<!ATTLIST g:postfix
290290
name ID #REQUIRED
291291
if IDREFS #IMPLIED
292292
not-if IDREFS #IMPLIED
293293
prefix-seq-type CDATA #IMPLIED
294294
condition CDATA #IMPLIED
295295
node-type (void | string | StepExpr | FTUnaryNot | UnaryExpr) #IMPLIED
296-
>
296+
>-->
297297

298-
<!ELEMENT g:prefix (g:optional | g:ref | g:xref | g:choice | g:zeroOrMore | g:oneOrMore | g:sequence | g:next | g:string)+>
298+
<!--<!ELEMENT g:prefix (g:optional | g:ref | g:xref | g:choice | g:zeroOrMore | g:oneOrMore | g:sequence | g:next | g:string)+>
299299
<!ATTLIST g:prefix
300300
name ID #REQUIRED
301301
if IDREFS #IMPLIED
302302
not-if IDREFS #IMPLIED
303303
prefix-seq-type CDATA "*"
304304
condition CDATA #IMPLIED
305305
node-type (void | string | StepExpr | FTUnaryNot | UnaryExpr) #IMPLIED
306-
>
306+
>-->
307307

308308
<!-- This element is used in exprProduction to control where the next production
309309
will be called from. If it is not used, the next production will automatically be
310310
called.
311311
-->
312-
<!ELEMENT g:next EMPTY>
312+
<!--<!ELEMENT g:next EMPTY>
313313
<!ATTLIST g:next
314314
if IDREFS #IMPLIED
315315
not-if IDREFS #IMPLIED
316-
>
316+
>-->
317317

318-
<!ELEMENT g:primary (g:optional | g:ref | g:xref | g:choice |
318+
<!--<!ELEMENT g:primary (g:optional | g:ref | g:xref | g:choice |
319319
g:zeroOrMore | g:oneOrMore | g:sequence | g:string)+>
320320
<!ATTLIST g:primary
321321
name ID #REQUIRED
322322
if IDREFS #IMPLIED
323323
not-if IDREFS #IMPLIED
324324
condition CDATA #IMPLIED
325325
node-type (void | string | StepExpr | FTUnaryNot | UnaryExpr) #IMPLIED
326-
>
326+
>-->
327327

328328
<!ELEMENT g:ref EMPTY>
329329
<!ATTLIST g:ref

0 commit comments

Comments
 (0)