Commit | Line | Data |
3fea05b9 |
1 | # Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. |
2 | # This program is free software; you can redistribute it and/or |
3 | # modify it under the same terms as Perl itself. |
4 | |
5 | # This file was generated from the 'katexml/xmldebug.xml' file of the syntax highlight |
6 | # engine of the kate text editor (http://kate.kde.org |
7 | |
8 | #kate xml version 1.02 |
9 | #kate version 2.3 |
10 | #generated: Wed Nov 1 21:17:55 2006, localtime |
11 | |
12 | package Syntax::Highlight::Engine::Kate::XML_Debug; |
13 | |
14 | our $VERSION = '0.06'; |
15 | |
16 | use strict; |
17 | use warnings; |
18 | use base('Syntax::Highlight::Engine::Kate::Template'); |
19 | |
20 | sub new { |
21 | my $proto = shift; |
22 | my $class = ref($proto) || $proto; |
23 | my $self = $class->SUPER::new(@_); |
24 | $self->attributes({ |
25 | 'Attribute' => 'DataType', |
26 | 'Comment' => 'Comment', |
27 | 'Doctype Declaration' => 'Keyword', |
28 | 'Entity' => 'Char', |
29 | 'Error' => 'Error', |
30 | 'Normal Tag' => 'Keyword', |
31 | 'Normal Text' => 'Normal', |
32 | 'PI content' => 'Others', |
33 | 'Processing Instruction' => 'Keyword', |
34 | 'Stylesheet' => 'Keyword', |
35 | 'Value' => 'String', |
36 | }); |
37 | $self->listAdd('AttType', |
38 | 'CDATA', |
39 | 'ENTITIES', |
40 | 'ENTITY', |
41 | 'ID', |
42 | 'IDREF', |
43 | 'IDREFS', |
44 | 'NMTOKEN', |
45 | 'NMTOKENS', |
46 | ); |
47 | $self->contextdata({ |
48 | '0:prolog' => { |
49 | callback => \&parse0prolog, |
50 | attribute => 'Error', |
51 | }, |
52 | '10:XMLDecl Standalone' => { |
53 | callback => \&parse10XMLDeclStandalone, |
54 | attribute => 'Error', |
55 | }, |
56 | '11:Misc after XMLDecl' => { |
57 | callback => \&parse11MiscafterXMLDecl, |
58 | attribute => 'Error', |
59 | }, |
60 | '12:Comment after XMLDecl' => { |
61 | callback => \&parse12CommentafterXMLDecl, |
62 | attribute => 'Comment', |
63 | }, |
64 | '13:PI after XMLDecl' => { |
65 | callback => \&parse13PIafterXMLDecl, |
66 | attribute => 'Processing Instruction Body', |
67 | }, |
68 | '14:Doctype Decl Name' => { |
69 | callback => \&parse14DoctypeDeclName, |
70 | attribute => 'Error', |
71 | }, |
72 | '15:Doctype Decl ExternalID' => { |
73 | callback => \&parse15DoctypeDeclExternalID, |
74 | attribute => 'Error', |
75 | }, |
76 | '16:Doctype Decl PublicID' => { |
77 | callback => \&parse16DoctypeDeclPublicID, |
78 | attribute => 'Error', |
79 | }, |
80 | '17:Doctype Decl PublicID qq' => { |
81 | callback => \&parse17DoctypeDeclPublicIDqq, |
82 | attribute => 'Error', |
83 | }, |
84 | '18:Doctype Decl PublicID q' => { |
85 | callback => \&parse18DoctypeDeclPublicIDq, |
86 | attribute => 'Value', |
87 | }, |
88 | '19:Doctype Decl SystemID' => { |
89 | callback => \&parse19DoctypeDeclSystemID, |
90 | attribute => 'Error', |
91 | }, |
92 | '1:XMLDecl Version' => { |
93 | callback => \&parse1XMLDeclVersion, |
94 | attribute => 'Error', |
95 | }, |
96 | '20:Doctype Decl SystemID qq' => { |
97 | callback => \&parse20DoctypeDeclSystemIDqq, |
98 | attribute => 'Value', |
99 | }, |
100 | '21:Doctype Decl SystemID q' => { |
101 | callback => \&parse21DoctypeDeclSystemIDq, |
102 | attribute => 'Value', |
103 | }, |
104 | '22:Doctype Decl IS or end' => { |
105 | callback => \&parse22DoctypeDeclISorend, |
106 | attribute => 'Error', |
107 | }, |
108 | '23:Doctype Decl IS' => { |
109 | callback => \&parse23DoctypeDeclIS, |
110 | attribute => 'Error', |
111 | }, |
112 | '24:elementdecl' => { |
113 | callback => \&parse24elementdecl, |
114 | attribute => 'Error', |
115 | }, |
116 | '25:contentspec' => { |
117 | callback => \&parse25contentspec, |
118 | attribute => 'Error', |
119 | }, |
120 | '26:MixedOrChildren' => { |
121 | callback => \&parse26MixedOrChildren, |
122 | attribute => 'Error', |
123 | }, |
124 | '27:MixedShort' => { |
125 | callback => \&parse27MixedShort, |
126 | attribute => 'Error', |
127 | }, |
128 | '28:MixedLong' => { |
129 | callback => \&parse28MixedLong, |
130 | attribute => 'Error', |
131 | }, |
132 | '29:MixedLong endOrContinue' => { |
133 | callback => \&parse29MixedLongendOrContinue, |
134 | attribute => 'Error', |
135 | }, |
136 | '2:XMLDecl Version Eq' => { |
137 | callback => \&parse2XMLDeclVersionEq, |
138 | attribute => 'Error', |
139 | lineending => '5:XMLDecl Encoding Eq', |
140 | }, |
141 | '30:children unknown' => { |
142 | callback => \&parse30childrenunknown, |
143 | attribute => 'Error', |
144 | }, |
145 | '31:children unknownOrEnd' => { |
146 | callback => \&parse31childrenunknownOrEnd, |
147 | attribute => 'Error', |
148 | }, |
149 | '32:children unknownName' => { |
150 | callback => \&parse32childrenunknownName, |
151 | attribute => 'Error', |
152 | }, |
153 | '33:children choice' => { |
154 | callback => \&parse33childrenchoice, |
155 | attribute => 'Error', |
156 | }, |
157 | '34:children choiceOrEnd' => { |
158 | callback => \&parse34childrenchoiceOrEnd, |
159 | attribute => 'Error', |
160 | }, |
161 | '35:children seq' => { |
162 | callback => \&parse35childrenseq, |
163 | attribute => 'Error', |
164 | }, |
165 | '36:children seqOrEnd' => { |
166 | callback => \&parse36childrenseqOrEnd, |
167 | attribute => 'Error', |
168 | }, |
169 | '37:element end' => { |
170 | callback => \&parse37elementend, |
171 | attribute => 'Error', |
172 | }, |
173 | '38:AttlistDecl' => { |
174 | callback => \&parse38AttlistDecl, |
175 | attribute => 'Error', |
176 | }, |
177 | '39:AttDef' => { |
178 | callback => \&parse39AttDef, |
179 | attribute => 'Error', |
180 | }, |
181 | '3:XMLDecl Version' => { |
182 | callback => \&parse3XMLDeclVersion, |
183 | attribute => 'Error', |
184 | }, |
185 | '40:AttType' => { |
186 | callback => \&parse40AttType, |
187 | attribute => 'Error', |
188 | }, |
189 | '41:NotationStart' => { |
190 | callback => \&parse41NotationStart, |
191 | attribute => 'Error', |
192 | }, |
193 | '42:Notation' => { |
194 | callback => \&parse42Notation, |
195 | attribute => 'Error', |
196 | }, |
197 | '43:Notation or End' => { |
198 | callback => \&parse43NotationorEnd, |
199 | attribute => 'Error', |
200 | }, |
201 | '44:Enumeration' => { |
202 | callback => \&parse44Enumeration, |
203 | attribute => 'Error', |
204 | }, |
205 | '45:Enumeration or End' => { |
206 | callback => \&parse45EnumerationorEnd, |
207 | attribute => 'Error', |
208 | }, |
209 | '46:DefaultDecl' => { |
210 | callback => \&parse46DefaultDecl, |
211 | attribute => 'Error', |
212 | }, |
213 | '47:DefaultDecl AttValue' => { |
214 | callback => \&parse47DefaultDeclAttValue, |
215 | attribute => 'Error', |
216 | }, |
217 | '48:DefaultDecl AttValue qq' => { |
218 | callback => \&parse48DefaultDeclAttValueqq, |
219 | attribute => 'Value', |
220 | }, |
221 | '49:DefaultDecl AttValue q' => { |
222 | callback => \&parse49DefaultDeclAttValueq, |
223 | attribute => 'Value', |
224 | }, |
225 | '4:XMLDecl Encoding' => { |
226 | callback => \&parse4XMLDeclEncoding, |
227 | attribute => 'Error', |
228 | }, |
229 | '50:EntityDecl' => { |
230 | callback => \&parse50EntityDecl, |
231 | attribute => 'Error', |
232 | }, |
233 | '51:unused' => { |
234 | callback => \&parse51unused, |
235 | attribute => 'Error', |
236 | }, |
237 | '52:GEDecl EntityValueOrExternalID' => { |
238 | callback => \&parse52GEDeclEntityValueOrExternalID, |
239 | attribute => 'Error', |
240 | }, |
241 | '53:GEDecl EntityValue qq' => { |
242 | callback => \&parse53GEDeclEntityValueqq, |
243 | attribute => 'Value', |
244 | }, |
245 | '54:GEDecl EntityValue q' => { |
246 | callback => \&parse54GEDeclEntityValueq, |
247 | attribute => 'Value', |
248 | }, |
249 | '55:GEDecl PublicID' => { |
250 | callback => \&parse55GEDeclPublicID, |
251 | attribute => 'Error', |
252 | }, |
253 | '56:GEDecl PublicID qq' => { |
254 | callback => \&parse56GEDeclPublicIDqq, |
255 | attribute => 'Error', |
256 | }, |
257 | '57:GEDecl PublicID q' => { |
258 | callback => \&parse57GEDeclPublicIDq, |
259 | attribute => 'Value', |
260 | }, |
261 | '58:GEDecl SystemID' => { |
262 | callback => \&parse58GEDeclSystemID, |
263 | attribute => 'Error', |
264 | }, |
265 | '59:GEDecl SystemID qq' => { |
266 | callback => \&parse59GEDeclSystemIDqq, |
267 | attribute => 'Value', |
268 | }, |
269 | '5:XMLDecl Encoding Eq' => { |
270 | callback => \&parse5XMLDeclEncodingEq, |
271 | attribute => 'Error', |
272 | }, |
273 | '60:GEDecl SystemID q' => { |
274 | callback => \&parse60GEDeclSystemIDq, |
275 | attribute => 'Value', |
276 | }, |
277 | '61:PEDecl' => { |
278 | callback => \&parse61PEDecl, |
279 | attribute => 'Error', |
280 | }, |
281 | '62:PEDecl EntityValueOrExternalID' => { |
282 | callback => \&parse62PEDeclEntityValueOrExternalID, |
283 | attribute => 'Error', |
284 | }, |
285 | '63:PEDecl PublicID' => { |
286 | callback => \&parse63PEDeclPublicID, |
287 | attribute => 'Error', |
288 | }, |
289 | '64:PEDecl PublicID qq' => { |
290 | callback => \&parse64PEDeclPublicIDqq, |
291 | attribute => 'Error', |
292 | }, |
293 | '65:PEDecl PublicID q' => { |
294 | callback => \&parse65PEDeclPublicIDq, |
295 | attribute => 'Value', |
296 | }, |
297 | '66:PEDecl SystemID' => { |
298 | callback => \&parse66PEDeclSystemID, |
299 | attribute => 'Error', |
300 | }, |
301 | '67:PEDecl SystemID qq' => { |
302 | callback => \&parse67PEDeclSystemIDqq, |
303 | attribute => 'Value', |
304 | }, |
305 | '68:PEDecl SystemID q' => { |
306 | callback => \&parse68PEDeclSystemIDq, |
307 | attribute => 'Value', |
308 | }, |
309 | '69:GEDecl endOrNDATA' => { |
310 | callback => \&parse69GEDeclendOrNDATA, |
311 | attribute => 'Error', |
312 | }, |
313 | '6:XMLDecl Encoding' => { |
314 | callback => \&parse6XMLDeclEncoding, |
315 | attribute => 'Error', |
316 | }, |
317 | '70:GEDecl NDATA' => { |
318 | callback => \&parse70GEDeclNDATA, |
319 | attribute => 'Error', |
320 | }, |
321 | '71:NotationDecl Name' => { |
322 | callback => \&parse71NotationDeclName, |
323 | attribute => 'Error', |
324 | }, |
325 | '72:NotationDecl ExternalID' => { |
326 | callback => \&parse72NotationDeclExternalID, |
327 | attribute => 'Error', |
328 | }, |
329 | '73:NotationDecl PublicID' => { |
330 | callback => \&parse73NotationDeclPublicID, |
331 | attribute => 'Error', |
332 | }, |
333 | '74:NotationDecl PublicID qq' => { |
334 | callback => \&parse74NotationDeclPublicIDqq, |
335 | attribute => 'Error', |
336 | }, |
337 | '75:NotationDecl PublicID q' => { |
338 | callback => \&parse75NotationDeclPublicIDq, |
339 | attribute => 'Value', |
340 | }, |
341 | '76:NotationDecl SystemIDOrEnd' => { |
342 | callback => \&parse76NotationDeclSystemIDOrEnd, |
343 | attribute => 'Error', |
344 | }, |
345 | '77:Comment inside IS' => { |
346 | callback => \&parse77CommentinsideIS, |
347 | attribute => 'Comment', |
348 | }, |
349 | '78:PI inside IS' => { |
350 | callback => \&parse78PIinsideIS, |
351 | attribute => 'Processing Instruction Body', |
352 | }, |
353 | '79:Outside' => { |
354 | callback => \&parse79Outside, |
355 | attribute => 'Normal Text', |
356 | }, |
357 | '7:XMLDecl Standalone' => { |
358 | callback => \&parse7XMLDeclStandalone, |
359 | attribute => 'Error', |
360 | }, |
361 | '80:STag' => { |
362 | callback => \&parse80STag, |
363 | attribute => 'Error', |
364 | }, |
365 | '81:STag Attribute' => { |
366 | callback => \&parse81STagAttribute, |
367 | attribute => 'Error', |
368 | }, |
369 | '82:STag Attribute Value' => { |
370 | callback => \&parse82STagAttributeValue, |
371 | attribute => 'Error', |
372 | }, |
373 | '83:STag Value qq' => { |
374 | callback => \&parse83STagValueqq, |
375 | attribute => 'Value', |
376 | }, |
377 | '84:STag Value q' => { |
378 | callback => \&parse84STagValueq, |
379 | attribute => 'Value', |
380 | }, |
381 | '85:ETag' => { |
382 | callback => \&parse85ETag, |
383 | attribute => 'Error', |
384 | }, |
385 | '86:CDSect' => { |
386 | callback => \&parse86CDSect, |
387 | attribute => 'Normal Text', |
388 | }, |
389 | '87:Comment inside IS' => { |
390 | callback => \&parse87CommentinsideIS, |
391 | attribute => 'Comment', |
392 | }, |
393 | '88:PI inside IS' => { |
394 | callback => \&parse88PIinsideIS, |
395 | attribute => 'Processing Instruction Body', |
396 | }, |
397 | '8:XMLDecl Standalone Eq' => { |
398 | callback => \&parse8XMLDeclStandaloneEq, |
399 | attribute => 'Error', |
400 | }, |
401 | '9:XMLDecl Standalone' => { |
402 | callback => \&parse9XMLDeclStandalone, |
403 | attribute => 'Error', |
404 | }, |
405 | }); |
406 | $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); |
407 | $self->basecontext('0:prolog'); |
408 | $self->keywordscase(1); |
409 | $self->initialize; |
410 | bless ($self, $class); |
411 | return $self; |
412 | } |
413 | |
414 | sub language { |
415 | return 'XML (Debug)'; |
416 | } |
417 | |
418 | sub parse0prolog { |
419 | my ($self, $text) = @_; |
420 | # type => RegExpr |
421 | if ($self->testRegExpr($text, '<\\?xml(\\s+|$)', 0, 0, 0, undef, 0, '1:XMLDecl Version', 'Doctype Declaration')) { |
422 | return 1 |
423 | } |
424 | return 0; |
425 | }; |
426 | |
427 | sub parse10XMLDeclStandalone { |
428 | my ($self, $text) = @_; |
429 | # type => RegExpr |
430 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
431 | return 1 |
432 | } |
433 | # type => RegExpr |
434 | if ($self->testRegExpr($text, '\\?>', 0, 0, 0, undef, 0, '11:Misc after XMLDecl', 'Doctype Declaration')) { |
435 | return 1 |
436 | } |
437 | return 0; |
438 | }; |
439 | |
440 | sub parse11MiscafterXMLDecl { |
441 | my ($self, $text) = @_; |
442 | # type => RegExpr |
443 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) { |
444 | return 1 |
445 | } |
446 | # type => RegExpr |
447 | if ($self->testRegExpr($text, '\\s*<!--\\s*', 0, 0, 0, undef, 0, '12:Comment after XMLDecl', 'Comment')) { |
448 | return 1 |
449 | } |
450 | # type => RegExpr |
451 | if ($self->testRegExpr($text, '\\s*<\\?xml-stylesheet(\\s+|$)', 0, 0, 0, undef, 0, '13:PI after XMLDecl', 'Processing Instruction')) { |
452 | return 1 |
453 | } |
454 | # type => RegExpr |
455 | if ($self->testRegExpr($text, '\\s*<\\??[xX][mM][lL]', 0, 0, 0, undef, 0, '13:PI after XMLDecl', 'Error')) { |
456 | return 1 |
457 | } |
458 | # type => RegExpr |
459 | if ($self->testRegExpr($text, '\\s*<\\?[a-zA-Z_][a-zA-Z0-9_-]*(:[a-zA-Z0-9_-]*)?(\\s+|$)', 0, 0, 0, undef, 0, '13:PI after XMLDecl', 'Processing Instruction')) { |
460 | return 1 |
461 | } |
462 | # type => RegExpr |
463 | if ($self->testRegExpr($text, '<!DOCTYPE(\\s+|$)', 0, 0, 0, undef, 0, '14:Doctype Decl Name', 'Doctype Declaration')) { |
464 | return 1 |
465 | } |
466 | # type => RegExpr |
467 | if ($self->testRegExpr($text, '<[xX][mM][lL](\\w|[_.-])*(:(\\w|[_.-])+)?', 0, 0, 0, undef, 0, '80:STag', 'Error')) { |
468 | return 1 |
469 | } |
470 | # type => RegExpr |
471 | if ($self->testRegExpr($text, '<(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|_)(\\w|[_.-])*(:(\\w|[_.-])+)?', 0, 0, 0, undef, 0, '80:STag', 'Normal Tag')) { |
472 | return 1 |
473 | } |
474 | # type => RegExpr |
475 | if ($self->testRegExpr($text, '<(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[:_])(\\w|[:_.-])*', 0, 0, 0, undef, 0, '80:STag', 'Error')) { |
476 | return 1 |
477 | } |
478 | # type => RegExpr |
479 | if ($self->testRegExpr($text, '</[xX][mM][lL](\\w|[_.-])*(:(\\w|[_.-])+)?', 0, 0, 0, undef, 0, '85:ETag', 'Error')) { |
480 | return 1 |
481 | } |
482 | # type => RegExpr |
483 | if ($self->testRegExpr($text, '</(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|_)(\\w|[_.-])*(:(\\w|[_.-])+)?', 0, 0, 0, undef, 0, '85:ETag', 'Normal Tag')) { |
484 | return 1 |
485 | } |
486 | # type => RegExpr |
487 | if ($self->testRegExpr($text, '</(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[:_])(\\w|[:_.-])*', 0, 0, 0, undef, 0, '85:ETag', 'Error')) { |
488 | return 1 |
489 | } |
490 | # type => RegExpr |
491 | if ($self->testRegExpr($text, '&(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*;', 0, 0, 0, undef, 0, '79:Outside', 'Entity')) { |
492 | return 1 |
493 | } |
494 | # type => RegExpr |
495 | if ($self->testRegExpr($text, '&#(x[0-9a-fA-F]+|[0-9]+);', 0, 0, 0, undef, 0, '79:Outside', 'Entity')) { |
496 | return 1 |
497 | } |
498 | # type => RegExpr |
499 | if ($self->testRegExpr($text, '<!\\[CDATA\\[', 0, 0, 0, undef, 0, '86:CDSect', 'Entity')) { |
500 | return 1 |
501 | } |
502 | # type => RegExpr |
503 | if ($self->testRegExpr($text, '<!--', 0, 0, 0, undef, 0, '87:Comment inside IS', 'Comment')) { |
504 | return 1 |
505 | } |
506 | # type => RegExpr |
507 | if ($self->testRegExpr($text, '<\\?xml-stylesheet(\\s|$)', 0, 0, 0, undef, 0, '88:PI inside IS', 'Normal Tag')) { |
508 | return 1 |
509 | } |
510 | # type => RegExpr |
511 | if ($self->testRegExpr($text, '<\\?[xX][mM][lL](\\w|[_.-])*(:(\\w|[_.-])+)?', 0, 0, 0, undef, 0, '88:PI inside IS', 'Error')) { |
512 | return 1 |
513 | } |
514 | # type => RegExpr |
515 | if ($self->testRegExpr($text, '<\\?(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|_)(\\w|[_.-])*(:(\\w|[_.-])+)?', 0, 0, 0, undef, 0, '88:PI inside IS', 'Normal Tag')) { |
516 | return 1 |
517 | } |
518 | # type => RegExpr |
519 | if ($self->testRegExpr($text, '<\\?(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[:_])(\\w|[:_.-])*', 0, 0, 0, undef, 0, '88:PI inside IS', 'Error')) { |
520 | return 1 |
521 | } |
522 | # type => DetectChar |
523 | if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, '79:Outside', 'Error')) { |
524 | return 1 |
525 | } |
526 | # type => DetectChar |
527 | if ($self->testDetectChar($text, '&', 0, 0, 0, undef, 0, '79:Outside', 'Error')) { |
528 | return 1 |
529 | } |
530 | # type => RegExpr |
531 | if ($self->testRegExpr($text, '\\]\\]>', 0, 0, 0, undef, 0, '79:Outside', 'Error')) { |
532 | return 1 |
533 | } |
534 | return 0; |
535 | }; |
536 | |
537 | sub parse12CommentafterXMLDecl { |
538 | my ($self, $text) = @_; |
539 | # type => RegExpr |
540 | if ($self->testRegExpr($text, '--->', 0, 0, 0, undef, 0, '#pop', 'Error')) { |
541 | return 1 |
542 | } |
543 | # type => RegExpr |
544 | if ($self->testRegExpr($text, '-->', 0, 0, 0, undef, 0, '#pop', 'Comment')) { |
545 | return 1 |
546 | } |
547 | # type => Detect2Chars |
548 | if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
549 | return 1 |
550 | } |
551 | return 0; |
552 | }; |
553 | |
554 | sub parse13PIafterXMLDecl { |
555 | my ($self, $text) = @_; |
556 | # type => Detect2Chars |
557 | if ($self->testDetect2Chars($text, '?', '>', 0, 0, 0, undef, 0, '#pop', 'Processing Instruction')) { |
558 | return 1 |
559 | } |
560 | return 0; |
561 | }; |
562 | |
563 | sub parse14DoctypeDeclName { |
564 | my ($self, $text) = @_; |
565 | # type => RegExpr |
566 | if ($self->testRegExpr($text, '(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*(\\s+|$)', 0, 0, 0, undef, 0, '15:Doctype Decl ExternalID', 'Doctype Declaration')) { |
567 | return 1 |
568 | } |
569 | # type => RegExpr |
570 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
571 | return 1 |
572 | } |
573 | return 0; |
574 | }; |
575 | |
576 | sub parse15DoctypeDeclExternalID { |
577 | my ($self, $text) = @_; |
578 | # type => RegExpr |
579 | if ($self->testRegExpr($text, 'PUBLIC(\\s+|$)', 0, 0, 0, undef, 0, '16:Doctype Decl PublicID', 'Doctype Declaration')) { |
580 | return 1 |
581 | } |
582 | # type => RegExpr |
583 | if ($self->testRegExpr($text, 'SYSTEM(\\s+|$)', 0, 0, 0, undef, 0, '19:Doctype Decl SystemID', 'Doctype Declaration')) { |
584 | return 1 |
585 | } |
586 | # type => DetectChar |
587 | if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Doctype Declaration')) { |
588 | return 1 |
589 | } |
590 | # type => DetectChar |
591 | if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Doctype Declaration')) { |
592 | return 1 |
593 | } |
594 | # type => RegExpr |
595 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
596 | return 1 |
597 | } |
598 | return 0; |
599 | }; |
600 | |
601 | sub parse16DoctypeDeclPublicID { |
602 | my ($self, $text) = @_; |
603 | # type => DetectChar |
604 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '17:Doctype Decl PublicID qq', 'Value')) { |
605 | return 1 |
606 | } |
607 | # type => DetectChar |
608 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '18:Doctype Decl PublicID q', 'Value')) { |
609 | return 1 |
610 | } |
611 | # type => RegExpr |
612 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
613 | return 1 |
614 | } |
615 | return 0; |
616 | }; |
617 | |
618 | sub parse17DoctypeDeclPublicIDqq { |
619 | my ($self, $text) = @_; |
620 | # type => DetectChar |
621 | if ($self->testDetectChar($text, '"(\\s+|$)', 0, 0, 0, undef, 0, '19:Doctype Decl SystemID', 'Value')) { |
622 | return 1 |
623 | } |
624 | # type => RegExpr |
625 | if ($self->testRegExpr($text, '[ \r |
626 | a-zA-Z0-9\'()+,./:=?;!*#@$_%-]', 0, 0, 0, undef, 0, '#stay', 'Value')) { |
627 | return 1 |
628 | } |
629 | return 0; |
630 | }; |
631 | |
632 | sub parse18DoctypeDeclPublicIDq { |
633 | my ($self, $text) = @_; |
634 | # type => DetectChar |
635 | if ($self->testDetectChar($text, '\'(\\s+|$)', 0, 0, 0, undef, 0, '19:Doctype Decl SystemID', 'Value')) { |
636 | return 1 |
637 | } |
638 | # type => RegExpr |
639 | if ($self->testRegExpr($text, '[ \r |
640 | a-zA-Z0-9()+,./:=?;!*#@$_%-]', 0, 0, 0, undef, 0, '#stay', 'Value')) { |
641 | return 1 |
642 | } |
643 | return 0; |
644 | }; |
645 | |
646 | sub parse19DoctypeDeclSystemID { |
647 | my ($self, $text) = @_; |
648 | # type => DetectChar |
649 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '20:Doctype Decl SystemID qq', 'Value')) { |
650 | return 1 |
651 | } |
652 | # type => DetectChar |
653 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '21:Doctype Decl SystemID q', 'Value')) { |
654 | return 1 |
655 | } |
656 | # type => RegExpr |
657 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
658 | return 1 |
659 | } |
660 | return 0; |
661 | }; |
662 | |
663 | sub parse1XMLDeclVersion { |
664 | my ($self, $text) = @_; |
665 | # type => RegExpr |
666 | if ($self->testRegExpr($text, '\\s*version\\s*', 0, 0, 0, undef, 0, '2:XMLDecl Version Eq', 'Attribute')) { |
667 | return 1 |
668 | } |
669 | # type => RegExpr |
670 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
671 | return 1 |
672 | } |
673 | return 0; |
674 | }; |
675 | |
676 | sub parse20DoctypeDeclSystemIDqq { |
677 | my ($self, $text) = @_; |
678 | # type => DetectChar |
679 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '22:Doctype Decl IS or end', 'Value')) { |
680 | return 1 |
681 | } |
682 | return 0; |
683 | }; |
684 | |
685 | sub parse21DoctypeDeclSystemIDq { |
686 | my ($self, $text) = @_; |
687 | # type => DetectChar |
688 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '22:Doctype Decl IS or end', 'Value')) { |
689 | return 1 |
690 | } |
691 | return 0; |
692 | }; |
693 | |
694 | sub parse22DoctypeDeclISorend { |
695 | my ($self, $text) = @_; |
696 | # type => DetectChar |
697 | if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Doctype Declaration')) { |
698 | return 1 |
699 | } |
700 | # type => DetectChar |
701 | if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '79:Outside', 'Doctype Declaration')) { |
702 | return 1 |
703 | } |
704 | # type => RegExpr |
705 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
706 | return 1 |
707 | } |
708 | return 0; |
709 | }; |
710 | |
711 | sub parse23DoctypeDeclIS { |
712 | my ($self, $text) = @_; |
713 | # type => RegExpr |
714 | if ($self->testRegExpr($text, '%(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*;', 0, 0, 0, undef, 0, '#stay', 'Entity')) { |
715 | return 1 |
716 | } |
717 | # type => RegExpr |
718 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
719 | return 1 |
720 | } |
721 | # type => RegExpr |
722 | if ($self->testRegExpr($text, '<!ELEMENT(\\s+|$)', 0, 0, 0, undef, 0, '24:elementdecl', 'Doctype Declaration')) { |
723 | return 1 |
724 | } |
725 | # type => RegExpr |
726 | if ($self->testRegExpr($text, '<!ATTLIST(\\s+|$)', 0, 0, 0, undef, 0, '38:AttlistDecl', 'Doctype Declaration')) { |
727 | return 1 |
728 | } |
729 | # type => RegExpr |
730 | if ($self->testRegExpr($text, '<!ENTITY(\\s+|$)', 0, 0, 0, undef, 0, '50:EntityDecl', 'Doctype Declaration')) { |
731 | return 1 |
732 | } |
733 | # type => RegExpr |
734 | if ($self->testRegExpr($text, '<!NOTATION(\\s+|$)', 0, 0, 0, undef, 0, '71:NotationDecl Name', 'Doctype Declaration')) { |
735 | return 1 |
736 | } |
737 | # type => RegExpr |
738 | if ($self->testRegExpr($text, '\\s*<!--\\s*', 0, 0, 0, undef, 0, '77:Comment inside IS', 'Comment')) { |
739 | return 1 |
740 | } |
741 | # type => RegExpr |
742 | if ($self->testRegExpr($text, '\\s*<\\?xml-stylesheet(\\s+|$)', 0, 0, 0, undef, 0, '78:PI inside IS', 'Processing Instruction')) { |
743 | return 1 |
744 | } |
745 | # type => RegExpr |
746 | if ($self->testRegExpr($text, '\\s*<\\??[xX][mM][lL]', 0, 0, 0, undef, 0, '78:PI inside IS', 'Error')) { |
747 | return 1 |
748 | } |
749 | # type => RegExpr |
750 | if ($self->testRegExpr($text, '\\s*<\\?[a-zA-Z_][a-zA-Z0-9_-]*(:[a-zA-Z0-9_-]*)?(\\s+|$)', 0, 0, 0, undef, 0, '78:PI inside IS', 'Processing Instruction')) { |
751 | return 1 |
752 | } |
753 | # type => Detect2Chars |
754 | if ($self->testDetect2Chars($text, ']', '>', 0, 0, 0, undef, 0, '79:Outside', 'Doctype Declaration')) { |
755 | return 1 |
756 | } |
757 | return 0; |
758 | }; |
759 | |
760 | sub parse24elementdecl { |
761 | my ($self, $text) = @_; |
762 | # type => RegExpr |
763 | if ($self->testRegExpr($text, '(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*', 0, 0, 0, undef, 0, '25:contentspec', 'Normal Tag')) { |
764 | return 1 |
765 | } |
766 | # type => RegExpr |
767 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
768 | return 1 |
769 | } |
770 | return 0; |
771 | }; |
772 | |
773 | sub parse25contentspec { |
774 | my ($self, $text) = @_; |
775 | # type => RegExpr |
776 | if ($self->testRegExpr($text, '(EMPTY|ANY)', 0, 0, 0, undef, 0, '37:element end', 'Attribute')) { |
777 | return 1 |
778 | } |
779 | # type => DetectChar |
780 | if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '26:MixedOrChildren', 'Attribute')) { |
781 | return 1 |
782 | } |
783 | # type => RegExpr |
784 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
785 | return 1 |
786 | } |
787 | return 0; |
788 | }; |
789 | |
790 | sub parse26MixedOrChildren { |
791 | my ($self, $text) = @_; |
792 | # type => RegExpr |
793 | if ($self->testRegExpr($text, '#PCDATA', 0, 0, 0, undef, 0, '27:MixedShort', 'Attribute')) { |
794 | return 1 |
795 | } |
796 | # type => RegExpr |
797 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
798 | return 1 |
799 | } |
800 | # type => DetectChar |
801 | if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '30:children unknown', 'Doctype Declaration')) { |
802 | return 1 |
803 | } |
804 | # type => RegExpr |
805 | if ($self->testRegExpr($text, '(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*[\\?\\*\\+]?', 0, 0, 0, undef, 0, '30:children unknown', 'Value')) { |
806 | return 1 |
807 | } |
808 | return 0; |
809 | }; |
810 | |
811 | sub parse27MixedShort { |
812 | my ($self, $text) = @_; |
813 | # type => DetectChar |
814 | if ($self->testDetectChar($text, '|', 0, 0, 0, undef, 0, '28:MixedLong', 'Doctype Declaration')) { |
815 | return 1 |
816 | } |
817 | # type => RegExpr |
818 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
819 | return 1 |
820 | } |
821 | # type => DetectChar |
822 | if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '37:element end', 'Doctype Declaration')) { |
823 | return 1 |
824 | } |
825 | return 0; |
826 | }; |
827 | |
828 | sub parse28MixedLong { |
829 | my ($self, $text) = @_; |
830 | # type => RegExpr |
831 | if ($self->testRegExpr($text, '(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*', 0, 0, 0, undef, 0, '29:MixedLong endOrContinue', 'Value')) { |
832 | return 1 |
833 | } |
834 | # type => RegExpr |
835 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
836 | return 1 |
837 | } |
838 | return 0; |
839 | }; |
840 | |
841 | sub parse29MixedLongendOrContinue { |
842 | my ($self, $text) = @_; |
843 | # type => DetectChar |
844 | if ($self->testDetectChar($text, '|', 0, 0, 0, undef, 0, '#pop', 'Doctype Declaration')) { |
845 | return 1 |
846 | } |
847 | # type => RegExpr |
848 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#pop#pop', 'Doctype Declaration')) { |
849 | return 1 |
850 | } |
851 | # type => Detect2Chars |
852 | if ($self->testDetect2Chars($text, ')', '*', 0, 0, 0, undef, 0, '37:element end', 'Doctype Declaration')) { |
853 | return 1 |
854 | } |
855 | return 0; |
856 | }; |
857 | |
858 | sub parse2XMLDeclVersionEq { |
859 | my ($self, $text) = @_; |
860 | # type => RegExpr |
861 | if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, '3:XMLDecl Version', 'Attribute')) { |
862 | return 1 |
863 | } |
864 | # type => RegExpr |
865 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Attribute')) { |
866 | return 1 |
867 | } |
868 | return 0; |
869 | }; |
870 | |
871 | sub parse30childrenunknown { |
872 | my ($self, $text) = @_; |
873 | # type => DetectChar |
874 | if ($self->testDetectChar($text, '|', 0, 0, 0, undef, 0, '33:children choice', 'Doctype Declaration')) { |
875 | return 1 |
876 | } |
877 | # type => DetectChar |
878 | if ($self->testDetectChar($text, ',', 0, 0, 0, undef, 0, '35:children seq', 'Doctype Declaration')) { |
879 | return 1 |
880 | } |
881 | # type => RegExpr |
882 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
883 | return 1 |
884 | } |
885 | # type => RegExpr |
886 | if ($self->testRegExpr($text, '\\)[\\?\\*\\+]?', 0, 0, 0, undef, 0, '31:children unknownOrEnd', 'Doctype Declaration')) { |
887 | return 1 |
888 | } |
889 | return 0; |
890 | }; |
891 | |
892 | sub parse31childrenunknownOrEnd { |
893 | my ($self, $text) = @_; |
894 | # type => DetectChar |
895 | if ($self->testDetectChar($text, '|', 0, 0, 0, undef, 0, '33:children choice', 'Doctype Declaration')) { |
896 | return 1 |
897 | } |
898 | # type => DetectChar |
899 | if ($self->testDetectChar($text, ',', 0, 0, 0, undef, 0, '35:children seq', 'Doctype Declaration')) { |
900 | return 1 |
901 | } |
902 | # type => RegExpr |
903 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
904 | return 1 |
905 | } |
906 | # type => RegExpr |
907 | if ($self->testRegExpr($text, '\\)[\\?\\*\\+]?', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
908 | return 1 |
909 | } |
910 | # type => DetectChar |
911 | if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Doctype Declaration')) { |
912 | return 1 |
913 | } |
914 | return 0; |
915 | }; |
916 | |
917 | sub parse32childrenunknownName { |
918 | my ($self, $text) = @_; |
919 | # type => RegExpr |
920 | if ($self->testRegExpr($text, '(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*[\\?\\*\\+]?', 0, 0, 0, undef, 0, '30:children unknown', 'Value')) { |
921 | return 1 |
922 | } |
923 | # type => DetectChar |
924 | if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
925 | return 1 |
926 | } |
927 | # type => RegExpr |
928 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
929 | return 1 |
930 | } |
931 | return 0; |
932 | }; |
933 | |
934 | sub parse33childrenchoice { |
935 | my ($self, $text) = @_; |
936 | # type => RegExpr |
937 | if ($self->testRegExpr($text, '(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*[\\?\\*\\+]?', 0, 0, 0, undef, 0, '34:children choiceOrEnd', 'Value')) { |
938 | return 1 |
939 | } |
940 | # type => DetectChar |
941 | if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '32:children unknownName', 'Doctype Declaration')) { |
942 | return 1 |
943 | } |
944 | # type => RegExpr |
945 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
946 | return 1 |
947 | } |
948 | return 0; |
949 | }; |
950 | |
951 | sub parse34childrenchoiceOrEnd { |
952 | my ($self, $text) = @_; |
953 | # type => DetectChar |
954 | if ($self->testDetectChar($text, '|', 0, 0, 0, undef, 0, '#pop', 'Doctype Declaration')) { |
955 | return 1 |
956 | } |
957 | # type => RegExpr |
958 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
959 | return 1 |
960 | } |
961 | # type => RegExpr |
962 | if ($self->testRegExpr($text, '\\)[\\?\\*\\+]?', 0, 0, 0, undef, 0, '31:children unknownOrEnd', 'Doctype Declaration')) { |
963 | return 1 |
964 | } |
965 | return 0; |
966 | }; |
967 | |
968 | sub parse35childrenseq { |
969 | my ($self, $text) = @_; |
970 | # type => RegExpr |
971 | if ($self->testRegExpr($text, '(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*[\\?\\*\\+]?', 0, 0, 0, undef, 0, '36:children seqOrEnd', 'Value')) { |
972 | return 1 |
973 | } |
974 | # type => DetectChar |
975 | if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '32:children unknownName', 'Doctype Declaration')) { |
976 | return 1 |
977 | } |
978 | # type => RegExpr |
979 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
980 | return 1 |
981 | } |
982 | return 0; |
983 | }; |
984 | |
985 | sub parse36childrenseqOrEnd { |
986 | my ($self, $text) = @_; |
987 | # type => DetectChar |
988 | if ($self->testDetectChar($text, ',', 0, 0, 0, undef, 0, '#pop', 'Doctype Declaration')) { |
989 | return 1 |
990 | } |
991 | # type => RegExpr |
992 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
993 | return 1 |
994 | } |
995 | # type => RegExpr |
996 | if ($self->testRegExpr($text, '\\)[\\?\\*\\+]?', 0, 0, 0, undef, 0, '31:children unknownOrEnd', 'Doctype Declaration')) { |
997 | return 1 |
998 | } |
999 | return 0; |
1000 | }; |
1001 | |
1002 | sub parse37elementend { |
1003 | my ($self, $text) = @_; |
1004 | # type => DetectChar |
1005 | if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Doctype Declaration')) { |
1006 | return 1 |
1007 | } |
1008 | # type => RegExpr |
1009 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1010 | return 1 |
1011 | } |
1012 | return 0; |
1013 | }; |
1014 | |
1015 | sub parse38AttlistDecl { |
1016 | my ($self, $text) = @_; |
1017 | # type => RegExpr |
1018 | if ($self->testRegExpr($text, '(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*(\\s+|$)', 0, 0, 0, undef, 0, '39:AttDef', 'Normal Tag')) { |
1019 | return 1 |
1020 | } |
1021 | # type => RegExpr |
1022 | if ($self->testRegExpr($text, '(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*>', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Normal Tag')) { |
1023 | return 1 |
1024 | } |
1025 | # type => RegExpr |
1026 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1027 | return 1 |
1028 | } |
1029 | return 0; |
1030 | }; |
1031 | |
1032 | sub parse39AttDef { |
1033 | my ($self, $text) = @_; |
1034 | # type => RegExpr |
1035 | if ($self->testRegExpr($text, '(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*(\\s+|$)', 0, 0, 0, undef, 0, '40:AttType', 'Attribute')) { |
1036 | return 1 |
1037 | } |
1038 | # type => RegExpr |
1039 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1040 | return 1 |
1041 | } |
1042 | # type => DetectChar |
1043 | if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Doctype Declaration')) { |
1044 | return 1 |
1045 | } |
1046 | return 0; |
1047 | }; |
1048 | |
1049 | sub parse3XMLDeclVersion { |
1050 | my ($self, $text) = @_; |
1051 | # type => RegExpr |
1052 | if ($self->testRegExpr($text, '\\s*("[A-Za-z0-9:._-]*"|\'[A-Za-z0-9:._-]*\')(?!e)\\s*', 0, 0, 0, undef, 0, '4:XMLDecl Encoding', 'Value')) { |
1053 | return 1 |
1054 | } |
1055 | # type => RegExpr |
1056 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Attribute')) { |
1057 | return 1 |
1058 | } |
1059 | return 0; |
1060 | }; |
1061 | |
1062 | sub parse40AttType { |
1063 | my ($self, $text) = @_; |
1064 | # type => keyword |
1065 | if ($self->testKeyword($text, 'AttType', 0, 0, undef, 0, '46:DefaultDecl', 'Doctype Declaration')) { |
1066 | return 1 |
1067 | } |
1068 | # type => RegExpr |
1069 | if ($self->testRegExpr($text, 'NOTATION(\\s+|$)', 0, 0, 0, undef, 0, '41:NotationStart', 'Doctype Declaration')) { |
1070 | return 1 |
1071 | } |
1072 | # type => DetectChar |
1073 | if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '42:Notation', 'Doctype Declaration')) { |
1074 | return 1 |
1075 | } |
1076 | # type => RegExpr |
1077 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#pop', 'Doctype Declaration')) { |
1078 | return 1 |
1079 | } |
1080 | return 0; |
1081 | }; |
1082 | |
1083 | sub parse41NotationStart { |
1084 | my ($self, $text) = @_; |
1085 | # type => DetectChar |
1086 | if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '42:Notation', 'Doctype Declaration')) { |
1087 | return 1 |
1088 | } |
1089 | # type => RegExpr |
1090 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#pop#pop', 'Doctype Declaration')) { |
1091 | return 1 |
1092 | } |
1093 | return 0; |
1094 | }; |
1095 | |
1096 | sub parse42Notation { |
1097 | my ($self, $text) = @_; |
1098 | # type => RegExpr |
1099 | if ($self->testRegExpr($text, '(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*', 0, 0, 0, undef, 0, '43:Notation or End', 'Value')) { |
1100 | return 1 |
1101 | } |
1102 | # type => RegExpr |
1103 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1104 | return 1 |
1105 | } |
1106 | return 0; |
1107 | }; |
1108 | |
1109 | sub parse43NotationorEnd { |
1110 | my ($self, $text) = @_; |
1111 | # type => DetectChar |
1112 | if ($self->testDetectChar($text, '|', 0, 0, 0, undef, 0, '#pop', 'Doctype Declaration')) { |
1113 | return 1 |
1114 | } |
1115 | # type => RegExpr |
1116 | if ($self->testRegExpr($text, '\\)(\\s+|$)', 0, 0, 0, undef, 0, '46:DefaultDecl', 'Doctype Declaration')) { |
1117 | return 1 |
1118 | } |
1119 | # type => RegExpr |
1120 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1121 | return 1 |
1122 | } |
1123 | return 0; |
1124 | }; |
1125 | |
1126 | sub parse44Enumeration { |
1127 | my ($self, $text) = @_; |
1128 | # type => RegExpr |
1129 | if ($self->testRegExpr($text, '(\\w|[_:.-])+', 0, 0, 0, undef, 0, '#stay', 'Value')) { |
1130 | return 1 |
1131 | } |
1132 | # type => RegExpr |
1133 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1134 | return 1 |
1135 | } |
1136 | return 0; |
1137 | }; |
1138 | |
1139 | sub parse45EnumerationorEnd { |
1140 | my ($self, $text) = @_; |
1141 | # type => DetectChar |
1142 | if ($self->testDetectChar($text, '|', 0, 0, 0, undef, 0, '44:Enumeration', 'Doctype Declaration')) { |
1143 | return 1 |
1144 | } |
1145 | # type => RegExpr |
1146 | if ($self->testRegExpr($text, '\\)(\\s+|$)', 0, 0, 0, undef, 0, '46:DefaultDecl', 'Doctype Declaration')) { |
1147 | return 1 |
1148 | } |
1149 | # type => RegExpr |
1150 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1151 | return 1 |
1152 | } |
1153 | return 0; |
1154 | }; |
1155 | |
1156 | sub parse46DefaultDecl { |
1157 | my ($self, $text) = @_; |
1158 | # type => RegExpr |
1159 | if ($self->testRegExpr($text, '(#REQUIRED|#IMPLIED)(\\s+|$)', 0, 0, 0, undef, 0, '39:AttDef', 'Attribute')) { |
1160 | return 1 |
1161 | } |
1162 | # type => RegExpr |
1163 | if ($self->testRegExpr($text, '#FIXED(\\s+|$)', 0, 0, 0, undef, 0, '47:DefaultDecl AttValue', 'Attribute')) { |
1164 | return 1 |
1165 | } |
1166 | # type => RegExpr |
1167 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1168 | return 1 |
1169 | } |
1170 | # type => RegExpr |
1171 | if ($self->testRegExpr($text, '"', 0, 0, 0, undef, 0, '48:DefaultDecl AttValue qq', 'Value')) { |
1172 | return 1 |
1173 | } |
1174 | # type => RegExpr |
1175 | if ($self->testRegExpr($text, '\'', 0, 0, 0, undef, 0, '49:DefaultDecl AttValue q', 'Value')) { |
1176 | return 1 |
1177 | } |
1178 | return 0; |
1179 | }; |
1180 | |
1181 | sub parse47DefaultDeclAttValue { |
1182 | my ($self, $text) = @_; |
1183 | # type => RegExpr |
1184 | if ($self->testRegExpr($text, '"', 0, 0, 0, undef, 0, '48:DefaultDecl AttValue qq', 'Value')) { |
1185 | return 1 |
1186 | } |
1187 | # type => RegExpr |
1188 | if ($self->testRegExpr($text, '\'', 0, 0, 0, undef, 0, '49:DefaultDecl AttValue q', 'Value')) { |
1189 | return 1 |
1190 | } |
1191 | return 0; |
1192 | }; |
1193 | |
1194 | sub parse48DefaultDeclAttValueqq { |
1195 | my ($self, $text) = @_; |
1196 | # type => RegExpr |
1197 | if ($self->testRegExpr($text, '&(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*;', 0, 0, 0, undef, 0, '#stay', 'Entity')) { |
1198 | return 1 |
1199 | } |
1200 | # type => RegExpr |
1201 | if ($self->testRegExpr($text, '&#(x[0-9a-fA-F]+|[0-9]+);', 0, 0, 0, undef, 0, '#stay', 'Entity')) { |
1202 | return 1 |
1203 | } |
1204 | # type => DetectChar |
1205 | if ($self->testDetectChar($text, '&', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1206 | return 1 |
1207 | } |
1208 | # type => DetectChar |
1209 | if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1210 | return 1 |
1211 | } |
1212 | # type => DetectChar |
1213 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '39:AttDef', 'Value')) { |
1214 | return 1 |
1215 | } |
1216 | return 0; |
1217 | }; |
1218 | |
1219 | sub parse49DefaultDeclAttValueq { |
1220 | my ($self, $text) = @_; |
1221 | # type => RegExpr |
1222 | if ($self->testRegExpr($text, '&(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*;', 0, 0, 0, undef, 0, '#stay', 'Entity')) { |
1223 | return 1 |
1224 | } |
1225 | # type => RegExpr |
1226 | if ($self->testRegExpr($text, '&#(x[0-9a-fA-F]+|[0-9]+);', 0, 0, 0, undef, 0, '#stay', 'Entity')) { |
1227 | return 1 |
1228 | } |
1229 | # type => DetectChar |
1230 | if ($self->testDetectChar($text, '&', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1231 | return 1 |
1232 | } |
1233 | # type => DetectChar |
1234 | if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1235 | return 1 |
1236 | } |
1237 | # type => DetectChar |
1238 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '39:AttDef', 'Value')) { |
1239 | return 1 |
1240 | } |
1241 | return 0; |
1242 | }; |
1243 | |
1244 | sub parse4XMLDeclEncoding { |
1245 | my ($self, $text) = @_; |
1246 | # type => RegExpr |
1247 | if ($self->testRegExpr($text, '\\s*encoding\\s*', 0, 0, 0, undef, 0, '5:XMLDecl Encoding Eq', 'Attribute')) { |
1248 | return 1 |
1249 | } |
1250 | # type => RegExpr |
1251 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1252 | return 1 |
1253 | } |
1254 | # type => RegExpr |
1255 | if ($self->testRegExpr($text, '\\?>', 0, 0, 0, undef, 0, '11:Misc after XMLDecl', 'Doctype Declaration')) { |
1256 | return 1 |
1257 | } |
1258 | return 0; |
1259 | }; |
1260 | |
1261 | sub parse50EntityDecl { |
1262 | my ($self, $text) = @_; |
1263 | # type => RegExpr |
1264 | if ($self->testRegExpr($text, '(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*(\\s+|$)', 0, 0, 0, undef, 0, '52:GEDecl EntityValueOrExternalID', 'Entity')) { |
1265 | return 1 |
1266 | } |
1267 | # type => DetectChar |
1268 | if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, '61:PEDecl', 'Entity')) { |
1269 | return 1 |
1270 | } |
1271 | # type => RegExpr |
1272 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1273 | return 1 |
1274 | } |
1275 | return 0; |
1276 | }; |
1277 | |
1278 | sub parse51unused { |
1279 | my ($self, $text) = @_; |
1280 | return 0; |
1281 | }; |
1282 | |
1283 | sub parse52GEDeclEntityValueOrExternalID { |
1284 | my ($self, $text) = @_; |
1285 | # type => RegExpr |
1286 | if ($self->testRegExpr($text, '"', 0, 0, 0, undef, 0, '53:GEDecl EntityValue qq', 'Value')) { |
1287 | return 1 |
1288 | } |
1289 | # type => RegExpr |
1290 | if ($self->testRegExpr($text, '\'', 0, 0, 0, undef, 0, '54:GEDecl EntityValue q', 'Value')) { |
1291 | return 1 |
1292 | } |
1293 | # type => RegExpr |
1294 | if ($self->testRegExpr($text, 'PUBLIC(\\s+|$)', 0, 0, 0, undef, 0, '55:GEDecl PublicID', 'Doctype Declaration')) { |
1295 | return 1 |
1296 | } |
1297 | # type => RegExpr |
1298 | if ($self->testRegExpr($text, 'SYSTEM(\\s+|$)', 0, 0, 0, undef, 0, '58:GEDecl SystemID', 'Doctype Declaration')) { |
1299 | return 1 |
1300 | } |
1301 | return 0; |
1302 | }; |
1303 | |
1304 | sub parse53GEDeclEntityValueqq { |
1305 | my ($self, $text) = @_; |
1306 | # type => RegExpr |
1307 | if ($self->testRegExpr($text, '[&%](?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*;', 0, 0, 0, undef, 0, '#stay', 'Entity')) { |
1308 | return 1 |
1309 | } |
1310 | # type => RegExpr |
1311 | if ($self->testRegExpr($text, '&#(x[0-9a-fA-F]+|[0-9]+);', 0, 0, 0, undef, 0, '#stay', 'Entity')) { |
1312 | return 1 |
1313 | } |
1314 | # type => DetectChar |
1315 | if ($self->testDetectChar($text, '&', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1316 | return 1 |
1317 | } |
1318 | # type => DetectChar |
1319 | if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1320 | return 1 |
1321 | } |
1322 | # type => DetectChar |
1323 | if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1324 | return 1 |
1325 | } |
1326 | # type => DetectChar |
1327 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '69:GEDecl endOrNDATA', 'Value')) { |
1328 | return 1 |
1329 | } |
1330 | return 0; |
1331 | }; |
1332 | |
1333 | sub parse54GEDeclEntityValueq { |
1334 | my ($self, $text) = @_; |
1335 | # type => RegExpr |
1336 | if ($self->testRegExpr($text, '[&%](?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*;', 0, 0, 0, undef, 0, '#stay', 'Entity')) { |
1337 | return 1 |
1338 | } |
1339 | # type => RegExpr |
1340 | if ($self->testRegExpr($text, '&#(x[0-9a-fA-F]+|[0-9]+);', 0, 0, 0, undef, 0, '#stay', 'Entity')) { |
1341 | return 1 |
1342 | } |
1343 | # type => DetectChar |
1344 | if ($self->testDetectChar($text, '&', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1345 | return 1 |
1346 | } |
1347 | # type => DetectChar |
1348 | if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1349 | return 1 |
1350 | } |
1351 | # type => DetectChar |
1352 | if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1353 | return 1 |
1354 | } |
1355 | # type => DetectChar |
1356 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '69:GEDecl endOrNDATA', 'Value')) { |
1357 | return 1 |
1358 | } |
1359 | return 0; |
1360 | }; |
1361 | |
1362 | sub parse55GEDeclPublicID { |
1363 | my ($self, $text) = @_; |
1364 | # type => DetectChar |
1365 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '56:GEDecl PublicID qq', 'Value')) { |
1366 | return 1 |
1367 | } |
1368 | # type => DetectChar |
1369 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '57:GEDecl PublicID q', 'Value')) { |
1370 | return 1 |
1371 | } |
1372 | # type => RegExpr |
1373 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1374 | return 1 |
1375 | } |
1376 | return 0; |
1377 | }; |
1378 | |
1379 | sub parse56GEDeclPublicIDqq { |
1380 | my ($self, $text) = @_; |
1381 | # type => DetectChar |
1382 | if ($self->testDetectChar($text, '"(\\s+|$)', 0, 0, 0, undef, 0, '58:GEDecl SystemID', 'Value')) { |
1383 | return 1 |
1384 | } |
1385 | # type => RegExpr |
1386 | if ($self->testRegExpr($text, '[ \r |
1387 | a-zA-Z0-9\'()+,./:=?;!*#@$_%-]', 0, 0, 0, undef, 0, '#stay', 'Value')) { |
1388 | return 1 |
1389 | } |
1390 | return 0; |
1391 | }; |
1392 | |
1393 | sub parse57GEDeclPublicIDq { |
1394 | my ($self, $text) = @_; |
1395 | # type => DetectChar |
1396 | if ($self->testDetectChar($text, '\'(\\s+|$)', 0, 0, 0, undef, 0, '58:GEDecl SystemID', 'Value')) { |
1397 | return 1 |
1398 | } |
1399 | # type => RegExpr |
1400 | if ($self->testRegExpr($text, '[ \r |
1401 | a-zA-Z0-9()+,./:=?;!*#@$_%-]', 0, 0, 0, undef, 0, '#stay', 'Value')) { |
1402 | return 1 |
1403 | } |
1404 | return 0; |
1405 | }; |
1406 | |
1407 | sub parse58GEDeclSystemID { |
1408 | my ($self, $text) = @_; |
1409 | # type => DetectChar |
1410 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '59:GEDecl SystemID qq', 'Value')) { |
1411 | return 1 |
1412 | } |
1413 | # type => DetectChar |
1414 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '60:GEDecl SystemID q', 'Value')) { |
1415 | return 1 |
1416 | } |
1417 | # type => RegExpr |
1418 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1419 | return 1 |
1420 | } |
1421 | return 0; |
1422 | }; |
1423 | |
1424 | sub parse59GEDeclSystemIDqq { |
1425 | my ($self, $text) = @_; |
1426 | # type => DetectChar |
1427 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '69:GEDecl endOrNDATA', 'Value')) { |
1428 | return 1 |
1429 | } |
1430 | return 0; |
1431 | }; |
1432 | |
1433 | sub parse5XMLDeclEncodingEq { |
1434 | my ($self, $text) = @_; |
1435 | # type => RegExpr |
1436 | if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, '6:XMLDecl Encoding', 'Attribute')) { |
1437 | return 1 |
1438 | } |
1439 | # type => RegExpr |
1440 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Attribute')) { |
1441 | return 1 |
1442 | } |
1443 | return 0; |
1444 | }; |
1445 | |
1446 | sub parse60GEDeclSystemIDq { |
1447 | my ($self, $text) = @_; |
1448 | # type => DetectChar |
1449 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '69:GEDecl endOrNDATA', 'Value')) { |
1450 | return 1 |
1451 | } |
1452 | return 0; |
1453 | }; |
1454 | |
1455 | sub parse61PEDecl { |
1456 | my ($self, $text) = @_; |
1457 | # type => RegExpr |
1458 | if ($self->testRegExpr($text, '(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*(\\s+|$)', 0, 0, 0, undef, 0, '62:PEDecl EntityValueOrExternalID', 'Entity')) { |
1459 | return 1 |
1460 | } |
1461 | # type => RegExpr |
1462 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1463 | return 1 |
1464 | } |
1465 | return 0; |
1466 | }; |
1467 | |
1468 | sub parse62PEDeclEntityValueOrExternalID { |
1469 | my ($self, $text) = @_; |
1470 | # type => RegExpr |
1471 | if ($self->testRegExpr($text, '"', 0, 0, 0, undef, 0, '53:GEDecl EntityValue qq', 'Value')) { |
1472 | return 1 |
1473 | } |
1474 | # type => RegExpr |
1475 | if ($self->testRegExpr($text, '\'', 0, 0, 0, undef, 0, '54:GEDecl EntityValue q', 'Value')) { |
1476 | return 1 |
1477 | } |
1478 | # type => RegExpr |
1479 | if ($self->testRegExpr($text, 'PUBLIC(\\s+|$)', 0, 0, 0, undef, 0, '63:PEDecl PublicID', 'Doctype Declaration')) { |
1480 | return 1 |
1481 | } |
1482 | # type => RegExpr |
1483 | if ($self->testRegExpr($text, 'SYSTEM(\\s+|$)', 0, 0, 0, undef, 0, '66:PEDecl SystemID', 'Doctype Declaration')) { |
1484 | return 1 |
1485 | } |
1486 | return 0; |
1487 | }; |
1488 | |
1489 | sub parse63PEDeclPublicID { |
1490 | my ($self, $text) = @_; |
1491 | # type => DetectChar |
1492 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '64:PEDecl PublicID qq', 'Value')) { |
1493 | return 1 |
1494 | } |
1495 | # type => DetectChar |
1496 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '65:PEDecl PublicID q', 'Value')) { |
1497 | return 1 |
1498 | } |
1499 | # type => RegExpr |
1500 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1501 | return 1 |
1502 | } |
1503 | return 0; |
1504 | }; |
1505 | |
1506 | sub parse64PEDeclPublicIDqq { |
1507 | my ($self, $text) = @_; |
1508 | # type => DetectChar |
1509 | if ($self->testDetectChar($text, '"(\\s+|$)', 0, 0, 0, undef, 0, '66:PEDecl SystemID', 'Value')) { |
1510 | return 1 |
1511 | } |
1512 | # type => RegExpr |
1513 | if ($self->testRegExpr($text, '[ \r |
1514 | a-zA-Z0-9\'()+,./:=?;!*#@$_%-]', 0, 0, 0, undef, 0, '#stay', 'Value')) { |
1515 | return 1 |
1516 | } |
1517 | return 0; |
1518 | }; |
1519 | |
1520 | sub parse65PEDeclPublicIDq { |
1521 | my ($self, $text) = @_; |
1522 | # type => DetectChar |
1523 | if ($self->testDetectChar($text, '\'(\\s+|$)', 0, 0, 0, undef, 0, '66:PEDecl SystemID', 'Value')) { |
1524 | return 1 |
1525 | } |
1526 | # type => RegExpr |
1527 | if ($self->testRegExpr($text, '[ \r |
1528 | a-zA-Z0-9()+,./:=?;!*#@$_%-]', 0, 0, 0, undef, 0, '#stay', 'Value')) { |
1529 | return 1 |
1530 | } |
1531 | return 0; |
1532 | }; |
1533 | |
1534 | sub parse66PEDeclSystemID { |
1535 | my ($self, $text) = @_; |
1536 | # type => DetectChar |
1537 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '67:PEDecl SystemID qq', 'Value')) { |
1538 | return 1 |
1539 | } |
1540 | # type => DetectChar |
1541 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '68:PEDecl SystemID q', 'Value')) { |
1542 | return 1 |
1543 | } |
1544 | # type => RegExpr |
1545 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1546 | return 1 |
1547 | } |
1548 | return 0; |
1549 | }; |
1550 | |
1551 | sub parse67PEDeclSystemIDqq { |
1552 | my ($self, $text) = @_; |
1553 | # type => DetectChar |
1554 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '37:element end', 'Value')) { |
1555 | return 1 |
1556 | } |
1557 | return 0; |
1558 | }; |
1559 | |
1560 | sub parse68PEDeclSystemIDq { |
1561 | my ($self, $text) = @_; |
1562 | # type => DetectChar |
1563 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '37:element end', 'Value')) { |
1564 | return 1 |
1565 | } |
1566 | return 0; |
1567 | }; |
1568 | |
1569 | sub parse69GEDeclendOrNDATA { |
1570 | my ($self, $text) = @_; |
1571 | # type => DetectChar |
1572 | if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Doctype Declaration')) { |
1573 | return 1 |
1574 | } |
1575 | # type => RegExpr |
1576 | if ($self->testRegExpr($text, 'NDATA(\\s+|$)', 0, 0, 0, undef, 0, '70:GEDecl NDATA', 'Doctype Declaration')) { |
1577 | return 1 |
1578 | } |
1579 | # type => RegExpr |
1580 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1581 | return 1 |
1582 | } |
1583 | return 0; |
1584 | }; |
1585 | |
1586 | sub parse6XMLDeclEncoding { |
1587 | my ($self, $text) = @_; |
1588 | # type => RegExpr |
1589 | if ($self->testRegExpr($text, '\\s*("[A-Za-z][A-Za-z0-9._-]*"|\'[A-Za-z][A-Za-z0-9._-]*\')(?!s)\\s*', 0, 0, 0, undef, 0, '7:XMLDecl Standalone', 'Value')) { |
1590 | return 1 |
1591 | } |
1592 | # type => RegExpr |
1593 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Attribute')) { |
1594 | return 1 |
1595 | } |
1596 | return 0; |
1597 | }; |
1598 | |
1599 | sub parse70GEDeclNDATA { |
1600 | my ($self, $text) = @_; |
1601 | # type => RegExpr |
1602 | if ($self->testRegExpr($text, '(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*', 0, 0, 0, undef, 0, '37:element end', 'Entity')) { |
1603 | return 1 |
1604 | } |
1605 | # type => RegExpr |
1606 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1607 | return 1 |
1608 | } |
1609 | return 0; |
1610 | }; |
1611 | |
1612 | sub parse71NotationDeclName { |
1613 | my ($self, $text) = @_; |
1614 | # type => RegExpr |
1615 | if ($self->testRegExpr($text, '(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*(\\s+|$)', 0, 0, 0, undef, 0, '72:NotationDecl ExternalID', 'Entity')) { |
1616 | return 1 |
1617 | } |
1618 | # type => RegExpr |
1619 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1620 | return 1 |
1621 | } |
1622 | return 0; |
1623 | }; |
1624 | |
1625 | sub parse72NotationDeclExternalID { |
1626 | my ($self, $text) = @_; |
1627 | # type => RegExpr |
1628 | if ($self->testRegExpr($text, 'PUBLIC(\\s+|$)', 0, 0, 0, undef, 0, '73:NotationDecl PublicID', 'Doctype Declaration')) { |
1629 | return 1 |
1630 | } |
1631 | # type => RegExpr |
1632 | if ($self->testRegExpr($text, 'SYSTEM(\\s+|$)', 0, 0, 0, undef, 0, '66:PEDecl SystemID', 'Doctype Declaration')) { |
1633 | return 1 |
1634 | } |
1635 | # type => RegExpr |
1636 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1637 | return 1 |
1638 | } |
1639 | return 0; |
1640 | }; |
1641 | |
1642 | sub parse73NotationDeclPublicID { |
1643 | my ($self, $text) = @_; |
1644 | # type => DetectChar |
1645 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '74:NotationDecl PublicID qq', 'Value')) { |
1646 | return 1 |
1647 | } |
1648 | # type => DetectChar |
1649 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '75:NotationDecl PublicID q', 'Value')) { |
1650 | return 1 |
1651 | } |
1652 | # type => RegExpr |
1653 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1654 | return 1 |
1655 | } |
1656 | return 0; |
1657 | }; |
1658 | |
1659 | sub parse74NotationDeclPublicIDqq { |
1660 | my ($self, $text) = @_; |
1661 | # type => DetectChar |
1662 | if ($self->testDetectChar($text, '"(\\s+|$)', 0, 0, 0, undef, 0, '76:NotationDecl SystemIDOrEnd', 'Value')) { |
1663 | return 1 |
1664 | } |
1665 | # type => RegExpr |
1666 | if ($self->testRegExpr($text, '[ \r |
1667 | a-zA-Z0-9\'()+,./:=?;!*#@$_%-]', 0, 0, 0, undef, 0, '#stay', 'Value')) { |
1668 | return 1 |
1669 | } |
1670 | return 0; |
1671 | }; |
1672 | |
1673 | sub parse75NotationDeclPublicIDq { |
1674 | my ($self, $text) = @_; |
1675 | # type => DetectChar |
1676 | if ($self->testDetectChar($text, '\'(\\s+|$)', 0, 0, 0, undef, 0, '76:NotationDecl SystemIDOrEnd', 'Value')) { |
1677 | return 1 |
1678 | } |
1679 | # type => RegExpr |
1680 | if ($self->testRegExpr($text, '[ \r |
1681 | a-zA-Z0-9()+,./:=?;!*#@$_%-]', 0, 0, 0, undef, 0, '#stay', 'Value')) { |
1682 | return 1 |
1683 | } |
1684 | return 0; |
1685 | }; |
1686 | |
1687 | sub parse76NotationDeclSystemIDOrEnd { |
1688 | my ($self, $text) = @_; |
1689 | # type => DetectChar |
1690 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '67:PEDecl SystemID qq', 'Value')) { |
1691 | return 1 |
1692 | } |
1693 | # type => DetectChar |
1694 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '68:PEDecl SystemID q', 'Value')) { |
1695 | return 1 |
1696 | } |
1697 | # type => DetectChar |
1698 | if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Doctype Declaration')) { |
1699 | return 1 |
1700 | } |
1701 | # type => RegExpr |
1702 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1703 | return 1 |
1704 | } |
1705 | return 0; |
1706 | }; |
1707 | |
1708 | sub parse77CommentinsideIS { |
1709 | my ($self, $text) = @_; |
1710 | # type => RegExpr |
1711 | if ($self->testRegExpr($text, '--->', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Error')) { |
1712 | return 1 |
1713 | } |
1714 | # type => RegExpr |
1715 | if ($self->testRegExpr($text, '-->', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Comment')) { |
1716 | return 1 |
1717 | } |
1718 | # type => Detect2Chars |
1719 | if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1720 | return 1 |
1721 | } |
1722 | return 0; |
1723 | }; |
1724 | |
1725 | sub parse78PIinsideIS { |
1726 | my ($self, $text) = @_; |
1727 | # type => Detect2Chars |
1728 | if ($self->testDetect2Chars($text, '?', '>', 0, 0, 0, undef, 0, '23:Doctype Decl IS', 'Processing Instruction')) { |
1729 | return 1 |
1730 | } |
1731 | return 0; |
1732 | }; |
1733 | |
1734 | sub parse79Outside { |
1735 | my ($self, $text) = @_; |
1736 | # type => RegExpr |
1737 | if ($self->testRegExpr($text, '<[xX][mM][lL](\\w|[_.-])*(:(\\w|[_.-])+)?', 0, 0, 0, undef, 0, '80:STag', 'Error')) { |
1738 | return 1 |
1739 | } |
1740 | # type => RegExpr |
1741 | if ($self->testRegExpr($text, '<(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|_)(\\w|[_.-])*(:(\\w|[_.-])+)?', 0, 0, 0, undef, 0, '80:STag', 'Normal Tag')) { |
1742 | return 1 |
1743 | } |
1744 | # type => RegExpr |
1745 | if ($self->testRegExpr($text, '<(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[:_])(\\w|[:_.-])*', 0, 0, 0, undef, 0, '80:STag', 'Error')) { |
1746 | return 1 |
1747 | } |
1748 | # type => RegExpr |
1749 | if ($self->testRegExpr($text, '</[xX][mM][lL](\\w|[_.-])*(:(\\w|[_.-])+)?', 0, 0, 0, undef, 0, '85:ETag', 'Error')) { |
1750 | return 1 |
1751 | } |
1752 | # type => RegExpr |
1753 | if ($self->testRegExpr($text, '</(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|_)(\\w|[_.-])*(:(\\w|[_.-])+)?', 0, 0, 0, undef, 0, '85:ETag', 'Normal Tag')) { |
1754 | return 1 |
1755 | } |
1756 | # type => RegExpr |
1757 | if ($self->testRegExpr($text, '</(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[:_])(\\w|[:_.-])*', 0, 0, 0, undef, 0, '85:ETag', 'Error')) { |
1758 | return 1 |
1759 | } |
1760 | # type => RegExpr |
1761 | if ($self->testRegExpr($text, '&(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*;', 0, 0, 0, undef, 0, '#stay', 'Entity')) { |
1762 | return 1 |
1763 | } |
1764 | # type => RegExpr |
1765 | if ($self->testRegExpr($text, '&#(x[0-9a-fA-F]+|[0-9]+);', 0, 0, 0, undef, 0, '#stay', 'Entity')) { |
1766 | return 1 |
1767 | } |
1768 | # type => RegExpr |
1769 | if ($self->testRegExpr($text, '<!\\[CDATA\\[', 0, 0, 0, undef, 0, '86:CDSect', 'Entity')) { |
1770 | return 1 |
1771 | } |
1772 | # type => RegExpr |
1773 | if ($self->testRegExpr($text, '<!--', 0, 0, 0, undef, 0, '87:Comment inside IS', 'Comment')) { |
1774 | return 1 |
1775 | } |
1776 | # type => RegExpr |
1777 | if ($self->testRegExpr($text, '<\\?xml-stylesheet(\\s|$)', 0, 0, 0, undef, 0, '88:PI inside IS', 'Normal Tag')) { |
1778 | return 1 |
1779 | } |
1780 | # type => RegExpr |
1781 | if ($self->testRegExpr($text, '<\\?[xX][mM][lL](\\w|[_.-])*(:(\\w|[_.-])+)?', 0, 0, 0, undef, 0, '88:PI inside IS', 'Error')) { |
1782 | return 1 |
1783 | } |
1784 | # type => RegExpr |
1785 | if ($self->testRegExpr($text, '<\\?(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|_)(\\w|[_.-])*(:(\\w|[_.-])+)?', 0, 0, 0, undef, 0, '88:PI inside IS', 'Normal Tag')) { |
1786 | return 1 |
1787 | } |
1788 | # type => RegExpr |
1789 | if ($self->testRegExpr($text, '<\\?(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[:_])(\\w|[:_.-])*', 0, 0, 0, undef, 0, '88:PI inside IS', 'Error')) { |
1790 | return 1 |
1791 | } |
1792 | # type => DetectChar |
1793 | if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1794 | return 1 |
1795 | } |
1796 | # type => DetectChar |
1797 | if ($self->testDetectChar($text, '&', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1798 | return 1 |
1799 | } |
1800 | # type => RegExpr |
1801 | if ($self->testRegExpr($text, '\\]\\]>', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1802 | return 1 |
1803 | } |
1804 | return 0; |
1805 | }; |
1806 | |
1807 | sub parse7XMLDeclStandalone { |
1808 | my ($self, $text) = @_; |
1809 | # type => RegExpr |
1810 | if ($self->testRegExpr($text, '\\s*standalone\\s*', 0, 0, 0, undef, 0, '8:XMLDecl Standalone Eq', 'Attribute')) { |
1811 | return 1 |
1812 | } |
1813 | # type => RegExpr |
1814 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Doctype Declaration')) { |
1815 | return 1 |
1816 | } |
1817 | # type => RegExpr |
1818 | if ($self->testRegExpr($text, '\\?>', 0, 0, 0, undef, 0, '11:Misc after XMLDecl', 'Doctype Declaration')) { |
1819 | return 1 |
1820 | } |
1821 | return 0; |
1822 | }; |
1823 | |
1824 | sub parse80STag { |
1825 | my ($self, $text) = @_; |
1826 | # type => Detect2Chars |
1827 | if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '79:Outside', 'Normal Tag')) { |
1828 | return 1 |
1829 | } |
1830 | # type => DetectChar |
1831 | if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '79:Outside', 'Normal Tag')) { |
1832 | return 1 |
1833 | } |
1834 | # type => RegExpr |
1835 | if ($self->testRegExpr($text, '(xmlns:(\\w|[_.-])*|xmlns|xml:(lang|base|space))', 0, 0, 0, undef, 0, '81:STag Attribute', 'Attribute')) { |
1836 | return 1 |
1837 | } |
1838 | # type => RegExpr |
1839 | if ($self->testRegExpr($text, '[xX][mM][lL](\\w|[_.-])*(:(\\w|[_.-])+)?', 0, 0, 0, undef, 0, '81:STag Attribute', 'Error')) { |
1840 | return 1 |
1841 | } |
1842 | # type => RegExpr |
1843 | if ($self->testRegExpr($text, '(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|_)(\\w|[_.-])*(:(\\w|[_.-])+)?', 0, 0, 0, undef, 0, '81:STag Attribute', 'Attribute')) { |
1844 | return 1 |
1845 | } |
1846 | # type => RegExpr |
1847 | if ($self->testRegExpr($text, '(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[:_])(\\w|[:_.-])*', 0, 0, 0, undef, 0, '81:STag Attribute', 'Error')) { |
1848 | return 1 |
1849 | } |
1850 | # type => RegExpr |
1851 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Normal Tag')) { |
1852 | return 1 |
1853 | } |
1854 | return 0; |
1855 | }; |
1856 | |
1857 | sub parse81STagAttribute { |
1858 | my ($self, $text) = @_; |
1859 | # type => DetectChar |
1860 | if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, '82:STag Attribute Value', 'Attribute')) { |
1861 | return 1 |
1862 | } |
1863 | # type => RegExpr |
1864 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Normal Tag')) { |
1865 | return 1 |
1866 | } |
1867 | return 0; |
1868 | }; |
1869 | |
1870 | sub parse82STagAttributeValue { |
1871 | my ($self, $text) = @_; |
1872 | # type => DetectChar |
1873 | if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '83:STag Value qq', 'Value')) { |
1874 | return 1 |
1875 | } |
1876 | # type => DetectChar |
1877 | if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '84:STag Value q', 'Value')) { |
1878 | return 1 |
1879 | } |
1880 | # type => RegExpr |
1881 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Normal Tag')) { |
1882 | return 1 |
1883 | } |
1884 | return 0; |
1885 | }; |
1886 | |
1887 | sub parse83STagValueqq { |
1888 | my ($self, $text) = @_; |
1889 | # type => RegExpr |
1890 | if ($self->testRegExpr($text, '&(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*;', 0, 0, 0, undef, 0, '#stay', 'Entity')) { |
1891 | return 1 |
1892 | } |
1893 | # type => RegExpr |
1894 | if ($self->testRegExpr($text, '&#(x[0-9a-fA-F]+|[0-9]+);', 0, 0, 0, undef, 0, '#stay', 'Entity')) { |
1895 | return 1 |
1896 | } |
1897 | # type => DetectChar |
1898 | if ($self->testDetectChar($text, '&', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1899 | return 1 |
1900 | } |
1901 | # type => DetectChar |
1902 | if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1903 | return 1 |
1904 | } |
1905 | # type => RegExpr |
1906 | if ($self->testRegExpr($text, '"(?=(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:]))', 0, 0, 0, undef, 0, '80:STag', 'Error')) { |
1907 | return 1 |
1908 | } |
1909 | # type => RegExpr |
1910 | if ($self->testRegExpr($text, '"(?=>|/>|\\s|$)', 0, 0, 0, undef, 0, '80:STag', 'Value')) { |
1911 | return 1 |
1912 | } |
1913 | return 0; |
1914 | }; |
1915 | |
1916 | sub parse84STagValueq { |
1917 | my ($self, $text) = @_; |
1918 | # type => RegExpr |
1919 | if ($self->testRegExpr($text, '&(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:])(\\w|[_:.-])*;', 0, 0, 0, undef, 0, '#stay', 'Entity')) { |
1920 | return 1 |
1921 | } |
1922 | # type => RegExpr |
1923 | if ($self->testRegExpr($text, '&#(x[0-9a-fA-F]+|[0-9]+);', 0, 0, 0, undef, 0, '#stay', 'Entity')) { |
1924 | return 1 |
1925 | } |
1926 | # type => DetectChar |
1927 | if ($self->testDetectChar($text, '&', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1928 | return 1 |
1929 | } |
1930 | # type => DetectChar |
1931 | if ($self->testDetectChar($text, '<', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1932 | return 1 |
1933 | } |
1934 | # type => RegExpr |
1935 | if ($self->testRegExpr($text, '\'(?=(?![٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௧-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩]|\\d)(\\w|[_:]))', 0, 0, 0, undef, 0, '80:STag', 'Error')) { |
1936 | return 1 |
1937 | } |
1938 | # type => RegExpr |
1939 | if ($self->testRegExpr($text, '\'(?=>|/>|\\s|$)', 0, 0, 0, undef, 0, '80:STag', 'Value')) { |
1940 | return 1 |
1941 | } |
1942 | return 0; |
1943 | }; |
1944 | |
1945 | sub parse85ETag { |
1946 | my ($self, $text) = @_; |
1947 | # type => DetectChar |
1948 | if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '79:Outside', 'Normal Tag')) { |
1949 | return 1 |
1950 | } |
1951 | # type => RegExpr |
1952 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Normal Tag')) { |
1953 | return 1 |
1954 | } |
1955 | return 0; |
1956 | }; |
1957 | |
1958 | sub parse86CDSect { |
1959 | my ($self, $text) = @_; |
1960 | # type => RegExpr |
1961 | if ($self->testRegExpr($text, '\\]\\]>', 0, 0, 0, undef, 0, '79:Outside', 'Entity')) { |
1962 | return 1 |
1963 | } |
1964 | return 0; |
1965 | }; |
1966 | |
1967 | sub parse87CommentinsideIS { |
1968 | my ($self, $text) = @_; |
1969 | # type => RegExpr |
1970 | if ($self->testRegExpr($text, '--->', 0, 0, 0, undef, 0, '79:Outside', 'Error')) { |
1971 | return 1 |
1972 | } |
1973 | # type => RegExpr |
1974 | if ($self->testRegExpr($text, '-->', 0, 0, 0, undef, 0, '79:Outside', 'Comment')) { |
1975 | return 1 |
1976 | } |
1977 | # type => Detect2Chars |
1978 | if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, '#stay', 'Error')) { |
1979 | return 1 |
1980 | } |
1981 | return 0; |
1982 | }; |
1983 | |
1984 | sub parse88PIinsideIS { |
1985 | my ($self, $text) = @_; |
1986 | # type => Detect2Chars |
1987 | if ($self->testDetect2Chars($text, '?', '>', 0, 0, 0, undef, 0, '79:Outside', 'Processing Instruction')) { |
1988 | return 1 |
1989 | } |
1990 | return 0; |
1991 | }; |
1992 | |
1993 | sub parse8XMLDeclStandaloneEq { |
1994 | my ($self, $text) = @_; |
1995 | # type => RegExpr |
1996 | if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, '9:XMLDecl Standalone', 'Attribute')) { |
1997 | return 1 |
1998 | } |
1999 | # type => RegExpr |
2000 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Attribute')) { |
2001 | return 1 |
2002 | } |
2003 | return 0; |
2004 | }; |
2005 | |
2006 | sub parse9XMLDeclStandalone { |
2007 | my ($self, $text) = @_; |
2008 | # type => RegExpr |
2009 | if ($self->testRegExpr($text, '\\s*"(yes|no)"|\'(yes|no)\'\\s*', 0, 0, 0, undef, 0, '10:XMLDecl Standalone', 'Value')) { |
2010 | return 1 |
2011 | } |
2012 | # type => RegExpr |
2013 | if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Attribute')) { |
2014 | return 1 |
2015 | } |
2016 | return 0; |
2017 | }; |
2018 | |
2019 | |
2020 | 1; |
2021 | |
2022 | __END__ |
2023 | |
2024 | =head1 NAME |
2025 | |
2026 | Syntax::Highlight::Engine::Kate::XML_Debug - a Plugin for XML (Debug) syntax highlighting |
2027 | |
2028 | =head1 SYNOPSIS |
2029 | |
2030 | require Syntax::Highlight::Engine::Kate::XML_Debug; |
2031 | my $sh = new Syntax::Highlight::Engine::Kate::XML_Debug([ |
2032 | ]); |
2033 | |
2034 | =head1 DESCRIPTION |
2035 | |
2036 | Syntax::Highlight::Engine::Kate::XML_Debug is a plugin module that provides syntax highlighting |
2037 | for XML (Debug) to the Syntax::Haghlight::Engine::Kate highlighting engine. |
2038 | |
2039 | This code is generated from the syntax definition files used |
2040 | by the Kate project. |
2041 | It works quite fine, but can use refinement and optimization. |
2042 | |
2043 | It inherits Syntax::Higlight::Engine::Kate::Template. See also there. |
2044 | |
2045 | =cut |
2046 | |
2047 | =head1 AUTHOR |
2048 | |
2049 | Hans Jeuken (haje <at> toneel <dot> demon <dot> nl) |
2050 | |
2051 | =cut |
2052 | |
2053 | =head1 BUGS |
2054 | |
2055 | Unknown. If you find any, please contact the author |
2056 | |
2057 | =cut |
2058 | |