comparison tests/agcl/parsifal/good/xmlp8.cpp @ 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 /*
2 * XML Syntax
3 * Transcribed from
4 * Extensible Markup Language (XML) 1.0
5 * W3C Recommendation 10-February-1998
6 * http://www.w3.org/TR/1998/REC-xml-19980210
7 *
8 * Transcription Copyright © Parsifal Software, 1999.
9 *
10 * Revision 1 fixed definition of [4] NameChar
11 *
12 * Revision 2, begun 1/24/00
13 *
14 * Fixed problem with mixed content declaration [51]
15 * Fixed missing S in [52]
16 * Removed unnecessary "sticky" statement
17 */
18
19 #include "xmldef8.h"
20 #include <stdio.h>
21
22
23 /*
24 * AnaGram, A System for Syntax Directed Programming
25 * File generated by: ...
26 *
27 * AnaGram Parsing Engine
28 * Copyright 1993-2002 Parsifal Software. All Rights Reserved.
29 *
30 * This software is provided 'as-is', without any express or implied
31 * warranty. In no event will the authors be held liable for any damages
32 * arising from the use of this software.
33 *
34 * Permission is granted to anyone to use this software for any purpose,
35 * including commercial applications, and to alter it and redistribute it
36 * freely, subject to the following restrictions:
37 *
38 * 1. The origin of this software must not be misrepresented; you must not
39 * claim that you wrote the original software. If you use this software
40 * in a product, an acknowledgment in the product documentation would be
41 * appreciated but is not required.
42 * 2. Altered source versions must be plainly marked as such, and must not be
43 * misrepresented as being the original software.
44 * 3. This notice may not be removed or altered from any source distribution.
45 */
46
47 #ifndef XMLP8_H
48 #include "xmlp8.h"
49 #endif
50
51 #ifndef XMLP8_H
52 #error Mismatched header file
53 #endif
54
55 #include <ctype.h>
56 #include <stdio.h>
57
58 #define RULE_CONTEXT (&((PCB).cs[(PCB).ssx]))
59 #define ERROR_CONTEXT ((PCB).cs[(PCB).error_frame_ssx])
60 #define CONTEXT ((PCB).cs[(PCB).ssx])
61
62
63 #ifndef PCB_TYPE
64 #define PCB_TYPE parse_pcb_type
65 #endif
66
67
68 #define PCB (*pcb_pointer)
69 #define PCB_DECL PCB_TYPE *pcb_pointer
70 #define PCB_POINTER pcb_pointer
71 static void ag_delete_wrappers(PCB_DECL);
72 #ifndef DELETE_WRAPPERS
73 #define DELETE_WRAPPERS ag_delete_wrappers(PCB_POINTER)
74 #endif
75
76 /* Line -, xmlp8.syn */
77 #define GET_CONTEXT CONTEXT = Context(PCB.line, PCB.column)
78
79 typedef parse_pcb_struct Pcb;
80
81 parse_pcb_struct::parse_pcb_struct()
82 : tokenType(Pcb::none), dtdPresent(0)
83 {
84 // Nothing to do
85 }
86
87 void parse_pcb_struct::spaceChar(int c) {
88 if (c == '\r') c = '\n';
89 if (textStack.size()) tokenType = textType;
90 spaceStack.concat(c);
91 }
92
93 void parse_pcb_struct::textChar(int c) {
94 if (spaceStack.size()) tokenType=spaceType;
95 textStack.concat((char)c);
96 }
97
98 void parse_pcb_struct::normalize(AgString &s) {
99 char *readPointer = s;
100 char *writePointer = readPointer;
101 if (readPointer == NULL) return;
102 while (*readPointer && strchr("\t\r\n ",*readPointer)) readPointer++;
103 while (*readPointer) {
104 while (*readPointer && strchr("\t\r\n ",*readPointer) == NULL) *writePointer++ = *readPointer++;
105 while (*readPointer && strchr("\t\r\n ",*readPointer)) readPointer++;
106 if (*readPointer) *writePointer++ = ' ';
107 }
108 *writePointer = 0;
109 }
110
111 void parse_pcb_struct::checkAttributes(const Context &context, const AgString &name, Symtab &map) {
112 if (!dtdPresent) return;
113 Element &element = elementMap[name];
114 AgBaseStack<Attribute> &attributeList = element.attributeList;
115 int i;
116 for (i = 0; i < attributeList.size(); i++) {
117 Attribute &attribute = attributeList[i];
118 switch (attribute.def.presence) {
119 case Default::REQUIRED: {
120 const char *value = map.findValue(attribute.name);
121 if (value) continue;
122 map[attribute.name] = "VALUE NOT SPECIFIED";
123 char buf[200];
124 sprintf(buf, "Required attribute '%s' is missing", (const char *)attribute.name);
125 warningList.push(Warning(context, buf));
126 break;
127 }
128 case Default::DEFAULT: {
129 const char *value = map[attribute.name];
130 if (value == 0) value = attribute.def.value;
131 if (attribute.def.fixed && attribute.def.value == value) continue;
132 char buf[200];
133 sprintf(buf, "Value of fixed attribute '%s' does not match default value ",
134 (const char *) attribute.name);
135 warningList.push(Warning(context, buf));
136 break;
137 }
138 }
139 }
140 for (i = 0; i < attributeList.size(); i++) {
141 Attribute &attribute = attributeList[i];
142 if (attribute.type != Attribute::CDATA) normalize(map[attribute.name]);
143 }
144 }
145
146 int parse_pcb_struct::warnAttval(const Context &context, const char *value, const AttvalPair &p) {
147 if (value == NULL) return 0;
148 char buf[200];
149 sprintf(buf, "Value of '%s' ignored. Previously specified as '%s'",
150 (const char *) p.name, value);
151 warningList.push(Warning(context, buf));
152 return 1;
153 }
154
155 void parse_pcb_struct::startTag(const Context &context, const AgString &name, AttvalList &list) {
156 Symtab map;
157 for (int i = 0; i < list.size(); i++) {
158 AgString &value = map[list[i].name];
159 if (warnAttval(context, value, list[i])) continue;
160 value = list[i].value;
161 }
162 currentTagName = name;
163 checkAttributes(context, name, map);
164 currentMap = map;
165 tagStack.push(name);
166 mapStack.push(map);
167 tokenType = startType;
168 }
169
170 void parse_pcb_struct::emptyTag(const Context &context, const AgString &name, AttvalList &list) {
171 Symtab map;
172 for (int i = 0; i < list.size(); i++) {
173 AgString &value = map[list[i].name];
174 if (warnAttval(context, value, list[i])) continue;
175 map[list[i].name] = list[i].value;
176 }
177 checkAttributes(context, name, map);
178 currentTagName = name;
179 currentMap = map;
180 tokenType = emptyType;
181 }
182
183 void parse_pcb_struct::endTag(const AgString &name) {
184 currentTagName = name;
185 currentMap = mapStack.pop();
186 if (name != tagStack.pop()) {
187 error_message = "Element nesting error";
188 exit_flag = AG_SEMANTIC_ERROR_CODE;
189 tokenType = errorType;
190 return;
191 }
192 tokenType = endType;
193 }
194 void parse_pcb_struct::registerAttributes(const AgString &name, const AgBaseStack<Attribute> &attributeList) {
195 Element &element = elementMap[name];
196 if (element.name.size() == 0) element.name = name;
197 int i;
198 for (i = 0; i < attributeList.size(); i++) {
199 AgString attributeName = attributeList[i].name;
200 int &index = element.attributeIndex[attributeName];
201 if (index != -1) {
202 Attribute &attribute = element.attributeList[index];
203 Context previous = attribute.context;
204 char buf[200];
205 sprintf(buf, "Redefinition of '%s::%s' ignored. Defined at line %d, column %d",
206 (const char *) name,
207 (const char *) attributeName, previous.line, previous.column);
208 warningList.push(Warning(attributeList[i].context, buf));
209 continue;
210 }
211 index = element.attributeList.size();
212 element.attributeList.push(attributeList[i]);
213 }
214 }
215
216 #ifndef CONVERT_CASE
217 #define CONVERT_CASE(c) (c)
218 #endif
219 #ifndef TAB_SPACING
220 #define TAB_SPACING 8
221 #endif
222
223 static inline AgString ag_rp_1(PCB_DECL, int c) {
224 /* Line -, xmlp8.syn */
225 return AgString().concat(c);
226 }
227
228 static inline AgString ag_rp_2(PCB_DECL, AgString &s, int c) {
229 /* Line -, xmlp8.syn */
230 return s.concat(c);
231 }
232
233 static inline AgString ag_rp_3(PCB_DECL, AgString &s) {
234 /* Line -, xmlp8.syn */
235 return s;
236 }
237
238 static inline AgString ag_rp_4(PCB_DECL, AgString &s) {
239 /* Line -, xmlp8.syn */
240 return s;
241 }
242
243 static inline AgString ag_rp_5(PCB_DECL) {
244 /* Line -, xmlp8.syn */
245 return AgString();
246 }
247
248 static inline AgString ag_rp_6(PCB_DECL, AgString &s, int c) {
249 /* Line -, xmlp8.syn */
250 return s.concat(c);
251 }
252
253 static inline AgString ag_rp_7(PCB_DECL, AgString &s) {
254 /* Line -, xmlp8.syn */
255 return s.concat(' ');
256 }
257
258 static inline AgString ag_rp_8(PCB_DECL, AgString &s, int c) {
259 /* Line -, xmlp8.syn */
260 return s.concat(c);
261 }
262
263 static inline AgString ag_rp_9(PCB_DECL, AgString &s) {
264 /* Line -, xmlp8.syn */
265 return s;
266 }
267
268 static inline AgString ag_rp_10(PCB_DECL) {
269 /* Line -, xmlp8.syn */
270 return AgString();
271 }
272
273 static inline AgString ag_rp_11(PCB_DECL, AgString &s, int c) {
274 /* Line -, xmlp8.syn */
275 return s.concat(c);
276 }
277
278 static inline AgString ag_rp_12(PCB_DECL, AgString &s) {
279 /* Line -, xmlp8.syn */
280 return s.concat(' ');
281 }
282
283 static inline AgString ag_rp_13(PCB_DECL, AgString &s, int c) {
284 /* Line -, xmlp8.syn */
285 return s.concat(c);
286 }
287
288 static inline AgString ag_rp_14(PCB_DECL, AgString &s) {
289 /* Line -, xmlp8.syn */
290 return s;
291 }
292
293 static inline void ag_rp_15(PCB_DECL, AgString &t) {
294 /* Line -, xmlp8.syn */
295 PCB.tokenType = Pcb::commentType, PCB.commentString = t;
296 }
297
298 static inline AgString ag_rp_16(PCB_DECL) {
299 /* Line -, xmlp8.syn */
300 return AgString();
301 }
302
303 static inline AgString ag_rp_17(PCB_DECL, AgString &s, int c) {
304 /* Line -, xmlp8.syn */
305 return s.concat(c);
306 }
307
308 static inline void ag_rp_18(PCB_DECL, int c) {
309 /* Line -, xmlp8.syn */
310 PCB.textChar(c);
311 }
312
313 static inline void ag_rp_19(PCB_DECL) {
314 /* Line -, xmlp8.syn */
315 PCB.spaceChar('\n');
316 }
317
318 static inline void ag_rp_20(PCB_DECL, int c) {
319 /* Line -, xmlp8.syn */
320 PCB.spaceChar(c);
321 }
322
323 static inline void ag_rp_21(PCB_DECL, AgString &n) {
324 /* Line -, xmlp8.syn */
325 PCB.dtdPresent=1;
326 }
327
328 static inline void ag_rp_22(PCB_DECL, AgString &n, AttvalList &l) {
329 /* Line -, xmlp8.syn */
330 PCB.startTag(CONTEXT, n, l);
331 }
332
333 static inline AttvalList ag_rp_23(PCB_DECL) {
334 /* Line -, xmlp8.syn */
335 return AttvalList();
336 }
337
338 static inline AttvalList ag_rp_24(PCB_DECL, AttvalList &list, AttvalPair &a) {
339 /* Line -, xmlp8.syn */
340 return list.push(a);
341 }
342
343 static inline AttvalPair ag_rp_25(PCB_DECL, AgString &n, AgString &s) {
344 /* Line -, xmlp8.syn */
345 return AttvalPair(n, s, CONTEXT);
346 }
347
348 static inline void ag_rp_26(PCB_DECL, AgString &n) {
349 /* Line -, xmlp8.syn */
350 PCB.endTag(n);
351 }
352
353 static inline void ag_rp_27(PCB_DECL, int c) {
354 /* Line -, xmlp8.syn */
355 PCB.textChar(c);
356 }
357
358 static inline void ag_rp_28(PCB_DECL, int c) {
359 /* Line -, xmlp8.syn */
360 PCB.textChar(c);
361 }
362
363 static inline void ag_rp_29(PCB_DECL, int c) {
364 /* Line -, xmlp8.syn */
365 PCB.spaceChar(c);
366 }
367
368 static inline void ag_rp_30(PCB_DECL) {
369 /* Line -, xmlp8.syn */
370 PCB.spaceChar('\n');
371 }
372
373 static inline void ag_rp_31(PCB_DECL, AgString &n, AttvalList &l) {
374 /* Line -, xmlp8.syn */
375 PCB.emptyTag(CONTEXT, n, l);
376 }
377
378 static inline void ag_rp_32(PCB_DECL, AgString &n, AttributeList &l) {
379 /* Line -, xmlp8.syn */
380 PCB.registerAttributes(n, l);
381 }
382
383 static inline AttributeList ag_rp_33(PCB_DECL, Attribute &a) {
384 /* Line -, xmlp8.syn */
385 return AttributeList().push(a);
386 }
387
388 static inline AttributeList ag_rp_34(PCB_DECL, AttributeList &l, Attribute &a) {
389 /* Line -, xmlp8.syn */
390 return l.push(a);
391 }
392
393 static inline Attribute ag_rp_35(PCB_DECL, AgString &n, Attribute::Type t, Default &d) {
394 /* Line -, xmlp8.syn */
395 return Attribute(RULE_CONTEXT[1], n, t, d);
396 }
397
398 static inline Attribute::Type ag_rp_36(PCB_DECL) {
399 /* Line -, xmlp8.syn */
400 return Attribute::CDATA;
401 }
402
403 static inline Attribute::Type ag_rp_37(PCB_DECL) {
404 /* Line -, xmlp8.syn */
405 return Attribute::ID;
406 }
407
408 static inline Attribute::Type ag_rp_38(PCB_DECL) {
409 /* Line -, xmlp8.syn */
410 return Attribute::IDREF;
411 }
412
413 static inline Attribute::Type ag_rp_39(PCB_DECL) {
414 /* Line -, xmlp8.syn */
415 return Attribute::IDREFS;
416 }
417
418 static inline Attribute::Type ag_rp_40(PCB_DECL) {
419 /* Line -, xmlp8.syn */
420 return Attribute::ENTITY;
421 }
422
423 static inline Attribute::Type ag_rp_41(PCB_DECL) {
424 /* Line -, xmlp8.syn */
425 return Attribute::ENTITIES;
426 }
427
428 static inline Attribute::Type ag_rp_42(PCB_DECL) {
429 /* Line -, xmlp8.syn */
430 return Attribute::NMTOKEN;
431 }
432
433 static inline Attribute::Type ag_rp_43(PCB_DECL) {
434 /* Line -, xmlp8.syn */
435 return Attribute::NMTOKENS;
436 }
437
438 static inline Attribute::Type ag_rp_44(PCB_DECL) {
439 /* Line -, xmlp8.syn */
440 return Attribute::NOTATION;
441 }
442
443 static inline Attribute::Type ag_rp_45(PCB_DECL) {
444 /* Line -, xmlp8.syn */
445 return Attribute::ENUMERATION;
446 }
447
448 static inline Default ag_rp_46(PCB_DECL) {
449 /* Line -, xmlp8.syn */
450 return Default(Default::REQUIRED);
451 }
452
453 static inline Default ag_rp_47(PCB_DECL) {
454 /* Line -, xmlp8.syn */
455 return Default();
456 }
457
458 static inline Default ag_rp_48(PCB_DECL, AgString &v) {
459 /* Line -, xmlp8.syn */
460 return Default(v);
461 }
462
463 static inline Default ag_rp_49(PCB_DECL, AgString &v) {
464 /* Line -, xmlp8.syn */
465 return Default(v,1);
466 }
467
468 static inline int ag_rp_50(PCB_DECL, int d) {
469 /* Line -, xmlp8.syn */
470 return d-'0';
471 }
472
473 static inline int ag_rp_51(PCB_DECL, int n, int d) {
474 /* Line -, xmlp8.syn */
475 return 10*n + d-'0';
476 }
477
478 static inline int ag_rp_52(PCB_DECL, int d) {
479 /* Line -, xmlp8.syn */
480 return d-'0';
481 }
482
483 static inline int ag_rp_53(PCB_DECL, int n, int d) {
484 /* Line -, xmlp8.syn */
485 return 16*n + d;
486 }
487
488 static inline int ag_rp_54(PCB_DECL, int n, int d) {
489 /* Line -, xmlp8.syn */
490 return 16*n + (d&7) + 9;
491 }
492
493 static inline int ag_rp_55(PCB_DECL, AgString &s) {
494 /* Line -, xmlp8.syn */
495 return PCB.currentEntityName = s, PCB.tokenType = Pcb::entityRefType;
496 }
497
498
499 #define READ_COUNTS
500 #define WRITE_COUNTS
501 #undef V
502 #define V(i,t) (*t (&(PCB).vs[(PCB).ssx + i]))
503 #undef VS
504 #define VS(i) (PCB).vs[(PCB).ssx + i]
505
506 #ifndef GET_CONTEXT
507 #define GET_CONTEXT CONTEXT = (PCB).input_context
508 #endif
509
510 typedef enum {
511 ag_action_1,
512 ag_action_2,
513 ag_action_3,
514 ag_action_4,
515 ag_action_5,
516 ag_action_6,
517 ag_action_7,
518 ag_action_8,
519 ag_action_9,
520 ag_action_10,
521 ag_action_11,
522 ag_action_12
523 } ag_parser_action;
524
525
526 #ifndef NULL_VALUE_INITIALIZER
527 #define NULL_VALUE_INITIALIZER = { 0 }
528 #endif
529
530
531 static const char ag_wdf[] = {
532 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 5, 0, 0, 5, 0, 0, 0, 0,
533 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 5, 0, 0, 0, 0, 0, 0,
534 0, 0, 0, 5, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0,
535 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
536 0, 0, 0, 0, 0, 5, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5,
537 0, 0, 0, 0, 8, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,
538 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0,
539 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
540 0, 0, 5, 0, 5, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 5
541 };
542
543 #undef VW
544 #define VW(i,t) *(t) (&(PCB).vs[(PCB).ssx + (i)])
545 #undef VNO
546 #define VNO new(&(PCB).vs[(PCB).ssx])
547 #undef VRO
548 #define VRO(to,v) ag_replace_object((to) &(PCB).vs[(PCB).ssx], v)
549 #undef VWD
550 #define VWD(i,t) ag_delete_object((t) &(PCB).vs[(PCB).ssx + (i)]);
551 #undef VDO
552 #define VDO(to, v) ag_delete_object((to) &(PCB).vs[(PCB).ssx], v)
553
554 template <class NewObject, class OldObject>
555 static inline void ag_replace_object(AgObjectWrapper<OldObject> *p, const NewObject &o) {
556 delete p;
557 new(p) AgObjectWrapper<NewObject >(o);
558 }
559
560 template <class Object>
561 static inline void ag_delete_object(AgObjectWrapper<Object> *p) {
562 delete p;
563 }
564
565 template <class NewObject, class OldObject>
566 static inline const NewObject &ag_delete_object(AgObjectWrapper<OldObject> *p, const NewObject &o) {
567 delete p;
568 return o;
569 }
570
571
572 #undef AG_WRAP_4
573 #define AG_WRAP_4 AgObjectWrapper<AttvalPair >
574 #undef AG_WRAP_5
575 #define AG_WRAP_5 AgObjectWrapper<AgString >
576 #undef AG_WRAP_6
577 #define AG_WRAP_6 AgObjectWrapper<AttvalList >
578 #undef AG_WRAP_7
579 #define AG_WRAP_7 AgObjectWrapper<Attribute >
580 #undef AG_WRAP_8
581 #define AG_WRAP_8 AgObjectWrapper<AttributeList >
582 #undef AG_WRAP_9
583 #define AG_WRAP_9 AgObjectWrapper<Default >
584
585 static void ag_delete_wrappers(PCB_DECL) {
586 int sn = (PCB).sn;
587 int sx = (PCB).ssx;
588 while (sx--) {
589 switch (ag_wdf[sn]) {
590 case 4: ag_delete_object((AG_WRAP_4 *) &(PCB).vs[sx]); break;
591 case 5: ag_delete_object((AG_WRAP_5 *) &(PCB).vs[sx]); break;
592 case 6: ag_delete_object((AG_WRAP_6 *) &(PCB).vs[sx]); break;
593 case 7: ag_delete_object((AG_WRAP_7 *) &(PCB).vs[sx]); break;
594 case 8: ag_delete_object((AG_WRAP_8 *) &(PCB).vs[sx]); break;
595 case 9: ag_delete_object((AG_WRAP_9 *) &(PCB).vs[sx]); break;
596 default: break;
597 }
598 sn = (PCB).ss[sx];
599 }
600 }
601
602 static parse_vs_type const ag_null_value NULL_VALUE_INITIALIZER;
603
604 static const unsigned char ag_rpx[] = {
605 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 0, 0, 0, 0, 0,
606 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
607 0, 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 0, 0, 0,
608 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 18,
609 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 20, 21, 22, 0, 0,
610 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
611 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
612 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
613 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
614 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, 0, 0, 0, 0, 29, 30,
615 0, 31, 32, 0, 0, 0, 33, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
616 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 34, 0,
617 0, 0, 0, 0, 0, 0, 35, 36, 37, 38, 0, 0, 0, 39, 40, 41, 42, 43,
618 44, 45, 46, 47, 48, 4, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 49,
619 50, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
620 0, 0, 53, 54, 55, 56, 57, 0, 0, 58, 59, 0, 0, 4, 60, 0, 0, 0,
621 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
622 0, 0, 0, 0, 0, 0, 4
623 };
624
625 static const unsigned char ag_key_itt[] = {
626 0
627 };
628
629 static const unsigned short ag_key_pt[] = {
630 0
631 };
632
633 static const unsigned char ag_key_ch[] = {
634 0, 45, 68,255,120,255, 33, 63,255, 60,255, 45, 68,255, 33, 63,255, 60,
635 255,110,121,255, 70, 73, 80, 82,255,110,121,255, 73, 89,255, 84,255, 73,
636 255, 84,255, 77, 78,255, 83,255, 70,255, 69,255, 82,255, 68,255, 83,255,
637 78,255, 69,255, 75,255, 79,255, 84,255, 68, 77, 79,255, 34, 35, 39, 41,
638 47, 63, 65, 67, 69, 73, 78, 80, 83,101,115,118,255,118,255, 45,255, 60,
639 255,120,255, 35,255, 45, 91,255, 33, 63,255, 13, 38, 60,255, 33, 63,255,
640 60,255, 63,255, 47,255, 13, 93,255,120,255, 35,255, 45, 91,255, 33, 47,
641 63,255, 13, 38, 60,255, 60,255,110,121,255, 34, 39, 63,101,115,255, 93,
642 255, 39,255,110,121,255, 34, 39, 63,115,255, 80, 83,255, 76, 78,255, 45,
643 65, 69, 78,255, 33, 63,255, 60,255,120,255, 35,255, 38,255, 65, 69,255,
644 35,255, 78,255, 73, 89,255, 84,255, 73,255, 84,255, 78,255, 83,255, 70,
645 255, 69,255, 82,255, 68,255, 83,255, 78,255, 69,255, 75,255, 79,255, 84,
646 255, 77, 79,255, 67, 69, 73, 78,255, 41,255, 70, 73, 82,255, 35,255
647 };
648
649 static const unsigned char ag_key_act[] = {
650 0,3,3,4,3,4,2,1,4,2,4,3,3,4,2,0,4,2,4,3,3,4,3,3,3,3,4,3,3,4,3,0,4,2,4,
651 2,4,2,4,3,2,4,0,4,1,4,2,4,2,4,1,4,0,4,1,4,2,4,2,4,2,4,2,4,3,2,3,4,2,2,
652 2,3,3,3,3,3,2,2,2,3,3,3,3,3,4,3,4,3,4,3,4,0,4,1,4,3,3,4,2,0,4,3,2,2,4,
653 3,0,4,2,4,3,4,3,4,3,3,4,0,4,1,4,3,3,4,2,0,0,4,3,2,2,4,3,4,3,3,4,2,3,3,
654 3,3,4,3,4,3,4,3,3,4,2,3,3,3,4,3,3,4,3,3,4,3,3,2,3,4,2,0,4,2,4,0,4,1,4,
655 2,4,3,3,4,3,4,3,4,3,0,4,2,4,2,4,2,4,2,4,0,4,1,4,2,4,2,4,1,4,0,4,1,4,2,
656 4,2,4,2,4,2,4,2,3,4,3,2,2,2,4,3,4,3,3,3,4,2,4
657 };
658
659 static const unsigned short ag_key_parm[] = {
660 0, 59, 97, 0, 84, 0, 0, 64, 0, 0, 0, 59, 97, 0, 0, 64, 0, 0,
661 0,124,122, 0,208,207,176,206, 0,123,121, 0,194,193, 0, 0, 0, 0,
662 0, 0, 0,154, 0, 0,192, 0,191, 0, 0, 0, 0, 0,190, 0,196, 0,
663 195, 0, 0, 0, 0, 0, 0, 0, 0, 0,239, 0,199, 0, 0, 0, 0,180,
664 151, 2,155,189, 0, 0, 0,238,237,243,120, 90, 0, 90, 0, 1, 0, 97,
665 0,226, 0,224, 0, 59, 75, 0, 0, 64, 0, 76, 0, 0, 0, 59, 64, 0,
666 0, 0, 2, 0,151, 0, 76, 3, 0,226, 0,224, 0, 59, 75, 0, 0,147,
667 64, 0, 76, 0, 0, 0,147, 0,124,122, 0, 0,123, 2,243,120, 0, 3,
668 0,121, 0,124,122, 0, 0,123, 2,120, 0,238,237, 0,152,232, 0, 59,
669 181, 0,250, 0, 0, 64, 0, 0, 0,226, 0,224, 0, 0, 0,155,154, 0,
670 176, 0,239, 0,194,193, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 0,191,
671 0, 0, 0, 0, 0,190, 0,196, 0,195, 0, 0, 0, 0, 0, 0, 0, 0,
672 0, 0,199, 0,189, 0, 0, 0, 0,180, 0,208,207,206, 0, 0, 0
673 };
674
675 static const unsigned short ag_key_jmp[] = {
676 0, 0, 2, 0, 9, 0, 1, 4, 0, 6, 0, 12, 14, 0, 11, 0, 0, 14,
677 0, 21, 24, 0, 28, 33, 40, 46, 0, 54, 57, 0, 79, 0, 0, 30, 0, 33,
678 0, 35, 0, 75, 37, 0, 0, 0, 42, 0, 44, 0, 46, 0, 48, 0, 0, 0,
679 52, 0, 54, 0, 56, 0, 58, 0, 60, 0, 82, 62, 86, 0, 19, 22, 27, 61,
680 63, 65, 67, 70, 39, 50, 64, 93, 99,105,113,123, 0,130, 0,137, 0,139,
681 0, 0, 0, 91, 0,150,152, 0, 95, 0, 0,148, 93, 98, 0,159, 0, 0,
682 105, 0,162, 0,164, 0,166,168, 0, 0, 0,117, 0,173,175, 0,121, 0,
683 0, 0,171,119,124, 0,182, 0,184,187, 0,134,191,195,197,205, 0,215,
684 0,218, 0,223,226, 0,147,230,234,236, 0,246,252, 0,267,273, 0,258,
685 260,158,278, 0,161, 0, 0,166, 0, 0, 0,171, 0,173, 0,286,289, 0,
686 294, 0,301, 0,311, 0, 0,184, 0,187, 0,189, 0,191, 0, 0, 0,195,
687 0,197, 0,199, 0,201, 0, 0, 0,205, 0,207, 0,209, 0,211, 0,213,
688 0,215,314, 0,306,193,203,217, 0,321, 0,323,328,335, 0,227, 0
689 };
690
691 static const unsigned char ag_key_index[] = {
692 9, 0, 17, 0, 68, 85, 0, 87, 17, 89, 0,101,108, 0,110,110,110, 87,
693 0,108,112, 0, 0,114, 0, 0, 0,128,132, 0, 0, 0,137,110,110,110,
694 0, 0,112,114,143, 0, 0,145, 0, 0, 0,110, 0,110,110, 0,112,112,
695 0, 0, 0, 0,145, 0,150,110,155, 0, 0, 0, 0, 0,110, 0, 0, 0,
696 169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,169, 0,175,175, 0,
697 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,175,175, 0, 0, 0, 0, 0,
698 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,155,155, 0, 0,177, 0,175,175,
699 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,180, 0,155,175, 0,175, 0,182,
700 0,220,180, 0, 0, 0, 0, 0, 0, 0,225, 0, 0, 0, 0, 0, 0, 0,
701 0, 0, 0,231, 0,225, 0,225,225,225, 0, 0, 0, 0, 0, 0, 0, 0,
702 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,225, 0, 0, 0, 0, 0,225, 0,
703 0, 0, 0, 0, 0, 0, 0, 0
704 };
705
706 static const unsigned char ag_key_ends[] = {
707 45,0, 79,67,84,89,80,69,0, 109,108,0, 45,0, 79,67,84,89,80,69,0,
708 111,34,0, 101,115,34,0, 73,88,69,68,0, 77,80,76,73,69,68,0,
709 67,68,65,84,65,0, 69,81,85,73,82,69,68,0, 111,39,0, 101,115,39,0,
710 42,0, 62,0, 62,0, 78,89,0, 68,65,84,65,0, 80,84,89,0, 69,83,0,
711 65,84,65,0, 84,65,84,73,79,78,0, 85,66,76,73,67,0,
712 89,83,84,69,77,0, 110,99,111,100,105,110,103,0,
713 116,97,110,100,97,108,111,110,101,0, 101,114,115,105,111,110,0,
714 101,114,115,105,111,110,0, 45,0, 33,68,79,67,84,89,80,69,0, 10,0,
715 45,0, 67,68,65,84,65,91,0, 45,45,0, 62,0, 62,0, 10,0, 93,62,0,
716 10,0, 45,0, 67,68,65,84,65,91,0, 47,0, 111,34,0, 101,115,34,0,
717 110,111,39,0, 62,0, 110,99,111,100,105,110,103,0,
718 116,97,110,100,97,108,111,110,101,0, 93,62,0, 121,101,115,39,0,
719 111,34,0, 101,115,34,0, 110,111,39,0, 62,0,
720 116,97,110,100,97,108,111,110,101,0, 85,66,76,73,67,0,
721 89,83,84,69,77,0, 45,0, 84,84,76,73,83,84,0, 69,77,69,78,84,0,
722 84,73,84,89,0, 79,84,65,84,73,79,78,0, 78,89,0, 77,80,84,89,0,
723 80,67,68,65,84,65,0, 68,65,84,65,0, 68,65,84,65,0, 69,83,0,
724 84,65,84,73,79,78,0, 42,0, 73,88,69,68,0, 77,80,76,73,69,68,0,
725 69,81,85,73,82,69,68,0,
726 };
727 #define AG_TCV(x) (((int)(x) >= -1 && (int)(x) <= 255) ? ag_tcv[(x) + 1] : 0)
728
729 static const unsigned short ag_tcv[] = {
730 10,262,262,262,262,262,262,262,262,262,253,254,262,262,255,262,262,262,
731 262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,254,263, 25,
732 263,263,229,228, 32,167,172,162,163,173,127,260,263,225,225,225,225,225,
733 225,225,225,225,225,256,222,144, 94, 61,161,263,227,227,227,227,227,227,
734 257,257,137,257,257,257,257,257,257,257,257,257,257,257,257,257,257,139,
735 257,257,101,264,106,264,258,264,227,227,227,227,227,227,257,257,137,257,
736 257,257,257,257,257,257,257,257,257,257,257,257,257,139,257,257,264,168,
737 264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,
738 264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,
739 264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,264,
740 264,264,264,264,261,264,264,264,264,264,264,264,264,259,259,259,259,259,
741 259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
742 264,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,259,
743 259,259,259,259,259,259,259,259,259,259,259,259,259,259,264,259,259,259,
744 259,259,259,259,259
745 };
746
747 #ifndef SYNTAX_ERROR
748 #define SYNTAX_ERROR fprintf(stderr,"%s, line %d, column %d\n", \
749 (PCB).error_message, (PCB).line, (PCB).column)
750 #endif
751
752 #ifndef FIRST_LINE
753 #define FIRST_LINE 1
754 #endif
755
756 #ifndef FIRST_COLUMN
757 #define FIRST_COLUMN 1
758 #endif
759
760 #ifndef PARSER_STACK_OVERFLOW
761 #define PARSER_STACK_OVERFLOW {fprintf(stderr, \
762 "\nParser stack overflow, line %d, column %d\n",\
763 (PCB).line, (PCB).column);}
764 #endif
765
766 #ifndef REDUCTION_TOKEN_ERROR
767 #define REDUCTION_TOKEN_ERROR {fprintf(stderr, \
768 "\nReduction token error, line %d, column %d\n", \
769 (PCB).line, (PCB).column);}
770 #endif
771
772
773 typedef enum
774 {ag_accept_key, ag_set_key, ag_jmp_key, ag_end_key, ag_no_match_key,
775 ag_cf_accept_key, ag_cf_set_key, ag_cf_end_key} key_words;
776
777
778 #ifndef AG_NEWLINE
779 #define AG_NEWLINE 10
780 #endif
781
782 #ifndef AG_RETURN
783 #define AG_RETURN 13
784 #endif
785
786 #ifndef AG_FORMFEED
787 #define AG_FORMFEED 12
788 #endif
789
790 #ifndef AG_TABCHAR
791 #define AG_TABCHAR 9
792 #endif
793
794 static void ag_track(PCB_DECL) {
795 int ag_k = 0;
796 while (ag_k < (PCB).rx) {
797 int ag_ch = (PCB).lab[ag_k++];
798 switch (ag_ch) {
799 case AG_NEWLINE:
800 (PCB).column = 1, (PCB).line++;
801 case AG_RETURN:
802 case AG_FORMFEED:
803 break;
804 case AG_TABCHAR:
805 (PCB).column += (TAB_SPACING) - ((PCB).column - 1) % (TAB_SPACING);
806 break;
807 default:
808 (PCB).column++;
809 }
810 }
811 ag_k = 0;
812 while ((PCB).rx < (PCB).fx) (PCB).lab[ag_k++] = (PCB).lab[(PCB).rx++];
813 (PCB).fx = ag_k;
814 (PCB).rx = 0;
815 }
816
817
818 static void ag_prot(PCB_DECL) {
819 int ag_k;
820 ag_k = 128 - ++(PCB).btsx;
821 if (ag_k <= (PCB).ssx) {
822 (PCB).exit_flag = AG_STACK_ERROR_CODE;
823 PARSER_STACK_OVERFLOW;
824 return;
825 }
826 (PCB).bts[(PCB).btsx] = (PCB).sn;
827 (PCB).bts[ag_k] = (PCB).ssx;
828 (PCB).vs[ag_k] = (PCB).vs[(PCB).ssx];
829 (PCB).ss[ag_k] = (PCB).ss[(PCB).ssx];
830 (PCB).cs[ag_k] = (PCB).cs[(PCB).ssx];
831 }
832
833 static void ag_undo(PCB_DECL) {
834 if ((PCB).drt == -1) return;
835 while ((PCB).btsx) {
836 int ag_k = 128 - (PCB).btsx;
837 (PCB).sn = (PCB).bts[(PCB).btsx--];
838 (PCB).ssx = (PCB).bts[ag_k];
839 (PCB).vs[(PCB).ssx] = (PCB).vs[ag_k];
840 (PCB).ss[(PCB).ssx] = (PCB).ss[ag_k];
841 (PCB).cs[(PCB).ssx] = (PCB).cs[ag_k];
842 }
843 (PCB).token_number = (parse_token_type) (PCB).drt;
844 (PCB).ssx = (PCB).dssx;
845 (PCB).sn = (PCB).dsn;
846 (PCB).drt = -1;
847 }
848
849
850 static const unsigned short ag_tstt[] = {
851 255,254,253,144,97,84,64,59,0,4,5,80,81,
852 255,254,253,0,11,13,
853 255,254,253,144,97,64,59,0,7,8,9,58,63,
854 144,0,6,140,141,
855 255,254,253,0,
856 90,0,85,
857 259,258,257,256,227,139,137,0,14,65,
858 264,263,261,260,259,258,257,256,254,253,229,228,227,225,222,173,172,168,167,
859 163,162,161,144,139,137,127,106,101,94,61,32,25,1,0,60,
860 255,254,253,64,59,0,7,58,63,
861 144,97,0,82,83,
862 259,258,257,256,227,139,137,0,14,
863 264,263,262,261,260,259,258,257,256,255,254,253,229,228,227,226,225,224,222,
864 173,172,168,167,163,162,161,144,139,137,127,106,101,94,76,75,64,61,59,
865 32,25,0,6,41,42,58,63,71,72,140,141,142,148,149,221,223,
866 255,254,253,64,59,10,0,7,8,9,58,63,
867 255,254,253,94,0,11,13,87,91,
868 255,254,253,2,0,11,13,86,87,
869 261,260,259,258,257,256,227,225,139,137,127,0,
870 255,254,253,2,0,11,13,70,
871 264,263,261,260,259,258,257,256,254,253,229,228,227,225,222,173,172,168,167,
872 163,162,161,144,139,137,127,106,101,94,61,32,25,1,0,
873 255,254,253,0,11,13,
874 255,254,253,144,64,59,0,7,8,9,58,63,
875 261,260,259,258,257,256,255,254,253,227,225,151,139,137,127,61,0,145,
876 225,0,
877 225,0,
878 264,263,261,260,259,258,257,256,255,254,253,229,228,227,225,222,173,172,168,
879 167,163,162,161,144,139,137,127,106,101,94,76,61,32,25,3,0,73,77,78,79,
880 259,258,257,256,227,139,137,0,14,
881 227,225,222,0,
882 225,222,0,
883 264,263,262,261,260,259,258,257,256,255,254,253,229,228,227,226,225,224,222,
884 173,172,168,167,163,162,161,144,139,137,127,106,101,94,76,75,64,61,59,
885 32,25,0,6,41,42,58,63,71,72,140,141,148,221,223,
886 147,0,143,
887 10,0,
888 94,0,
889 32,25,0,93,
890 243,124,123,122,120,0,88,89,
891 2,0,
892 264,263,261,260,259,258,257,256,229,228,227,225,222,173,172,168,167,163,162,
893 161,144,139,137,127,106,101,94,61,32,25,2,0,69,
894 2,0,
895 61,0,
896 259,258,257,256,227,139,137,0,14,
897 255,254,253,151,61,0,11,13,87,
898 264,263,261,260,259,258,257,256,255,254,253,229,228,227,225,222,173,172,168,
899 167,163,162,161,144,139,137,127,106,101,94,76,61,32,25,0,77,
900 3,0,74,
901 261,260,259,258,257,256,227,225,222,139,137,127,0,
902 259,258,257,256,227,139,137,0,14,
903 255,254,253,121,32,25,0,11,13,87,
904 260,258,257,256,227,225,139,137,127,0,92,96,
905 260,258,257,256,227,225,139,137,127,0,92,96,
906 255,254,253,94,0,11,13,87,91,
907 255,254,253,2,0,11,13,87,
908 255,254,253,94,0,11,13,87,91,
909 255,254,253,2,0,11,13,87,
910 264,263,261,260,259,258,257,256,254,253,229,228,227,225,222,173,172,168,167,
911 163,162,161,144,139,137,127,106,101,94,61,32,25,2,0,67,68,
912 261,260,259,258,257,256,255,254,253,227,225,139,137,127,101,61,0,11,13,100,
913 259,258,257,256,227,139,137,0,14,146,
914 151,61,0,
915 261,260,259,258,257,256,255,254,253,227,225,139,137,127,61,0,11,13,87,
916 260,258,257,256,227,225,139,137,127,0,
917 25,0,
918 32,0,
919 121,0,
920 32,25,0,245,
921 124,123,122,120,0,89,
922 264,263,261,260,259,258,257,256,254,253,229,228,227,225,222,173,172,168,167,
923 163,162,161,144,139,137,127,106,101,94,61,32,25,0,
924 238,237,101,61,0,98,99,
925 101,61,0,107,
926 261,260,259,258,257,256,255,254,253,227,225,139,137,127,94,0,11,13,87,91,
927 61,0,
928 257,227,139,137,0,244,
929 257,227,139,137,0,244,
930 255,254,253,2,0,11,13,87,
931 255,254,253,0,11,13,
932 255,254,253,0,11,13,
933 255,254,253,101,61,0,11,13,87,
934 255,254,253,250,232,229,181,152,106,64,59,0,27,58,63,102,103,104,105,108,
935 109,110,111,230,231,
936 61,0,
937 32,25,0,37,
938 258,257,227,225,139,137,127,32,25,0,247,248,249,
939 32,0,
940 25,0,
941 32,25,0,51,
942 32,25,0,44,
943 255,254,253,0,11,13,
944 255,254,253,0,11,13,
945 255,254,253,0,11,13,
946 255,254,253,0,11,13,
947 259,258,257,256,227,139,137,0,14,
948 255,254,253,250,232,229,181,152,64,59,0,27,58,63,102,103,108,109,110,111,
949 230,231,
950 106,0,
951 264,263,262,261,260,259,258,257,256,255,254,253,228,227,226,225,224,222,173,
952 172,168,167,163,162,161,144,139,137,127,106,101,94,61,32,25,0,39,
953 264,263,262,261,260,259,258,257,256,255,254,253,228,227,226,225,224,222,173,
954 172,168,167,163,162,161,144,139,137,127,106,101,94,61,32,25,0,38,
955 258,257,227,225,139,137,127,0,247,
956 263,260,258,257,256,255,254,229,227,225,222,173,172,167,163,162,161,139,137,
957 127,32,0,56,57,
958 263,260,258,257,256,255,254,229,227,225,222,173,172,167,163,162,161,139,137,
959 127,32,25,0,53,54,
960 255,254,253,0,11,13,
961 264,263,262,261,260,259,258,257,256,255,254,253,229,228,227,225,222,173,172,
962 168,167,163,162,161,144,139,137,127,106,101,94,61,32,25,0,49,50,
963 264,263,262,261,260,259,258,257,256,255,254,253,229,228,227,225,222,173,172,
964 168,167,163,162,161,144,139,137,127,106,101,94,61,32,25,0,46,47,
965 259,258,257,256,229,227,139,137,0,14,
966 259,258,257,256,227,139,137,0,14,
967 259,258,257,256,227,139,137,0,14,
968 259,258,257,256,227,139,137,0,14,
969 261,260,259,258,257,256,227,225,222,139,137,127,0,
970 255,254,253,61,0,11,13,87,
971 264,263,262,261,260,259,258,257,256,255,254,253,228,227,226,225,224,222,173,
972 172,168,167,163,162,161,144,139,137,127,106,101,94,61,32,25,0,41,42,221,
973 223,
974 264,263,262,261,260,259,258,257,256,255,254,253,228,227,226,225,224,222,173,
975 172,168,167,163,162,161,144,139,137,127,106,101,94,61,32,25,0,41,42,221,
976 223,
977 263,260,258,257,256,255,254,229,227,225,222,173,172,167,163,162,161,139,137,
978 127,0,
979 32,0,
980 263,260,258,257,256,255,254,229,227,225,222,173,172,167,163,162,161,139,137,
981 127,32,0,
982 25,0,
983 32,25,0,44,
984 264,263,262,261,260,259,258,257,256,255,254,253,229,228,227,225,222,173,172,
985 168,167,163,162,161,144,139,137,127,106,101,94,61,25,0,
986 32,0,
987 264,263,262,261,260,259,258,257,256,255,254,253,229,228,227,225,222,173,172,
988 168,167,163,162,161,144,139,137,127,106,101,94,61,32,0,
989 25,0,
990 255,254,253,0,11,13,
991 261,260,259,258,257,256,255,254,253,227,225,139,137,127,0,11,13,
992 261,260,259,258,257,256,255,254,253,227,225,139,137,127,0,11,13,
993 261,260,259,258,257,256,255,254,253,227,225,139,137,127,0,11,13,182,183,
994 261,260,259,258,257,256,255,254,253,227,225,139,137,127,0,11,13,
995 259,258,257,256,227,139,137,0,14,
996 238,237,32,25,0,24,98,233,
997 238,237,0,98,251,252,
998 259,258,257,256,227,139,137,0,14,
999 255,254,253,61,0,11,13,87,183,
1000 167,155,154,0,153,156,157,158,159,160,
1001 261,260,259,258,257,256,255,254,253,227,225,139,137,127,0,11,13,
1002 264,263,262,261,260,259,258,257,256,255,254,253,229,228,227,226,225,224,222,
1003 173,172,168,167,163,162,161,144,139,137,127,106,101,94,61,32,25,0,27,28,
1004 34,35,36,41,42,221,223,
1005 264,263,262,261,260,259,258,257,256,255,254,253,229,228,227,226,225,224,222,
1006 173,172,168,167,163,162,161,144,139,137,127,106,101,94,61,32,25,0,27,28,
1007 29,30,31,41,42,221,223,
1008 255,254,253,61,0,11,13,235,236,
1009 255,254,253,61,0,11,13,87,
1010 61,0,
1011 255,254,253,0,11,13,
1012 255,254,253,61,0,11,13,87,
1013 61,0,
1014 261,260,259,258,257,256,255,254,253,227,225,139,137,127,0,11,13,
1015 259,258,257,256,227,139,137,0,14,
1016 61,0,
1017 255,254,253,163,162,161,61,0,164,
1018 259,258,257,256,255,254,253,227,176,167,139,137,0,11,13,87,
1019 255,254,253,61,0,11,13,87,
1020 238,237,32,25,0,24,98,234,
1021 264,263,262,261,260,259,258,257,256,255,254,253,229,228,227,226,225,224,222,
1022 173,172,168,167,163,162,161,144,139,137,127,106,101,94,61,25,0,27,28,34,
1023 41,42,221,223,
1024 32,0,
1025 264,263,262,261,260,259,258,257,256,255,254,253,229,228,227,226,225,224,222,
1026 173,172,168,167,163,162,161,144,139,137,127,106,101,94,61,32,0,27,28,29,
1027 41,42,221,223,
1028 25,0,
1029 239,0,
1030 32,25,0,51,
1031 199,196,195,194,193,192,191,190,189,167,0,184,186,187,188,197,198,
1032 259,258,257,256,227,176,167,139,137,0,14,158,159,165,166,
1033 61,0,
1034 255,254,253,61,0,11,13,87,
1035 255,254,253,0,11,13,
1036 255,254,253,61,0,11,13,87,
1037 261,260,259,258,257,256,227,225,139,137,127,0,18,19,
1038 255,254,253,0,11,13,
1039 255,254,253,0,11,13,
1040 255,254,253,180,172,168,0,11,13,87,177,178,179,
1041 259,258,257,256,255,254,253,227,167,139,137,0,11,13,87,
1042 261,260,259,258,257,256,227,225,139,137,127,0,
1043 255,254,253,173,172,168,163,162,161,0,164,
1044 255,254,253,173,172,168,0,11,13,87,
1045 61,0,
1046 259,258,257,256,227,139,137,0,14,
1047 32,25,0,44,
1048 261,260,259,258,257,256,227,225,139,137,127,0,
1049 255,254,253,172,168,0,11,13,87,
1050 167,0,
1051 208,207,206,32,25,0,37,185,
1052 172,0,
1053 180,172,168,0,
1054 259,258,257,256,255,254,253,227,139,137,0,11,13,87,
1055 168,0,
1056 255,254,253,0,11,13,
1057 180,0,
1058 259,258,257,256,227,167,139,137,0,14,158,159,165,166,
1059 173,172,168,0,169,170,171,174,175,
1060 261,260,259,258,257,256,227,225,139,137,127,0,
1061 172,168,0,203,204,205,
1062 259,258,257,256,227,139,137,0,14,
1063 255,254,253,0,11,13,
1064 259,258,257,256,227,139,137,0,14,
1065 259,258,257,256,255,254,253,227,139,137,0,11,13,87,
1066 259,258,257,256,255,254,253,227,167,139,137,0,11,13,87,
1067 173,172,0,174,
1068 259,258,257,256,255,254,253,227,167,139,137,0,11,13,87,
1069 168,0,169,
1070 172,0,
1071 261,260,259,258,257,256,255,254,253,227,225,139,137,127,0,11,13,87,
1072 168,0,203,
1073 172,0,
1074 261,260,259,258,257,256,255,254,253,227,225,172,168,139,137,127,0,11,13,87,
1075 32,25,0,37,
1076 261,260,259,258,257,256,227,225,139,137,127,0,
1077 259,258,257,256,227,139,137,0,14,
1078 259,258,257,256,227,167,139,137,0,14,158,159,165,166,
1079 259,258,257,256,227,167,139,137,0,14,158,159,165,166,
1080 261,260,259,258,257,256,227,225,139,137,127,0,18,19,
1081 172,168,0,200,201,202,
1082 261,260,259,258,257,256,227,225,139,137,127,0,
1083 255,254,253,173,172,0,11,13,87,
1084 255,254,253,172,168,0,11,13,87,
1085 255,254,253,172,168,0,11,13,87,
1086 259,258,257,256,255,254,253,227,139,137,0,11,13,87,
1087 168,0,200,
1088 172,0,
1089 259,258,257,256,227,139,137,0,14,
1090 261,260,259,258,257,256,255,254,253,227,225,172,168,139,137,127,0,11,13,87,
1091 0
1092 };
1093
1094
1095 static unsigned const char ag_astt[2389] = {
1096 8,8,8,5,5,1,8,8,7,0,1,1,1,1,1,1,7,1,1,1,1,1,5,8,1,1,7,1,1,1,1,1,1,7,1,1,1,
1097 9,9,9,5,1,7,1,2,2,2,2,2,2,2,7,1,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
1098 4,4,4,4,4,4,4,4,4,4,4,4,4,7,1,9,9,9,1,1,5,3,3,3,5,1,7,1,3,2,2,2,2,2,2,2,7,
1099 1,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,1,2,1,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,1,1,
1100 2,1,2,2,7,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,8,7,1,1,1,1,1,1,1,1,8,7,1,
1101 1,1,1,1,1,1,5,7,1,1,1,1,10,10,10,10,10,10,10,10,10,10,10,5,1,1,1,8,7,1,1,1,
1102 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
1103 10,10,10,10,10,10,10,1,7,1,1,1,7,1,1,1,1,1,5,1,1,7,1,1,3,1,1,10,10,10,10,
1104 10,10,4,4,4,10,10,4,10,10,10,4,7,1,2,7,2,7,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
1105 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,5,7,1,1,1,1,2,2,2,2,2,2,2,7,1,10,10,3,
1106 7,10,3,7,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,1,2,1,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,
1107 2,1,1,2,1,2,2,5,3,2,3,3,3,3,1,3,1,3,1,1,1,7,3,3,7,1,7,1,1,7,3,1,1,1,1,1,5,
1108 1,1,3,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,7,3,
1109 3,7,2,7,2,2,2,2,2,2,2,7,1,1,1,1,8,8,7,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
1110 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,5,3,3,7,3,10,10,10,10,10,10,10,10,2,
1111 10,10,10,7,2,2,2,2,2,2,2,7,1,1,1,1,5,5,5,7,3,1,3,1,1,1,1,1,1,1,1,1,7,1,1,1,
1112 1,1,1,1,1,1,1,1,7,1,1,1,1,1,8,7,1,1,1,1,1,1,1,5,7,3,1,3,1,1,1,8,7,1,1,1,1,
1113 1,1,1,5,7,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1114 1,1,1,5,7,1,3,10,10,10,10,10,10,1,1,1,10,10,10,10,10,8,5,7,1,1,1,2,2,2,2,2,
1115 2,2,5,1,2,2,2,7,10,10,10,10,10,10,1,1,1,10,10,10,10,10,8,7,1,1,1,9,9,9,9,9,
1116 9,9,9,9,5,3,7,3,7,3,7,1,1,7,3,1,1,1,1,5,1,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
1117 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,1,1,5,5,7,1,3,1,8,7,1,10,10,10,10,10,10,
1118 1,1,1,10,10,10,10,10,8,7,1,1,1,1,2,7,1,1,1,1,7,1,1,1,1,1,7,1,1,1,1,5,7,3,1,
1119 3,1,1,1,7,1,1,1,1,1,7,1,1,1,1,1,5,5,7,3,1,3,1,1,1,1,1,1,1,1,8,1,1,7,1,1,1,
1120 1,1,1,1,1,1,1,1,1,1,2,7,1,1,7,2,1,1,1,1,1,1,1,5,5,7,1,1,3,3,7,3,7,1,1,7,1,
1121 1,1,7,3,1,1,1,7,1,1,1,1,1,7,1,1,1,1,1,7,1,1,1,1,1,7,1,1,2,2,2,2,2,2,2,7,1,
1122 9,9,9,1,1,1,1,1,1,1,5,3,3,3,3,3,3,3,3,3,3,3,1,7,4,4,4,4,4,4,4,4,4,4,4,4,4,
1123 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,7,1,4,4,4,4,4,4,4,4,4,4,4,4,4,
1124 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,7,1,9,9,9,9,9,9,9,5,3,1,1,1,1,
1125 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,8,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1126 1,1,1,1,8,7,1,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1127 1,1,1,1,1,1,1,1,1,8,1,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1128 1,1,1,1,1,1,1,1,1,1,8,7,1,1,2,2,2,2,1,2,2,2,7,1,2,2,2,2,2,2,2,7,1,2,2,2,2,
1129 2,2,2,7,1,2,2,2,2,2,2,2,7,1,10,10,10,10,10,10,10,10,2,10,10,10,7,1,1,1,5,7,
1130 3,1,3,10,10,10,10,10,10,10,10,10,10,10,10,1,10,1,10,1,10,10,10,10,10,10,10,
1131 10,10,10,10,10,10,10,10,10,2,10,7,2,2,1,1,10,10,10,10,10,10,10,10,10,10,10,
1132 10,1,10,1,10,1,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,2,7,2,2,
1133 1,1,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,3,7,9,9,9,9,9,9,9,9,9,9,9,9,
1134 9,9,9,9,9,9,9,9,9,5,3,7,1,1,7,3,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
1135 9,9,9,9,9,9,9,9,9,9,9,9,5,3,7,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
1136 9,9,9,9,9,9,9,9,9,9,9,5,3,7,1,1,1,7,1,1,10,10,10,10,10,10,1,1,1,10,10,10,
1137 10,10,7,1,1,10,10,10,10,10,10,1,1,1,10,10,10,10,10,7,1,1,10,10,10,10,10,10,
1138 1,1,1,10,10,10,10,10,7,1,1,1,2,10,10,10,10,10,10,1,1,1,10,10,10,10,10,7,1,
1139 1,2,2,2,2,2,2,2,7,1,1,1,1,1,7,1,1,1,1,1,7,1,1,1,2,2,2,2,2,2,2,7,1,1,1,1,8,
1140 7,1,1,1,2,1,1,1,7,1,1,1,1,1,1,10,10,10,10,10,10,1,1,1,10,10,10,10,10,7,1,1,
1141 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,8,1,7,
1142 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1143 1,1,1,1,1,1,1,8,7,1,1,1,1,1,1,1,1,1,1,1,1,5,7,1,1,3,3,1,1,1,5,7,3,1,3,2,7,
1144 1,1,1,7,1,1,1,1,1,5,7,3,1,3,2,7,10,10,10,10,10,10,1,1,1,10,10,10,10,10,7,1,
1145 1,2,2,2,2,2,2,2,5,1,2,7,5,5,5,3,3,3,5,7,3,8,8,8,8,1,1,1,8,8,8,8,8,7,1,1,1,
1146 1,1,1,8,7,1,1,1,1,1,1,1,7,1,1,1,9,9,9,9,9,9,9,9,9,9,9,9,1,1,9,1,9,1,9,9,9,
1147 9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,3,3,3,3,3,1,1,3,7,9,9,9,9,9,9,9,9,9,9,9,9,1,
1148 1,9,1,9,1,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,3,3,3,3,3,1,1,3,7,1,5,1,1,7,
1149 1,1,2,2,2,2,2,2,2,2,1,7,1,1,1,1,2,2,2,2,2,2,2,1,1,2,2,7,1,1,1,1,1,2,7,1,1,
1150 1,8,7,1,1,1,1,1,1,7,1,1,1,1,1,5,7,1,1,3,1,1,1,1,1,1,1,1,1,1,1,7,1,1,1,1,1,
1151 7,1,1,1,1,1,7,1,1,1,1,1,8,8,1,7,1,1,1,1,1,1,8,8,8,8,1,1,1,8,8,8,8,7,1,1,1,
1152 10,10,10,10,10,10,10,10,10,10,10,5,5,5,5,5,5,5,3,3,3,7,3,1,1,1,8,5,8,7,1,1,
1153 1,2,7,2,2,2,2,2,2,2,7,1,1,1,5,3,9,9,9,9,9,9,9,9,9,9,9,5,1,1,1,5,8,7,1,1,1,
1154 1,7,1,2,2,1,1,7,2,2,3,7,5,5,5,7,8,8,8,8,1,1,1,8,8,8,7,1,1,1,1,5,1,1,1,5,3,
1155 1,3,7,2,2,2,2,2,1,2,2,7,1,1,1,1,1,1,8,1,7,1,1,1,1,1,10,10,10,10,10,10,10,
1156 10,10,10,10,4,8,1,7,1,1,1,2,2,2,2,2,2,2,7,1,1,1,1,7,1,1,2,2,2,2,2,2,2,7,1,
1157 8,8,8,8,1,1,1,8,8,8,7,1,1,1,8,8,8,8,1,1,1,8,8,8,8,7,1,1,1,1,3,7,3,8,8,8,8,
1158 1,1,1,8,8,8,8,7,1,1,1,1,5,3,3,7,8,8,8,8,8,8,1,1,1,8,8,8,8,8,7,1,1,1,1,5,3,
1159 3,7,10,10,10,10,10,10,1,1,1,10,10,5,8,10,10,10,7,1,1,1,1,1,7,2,10,10,10,10,
1160 10,10,10,10,10,10,10,4,2,2,2,2,2,2,2,7,1,2,2,2,2,2,1,2,2,7,1,1,1,1,1,2,2,2,
1161 2,2,1,2,2,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7,1,1,8,1,7,1,1,1,10,10,10,10,
1162 10,10,10,10,10,10,10,4,1,1,1,5,5,7,3,1,3,1,1,1,5,5,7,3,1,3,1,1,1,5,5,7,3,1,
1163 3,8,8,8,8,1,1,1,8,8,8,7,1,1,1,1,5,3,2,7,2,2,2,2,2,2,2,7,1,10,10,10,10,10,
1164 10,1,1,1,10,10,5,5,10,10,10,7,2,1,2,11
1165 };
1166
1167
1168 static const unsigned short ag_pstt[] = {
1169 2,2,2,94,94,1,2,2,0,0,3,2,2,
1170 4,4,4,1,5,4,
1171 8,8,8,3,9,6,7,2,8,8,9,8,8,
1172 10,3,12,12,11,
1173 7,7,7,8,
1174 13,5,14,
1175 9,9,9,9,9,9,9,6,15,16,
1176 71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,
1177 71,71,71,71,71,71,71,71,7,17,
1178 2,2,2,6,7,4,2,2,2,
1179 96,18,9,19,98,
1180 9,9,9,9,9,9,9,10,20,
1181 178,178,178,178,178,178,178,178,178,181,181,181,178,24,178,21,178,22,178,
1182 178,178,178,178,178,178,178,10,178,178,178,178,178,178,182,23,6,178,7,
1183 178,178,11,27,179,27,27,27,27,23,27,11,28,27,27,26,25,
1184 8,8,8,6,7,29,12,8,8,29,8,8,
1185 4,4,4,30,13,30,4,30,31,
1186 4,4,4,100,14,32,4,33,33,
1187 10,10,10,10,10,10,10,10,10,10,10,82,
1188 4,4,4,35,16,34,4,35,
1189 72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,
1190 72,72,72,72,72,72,72,36,17,
1191 4,4,4,18,37,4,
1192 8,8,8,3,6,7,19,8,8,97,8,8,
1193 10,10,10,10,10,10,170,170,170,10,10,170,10,10,10,170,20,38,
1194 274,21,
1195 272,22,
1196 85,85,85,85,85,85,85,85,87,87,87,85,85,85,85,85,85,85,85,85,85,85,85,85,85,
1197 85,85,85,85,85,86,85,85,85,90,23,40,39,39,40,
1198 9,9,9,9,9,9,9,24,41,
1199 276,275,271,25,
1200 273,270,26,
1201 178,178,178,178,178,178,178,178,178,181,181,181,178,24,178,21,178,22,178,
1202 178,178,178,178,178,178,178,10,178,178,178,178,178,178,182,23,6,178,7,
1203 178,178,176,175,179,175,175,175,175,23,175,11,175,26,25,
1204 42,28,168,
1205 5,29,
1206 43,30,
1207 45,44,31,108,
1208 48,47,47,47,46,101,49,47,
1209 99,33,
1210 50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,
1211 50,50,50,50,50,77,34,80,
1212 81,35,
1213 70,36,
1214 9,9,9,9,9,9,9,37,51,
1215 4,4,4,53,53,38,52,4,53,
1216 85,85,85,85,85,85,85,85,87,87,87,85,85,85,85,85,85,85,85,85,85,85,85,85,85,
1217 85,85,85,85,85,86,85,85,85,91,89,
1218 83,40,83,
1219 10,10,10,10,10,10,10,10,279,10,10,10,41,
1220 9,9,9,9,9,9,9,42,54,
1221 4,4,4,100,100,100,43,109,4,109,
1222 55,55,55,55,55,55,55,55,55,44,56,55,
1223 55,55,55,55,55,55,55,55,55,45,57,55,
1224 4,4,4,30,46,30,4,30,58,
1225 4,4,4,100,47,105,4,105,
1226 4,4,4,30,48,30,4,30,59,
1227 4,4,4,100,49,60,4,103,
1228 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,
1229 61,61,61,61,61,61,61,75,50,61,78,
1230 10,10,10,10,10,10,4,4,4,10,10,10,10,10,63,118,51,62,4,63,
1231 9,9,9,9,9,9,9,101,64,171,
1232 186,169,53,
1233 10,10,10,10,10,10,4,4,4,10,10,10,10,10,65,54,65,4,65,
1234 111,111,111,111,111,111,111,111,111,112,
1235 107,56,
1236 106,57,
1237 148,58,
1238 66,67,59,302,
1239 68,68,68,46,101,68,
1240 74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,
1241 74,74,74,74,74,74,74,76,
1242 69,70,116,116,62,71,119,
1243 72,73,63,73,
1244 10,10,10,10,10,10,4,4,4,10,10,10,10,10,30,64,30,4,30,74,
1245 173,65,
1246 75,75,75,75,66,76,
1247 75,75,75,75,67,77,
1248 4,4,4,100,68,104,4,104,
1249 4,4,4,69,78,4,
1250 4,4,4,70,79,4,
1251 4,4,4,100,100,71,117,4,117,
1252 85,85,85,81,80,84,82,83,86,6,7,72,85,85,85,85,85,85,86,85,85,85,85,85,85,
1253 129,73,
1254 87,88,74,172,
1255 89,89,89,89,89,89,89,307,307,75,89,89,309,
1256 301,76,
1257 300,77,
1258 90,91,78,92,
1259 93,94,79,292,
1260 4,4,4,80,95,4,
1261 4,4,4,81,96,4,
1262 4,4,4,82,97,4,
1263 4,4,4,83,98,4,
1264 9,9,9,9,9,9,9,84,99,
1265 124,124,124,81,80,84,82,83,6,7,126,124,124,124,124,124,124,124,124,124,124,
1266 124,
1267 100,86,
1268 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,
1269 45,45,45,45,45,45,45,45,45,45,87,101,
1270 40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,
1271 40,40,40,40,40,40,40,40,40,40,88,102,
1272 306,306,306,306,306,306,306,308,306,
1273 103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,
1274 103,104,90,103,104,
1275 105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,
1276 105,105,106,91,105,106,
1277 4,4,4,92,107,4,
1278 108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
1279 108,108,108,108,108,108,108,108,108,108,108,108,108,109,108,93,108,109,
1280 110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,
1281 110,110,110,110,110,110,110,110,110,110,110,110,110,110,111,94,110,111,
1282 9,9,9,9,112,9,9,9,95,113,
1283 9,9,9,9,9,9,9,96,114,
1284 9,9,9,9,9,9,9,97,115,
1285 9,9,9,9,9,9,9,98,116,
1286 10,10,10,10,10,10,10,10,280,10,10,10,99,
1287 4,4,4,100,100,128,4,128,
1288 46,46,46,46,46,46,46,46,46,47,47,47,24,46,21,46,22,46,46,46,46,46,46,46,46,
1289 46,46,46,46,46,46,46,46,39,46,101,48,49,26,25,
1290 41,41,41,41,41,41,41,41,41,42,42,42,24,41,21,41,22,41,41,41,41,41,41,41,41,
1291 41,41,41,41,41,41,41,41,41,38,102,43,44,26,25,
1292 66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,68,
1293 69,104,
1294 61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,63,
1295 64,106,
1296 93,94,107,293,
1297 56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,
1298 56,56,56,56,56,56,56,56,58,
1299 59,109,
1300 51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,
1301 51,51,51,51,51,51,51,51,53,
1302 54,111,
1303 4,4,4,112,117,4,
1304 10,10,10,10,10,10,4,4,4,10,10,10,10,10,113,118,4,
1305 10,10,10,10,10,10,4,4,4,10,10,10,10,10,114,119,4,
1306 10,10,10,10,10,10,4,4,4,10,10,10,10,10,115,120,4,121,223,
1307 10,10,10,10,10,10,4,4,4,10,10,10,10,10,116,122,4,
1308 9,9,9,9,9,9,9,117,123,
1309 69,70,124,125,118,127,126,128,
1310 129,70,119,130,131,131,
1311 9,9,9,9,9,9,9,120,132,
1312 4,4,4,134,121,133,4,134,224,
1313 136,137,137,122,137,137,137,135,135,135,
1314 10,10,10,10,10,10,4,4,4,10,10,10,10,10,123,138,4,
1315 139,139,139,139,139,139,139,139,139,139,139,139,84,24,139,21,139,22,139,139,
1316 139,139,139,139,139,139,139,139,139,139,139,139,139,139,140,139,124,139,
1317 139,139,139,140,139,139,26,25,
1318 141,141,141,141,141,141,141,141,141,141,141,141,84,24,141,21,141,22,141,141,
1319 141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,142,125,141,
1320 141,141,141,142,141,141,26,25,
1321 4,4,4,286,126,143,4,289,289,
1322 4,4,4,100,127,285,4,285,
1323 283,128,
1324 4,4,4,129,144,4,
1325 4,4,4,100,130,310,4,310,
1326 312,131,
1327 10,10,10,10,10,10,4,4,4,10,10,10,10,10,132,145,4,
1328 9,9,9,9,9,9,9,101,132,
1329 222,134,
1330 194,194,194,198,198,198,194,135,198,
1331 146,146,146,146,4,4,4,146,146,146,146,146,136,146,4,146,
1332 4,4,4,147,137,147,4,147,
1333 69,70,124,125,138,148,148,148,
1334 34,34,34,34,34,34,34,34,34,34,34,34,84,24,34,21,34,22,34,34,34,34,34,34,34,
1335 34,34,34,34,34,34,34,34,34,34,36,34,34,34,34,34,26,25,
1336 37,140,
1337 26,26,26,26,26,26,26,26,26,26,26,26,84,24,26,21,26,22,26,26,26,26,26,26,26,
1338 26,26,26,26,26,26,26,26,26,26,28,26,26,26,26,26,26,25,
1339 29,142,
1340 149,288,
1341 90,91,144,150,
1342 152,236,235,234,233,232,231,230,229,151,145,153,153,153,153,237,238,
1343 9,9,9,9,9,154,155,9,9,146,156,157,157,158,157,
1344 187,147,
1345 4,4,4,159,148,159,4,159,
1346 4,4,4,149,160,4,
1347 4,4,4,100,150,161,4,313,
1348 162,162,162,162,162,162,162,162,162,162,162,151,163,162,
1349 4,4,4,152,164,4,
1350 4,4,4,153,165,4,
1351 4,4,4,171,166,168,154,167,4,166,170,169,171,
1352 172,172,172,172,4,4,4,172,172,172,172,155,172,4,172,
1353 10,10,10,10,10,10,10,10,10,10,10,199,
1354 194,194,194,194,194,194,202,202,202,157,202,
1355 4,4,4,173,100,173,158,173,4,173,
1356 284,159,
1357 9,9,9,9,9,9,9,160,174,
1358 93,94,101,293,
1359 14,14,14,14,14,14,14,14,14,14,14,15,
1360 4,4,4,100,175,163,175,4,175,
1361 176,164,
1362 177,252,251,87,88,165,253,225,
1363 221,166,
1364 216,101,216,167,
1365 178,178,178,178,4,4,4,178,178,178,168,178,4,178,
1366 179,219,
1367 4,4,4,218,215,4,
1368 220,171,
1369 9,9,9,9,9,155,9,9,172,156,157,157,158,157,
1370 180,184,182,173,183,183,184,181,181,
1371 10,10,10,10,10,10,10,10,10,10,10,294,
1372 187,185,175,186,186,187,
1373 9,9,9,9,9,9,9,176,188,
1374 4,4,4,177,189,4,
1375 9,9,9,9,9,9,9,178,190,
1376 191,191,191,191,4,4,4,191,191,191,179,191,4,191,
1377 192,192,192,192,4,4,4,192,192,192,192,180,192,4,192,
1378 180,212,181,211,
1379 193,193,193,193,4,4,4,193,193,193,193,182,193,4,193,
1380 182,207,205,
1381 208,184,
1382 194,194,194,194,194,194,4,4,4,194,194,194,194,194,185,194,4,194,
1383 185,249,247,
1384 250,187,
1385 10,10,10,10,10,10,4,4,4,10,10,100,195,10,10,10,188,195,4,195,
1386 87,88,189,254,
1387 10,10,10,10,10,10,10,10,10,10,10,213,
1388 9,9,9,9,9,9,9,191,196,
1389 9,9,9,9,9,155,9,9,192,156,157,157,197,157,
1390 9,9,9,9,9,155,9,9,193,156,157,157,198,157,
1391 162,162,162,162,162,162,162,162,162,162,162,194,199,162,
1392 202,200,195,201,201,202,
1393 10,10,10,10,10,10,10,10,10,10,10,214,
1394 4,4,4,100,100,197,209,4,209,
1395 4,4,4,100,100,198,203,4,203,
1396 4,4,4,100,100,199,245,4,245,
1397 203,203,203,203,4,4,4,203,203,203,200,203,4,203,
1398 200,243,241,
1399 244,202,
1400 9,9,9,9,9,9,9,203,204,
1401 10,10,10,10,10,10,4,4,4,10,10,100,100,10,10,10,204,239,4,239,
1402 0
1403 };
1404
1405
1406 static const unsigned short ag_sbt[] = {
1407 0, 13, 19, 32, 37, 41, 44, 54, 89, 98, 103, 112, 167, 179,
1408 188, 197, 209, 217, 251, 257, 269, 287, 289, 291, 331, 340, 344, 347,
1409 400, 403, 405, 407, 411, 419, 421, 454, 456, 458, 467, 476, 512, 515,
1410 528, 537, 547, 559, 571, 580, 588, 597, 605, 641, 661, 671, 674, 693,
1411 703, 705, 707, 709, 713, 719, 752, 759, 763, 783, 785, 791, 797, 805,
1412 811, 817, 826, 851, 853, 857, 870, 872, 874, 878, 882, 888, 894, 900,
1413 906, 915, 937, 939, 976,1013,1022,1046,1071,1077,1114,1151,1161,1170,
1414 1179,1188,1201,1209,1249,1289,1310,1312,1334,1336,1340,1374,1376,1410,
1415 1412,1418,1435,1452,1471,1488,1497,1505,1511,1520,1529,1539,1556,1602,
1416 1648,1657,1665,1667,1673,1681,1683,1700,1709,1711,1720,1736,1744,1752,
1417 1795,1797,1840,1842,1844,1848,1865,1880,1882,1890,1896,1904,1918,1924,
1418 1930,1943,1958,1970,1981,1991,1993,2002,2006,2018,2027,2029,2037,2039,
1419 2043,2057,2059,2065,2067,2081,2090,2102,2108,2117,2123,2132,2146,2161,
1420 2165,2180,2183,2185,2203,2206,2208,2228,2232,2244,2253,2267,2281,2295,
1421 2301,2313,2322,2331,2340,2354,2357,2359,2368,2388
1422 };
1423
1424
1425 static const unsigned short ag_sbe[] = {
1426 8, 16, 26, 33, 40, 42, 51, 87, 94, 100, 110, 152, 173, 183,
1427 192, 208, 213, 250, 254, 263, 285, 288, 290, 326, 338, 343, 346, 387,
1428 401, 404, 406, 409, 416, 420, 452, 455, 457, 465, 472, 510, 513, 527,
1429 535, 543, 556, 568, 575, 584, 592, 601, 638, 657, 668, 673, 689, 702,
1430 704, 706, 708, 711, 717, 751, 756, 761, 778, 784, 789, 795, 801, 808,
1431 814, 822, 837, 852, 855, 866, 871, 873, 876, 880, 885, 891, 897, 903,
1432 913, 925, 938, 974,1011,1020,1043,1068,1074,1111,1148,1159,1168,1177,
1433 1186,1200,1205,1244,1284,1309,1311,1333,1335,1338,1373,1375,1409,1411,
1434 1415,1432,1449,1466,1485,1495,1501,1507,1518,1524,1532,1553,1592,1638,
1435 1652,1661,1666,1670,1677,1682,1697,1707,1710,1718,1732,1740,1748,1787,
1436 1796,1832,1841,1843,1846,1858,1874,1881,1886,1893,1900,1915,1921,1927,
1437 1936,1954,1969,1979,1987,1992,2000,2004,2017,2023,2028,2034,2038,2042,
1438 2053,2058,2062,2066,2075,2084,2101,2104,2115,2120,2130,2142,2157,2163,
1439 2176,2181,2184,2199,2204,2207,2224,2230,2243,2251,2261,2275,2292,2297,
1440 2312,2318,2327,2336,2350,2355,2358,2366,2384,2388
1441 };
1442
1443
1444 static const unsigned char ag_fl[] = {
1445 1,1,2,0,1,4,1,2,1,1,2,1,3,1,2,1,2,1,2,0,1,2,1,1,1,1,2,0,1,3,1,1,1,1,2,
1446 0,1,3,3,3,0,2,2,2,2,0,2,2,2,2,1,2,0,1,3,1,2,0,1,3,1,2,0,1,3,1,2,0,1,3,
1447 4,0,2,1,2,0,1,0,2,0,2,4,1,3,1,1,1,1,1,2,0,1,1,1,0,1,0,2,3,5,0,1,1,3,5,
1448 3,3,3,3,3,1,2,1,1,1,1,0,2,0,2,1,1,1,1,2,0,1,0,4,6,1,1,1,1,1,1,0,1,2,1,
1449 1,1,1,1,2,0,1,1,3,1,1,1,2,1,2,0,1,2,1,1,1,2,1,2,3,3,1,1,3,5,0,3,3,4,1,
1450 2,1,1,1,1,1,1,1,1,1,1,5,7,1,1,1,1,1,1,0,1,1,1,2,1,1,1,2,4,1,2,0,1,6,4,
1451 1,2,6,3,4,2,1,0,1,1,5,5,6,1,2,6,1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,2,0,1,7,
1452 4,1,2,0,1,5,1,1,1,3,1,1,7,1,2,0,1,7,4,1,2,0,1,2,1,2,2,2,2,2,2,2,1,1,3,
1453 3,1,1,6,9,2,0,1,1,2,1,1,3,5,4,0,2,6,2,2,3,3,3,1,1,1,2,0,1,2,2,1,6,4
1454 };
1455
1456 static const unsigned short ag_ptt[] = {
1457 0, 8, 8, 9, 9, 4, 13, 13, 11, 14, 14, 17, 17, 19, 19, 18, 21, 22,
1458 22, 23, 23, 20, 29, 29, 29, 30, 30, 31, 31, 24, 34, 34, 34, 35, 35, 36,
1459 36, 24, 37, 37, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 46, 46, 47, 47,
1460 44, 49, 49, 50, 50, 44, 53, 53, 54, 54, 51, 56, 56, 57, 57, 51, 58, 60,
1461 60, 67, 67, 68, 68, 69, 69, 70, 70, 63, 65, 71, 72, 77, 77, 77, 78, 78,
1462 79, 79, 73, 74, 81, 81, 83, 83, 5, 80, 87, 87, 86, 86, 86, 86, 93, 93,
1463 85, 91, 96, 96, 92, 7, 7, 7, 99, 99,100,100,103,103,103,104,104,105,
1464 105,107,107, 82,102,102,102,102,102,102,114,114,112,117,117,117,117,118,
1465 118,119,119,115, 89, 89, 89, 89,129,130,130,131,131,125,126,126,126,132,
1466 138,138,133,134,128, 6, 6,141,145,145,146,143,149,149,142,148,148,148,
1467 148,148,148,148,148,148,140,108,153,153,153,153,160,160,164,164,164,164,
1468 157,166,166,166,165,169,170,170,171,171,158,174,175,175,159,177,177,178,
1469 178,179,179,179,156,156,109,182,182,183,184,184,184,186,187,187,187,187,
1470 187,187,187,188,188,200,201,201,202,202,197,203,204,204,205,205,198,185,
1471 185,185,185,116,116,209,215,215,216,216,210,218,219,219,220,220,214,217,
1472 41, 41,221,221,223,223,223, 28, 28, 42, 27,110,110,230,231,233,236,236,
1473 236,233,234,234, 98, 98,235,240,240,113,241,242,245,245, 88,247,247,248,
1474 248,249,249,244,252,252,111,251
1475 };
1476
1477
1478 static void ag_ra(PCB_DECL)
1479 {
1480 switch(ag_rpx[(PCB).ag_ap]) {
1481 case 1: VNO AG_WRAP_5(ag_rp_1(PCB_POINTER, V(0,(int *)))); break;
1482 case 2: VRO(AG_WRAP_5 *, ag_rp_2(PCB_POINTER, VW(0, AG_WRAP_5 *), V(1,(int *)))); break;
1483 case 3: VWD(0,AG_WRAP_5 *); break;
1484 case 4: VWD(2,AG_WRAP_5 *); break;
1485 case 5: VNO AG_WRAP_5(ag_rp_3(PCB_POINTER, VW(1, AG_WRAP_5 *)));
1486 VWD(1, AG_WRAP_5 *); break;
1487 case 6: VNO AG_WRAP_5(ag_rp_4(PCB_POINTER, VW(1, AG_WRAP_5 *)));
1488 VWD(1, AG_WRAP_5 *); break;
1489 case 7: VNO AG_WRAP_5(ag_rp_5(PCB_POINTER)); break;
1490 case 8: VRO(AG_WRAP_5 *, ag_rp_6(PCB_POINTER, VW(0, AG_WRAP_5 *), V(1,(int *)))); break;
1491 case 9: VRO(AG_WRAP_5 *, ag_rp_7(PCB_POINTER, VW(0, AG_WRAP_5 *))); break;
1492 case 10: VRO(AG_WRAP_5 *, ag_rp_8(PCB_POINTER, VW(0, AG_WRAP_5 *), V(1,(int *)))); break;
1493 case 11: VRO(AG_WRAP_5 *, ag_rp_9(PCB_POINTER, VW(0, AG_WRAP_5 *))); break;
1494 case 12: VNO AG_WRAP_5(ag_rp_10(PCB_POINTER)); break;
1495 case 13: VRO(AG_WRAP_5 *, ag_rp_11(PCB_POINTER, VW(0, AG_WRAP_5 *), V(1,(int *)))); break;
1496 case 14: VRO(AG_WRAP_5 *, ag_rp_12(PCB_POINTER, VW(0, AG_WRAP_5 *))); break;
1497 case 15: VRO(AG_WRAP_5 *, ag_rp_13(PCB_POINTER, VW(0, AG_WRAP_5 *), V(1,(int *)))); break;
1498 case 16: VRO(AG_WRAP_5 *, ag_rp_14(PCB_POINTER, VW(0, AG_WRAP_5 *))); break;
1499 case 17: ag_rp_15(PCB_POINTER, VW(1, AG_WRAP_5 *));
1500 VWD(1, AG_WRAP_5 *); break;
1501 case 18: VNO AG_WRAP_5(ag_rp_16(PCB_POINTER)); break;
1502 case 19: VRO(AG_WRAP_5 *, ag_rp_17(PCB_POINTER, VW(0, AG_WRAP_5 *), V(1,(int *)))); break;
1503 case 20: ag_rp_18(PCB_POINTER, V(0,(int *))); break;
1504 case 21: ag_rp_19(PCB_POINTER); break;
1505 case 22: ag_rp_20(PCB_POINTER, V(0,(int *))); break;
1506 case 23: ag_rp_21(PCB_POINTER, VW(2, AG_WRAP_5 *));
1507 VWD(2, AG_WRAP_5 *); break;
1508 case 24: ag_rp_22(PCB_POINTER, VW(1, AG_WRAP_5 *), VW(2, AG_WRAP_6 *));
1509 VWD(1, AG_WRAP_5 *); VWD(2, AG_WRAP_6 *); break;
1510 case 25: VNO AG_WRAP_6(ag_rp_23(PCB_POINTER)); break;
1511 case 26: VRO(AG_WRAP_6 *, ag_rp_24(PCB_POINTER, VW(0, AG_WRAP_6 *), VW(2, AG_WRAP_4 *)));
1512 VWD(2, AG_WRAP_4 *); break;
1513 case 27: VRO(AG_WRAP_5 *, ag_rp_25(PCB_POINTER, VW(0, AG_WRAP_5 *), VW(2, AG_WRAP_5 *)));
1514 VWD(2, AG_WRAP_5 *); break;
1515 case 28: ag_rp_26(PCB_POINTER, VW(1, AG_WRAP_5 *));
1516 VWD(1, AG_WRAP_5 *); break;
1517 case 29: ag_rp_27(PCB_POINTER, V(0,(int *))); break;
1518 case 30: ag_rp_28(PCB_POINTER, V(0,(int *))); break;
1519 case 31: ag_rp_29(PCB_POINTER, V(0,(int *))); break;
1520 case 32: ag_rp_30(PCB_POINTER); break;
1521 case 33: ag_rp_31(PCB_POINTER, VW(1, AG_WRAP_5 *), VW(2, AG_WRAP_6 *));
1522 VWD(1, AG_WRAP_5 *); VWD(2, AG_WRAP_6 *); break;
1523 case 34: VWD(3,AG_WRAP_5 *); break;
1524 case 35: ag_rp_32(PCB_POINTER, VW(2, AG_WRAP_5 *), VW(3, AG_WRAP_8 *));
1525 VWD(2, AG_WRAP_5 *); VWD(3, AG_WRAP_8 *); break;
1526 case 36: VRO(AG_WRAP_7 *, ag_rp_33(PCB_POINTER, VW(0, AG_WRAP_7 *))); break;
1527 case 37: VRO(AG_WRAP_8 *, ag_rp_34(PCB_POINTER, VW(0, AG_WRAP_8 *), VW(1, AG_WRAP_7 *)));
1528 VWD(1, AG_WRAP_7 *); break;
1529 case 38: VNO AG_WRAP_7(ag_rp_35(PCB_POINTER, VW(1, AG_WRAP_5 *), V(3,(Attribute::Type *)), VW(5, AG_WRAP_9 *)));
1530 VWD(1, AG_WRAP_5 *); VWD(5, AG_WRAP_9 *); break;
1531 case 39: V(0,(Attribute::Type *)) = ag_rp_36(PCB_POINTER); break;
1532 case 40: V(0,(Attribute::Type *)) = ag_rp_37(PCB_POINTER); break;
1533 case 41: V(0,(Attribute::Type *)) = ag_rp_38(PCB_POINTER); break;
1534 case 42: V(0,(Attribute::Type *)) = ag_rp_39(PCB_POINTER); break;
1535 case 43: V(0,(Attribute::Type *)) = ag_rp_40(PCB_POINTER); break;
1536 case 44: V(0,(Attribute::Type *)) = ag_rp_41(PCB_POINTER); break;
1537 case 45: V(0,(Attribute::Type *)) = ag_rp_42(PCB_POINTER); break;
1538 case 46: V(0,(Attribute::Type *)) = ag_rp_43(PCB_POINTER); break;
1539 case 47: V(0,(Attribute::Type *)) = ag_rp_44(PCB_POINTER); break;
1540 case 48: V(0,(Attribute::Type *)) = ag_rp_45(PCB_POINTER); break;
1541 case 49: VNO AG_WRAP_9(ag_rp_46(PCB_POINTER)); break;
1542 case 50: VNO AG_WRAP_9(ag_rp_47(PCB_POINTER)); break;
1543 case 51: VRO(AG_WRAP_5 *, ag_rp_48(PCB_POINTER, VW(0, AG_WRAP_5 *))); break;
1544 case 52: VNO AG_WRAP_9(ag_rp_49(PCB_POINTER, VW(2, AG_WRAP_5 *)));
1545 VWD(2, AG_WRAP_5 *); break;
1546 case 53: V(0,(int *)) = ag_rp_50(PCB_POINTER, V(1,(int *))); break;
1547 case 54: V(0,(int *)) = ag_rp_51(PCB_POINTER, V(0,(int *)), V(1,(int *))); break;
1548 case 55: V(0,(int *)) = ag_rp_52(PCB_POINTER, V(1,(int *))); break;
1549 case 56: V(0,(int *)) = ag_rp_53(PCB_POINTER, V(0,(int *)), V(1,(int *))); break;
1550 case 57: V(0,(int *)) = ag_rp_54(PCB_POINTER, V(0,(int *)), V(1,(int *))); break;
1551 case 58: V(0,(int *)) = ag_rp_55(PCB_POINTER, VW(1, AG_WRAP_5 *));
1552 VWD(1, AG_WRAP_5 *); break;
1553 case 59: VWD(1,AG_WRAP_5 *); break;
1554 case 60: VWD(4,AG_WRAP_5 *); break;
1555 }
1556 }
1557
1558 #define TOKEN_NAMES parse_token_names
1559 const char *const parse_token_names[265] = {
1560 "document",
1561 "\"--\"",
1562 "\"?>\"",
1563 "\"]]>\"",
1564 "document",
1565 "prolog",
1566 "element",
1567 "Misc",
1568 "",
1569 "",
1570 "eof",
1571 "S",
1572 "SpaceChar",
1573 "",
1574 "Name",
1575 "",
1576 "NameChar",
1577 "Names",
1578 "Nmtoken",
1579 "",
1580 "Nmtokens",
1581 "",
1582 "",
1583 "",
1584 "EntityValue",
1585 "'\\\"'",
1586 "",
1587 "PEReference",
1588 "Reference",
1589 "",
1590 "",
1591 "",
1592 "'\\''",
1593 "",
1594 "",
1595 "",
1596 "",
1597 "AttValue",
1598 "dq AttValString",
1599 "sq AttValString",
1600 "",
1601 "CharRef",
1602 "EntityRef",
1603 "",
1604 "SystemLiteral",
1605 "",
1606 "",
1607 "",
1608 "",
1609 "",
1610 "",
1611 "PubidLiteral",
1612 "PubidChar",
1613 "",
1614 "",
1615 "",
1616 "",
1617 "",
1618 "Comment",
1619 "\"<!--\"",
1620 "comment text",
1621 "'>'",
1622 "Char",
1623 "PI",
1624 "\"<?\"",
1625 "PITarget",
1626 "",
1627 "",
1628 "",
1629 "",
1630 "",
1631 "CDSect",
1632 "CDStart",
1633 "CData",
1634 "CDEnd",
1635 "\"<![CDATA[\"",
1636 "\"\\r\\n\"",
1637 "",
1638 "",
1639 "",
1640 "XMLDecl",
1641 "",
1642 "doctypedecl",
1643 "",
1644 "\"<?xml\"",
1645 "VersionInfo",
1646 "VersionDecl",
1647 "",
1648 "EncodingDecl",
1649 "SDDecl",
1650 "\"version\"",
1651 "Eq",
1652 "VersionNum",
1653 "",
1654 "'='",
1655 "",
1656 "",
1657 "\"<!DOCTYPE\"",
1658 "ExternalID",
1659 "",
1660 "",
1661 "'['",
1662 "markupdecl",
1663 "",
1664 "",
1665 "",
1666 "']'",
1667 "",
1668 "elementdecl",
1669 "AttlistDecl",
1670 "EntityDecl",
1671 "NotationDecl",
1672 "extSubset",
1673 "TextDecl",
1674 "",
1675 "extSubsetDecl",
1676 "conditionalSect",
1677 "",
1678 "",
1679 "",
1680 "\"standalone\"",
1681 "\"\\'yes\\'\"",
1682 "\"\\\"yes\\\"\"",
1683 "\"\\'no\\'\"",
1684 "\"\\\"no\\\"\"",
1685 "LanguageId",
1686 "Langcode",
1687 "'-'",
1688 "Subcode",
1689 "",
1690 "",
1691 "",
1692 "ISO639Code",
1693 "IanaCode",
1694 "UserCode",
1695 "",
1696 "",
1697 "",
1698 "",
1699 "",
1700 "EmptyElementTag",
1701 "STag",
1702 "content",
1703 "ETag",
1704 "'<'",
1705 "AttributeList",
1706 "Attribute",
1707 "\"</\"",
1708 "content unit",
1709 "",
1710 "",
1711 "\"/>\"",
1712 "\"<!ELEMENT\"",
1713 "contentspec",
1714 "\"EMPTY\"",
1715 "\"ANY\"",
1716 "Mixed",
1717 "Children",
1718 "choice",
1719 "seq",
1720 "",
1721 "'\\?'",
1722 "'*'",
1723 "'+'",
1724 "",
1725 "cp",
1726 "",
1727 "'('",
1728 "'|'",
1729 "",
1730 "",
1731 "",
1732 "')'",
1733 "','",
1734 "",
1735 "",
1736 "\"#PCDATA\"",
1737 "",
1738 "",
1739 "",
1740 "\")*\"",
1741 "\"<!ATTLIST\"",
1742 "AttDefs",
1743 "AttDef",
1744 "AttType",
1745 "DefaultDecl",
1746 "StringType",
1747 "TokenizedType",
1748 "EnumeratedType",
1749 "\"CDATA\"",
1750 "\"ID\"",
1751 "\"IDREF\"",
1752 "\"IDREFS\"",
1753 "\"ENTITY\"",
1754 "\"ENTITIES\"",
1755 "\"NMTOKEN\"",
1756 "\"NMTOKENS\"",
1757 "NotationType",
1758 "Enumeration",
1759 "\"NOTATION\"",
1760 "",
1761 "",
1762 "",
1763 "",
1764 "",
1765 "",
1766 "\"#REQUIRED\"",
1767 "\"#IMPLIED\"",
1768 "\"#FIXED\"",
1769 "includeSect",
1770 "ignoreSect",
1771 "\"<![\"",
1772 "\"INCLUDE\"",
1773 "\"IGNORE\"",
1774 "ignoreSectContents",
1775 "",
1776 "",
1777 "Ignore",
1778 "",
1779 "",
1780 "",
1781 "decimal CharRef",
1782 "';'",
1783 "hex CharRef",
1784 "\"&#\"",
1785 "",
1786 "\"&#x\"",
1787 "",
1788 "'&'",
1789 "'%'",
1790 "GEDecl",
1791 "PEDecl",
1792 "\"<!ENTITY\"",
1793 "EntityDef",
1794 "PEDef",
1795 "NDataDecl",
1796 "",
1797 "\"SYSTEM\"",
1798 "\"PUBLIC\"",
1799 "\"NDATA\"",
1800 "",
1801 "extParsedEnt",
1802 "extPE",
1803 "\"encoding\"",
1804 "EncName",
1805 "",
1806 "",
1807 "",
1808 "",
1809 "",
1810 "\"<!NOTATION\"",
1811 "PublicID",
1812 "",
1813 "",
1814 "",
1815 "",
1816 "",
1817 "",
1818 "",
1819 "",
1820 "",
1821 "",
1822 "",
1823 "",
1824 "",
1825
1826 };
1827
1828 #ifndef MISSING_FORMAT
1829 #define MISSING_FORMAT "Missing %s"
1830 #endif
1831 #ifndef UNEXPECTED_FORMAT
1832 #define UNEXPECTED_FORMAT "Unexpected %s"
1833 #endif
1834 #ifndef UNNAMED_TOKEN
1835 #define UNNAMED_TOKEN "input"
1836 #endif
1837
1838
1839 static void ag_diagnose(PCB_DECL) {
1840 int ag_snd = (PCB).sn;
1841 int ag_k = ag_sbt[ag_snd];
1842
1843 if (*TOKEN_NAMES[ag_tstt[ag_k]] && ag_astt[ag_k + 1] == ag_action_8) {
1844 sprintf((PCB).ag_msg, MISSING_FORMAT, TOKEN_NAMES[ag_tstt[ag_k]]);
1845 }
1846 else if (ag_astt[ag_sbe[(PCB).sn]] == ag_action_8
1847 && (ag_k = (int) ag_sbe[(PCB).sn] + 1) == (int) ag_sbt[(PCB).sn+1] - 1
1848 && *TOKEN_NAMES[ag_tstt[ag_k]]) {
1849 sprintf((PCB).ag_msg, MISSING_FORMAT, TOKEN_NAMES[ag_tstt[ag_k]]);
1850 }
1851 else if ((PCB).token_number && *TOKEN_NAMES[(PCB).token_number]) {
1852 sprintf((PCB).ag_msg, UNEXPECTED_FORMAT, TOKEN_NAMES[(PCB).token_number]);
1853 }
1854 else if (isprint((*(PCB).lab)) && (*(PCB).lab) != '\\') {
1855 char buf[20];
1856 sprintf(buf, "\'%c\'", (char) (*(PCB).lab));
1857 sprintf((PCB).ag_msg, UNEXPECTED_FORMAT, buf);
1858 }
1859 else sprintf((PCB).ag_msg, UNEXPECTED_FORMAT, UNNAMED_TOKEN);
1860 (PCB).error_message = (PCB).ag_msg;
1861
1862
1863 }
1864 static int ag_action_1_r_proc(PCB_DECL);
1865 static int ag_action_2_r_proc(PCB_DECL);
1866 static int ag_action_3_r_proc(PCB_DECL);
1867 static int ag_action_4_r_proc(PCB_DECL);
1868 static int ag_action_1_s_proc(PCB_DECL);
1869 static int ag_action_3_s_proc(PCB_DECL);
1870 static int ag_action_1_proc(PCB_DECL);
1871 static int ag_action_2_proc(PCB_DECL);
1872 static int ag_action_3_proc(PCB_DECL);
1873 static int ag_action_4_proc(PCB_DECL);
1874 static int ag_action_5_proc(PCB_DECL);
1875 static int ag_action_6_proc(PCB_DECL);
1876 static int ag_action_7_proc(PCB_DECL);
1877 static int ag_action_8_proc(PCB_DECL);
1878 static int ag_action_9_proc(PCB_DECL);
1879 static int ag_action_10_proc(PCB_DECL);
1880 static int ag_action_11_proc(PCB_DECL);
1881 static int ag_action_8_proc(PCB_DECL);
1882
1883
1884 static int (*const ag_r_procs_scan[])(PCB_DECL) = {
1885 ag_action_1_r_proc,
1886 ag_action_2_r_proc,
1887 ag_action_3_r_proc,
1888 ag_action_4_r_proc
1889 };
1890
1891 static int (*const ag_s_procs_scan[])(PCB_DECL) = {
1892 ag_action_1_s_proc,
1893 ag_action_2_r_proc,
1894 ag_action_3_s_proc,
1895 ag_action_4_r_proc
1896 };
1897
1898 static int (*const ag_gt_procs_scan[])(PCB_DECL) = {
1899 ag_action_1_proc,
1900 ag_action_2_proc,
1901 ag_action_3_proc,
1902 ag_action_4_proc,
1903 ag_action_5_proc,
1904 ag_action_6_proc,
1905 ag_action_7_proc,
1906 ag_action_8_proc,
1907 ag_action_9_proc,
1908 ag_action_10_proc,
1909 ag_action_11_proc,
1910 ag_action_8_proc
1911 };
1912
1913
1914 static int ag_action_10_proc(PCB_DECL) {
1915 (PCB).btsx = 0, (PCB).drt = -1;
1916 ag_track(PCB_POINTER);
1917 return 0;
1918 }
1919
1920 static int ag_action_11_proc(PCB_DECL) {
1921 (PCB).btsx = 0, (PCB).drt = -1;
1922 (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).lab;
1923 (PCB).ssx--;
1924 ag_ra(PCB_POINTER);
1925 (PCB).ssx++;
1926 ag_track(PCB_POINTER);
1927 return 0;
1928 }
1929
1930 static int ag_action_3_r_proc(PCB_DECL) {
1931 int ag_sd = ag_fl[(PCB).ag_ap] - 1;
1932 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
1933 (PCB).btsx = 0, (PCB).drt = -1;
1934 (PCB).reduction_token = (parse_token_type) ag_ptt[(PCB).ag_ap];
1935 ag_ra(PCB_POINTER);
1936 return (PCB).exit_flag == AG_RUNNING_CODE;
1937 }
1938
1939 static int ag_action_3_s_proc(PCB_DECL) {
1940 int ag_sd = ag_fl[(PCB).ag_ap] - 1;
1941 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
1942 (PCB).btsx = 0, (PCB).drt = -1;
1943 (PCB).reduction_token = (parse_token_type) ag_ptt[(PCB).ag_ap];
1944 ag_ra(PCB_POINTER);
1945 return (PCB).exit_flag == AG_RUNNING_CODE;
1946 }
1947
1948 static int ag_action_4_r_proc(PCB_DECL) {
1949 int ag_sd = ag_fl[(PCB).ag_ap] - 1;
1950 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
1951 (PCB).reduction_token = (parse_token_type) ag_ptt[(PCB).ag_ap];
1952 return 1;
1953 }
1954
1955 static int ag_action_2_proc(PCB_DECL) {
1956 (PCB).btsx = 0, (PCB).drt = -1;
1957 if ((PCB).ssx >= 128) {
1958 (PCB).exit_flag = AG_STACK_ERROR_CODE;
1959 PARSER_STACK_OVERFLOW;
1960 }
1961 (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).lab;
1962 GET_CONTEXT;
1963 (PCB).ss[(PCB).ssx] = (PCB).sn;
1964 (PCB).ssx++;
1965 (PCB).sn = (PCB).ag_ap;
1966 ag_track(PCB_POINTER);
1967 return 0;
1968 }
1969
1970 static int ag_action_9_proc(PCB_DECL) {
1971 if ((PCB).drt == -1) {
1972 (PCB).drt=(PCB).token_number;
1973 (PCB).dssx=(PCB).ssx;
1974 (PCB).dsn=(PCB).sn;
1975 }
1976 ag_prot(PCB_POINTER);
1977 GET_CONTEXT;
1978 (PCB).ss[(PCB).ssx] = (PCB).sn;
1979 (PCB).ssx++;
1980 (PCB).sn = (PCB).ag_ap;
1981 (PCB).rx = 0;
1982 return (PCB).exit_flag == AG_RUNNING_CODE;
1983 }
1984
1985 static int ag_action_2_r_proc(PCB_DECL) {
1986 (PCB).ssx++;
1987 (PCB).sn = (PCB).ag_ap;
1988 return 0;
1989 }
1990
1991 static int ag_action_7_proc(PCB_DECL) {
1992 --(PCB).ssx;
1993 (PCB).exit_flag = AG_SUCCESS_CODE;
1994 (PCB).rx = 0;
1995 return 0;
1996 }
1997
1998 static int ag_action_1_proc(PCB_DECL) {
1999 (PCB).exit_flag = AG_SUCCESS_CODE;
2000 ag_track(PCB_POINTER);
2001 return 0;
2002 }
2003
2004 static int ag_action_1_r_proc(PCB_DECL) {
2005 (PCB).exit_flag = AG_SUCCESS_CODE;
2006 return 0;
2007 }
2008
2009 static int ag_action_1_s_proc(PCB_DECL) {
2010 (PCB).exit_flag = AG_SUCCESS_CODE;
2011 return 0;
2012 }
2013
2014 static int ag_action_4_proc(PCB_DECL) {
2015 int ag_sd = ag_fl[(PCB).ag_ap] - 1;
2016 (PCB).reduction_token = (parse_token_type) ag_ptt[(PCB).ag_ap];
2017 (PCB).btsx = 0, (PCB).drt = -1;
2018 (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).lab;
2019 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
2020 else GET_CONTEXT;
2021 (PCB).ss[(PCB).ssx] = (PCB).sn;
2022 ag_track(PCB_POINTER);
2023 while ((PCB).exit_flag == AG_RUNNING_CODE) {
2024 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
2025 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
2026 do {
2027 unsigned ag_tx = (ag_t1 + ag_t2)/2;
2028 if (ag_tstt[ag_tx] < (unsigned short)(PCB).reduction_token) ag_t1 = ag_tx + 1;
2029 else ag_t2 = ag_tx;
2030 } while (ag_t1 < ag_t2);
2031 (PCB).ag_ap = ag_pstt[ag_t1];
2032 if ((ag_s_procs_scan[ag_astt[ag_t1]])(PCB_POINTER) == 0) break;
2033 }
2034 return 0;
2035 }
2036
2037 static int ag_action_3_proc(PCB_DECL) {
2038 int ag_sd = ag_fl[(PCB).ag_ap] - 1;
2039 (PCB).btsx = 0, (PCB).drt = -1;
2040 (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).lab;
2041 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
2042 else GET_CONTEXT;
2043 (PCB).ss[(PCB).ssx] = (PCB).sn;
2044 ag_track(PCB_POINTER);
2045 (PCB).reduction_token = (parse_token_type) ag_ptt[(PCB).ag_ap];
2046 ag_ra(PCB_POINTER);
2047 while ((PCB).exit_flag == AG_RUNNING_CODE) {
2048 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
2049 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
2050 do {
2051 unsigned ag_tx = (ag_t1 + ag_t2)/2;
2052 if (ag_tstt[ag_tx] < (unsigned short)(PCB).reduction_token) ag_t1 = ag_tx + 1;
2053 else ag_t2 = ag_tx;
2054 } while (ag_t1 < ag_t2);
2055 (PCB).ag_ap = ag_pstt[ag_t1];
2056 if ((ag_s_procs_scan[ag_astt[ag_t1]])(PCB_POINTER) == 0) break;
2057 }
2058 return 0;
2059 }
2060
2061 static int ag_action_8_proc(PCB_DECL) {
2062 ag_undo(PCB_POINTER);
2063 (PCB).rx = 0;
2064 (PCB).exit_flag = AG_SYNTAX_ERROR_CODE;
2065 ag_diagnose(PCB_POINTER);
2066 SYNTAX_ERROR;
2067 {(PCB).rx = 1; ag_track(PCB_POINTER);}
2068 return (PCB).exit_flag == AG_RUNNING_CODE;
2069 }
2070
2071 static int ag_action_5_proc(PCB_DECL) {
2072 int ag_sd = ag_fl[(PCB).ag_ap];
2073 (PCB).btsx = 0, (PCB).drt = -1;
2074 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
2075 else {
2076 GET_CONTEXT;
2077 (PCB).ss[(PCB).ssx] = (PCB).sn;
2078 }
2079 (PCB).rx = 0;
2080 (PCB).reduction_token = (parse_token_type) ag_ptt[(PCB).ag_ap];
2081 ag_ra(PCB_POINTER);
2082 while ((PCB).exit_flag == AG_RUNNING_CODE) {
2083 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
2084 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
2085 do {
2086 unsigned ag_tx = (ag_t1 + ag_t2)/2;
2087 if (ag_tstt[ag_tx] < (unsigned short)(PCB).reduction_token) ag_t1 = ag_tx + 1;
2088 else ag_t2 = ag_tx;
2089 } while (ag_t1 < ag_t2);
2090 (PCB).ag_ap = ag_pstt[ag_t1];
2091 if ((ag_r_procs_scan[ag_astt[ag_t1]])(PCB_POINTER) == 0) break;
2092 }
2093 return (PCB).exit_flag == AG_RUNNING_CODE;
2094 }
2095
2096 static int ag_action_6_proc(PCB_DECL) {
2097 int ag_sd = ag_fl[(PCB).ag_ap];
2098 (PCB).reduction_token = (parse_token_type) ag_ptt[(PCB).ag_ap];
2099 if ((PCB).drt == -1) {
2100 (PCB).drt=(PCB).token_number;
2101 (PCB).dssx=(PCB).ssx;
2102 (PCB).dsn=(PCB).sn;
2103 }
2104 if (ag_sd) {
2105 (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
2106 }
2107 else {
2108 ag_prot(PCB_POINTER);
2109 (PCB).vs[(PCB).ssx] = ag_null_value;
2110 GET_CONTEXT;
2111 (PCB).ss[(PCB).ssx] = (PCB).sn;
2112 }
2113 (PCB).rx = 0;
2114 while ((PCB).exit_flag == AG_RUNNING_CODE) {
2115 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
2116 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
2117 do {
2118 unsigned ag_tx = (ag_t1 + ag_t2)/2;
2119 if (ag_tstt[ag_tx] < (unsigned short)(PCB).reduction_token) ag_t1 = ag_tx + 1;
2120 else ag_t2 = ag_tx;
2121 } while (ag_t1 < ag_t2);
2122 (PCB).ag_ap = ag_pstt[ag_t1];
2123 if ((ag_r_procs_scan[ag_astt[ag_t1]])(PCB_POINTER) == 0) break;
2124 }
2125 return (PCB).exit_flag == AG_RUNNING_CODE;
2126 }
2127
2128
2129 void init_parse(parse_pcb_type *PCB_POINTER) {
2130 unsigned ag_t1;
2131 ag_t1 = 0;
2132 (PCB).rx = (PCB).fx = 0;
2133 (PCB).ss[0] = (PCB).sn = (PCB).ssx = 0;
2134 (PCB).exit_flag = AG_RUNNING_CODE;
2135 (PCB).key_sp = NULL;
2136 (PCB).key_state = 0;
2137 (PCB).line = FIRST_LINE;
2138 (PCB).column = FIRST_COLUMN;
2139 (PCB).btsx = 0, (PCB).drt = -1;
2140 while (ag_tstt[ag_t1] == 0) {
2141 (PCB).ag_ap = ag_pstt[ag_t1];
2142 (ag_gt_procs_scan[ag_astt[ag_t1]])((PCB_TYPE *)PCB_POINTER);
2143 ag_t1 = ag_sbt[(PCB).sn];
2144 }
2145 }
2146
2147 void parse(parse_pcb_type *PCB_POINTER) {
2148 (PCB).lab[(PCB).fx++] = (PCB).input_code;
2149 while ((PCB).exit_flag == AG_RUNNING_CODE) {
2150 while (1) {
2151 const unsigned char *ag_p;
2152 int ag_ch;
2153 if ((PCB).rx >= (PCB).fx) return;
2154 ag_ch = CONVERT_CASE((PCB).lab[(PCB).rx++]);
2155 if ((PCB).key_sp) {
2156 if (ag_ch != *(PCB).key_sp++) {
2157 (PCB).rx = (PCB).save_index;
2158 (PCB).key_sp = NULL;
2159 (PCB).key_state = 0;
2160 break;
2161 } else if (*(PCB).key_sp) continue;
2162 if (ag_key_act[(PCB).key_state] == ag_cf_end_key) {
2163 int ag_k1;
2164 int ag_k2;
2165 if ((PCB).rx >= (PCB).fx) {
2166 (PCB).rx--;
2167 (PCB).key_sp--;
2168 return;
2169 }
2170 (PCB).key_sp = NULL;
2171 ag_k1 = ag_key_parm[(PCB).key_state];
2172 ag_k2 = ag_key_pt[ag_k1];
2173 if (ag_key_itt[ag_k2 + CONVERT_CASE((PCB).lab[(PCB).rx])])
2174 (PCB).rx = (PCB).save_index;
2175 else {
2176 (PCB).token_number = (parse_token_type) ag_key_pt[ag_k1+1];
2177 (PCB).key_state = 0;
2178 }
2179 break;
2180 }
2181 else {
2182 (PCB).token_number = (parse_token_type) ag_key_parm[(PCB).key_state];
2183 (PCB).key_state = 0;
2184 (PCB).key_sp = NULL;
2185 }
2186 break;
2187 }
2188 if ((PCB).key_state == 0) {
2189 (PCB).token_number = (parse_token_type) AG_TCV(ag_ch);
2190 if (((PCB).key_state = ag_key_index[(PCB).sn]) == 0) break;
2191 (PCB).save_index = 1;
2192 }
2193 ag_p = &ag_key_ch[(PCB).key_state];
2194 if (ag_ch <= 255) while (*ag_p < ag_ch) ag_p++;
2195 if (*ag_p == ag_ch) {
2196 (PCB).key_state = (int)(ag_p - ag_key_ch);
2197 switch (ag_key_act[(PCB).key_state]) {
2198 case ag_cf_set_key: {
2199 int ag_k1;
2200 int ag_k2;
2201 if ((PCB).rx >= (PCB).fx) {
2202 (PCB).rx--;
2203 return;
2204 }
2205 ag_k1 = ag_key_parm[(PCB).key_state];
2206 ag_k2 = ag_key_pt[ag_k1];
2207 (PCB).key_state = ag_key_jmp[(PCB).key_state];
2208 if (ag_key_itt[ag_k2 + CONVERT_CASE((PCB).lab[(PCB).rx])]) continue;
2209 (PCB).save_index = (PCB).rx;
2210 (PCB).token_number = (parse_token_type) ag_key_pt[ag_k1+1];
2211 continue;
2212 }
2213 case ag_set_key:
2214 (PCB).save_index = (PCB).rx;
2215 (PCB).token_number = (parse_token_type) ag_key_parm[(PCB).key_state];
2216 case ag_jmp_key:
2217 (PCB).key_state = ag_key_jmp[(PCB).key_state];
2218 continue;
2219 case ag_cf_end_key:
2220 case ag_end_key:
2221 (PCB).key_sp = ag_key_ends + ag_key_jmp[(PCB).key_state];
2222 continue;
2223 case ag_accept_key:
2224 (PCB).token_number = (parse_token_type) ag_key_parm[(PCB).key_state];
2225 (PCB).key_state = 0;
2226 break;
2227 case ag_cf_accept_key: {
2228 int ag_k1;
2229 int ag_k2;
2230 if ((PCB).rx >= (PCB).fx) {
2231 (PCB).rx--;
2232 return;
2233 }
2234 ag_k1 = ag_key_parm[(PCB).key_state];
2235 ag_k2 = ag_key_pt[ag_k1];
2236 if (ag_key_itt[ag_k2 + CONVERT_CASE((PCB).lab[(PCB).rx])])
2237 (PCB).rx = (PCB).save_index;
2238 else {
2239 (PCB).token_number = (parse_token_type) ag_key_pt[ag_k1+1];
2240 (PCB).key_state = 0;
2241 }
2242 break;
2243 }
2244 }
2245 break;
2246 } else {
2247 (PCB).rx = (PCB).save_index;
2248 (PCB).key_state = 0;
2249 break;
2250 }
2251 }
2252
2253 {
2254 unsigned ag_t1 = ag_sbt[(PCB).sn];
2255 unsigned ag_t2 = ag_sbe[(PCB).sn] - 1;
2256 do {
2257 unsigned ag_tx = (ag_t1 + ag_t2)/2;
2258 if (ag_tstt[ag_tx] > (unsigned short)(PCB).token_number)
2259 ag_t1 = ag_tx + 1;
2260 else ag_t2 = ag_tx;
2261 } while (ag_t1 < ag_t2);
2262 if (ag_tstt[ag_t1] != (PCB).token_number) ag_t1 = ag_sbe[(PCB).sn];
2263 (PCB).ag_ap = ag_pstt[ag_t1];
2264 (ag_gt_procs_scan[ag_astt[ag_t1]])((PCB_TYPE *)PCB_POINTER);
2265 }
2266 }
2267 }
2268
2269