Mercurial > ~dholland > hg > ag > index.cgi
comparison tests/agcl/parsifal/xml3.syn @ 0:13d2b8934445
Import AnaGram (near-)release tree into Mercurial.
author | David A. Holland |
---|---|
date | Sat, 22 Dec 2007 17:52:45 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:13d2b8934445 |
---|---|
1 // Document | |
2 | |
3 // [1] | |
4 document $ | |
5 -> prolog, element, Misc?... | |
6 | |
7 | |
8 // Character Range | |
9 | |
10 // [2] | |
11 //Char = 0x9 + 0xA + 0x20..0xd7ff + 0xe000..0xfffd + 0x0000-0x10ffff | |
12 Char = 0x9 + 0xA + 0x20..0xff // 8 bit characters only pro tem | |
13 | |
14 | |
15 // White Space | |
16 | |
17 // [3] | |
18 SpaceChar | |
19 -> 0x20 + 0x9 + 0xd + 0xa | |
20 S | |
21 -> SpaceChar... | |
22 | |
23 | |
24 // Names and Tokens | |
25 | |
26 // [4] | |
27 NameChar = Letter + Digit + '.' + '-' + ':' + CombiningChar + Extender | |
28 | |
29 // [5] | |
30 Name | |
31 -> Letter + '_' + ':', NameChar?... | |
32 | |
33 // [6] | |
34 Names | |
35 -> Name, [S, Name]... | |
36 | |
37 // [7] | |
38 Nmtoken | |
39 -> NameChar... | |
40 | |
41 // [8] | |
42 Nmtokens | |
43 -> Nmtoken, [S, Nmtoken]... | |
44 | |
45 | |
46 // Literals | |
47 | |
48 // [9] | |
49 EntityValue | |
50 -> '"', [~(eof + '%' + '&' + '"') | PEReference | Reference]..., '"' | |
51 -> '\'', [~(eof + '%' + '&' + '\'') | PEReference | Reference]..., '\'' | |
52 | |
53 // [10] | |
54 AttValue | |
55 -> '"', [~(eof + '%' + '&' + '"') | Reference]..., '"' | |
56 -> '\'', [~(eof + '%' + '&' + '\'') | Reference]..., '\'' | |
57 | |
58 // [11] | |
59 SystemLiteral | |
60 -> '"', ~(eof + '"')?..., '"' | |
61 -> '\'', ~(eof + '\'')?..., '\'' | |
62 | |
63 // [12] | |
64 PubidLiteral | |
65 -> '"', PubidChar?..., '"' | |
66 -> '\'', PubidChar?..., '\'' | |
67 | |
68 // [13] | |
69 PubidChar = 0x20 + 0xd + 0xa + 'a-z' + 'A-Z' + '0-9' + | |
70 '-' + '\'' + '(' + ')' + '+' + ',' + '.' + | |
71 '/' + ':' + '?' + ';' + '!' + '*' + '#' + | |
72 '@' + '$' + '_' + '%' | |
73 | |
74 | |
75 // Character Data | |
76 | |
77 // [14] | |
78 DataChar | |
79 -> ~(eof + '<' + '&') | |
80 CharData | |
81 -> DataChar?... | |
82 // Note that use of keyword "]]>" will take care of CDATA problem | |
83 | |
84 | |
85 // Comments | |
86 | |
87 // [15] | |
88 Comment | |
89 -> "<!--", Char?..., "--", '>' | |
90 | |
91 | |
92 // Processing Instructions | |
93 | |
94 // [16] | |
95 PI | |
96 -> "<?", PITarget, [S, char?...], "?>" | |
97 | |
98 // [17] | |
99 PITarget | |
100 -> Name // Name lookup mechanism should reject "xml" | |
101 | |
102 | |
103 // CDATA Sections | |
104 | |
105 // [18] | |
106 CDSect | |
107 -> CDStart, CData, CDEnd | |
108 | |
109 // [19] | |
110 CDStart | |
111 -> "<![CDATA[" | |
112 | |
113 // [20] | |
114 CData | |
115 -> Char?... | |
116 // Keyword recognition logic overrides character recognition | |
117 | |
118 // [21] | |
119 -> "]]>" | |
120 | |
121 | |
122 // Prolog | |
123 | |
124 // [22] | |
125 prolog | |
126 -> XMLDecl?, Misc?..., [doctypedecl, Misc?...] | |
127 | |
128 // [23] | |
129 XMLDecl | |
130 // -> "<?xml", VersionInfo, EncodingDecl?, SDDecl?, S?, "?>" | |
131 -> "<?xml", VersionInfo, EncodingDecl?, [SDDecl, S? | S], "?>" | |
132 | |
133 // [24] | |
134 VersionInfo | |
135 -> S, "version", Eq, {'\'', VersionNum, '\'' | '"', VersionNum, '"'} | |
136 | |
137 // [25] | |
138 Eq | |
139 -> S?, '=', S? | |
140 | |
141 // [26] | |
142 VersionNum | |
143 -> 'a-z' + 'A-Z' + '0-9' + '_' + '.' + ':' + '-'... | |
144 | |
145 // [27] | |
146 Misc | |
147 // -> Comment | PI | S | |
148 -> Comment | PI | SpaceChar // Avoid double recursion | |
149 | |
150 | |
151 // Document Type Definition | |
152 | |
153 // [28] | |
154 doctypedecl | |
155 // -> "<!DOCTYPE", S, Name, [S, ExternalID], S?, [ '[', [markupdecl | PEReference | S]..., ']', S?], '>' | |
156 // -> "<!DOCTYPE", S, Name, [S, ExternalID], S?, [ '[', [markupdecl | PEReference | SpaceChar]..., ']', S?], '>' | |
157 -> "<!DOCTYPE", S, Name, [S, [ExternalID, S?]], [ '[', [markupdecl | PEReference | SpaceChar]..., ']', S?], '>' | |
158 | |
159 // [29] | |
160 markupdecl | |
161 -> elementdecl | |
162 -> AttlistDecl | |
163 -> EntityDecl | |
164 -> NotationDecl | |
165 -> PI | |
166 -> Comment | |
167 | |
168 | |
169 // External Subset | |
170 | |
171 // [30] | |
172 | |
173 extSubset | |
174 -> TextDecl?, extSubsetDecl | |
175 | |
176 // [31] | |
177 extSubsetDecl | |
178 -> [markupdecl | conditionalSect | PEReference | SpaceChar]... | |
179 | |
180 | |
181 // Standalone Document Declaration | |
182 | |
183 // [32] | |
184 SDDecl | |
185 -> S, "standalone", Eq, "'yes'" | "\"yes\"" | "'no'" | "\"no\"" | |
186 | |
187 | |
188 // Language Identification | |
189 | |
190 // [33] | |
191 Language Id | |
192 -> Langcode, ['-', Subcode]... | |
193 | |
194 // [34] | |
195 Langcode | |
196 -> ISO639Code | IanaCode | UserCode | |
197 | |
198 // [35] | |
199 ISO639Code | |
200 -> 'a-z' + 'A-Z' -('i' + 'I' + 'x' + 'X'), 'a-z' + 'A-Z' | |
201 | |
202 // [36] | |
203 IanaCode | |
204 -> 'i' + 'I', '-', 'a-z' + 'A-Z'... | |
205 | |
206 // [37] | |
207 UserCode | |
208 -> 'x' + 'X', '-', 'a-z' + 'A-Z'... | |
209 | |
210 // [38] | |
211 Subcode | |
212 -> 'a-z' + 'A-Z'... | |
213 | |
214 | |
215 // Element | |
216 | |
217 // [39] | |
218 element | |
219 -> EmptyElemTag | STag, content, ETag | |
220 | |
221 | |
222 // Start-Tags, End-Tags, and Empty-Element Tags | |
223 | |
224 // Start-tag | |
225 | |
226 // [40] | |
227 STag | |
228 -> '<', Name, [{S, Attribute}... | S], '>' | |
229 | |
230 // [41] | |
231 Attribute | |
232 -> Name, Eq, AttValue | |
233 | |
234 // End-tag | |
235 | |
236 // [42] | |
237 ETag | |
238 -> "</", Name, S?, '>' | |
239 | |
240 | |
241 // Content of Elements | |
242 | |
243 // [43] | |
244 content | |
245 // -> [element | CharData | Reference | CDSect | PI | Comment]... | |
246 -> [element | DataChar]... |