/
ldf.xsd
957 lines (916 loc) · 40.3 KB
/
ldf.xsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ldf="http://planet-sl.org/ldf"
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
targetNamespace="http://planet-sl.org/ldf">
<xsd:import namespace="http://planet-sl.org/bgf" schemaLocation="bgf.xsd"/>
<xsd:import namespace="http://www.w3.org/1998/Math/MathML" schemaLocation="fakemathml.xsd"/>
<!-- info -->
<xsd:annotation>
<xsd:documentation>
Language Document Format
</xsd:documentation>
<xsd:documentation>
This is basically a metamodel for language documents or documentations.
Sample program tags:
- External reference (with XPath-like subprogram selection)
- Verbatim text + claim about corresponding grammar and nontermninal (and perhaps version)
- Generation request for given grammar and nontermninal (and perhaps version, more control)
- Sample suite extraction request (what are the constraints on the requested sample?)
</xsd:documentation>
</xsd:annotation>
<!-- elements -->
<xsd:element name="document">
<xsd:annotation>
<xsd:documentation>
A document is essentially a sequence of several parts, such as title page, front matter,
lexical and syntax sections, placeholders for generated content and various lists.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="titlePage" type="ldf:titlePage"/>
<xsd:element name="frontMatter">
<xsd:complexType>
<xsd:sequence>
<xsd:group ref="ldf:topSection" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="lists" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:group ref="ldf:frontList" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="lexicalPart" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:group ref="ldf:lexicalSection" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:choice>
<xsd:element name="core" type="ldf:structuredSection" maxOccurs="unbounded"/>
<xsd:element name="part" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="core" type="ldf:structuredSection" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:choice>
<xsd:element name="backMatter" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:group ref="ldf:topSection" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="annex" type="ldf:structuredSection" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="titlePage">
<xsd:annotation>
<xsd:documentation>
The ``title page'' can in reality be rendered as several pages, but it contains the basic
information that helps to identify this particular language definition and to distinguish
it from similar documents. From our experience, language standards are either marked as
organisation-created or person-authored ones. In the former case, the document must contain
the name of the organisation and the standard reference number within it (e.g, ISO 10279).
In the latter case, one or more authors are specified. It is also possible to mark some sections
as having been authored by a specific set of authors, but the ones defined here are the principal
authors that identify the specific standard.
</xsd:documentation>
<xsd:documentation>
The ``topic'' of the language document is its pure textual title without the reference number
and status: e.g., ``Programming Language REXX'',
``Information technology --- Programming languages --- Full BASIC'', etc. Either version or edition
follows.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:choice>
<xsd:sequence>
<xsd:element name="body" type="ldf:body"/>
<xsd:element name="number" type="xsd:int"/>
</xsd:sequence>
<xsd:sequence>
<xsd:element name="author" type="xsd:string" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:choice>
<xsd:element name="topic" type="xsd:string"/>
<xsd:choice>
<xsd:element name="version" type="xsd:string" default="1.0"/>
<xsd:element name="edition" type="xsd:string"/>
</xsd:choice>
<xsd:element name="status" type="ldf:status"/>
<xsd:element name="date" type="xsd:string"/>
<!-- xsd:date -->
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="body">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="ansi"/>
<xsd:enumeration value="ecma"/>
<xsd:enumeration value="ieee"/>
<xsd:enumeration value="iec"/>
<xsd:enumeration value="iso"/>
<xsd:enumeration value="iso/iet"/>
<xsd:enumeration value="itu"/>
<xsd:enumeration value="ietf"/>
<xsd:enumeration value="iec"/>
<xsd:enumeration value="oasis"/>
<xsd:enumeration value="wsa"/>
<xsd:enumeration value="w3c"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="status">
<xsd:annotation>
<xsd:documentation>
According to W3C Process Document, each viable specification goes through the stages
of Working Draft (WD), Candidate Recommendation (CR), Proposed Recommendation (PR),
W3C Recommendation (REC), with possible continuation to Proposed Edited Recommendation
and decline to Rescinded Recommendation. There has also been a ``Note'fma' status in the past
for internal drafts.
</xsd:documentation>
<xsd:documentation>
IEEE uses different publication types, they are:
Changed Designation,
Collection,
New Standard Project,
Modified New Project,
Modified Revision Project,
Revision Project,
Adoption in Progress,
Approved Publication of IEEE,
International Publication,
Trial Use,
Amendment,
Corrigenda of Standard,
Superseded,
Withdrawn (IEEE Status Report).
</xsd:documentation>
<xsd:documentation>
ISO/IEC operates with the following standard ratification stages:
Approved Work Item (AWI),
Working Draft (WD), Committee Draft (CD),
Committee Draft Technical Report (CD TR),
Committee Draft Technical Specification (CD TS),
Committee Draft for Vote (CDV, only for IEC),
Draft International Standard (DIS),
Final Committee Draft (FCD, only for JTC1),
Draft Technical Report (DTR),
Draft Technical Specification (DTS),
Final Draft International Standard (FDIS),
International Standard (ISO),
Technical Report (ISO TR),
Technical Specification (ISO TS).
</xsd:documentation>
<xsd:documentation>
Some standardisation bodies like ANSI or ECMA do not have a long list of stages, the
standard there is just either approved or not. Of course, it still can be revised,
reaffirmed, withdrawn or be put into a category of technical reports.
</xsd:documentation>
<xsd:documentation>
We summarise these and possibly other sets of statuses by the following enumeration.
Conceptually it provides functionality for the same categories, but the concrete
wording may vary (i.e., ``errata'' vs ``corrigenda'', ``obsolete'' vs ``rescinded'').
If necessary, the schema can be extended with more standard publication types
or even adapted to fit completely in some specific standardisation body classification.
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:token">
<xsd:enumeration value="unknown"/>
<xsd:enumeration value="draft"/>
<!-- working draft, committee draft -->
<xsd:enumeration value="candidate"/>
<xsd:enumeration value="proposed"/>
<xsd:enumeration value="approved"/>
<!-- recommendation, international standard -->
<xsd:enumeration value="revised"/>
<xsd:enumeration value="obsolete"/>
<xsd:enumeration value="withdrawn"/>
<xsd:enumeration value="collection"/>
<xsd:enumeration value="trial"/>
<xsd:enumeration value="errata"/>
<xsd:enumeration value="report"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="generated">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="index"/>
<xsd:enumeration value="fullgrammar"/>
<xsd:enumeration value="listoftables"/>
<xsd:enumeration value="listofauthors"/>
<xsd:enumeration value="listofcontents"/>
<xsd:enumeration value="listofreferences"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="figureType">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="PDF"/>
<xsd:enumeration value="PostScript"/>
<xsd:enumeration value="SVG"/>
<xsd:enumeration value="PNG"/>
<xsd:enumeration value="GIF"/>
<xsd:enumeration value="JPEG"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:group name="topSection">
<xsd:choice>
<xsd:element name="foreword" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
Whatever the authors deem to be important enough to be put on one of the first
pages. For example, in C\# specifications Foreword is about the differences brought
to the language by the current standard, while in the Scheme specification
Foreword discusses programming languages design and demonstrates its principles
applied to the forthcoming document.
</xsd:documentation>
<xsd:documentation>
Technically speaking, Foreword is not a part of the specification. Instead, it
precedes the specification and introduces it by putting in the proper context.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="designGoals" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
The goals of language design are sometimes encounted being explicitly
stated in the language document in one of the informative sections
of the front matter part.
</xsd:documentation>
<xsd:documentation>
For example:
"C\# is intended to be a simple, modern, general-purpose, object-oriented
programming language."
(from ECMA 334 3rd edition, page xvii)
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="scope" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
Scope section explains the context for the language document.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="conformance" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
Conformance section defines several levels of compliance by
explaining what is a conforming program and a conforming
implementation with respect to this standard.
</xsd:documentation>
<xsd:documentation>
Definitions for meta-terms like "shall" and "should"
and their relation to the compliance issue explained above.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="compliance" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
Same as conformance
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="compatibility" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
While conformance/compliance define how external artifacts should
conform to this standard, this section defines how this standard
complies with previously existing ones.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="notation" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
Notation section defines grammar definition formalism used in the document:
mostly it is about the EBNF dialect.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="normativeReferences" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
Formally lined up references to all other standards that are used or referenced to
from within the document.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="documentStructure" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
This section informally describes how the document is organised, divided
into parts and chapters. Sometimes it explicitly states which sections are
normative and which are informative.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="whatsnew" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
A list of changes brought to the language by the current specification
replacing the previous one.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="placeholder" type="ldf:generated">
<xsd:annotation>
<xsd:documentation>
Placeholders are used to designate places where generated content
should be inserted.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<!-- none of the above
<xsd:element name="core" type="ldf:simpleSection"/>
-->
</xsd:choice>
</xsd:group>
<xsd:complexType name="simpleSection">
<xsd:sequence>
<xsd:element name="title" type="xsd:string" minOccurs="0"/>
<xsd:sequence>
<xsd:element name="author" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:element name="content" type="ldf:simpleText"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<xsd:complexType name="simpleText">
<xsd:sequence>
<xsd:group ref="ldf:simpleTextElement" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:group name="simpleTextElement">
<xsd:choice>
<xsd:element name="empty" nillable="true">
<xsd:complexType/>
</xsd:element>
<xsd:element name="text" type="ldf:mixedType"/>
<xsd:element name="figure" type="ldf:simpleFigure"/>
<xsd:element name="table" type="ldf:simpleTable"/>
<xsd:element name="list" type="ldf:simpleList"/>
<xsd:element name="formula">
<xsd:complexType>
<xsd:sequence maxOccurs="unbounded">
<xsd:any namespace="http://www.w3.org/1998/Math/MathML"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!--<xsd:element name="sample">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="src" type="xsd:string"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>-->
<xsd:element name="sample">
<xsd:complexType mixed="true">
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:any namespace="http://www.w3.org/1999/xhtml" processContents="lax"/>
</xsd:sequence>
<xsd:attribute name="src" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element ref="bgf:production"/>
<!-- later redo with MathML -->
<!--<xsd:element ref="mml:math" />-->
</xsd:choice>
</xsd:group>
<xsd:complexType name="simpleFigure">
<xsd:sequence>
<xsd:element name="shortcaption" type="xsd:string" minOccurs="0"/>
<xsd:element name="caption" type="xsd:string"/>
<xsd:element name="source" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="type" type="ldf:figureType"/>
<xsd:choice>
<xsd:element name="localfile" type="xsd:string"/>
<xsd:element name="url" type="xsd:anyURI"/>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<xsd:complexType name="simpleTable">
<xsd:sequence>
<xsd:element name="header" type="ldf:tableRow" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="row" type="ldf:tableRow" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="simpleList">
<xsd:sequence>
<xsd:element name="item" type="ldf:mixedType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:group name="frontList">
<xsd:choice>
<xsd:element name="definitions" type="ldf:listOfTerms">
<xsd:annotation>
<xsd:documentation>
This is a list of definitions for all basic terms needed to understand the document,
but not especially introduced in it. Typical examples include explaining what is
a "program", what is a "namespace", what is a "library", what is "behaviour".
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="abbreviations" type="ldf:listOfTerms">
<xsd:annotation>
<xsd:documentation>
Acronyms like IEEE, ISO or like CLI, BCL are frequently defined here in a separate definition list.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="languageOverview" type="ldf:listOfTerms">
<xsd:annotation>
<xsd:documentation>
Such an informal introduction to the language is not present in all standards.
However, some specifications contain a not claimed to be complete list of
language concepts with their definitions and perhaps even some examples.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:choice>
</xsd:group>
<xsd:group name="lexicalSection">
<xsd:annotation>
<xsd:documentation>
Sections describing lexical structure tend to be shorter, less structured inside,
and very limited in scope: there is usually one on whitespace, one on tokens,
one on literals, one on comments, etc.
</xsd:documentation>
<xsd:documentation>
See the section on grammar notation for more details about how broad even the smallest
aspects (e.g., about line continuations) can vary.
</xsd:documentation>
</xsd:annotation>
<xsd:choice>
<xsd:element name="lineContinuations" type="ldf:simpleSection"/>
<xsd:element name="whitespace" type="ldf:simpleSection"/>
<xsd:element name="tokens" type="ldf:simpleSection"/>
<xsd:element name="preprocessor" type="ldf:simpleSection"/>
<xsd:element name="literals" type="ldf:simpleSection"/>
<!-- none of the above -->
<xsd:element name="lexical" type="ldf:simpleSection"/>
</xsd:choice>
</xsd:group>
<xsd:complexType name="structuredSection">
<xsd:annotation>
<xsd:documentation>
The main bulk of the information the language document possesses
lies in its core sections: they have more structure than other sections
and than their own subsections, so we call them ``structured sections''.
</xsd:documentation>
<xsd:documentation>
Beside the title, any section can include a list of authors that worked on it:
this way even if the whole document is attributed to a particular company
or a standardisation body, the main contributors can be attributed.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="title" type="xsd:string"/>
<xsd:sequence>
<xsd:element name="author" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:group ref="ldf:structuredSectionElement" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- types of content -->
<xsd:complexType name="listOfTerms">
<xsd:sequence>
<xsd:element name="title" type="xsd:string" minOccurs="0"/>
<xsd:sequence>
<xsd:element name="author" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:element name="term" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="definition" type="ldf:simpleText"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!--<xsd:complexType name="listOfInternalLinks">
<xsd:sequence>
<xsd:element name="link" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="text" type="xsd:string"/>
<xsd:element name="linkText" type="xsd:string" minOccurs="0"/>
<xsd:element name="reference" type="xsd:IDREF"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>-->
<xsd:complexType name="tableRow">
<xsd:sequence>
<xsd:element name="cell" maxOccurs="unbounded" type="ldf:simpleText"/>
</xsd:sequence>
</xsd:complexType>
<xsd:group name="structuredSectionElement">
<xsd:choice>
<xsd:element name="placeholder" type="ldf:generated">
<xsd:annotation>
<xsd:documentation>
Some subsections can be generated, especially those that consist
of structured content that is possible to derive automatically
from the information stored in or collected from other sections.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:group ref="ldf:normative">
<xsd:annotation>
<xsd:documentation>
Normative sections are obligatory and usually contain strict content
that needs to be implemented by compiler developers or satisfied
by language end users in order to comply to this standard.
</xsd:documentation>
<xsd:documentation>
For instance, if a section with a grammar production is marked as
normative, this production must hold for the implemented language.
</xsd:documentation>
</xsd:annotation>
</xsd:group>
<xsd:group ref="ldf:informative">
<xsd:annotation>
<xsd:documentation>
Informative sections are supplementary and provide some useful information
that can be omitted or overridden if deemed appropriately.
</xsd:documentation>
<xsd:documentation>
For instance, if all sections with code samples are marked as informative,
we cannot rely on the set of examples extracted from the standard to be
the test set for the language. Apparently, we can still run some analyses
on the basis of this, but it is not legitimate to make any conclusions
about standard inconsistencies based on the informative sections, nor can
they be legitimately be used to resolve inner conflicts of the documentation.
</xsd:documentation>
</xsd:annotation>
</xsd:group>
<xsd:element ref="bgf:production">
<xsd:annotation>
<xsd:documentation>
Grammar productions can be easily extracted from the language document
for the purpose of grammar recovery, grammar adaptation, grammar convergence, etc.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="references" type="ldf:simpleList">
<xsd:annotation>
<xsd:documentation>
Hardbound standards have been trying to be more hypertext
for decades. One of the ways was to attach a list of links
and backlinks to every section --- that way, one can easily
find any related language constructs when learning the
language or debugging a particular feature.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="section" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
Any other type of normative or informative section.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<!-- <xsd:group ref="ldf:top-section"/> -->
<xsd:element name="subtopic" type="ldf:structuredSection">
<xsd:annotation>
<xsd:documentation>
In big documents it is not uncommon to find one topic divided into
several subtopics, each one dedicated to a separate issue and each one
structured in the same way its parent section is.
DSLs and 4GLs specification authors often find it easier to lay out
different clauses of one language construct in different sections.
When the language has a lof of parametrised constructs, it makes sense
to dedicate a special subsection for each field.
Parameters, types, methods, operations, participants---whatever categories
inspire these subtopics, each of them is a fully structured section in itself.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="value">
<xsd:annotation>
<xsd:documentation>
A singled named value can be bound to a language document section: it can be
a type of a parameter that is being described here, or an alternative name,
or a superclass, or anything else that is atomic and non-structured.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="key" type="xsd:string"/>
<xsd:element name="data" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:group>
<!-- tokens -->
<xsd:group name="normative">
<xsd:annotation>
<xsd:documentation>
Normative sections form the core of the language standard: for each core section they belong to,
they define the purpose of the language construct, provide a description, some syntax definition,
list use constraints and other semantic details, etc.
</xsd:documentation>
</xsd:annotation>
<xsd:choice>
<xsd:element name="synopsis" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
A separate subsection named ``purpose'' is only encountered in some 4GL
language manuals (e.g., JCL). However, it is quite common for the first
paragraph of any new section of any language document to relay short word
about the purpose of the language construct that is about to be introduced.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="description" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
Description is the core of the parent section, containing the main details about the
defined topic, information about its usage, motivation behind its design.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="syntax" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
Syntax sections consist of one or more BGF productions, possibly complemented by textual descriptions.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="constraints" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
This section can list requirements needed for using a specific language construct,
applicability constraints and other restrictions.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="relationship" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
Related language constructs can be named and referenced here.
It is not a simple list of references, but rather a comprehensive
overview on the kind of consequences other parts of the language
can bear if this one is used.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="semantics" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
A section on semantics explains in plain English, if no other specific formalism
is used, how exactly the language construct works, what happens inside the system when
it is utilised. It also describes the context in which the introduced language construct
can be encountered and in which it should or should not be used.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="default" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
It is quite common in the sections that describe an optional parameter
to tell the reader what will happen in the case nothing was specified.
``There is no default'' can be as valid a definition as a real default value.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<!-- none of the above
<xsd:element name="normative" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
Any other type of normative section.
</xsd:documentation>
</xsd:annotation>
</xsd:element>-->
</xsd:choice>
</xsd:group>
<xsd:group name="informative">
<xsd:annotation>
<xsd:documentation>
Unlike normative sections that impose some conformance constraints that need
to be satisfied by a language processor to claim compatibility with the standard,
the informative sections are only presented to provide some additional information
to the reader.
</xsd:documentation>
</xsd:annotation>
<xsd:choice>
<xsd:element name="rationale" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
A rationale or a note usually lists some narrow places of
non-obvious usage, implementation details, incompatibility issues,
coding standards, common programming practices, etc. It is a
subsection of secondary importance, contributing some information
on a minor point that can still be interesting and useful for some
readers. Notes usually tell the readers how to use certain language
constructs or tell compiler vendors how to implement them.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="example" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
A subsection with an example can contain a code sample as well
as some accompanying text.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="update" type="ldf:simpleSection">
<xsd:annotation>
<xsd:documentation>
It is quite uncommon practice, but some standardisation bodies really
put the information about language evolution directly into each section
that changed since the last public version of the language document.
</xsd:documentation>
<xsd:documentation>
If this is done consistently and carefully, it is possible to generate
the global ``What's new'' section automatically.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<!-- none of the above -->
</xsd:choice>
</xsd:group>
<!--xsd:complexType name="contentType">
<xsd:annotation>
<xsd:documentation>
A sections content is a list of different kinds of portions.
Text is one kind of portion.
A grammar fragment is another kind of portion.
A sample is yet another kind of portion.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="text" type="ldf:mixedType"/>
<xsd:element name="grammar">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="http://planet-sl.org/bgf" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="language" type="xsd:anyURI" use="required"/>
<xsd:attribute name="version" type="xsd:token" use="optional"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="sample" type="ldf:informative"/>
<xsd:element name="runnable" type="ldf:runnableType"/>
</xsd:choice>
<xsd:element name="section" type="ldf:section" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType-->
<xsd:complexType name="runnableType">
<xsd:annotation>
<xsd:documentation>
Related to the sample, this element shows a way to run a sample.
In FL, it is always just a name of one of the functions and the list of its parameters.
Generally, while keeping the internal structure of this element as such,
one might want to represent it in the resulting language document differently
(i.e. "java Test a b c" instead of "main(a,b,c);" ).
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="context" type="xsd:IDREF">
<xsd:annotation>
<xsd:documentation>
The reference to another sample that must be used
as a context while evaluating this one
The means to refer to this particular sample later in the same document.
For example, this sample introduces a function that is used in one of the next samples.
It can also be a full text of a program that is run with different set of attributes later.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="main" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
The main function that is applied to the arguments.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="argument" type="xsd:string" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
These arguments are passed to the function during execution.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="yields" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
The value that the sample should yield if parsed and
evalutated in the specified language.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="language" type="xsd:anyURI" use="required"/>
<xsd:attribute name="version" type="xsd:token" use="optional"/>
<xsd:attribute name="id" type="xsd:ID" use="optional">
<xsd:annotation>
<xsd:documentation>
The means to refer to this particular sample later in the same document.
For example, this sample introduces a function that is used in one of the next samples.
It can also be a full text of a program that is run with different set of attributes later.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<!--xsd:complexType name="sectionTypeodl">
<xsd:annotation>
<xsd:documentation>
A section has a title, some content, and possibly a list of subsections.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="content" type="ldf:contentType"/>
</xsd:sequence>
</xsd:complexType-->
<xsd:complexType name="mixedType" mixed="true">
<xsd:annotation>
<xsd:documentation>
Any unstructured element of the language document belongs to a so called
mixed type: i.e., it is plain text with some keywords marked.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:any namespace="http://planet-sl.org/ldf" processContents="lax"/>
</xsd:sequence>
<!--<xsd:anyAttribute namespace="##other" processContents="lax"/>-->
</xsd:complexType>
<xsd:element name="formula">
<xsd:annotation>
<xsd:documentation>
Formulae can be used in language documentation in many ways.
The internal representation format is MathML which is W3C Recommendation,
but the external representation can vary, in our case there are two:
\TeX\ and HTML.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence maxOccurs="unbounded">
<xsd:any namespace="http://www.w3.org/1998/Math/MathML"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="keyword" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
Keywords are usually printed in bolder font weight.
They need to be marked as such for two purposes: for presentation and for meta-information.
The former goal serves as a basis for typesetting and hyperlinking,
while the latter allows for correct indexing and searching facilities.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="code" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
Inlined pieces of code are usually printed in typewriter-like font.
They are frequently incomplete, mostly nothing more than simple literals,
and can only be checked to be correct tokens of the language in
a lexical sense.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="link">
<xsd:annotation>
<xsd:documentation>
Internal links are pairs of text that will become clickable in hypertext
presentation forms or precede the reference itself when this is the only
option. The reference points to a section or a subsection of the same
document that the link should refer to. If the explicit text is omitted,
its default value is the name of the section being referenced.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<!--<xsd:element name="text" type="xsd:string"/>-->
<xsd:element name="text" type="xsd:string" minOccurs="0"/>
<xsd:element name="reference" type="xsd:IDREF"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>