comparison anagram/agcore/pgg24.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 ec2b657edf13
comparison
equal deleted inserted replaced
-1:000000000000 0:13d2b8934445
1 /*
2 * AnaGram, A System for Syntax Directed Programming
3 * Copyright 1989-2002 Jerome T. Holland. All Rights Reserved.
4 * See the file COPYING for license and usage terms.
5 *
6 * pgg24.syn - parser generator grammar, rev. 24
7 */
8
9 #include "port.h"
10
11 #include "agdict.h"
12 #include "agstring.h"
13 #include "assert.h"
14 #include "bpe3.h"
15 #include "cint.h"
16 #include "config.h"
17 #include "configparam.h"
18 #include "csexp.h"
19 #include "error.h"
20 #include "lexeme.h"
21 #include "operations.h"
22 #include "p.h"
23 #include "pgg24-defs.h"
24 #include "pgg24.h"
25 #include "rpk.h"
26 #include "rpz.h"
27 #include "rproc.h"
28 #include "rule.h"
29 #include "stacks.h"
30 #include "token.h"
31 #include "tree.h"
32 #include "tsd.h"
33 #include "ut.h"
34
35 //#define INCLUDE_LOGGING
36 #include "log.h"
37
38 /*
39 * AnaGram, A System for Syntax Directed Programming
40 * File generated by: Version 2.40-current, built Oct 30 2007
41 *
42 * AnaGram Parsing Engine
43 * Copyright 1993-2002 Parsifal Software. All Rights Reserved.
44 *
45 * This software is provided 'as-is', without any express or implied
46 * warranty. In no event will the authors be held liable for any damages
47 * arising from the use of this software.
48 *
49 * Permission is granted to anyone to use this software for any purpose,
50 * including commercial applications, and to alter it and redistribute it
51 * freely, subject to the following restrictions:
52 *
53 * 1. The origin of this software must not be misrepresented; you must not
54 * claim that you wrote the original software. If you use this software
55 * in a product, an acknowledgment in the product documentation would be
56 * appreciated but is not required.
57 * 2. Altered source versions must be plainly marked as such, and must not be
58 * misrepresented as being the original software.
59 * 3. This notice may not be removed or altered from any source distribution.
60 */
61
62 #ifndef PGG24_H_1198348407
63 #include "pgg24.h"
64 #endif
65
66 #ifndef PGG24_H_1198348407
67 #error Mismatched header file
68 #endif
69
70 #include <ctype.h>
71 #include <stdio.h>
72
73 #define RULE_CONTEXT (&((PCB).cs[(PCB).ssx]))
74 #define ERROR_CONTEXT ((PCB).cs[(PCB).error_frame_ssx])
75 #define CONTEXT ((PCB).cs[(PCB).ssx])
76
77
78 #define CHANGE_REDUCTION(x) pgg_change_reduction(pgg_##x##_token)
79 int pgg_change_reduction(pgg_token_type);
80
81 #define TOKEN_NAMES pgg_token_names
82 const char *const pgg_token_names[254] = {
83 "syntax definition",
84 "",
85 "\"->\"",
86 "",
87 "",
88 "",
89 "",
90 "','",
91 "",
92 "",
93 "",
94 "\"...\"",
95 "",
96 "'='",
97 "",
98 "'!'",
99 "",
100 "'{'",
101 "",
102 "'['",
103 "",
104 "'('",
105 "",
106 "'-'",
107 "",
108 "'+'",
109 "",
110 "']'",
111 "",
112 "'}'",
113 "",
114 "')'",
115 "",
116 "single quote",
117 "",
118 "'~'",
119 "",
120 "'|'",
121 "syntax definition",
122 "",
123 "",
124 "statement list",
125 "statement",
126 "",
127 "",
128 "eof",
129 "production",
130 "definition",
131 "embedded c",
132 "configuration section",
133 "",
134 "comment",
135 "",
136 "left hand side",
137 "right hand side",
138 "",
139 "",
140 "",
141 "token name list",
142 "type definition",
143 "",
144 "symbol name",
145 "'$'",
146 "",
147 "wrapper type",
148 "wrapper list",
149 "wrappers",
150 "",
151 "",
152 "vp rule spec",
153 "",
154 "",
155 "empty vp rule",
156 "proper reduction procedure",
157 "vp rules",
158 "grammar rule",
159 "reduction procedure",
160 "",
161 "init grammar rule",
162 "rule element",
163 "parameter name",
164 "c expression",
165 "';'",
166 "type name",
167 "",
168 "",
169 "",
170 "\"::\"",
171 "",
172 "",
173 "",
174 "",
175 "template field head",
176 "'>'",
177 "'<'",
178 "",
179 "",
180 "'*'",
181 "",
182 "",
183 "letter",
184 "",
185 "",
186 "\"enum\"",
187 "blank char",
188 "c comment",
189 "continuation",
190 "",
191 "carriage return",
192 "",
193 "newline",
194 "",
195 "vertical space",
196 "\"//\"",
197 "",
198 "",
199 "",
200 "character",
201 "signed number",
202 "'^'",
203 "",
204 "quoted character",
205 "char const",
206 "",
207 "",
208 "",
209 "decimal number",
210 "octal number",
211 "\"0x\"",
212 "\"0X\"",
213 "",
214 "hex number",
215 "",
216 "",
217 "'0'",
218 "",
219 "hex digit",
220 "",
221 "token",
222 "immediate action",
223 "set union",
224 "virtual production",
225 "set intersection",
226 "set difference",
227 "set complement",
228 "'&'",
229 "character set",
230 "",
231 "escape sequence",
232 "octal escape",
233 "",
234 "hex escape",
235 "",
236 "any character",
237 "\"..\"",
238 "proc def",
239 "enum definition",
240 "enum statement",
241 "keyword string",
242 "keyword string head",
243 "string",
244 "double quote",
245 "",
246 "",
247 "",
248 "string char",
249 "simple string char",
250 "\"\\\\a\"",
251 "\"\\\\b\"",
252 "\"\\\\f\"",
253 "\"\\\\n\"",
254 "\"\\\\r\"",
255 "\"\\\\t\"",
256 "\"\\\\v\"",
257 "\"\\\\\\\\\"",
258 "\"\\\\?\"",
259 "\"\\\\\\'\"",
260 "\"\\\\\\\"\"",
261 "",
262 "backslash",
263 "",
264 "\"\\\\x\"",
265 "any digit",
266 "nonoctal digit",
267 "':'",
268 "",
269 "",
270 "configuration parameters",
271 "configuration parameter list",
272 "",
273 "configuration parameter",
274 "attribute statement",
275 "keyword kluge",
276 "\"distinguish\"",
277 "\"left\"",
278 "token list",
279 "\"right\"",
280 "\"nonassoc\"",
281 "\"sticky\"",
282 "\"subgrammar\"",
283 "\"hidden\"",
284 "",
285 "\"disregard\"",
286 "\"extend\"",
287 "\"pcb\"",
288 "\"lexeme\"",
289 "\"reserve\"",
290 "\"keywords\"",
291 "\"rename\"",
292 "\"macro\"",
293 "macro name",
294 "\"wrapper\"",
295 "",
296 "tokens",
297 "'\\?'",
298 "\"}...\"",
299 "\"]...\"",
300 "\"?...\"",
301 "\"}/...\"",
302 "\"]/...\"",
303 "embedded c head",
304 "",
305 "",
306 "",
307 "",
308 "c code first",
309 "",
310 "",
311 "c character constant",
312 "c string constant",
313 "",
314 "simple c char",
315 "",
316 "",
317 "",
318 "",
319 "\"\\\\\\n\"",
320 "",
321 "\"*/\"",
322 "\"/*\"",
323 "",
324 "c literal elem",
325 "",
326 "",
327 "",
328 "",
329 "",
330 "",
331 "",
332 "",
333 "",
334 "",
335 "",
336 "",
337
338 };
339
340
341 #line 447 "pgg24.syn"
342 static int null_warning(int n) {
343 if (n == 0) log_error("Null character in string");
344 return n;
345 }
346 #line 347 "pgg24.cpp"
347 #line 671 "pgg24.syn"
348 pgg_pcb_type pgcb;
349 #define PCB pgcb
350
351 #define PARSER_STACK_OVERFLOW parse_stack_overflow()
352 #define SYNTAX_ERROR log_syntax_error()
353 #define GET_CONTEXT CONTEXT.y = PCB.line, CONTEXT.x = PCB.column;
354
355 #define REDUCTION_TOKEN_ERROR reduction_token_error()
356
357 CSegment::CSegment()
358 : begin(PCB.pointer), end(PCB.pointer), line(PCB.line)
359 {
360 LOGSECTION("CSegment::CSegment");
361 // Nothing to do
362 }
363
364 static class PggErrorHandler : public ConfigParam::ErrorHandler {
365 void badParam(const char *s){log_error(s);}
366 } pggErrorHandler;
367
368
369 static void reduction_token_error(void) {
370 #ifdef INCLUDE_LOGGING
371 LOGSECTION("reduction_token_error");
372 LOGV(PCB.sn) LCV(PCB.ssx) LCV(PCB.reduction_token);
373 for (int i = 0; i < PCB.ssx; i++) LOGV(i) LCV(PCB.ss[i]);
374 #endif
375 assert(0);
376 }
377
378 static void parse_stack_overflow(void) {
379 reset_stk();
380 log_error("Nesting too deep. Analysis aborted.");
381 errorList.top().setFatal();
382 parse_abort_flag = 1;
383 PCB.exit_flag = AG_SEMANTIC_ERROR_CODE;
384 }
385
386
387 static int head_list_3(int);
388 static void set_prec(int,int);
389
390 // void range(int, int);
391
392 /*
393 static void disregard(int tn) {
394 LOGSECTION("disregard");
395 iws();
396 if (n_disregard_list) {
397 int *p = disregard_list;
398 while (n_disregard_list--) aws(*p++);
399 DEALLOCATE(disregard_list);
400 }
401 xws(tn);
402 disregard_list = build_list();
403 n_disregard_list = fis();
404 }
405 */
406
407 static void pgg24_error(const char *msg, int contextFlag=0) {
408 LOGSECTION("pgg24_error");
409 LOGV(msg);
410 LOGV(contextFlag);
411 LOGV(PCB.line) LCV(PCB.column);
412 LOGV(ERROR_CONTEXT.y) LCV(ERROR_CONTEXT.x);
413
414 int line, column;
415 if (contextFlag) {
416 line = ERROR_CONTEXT.y;
417 column = ERROR_CONTEXT.x;
418 }
419 else {
420 line = PCB.line;
421 column = PCB.column;
422 }
423
424 errorList.push(Error(line, column, msg));
425 }
426
427 static void log_syntax_error(void) {
428 LOGSECTION("log_syntax_error");
429
430 #ifdef INCLUDE_LOGGING
431 {
432 LOGV(PCB.sn) LCV(PCB.ssx) LCV(PCB.token_number);
433 for (int i = 0; i < PCB.ssx; i++) LOGV(i) LCV(PCB.ss[i]);
434 }
435 #endif
436 int flag = PCB.error_frame_token == pgg_c_comment_token ||
437 PCB.error_frame_token == pgg_embedded_c_token;
438 LOGV(flag);
439 reset_stk();
440
441 #ifdef INCLUDE_LOGGING
442 {
443 LOGV(PCB.sn) LCV(PCB.ssx) LCV(PCB.token_number);
444 for (int i = 0; i < PCB.ssx; i++) LOGV(i) LCV(PCB.ss[i]);
445 }
446 #endif
447 ssprintf("%s in %s", PCB.error_message, pgg_token_names[PCB.error_frame_token]);
448 LOGS(string_base);
449
450 pgg24_error(string_base, flag && PCB.token_number == pgg_eof_token);
451 rcs();
452 #ifdef INCLUDE_LOGGING
453 {
454 LOGV(PCB.sn) LCV(PCB.ssx) LCV(PCB.token_number);
455 for (int i = 0; i < PCB.ssx; i++) LOGV(i) LCV(PCB.ss[i]);
456 }
457 #endif
458 LOGS("error logged");
459 errorList.top().setFatal();
460 LOGS("fatal flag set");
461 syntax_error_flag++;
462 #ifdef INCLUDE_LOGGING
463 {
464 LOGV(PCB.sn) LCV(PCB.ssx) LCV(PCB.token_number);
465 for (int i = 0; i < PCB.ssx; i++) LOGV(i) LCV(PCB.ss[i]);
466 }
467 #endif
468 if (errorList.size() < 50) return;
469 log_error("Too many errors. Parse aborted.");
470 errorList.top().setFatal();
471 PCB.exit_flag = AG_SYNTAX_ERROR_CODE;
472 }
473
474 static int head_list_3(int type) {
475 LOGSECTION("head_list_3");
476 LOGV(type);
477 int i, n = tis();
478 for (i = 0; i < n; i ++) {
479 Token token(list_base[i]);
480 int ptt = token->value_type;
481 LOGV(ptt) LCV(type);
482 if (ptt && ptt != type) {
483 ssprintf("Type Redefinition of T%03d: ", (int) token);
484 atkn(token);
485 log_error();
486 }
487 token->value_type = type;
488 /*
489 if (ptt == 0 && token->rp_arg && type == void_token_type) {
490 //ssprintf("Void token, %s, used as parameter", dict_str(tkn_dict,token->token_name));
491 ssprintf("Void token, %s, used as parameter", token->token_name->string.pointer());
492 log_error();
493 }
494 */
495 }
496 return type;
497 }
498
499 static void set_prec(int left, int right){
500 LOGSECTION("set_prec");
501 int n = tis();
502 precedence_level++;
503 while (n--) {
504 Token token(list_base[n]);
505 token->left_associative = left;
506 token->right_associative = right;
507 token->precedence_level = precedence_level;
508 token->operatorCandidate = 1;
509 }
510 rws();
511 }
512
513 static void set_sticky(void){
514 LOGSECTION("set_sticky");
515 int n = tis();
516 while (n--) {
517 Token token(list_base[n]);
518 token->sticky = 1;
519 }
520 rws();
521 }
522
523 static void set_subgrammar(void){
524 LOGSECTION("set_subgrammar");
525 int n = tis();
526 while (n--) {
527 Token token = list_base[n];
528 token->subgrammar = 1;
529 }
530 rws();
531 }
532
533 static void set_hidden(void) {
534 LOGSECTION("set_hidden");
535 int *lb = list_base;
536 int n = tis();
537 //while (n--) map_token_number[*lb++].fine_structure = 1;
538 while (n--) Token(*lb++)->fine_structure = 1;
539 rws();
540 }
541
542 static void set_lexeme(void) {
543 LOGSECTION("set_lexeme");
544 int n = tis();
545 while (n--) {
546 Token token = list_base[n];
547 token->lexeme = 1;
548 }
549 rws();
550 }
551
552 static void set_reserved_words(void) {
553 LOGSECTION("set_reserved_words");
554 int n = tis();
555 while (n--) {
556 Token token(list_base[n]);
557 token->reserved_word = 1;
558 }
559 rws();
560 }
561
562 void parse(void) {
563 pgcb.pointer = input_base;
564 pgg();
565 }
566 #line 567 "pgg24.cpp"
567
568 #ifndef CONVERT_CASE
569 #define CONVERT_CASE(c) (c)
570 #endif
571 #ifndef TAB_SPACING
572 #define TAB_SPACING 8
573 #endif
574
575 #define ag_rp_1(t) (production(t))
576
577 #define ag_rp_2() (nPrologueSegments = 1)
578
579 #define ag_rp_5(type) (iws(),type)
580
581 #define ag_rp_6(type) (concat_list(),type)
582
583 #define ag_rp_7() (0)
584
585 #define ag_rp_8(d) (head_list_3(d))
586
587 #define ag_rp_9(x) (sws(head_list_2(x)))
588
589 #define ag_rp_10(x) (aws(head_list_2(x)))
590
591 #define ag_rp_11() (0)
592
593 #define ag_rp_12() (1)
594
595 #define ag_rp_13() (Cast::create())
596
597 #define ag_rp_14() (Cast::create().requireWrapper())
598
599 #define ag_rp_15(n) (sws(n))
600
601 #define ag_rp_16(n) (aws(n))
602
603 #define ag_rp_17(pn) (sws((iws(),vp_form3(pn))))
604
605 #define ag_rp_18(s) (vp_form3(s))
606
607 #define ag_rp_19(n) (sws(form_spec_2(form1(),n)))
608
609 #define ag_rp_20(n) (sws(n))
610
611 #define ag_rp_21(n) (aws(n))
612
613 #define ag_rp_22(s) (form_spec_2(makeRule(ruleElementStack.pop()),s))
614
615 #define ag_rp_23(e, p) (ruleElementStack.top().push(RuleElement(e,p)))
616
617 #define ag_rp_24(e, p) (ruleElementStack.top().push(RuleElement(e,p)))
618
619 #define ag_rp_25() (ruleElementStack.push(AgStack<RuleElement>()))
620
621 #define ag_rp_26() (0)
622
623 #define ag_rp_27() (proc_spec_4(0))
624
625 #define ag_rp_28() (proc_spec_4(1))
626
627 #define ag_rp_29() (concat_string())
628
629 #define ag_rp_30() (sss("::"))
630
631 #define ag_rp_31() (concat_string())
632
633 #define ag_rp_32() (ass("::"))
634
635 #define ag_rp_33() (concat_string())
636
637 #define ag_rp_34() (concat_string())
638
639 #define ag_rp_35() (acs('>'), concat_string())
640
641 #define ag_rp_36() (acs('<'))
642
643 #define ag_rp_37() (acs(','), concat_string())
644
645 #define ag_rp_38() (scs('('))
646
647 #define ag_rp_39() (concat_string(), acs(')'))
648
649 #define ag_rp_40() (sss(" *"))
650
651 #define ag_rp_41() (concat_string())
652
653 #define ag_rp_42() (concat_string())
654
655 #define ag_rp_43(c) (scs(c))
656
657 #define ag_rp_44(c) (acs(c))
658
659 #define ag_rp_45(c) (acs(' '), acs(c))
660
661 #define ag_rp_46(c) (sss("enum "), acs(c))
662
663 #define ag_rp_47(c) (acs(c))
664
665 #define ag_rp_48(c) (acs(' '), acs(c))
666
667 #define ag_rp_49(x) (x & 0x1f)
668
669 #define ag_rp_50(c) ((character_seen=1),c)
670
671 #define ag_rp_51(s, n) (s*n)
672
673 #define ag_rp_52() (1)
674
675 #define ag_rp_53() (-1)
676
677 #define ag_rp_54(n) (n)
678
679 #define ag_rp_55(n) (n)
680
681 #define ag_rp_56(d) (d - '0')
682
683 #define ag_rp_57(n, d) (10*n + d - '0')
684
685 #define ag_rp_58() (0)
686
687 #define ag_rp_59(n, d) (8*n + d - '0')
688
689 #define ag_rp_60(d) (d)
690
691 #define ag_rp_61(n, d) (16*n + d)
692
693 #define ag_rp_62(d) (d-'0')
694
695 #define ag_rp_63(d) ((d&7)+9)
696
697 #define ag_rp_64(p) (vp_8a(mid_line(p)))
698
699 #define ag_rp_65(n) (form_element_1(n))
700
701 #define ag_rp_66(u, i) (new CharSetUnion(u,i))
702
703 #define ag_rp_67(u, i) (new CharSetDifference(u,i))
704
705 #define ag_rp_68(i, n) (new CharSetIntersection(i,n))
706
707 #define ag_rp_69(n) (new CharSetComplement(n))
708
709 #define ag_rp_70(c) (new IndividualCode(c))
710
711 #define ag_rp_71(c) (new IndividualChar(c))
712
713 #define ag_rp_72() (ss2())
714
715 #define ag_rp_73(x) (x)
716
717 #define ag_rp_74(l, r) ((character_seen=1),new CharRange(l,r))
718
719 #define ag_rp_75(l, r) (new CodeRange(l,r))
720
721 #define ag_rp_76(n) (definition_1(n))
722
723 #define ag_rp_77(p) (definition_2(p))
724
725 #define ag_rp_78(p) (defineImmediateProc(Procedure(p)))
726
727 #define ag_rp_79() (definition_3(enum_base++))
728
729 #define ag_rp_80(n) (definition_3(enum_base = n), enum_base++)
730
731 #define ag_rp_81(n) (definition_3(enum_base = n), enum_base++)
732
733 #define ag_rp_82() (ics())
734
735 #define ag_rp_83(n) (null_warning(n))
736
737 #define ag_rp_84() ('\a')
738
739 #define ag_rp_85() ('\b')
740
741 #define ag_rp_86() ('\f')
742
743 #define ag_rp_87() ('\n')
744
745 #define ag_rp_88() ('\r')
746
747 #define ag_rp_89() ('\t')
748
749 #define ag_rp_90() ('\v')
750
751 #define ag_rp_91() ('\\')
752
753 #define ag_rp_92() ('\?')
754
755 #define ag_rp_93() ('\'')
756
757 #define ag_rp_94() ('"')
758
759 #define ag_rp_95(n) (n&7)
760
761 #define ag_rp_96(n, d) (n*8 + (d&7))
762
763 #define ag_rp_97(n, d) (n*8 + (d&7))
764
765 #define ag_rp_98(x) (x)
766
767 #define ag_rp_99(c) (acs(c))
768
769 #define ag_rp_100(c) (acs(c))
770
771 #define ag_rp_101(c) (acs(c))
772
773 #define ag_rp_102(c) (acs(c))
774
775 #define ag_rp_103(c) (acs(c))
776
777 #define ag_rp_104(c) (acs(null_warning(c)))
778
779 #define ag_rp_105(c) (acs(null_warning(c)))
780
781 #define ag_rp_106(c) (acs(null_warning(c)))
782
783 #define ag_rp_107(c) (acs(null_warning(c)))
784
785 #define ag_rp_108() (0)
786
787 #define ag_rp_109() (cVariableList << buildAgString())
788
789 #define ag_rp_110(c) (scs(c))
790
791 #define ag_rp_111(c) (acs(c))
792
793 #define ag_rp_112() (ConfigParam::set(1, pggErrorHandler))
794
795 #define ag_rp_113() (ConfigParam::set(0, pggErrorHandler))
796
797 #define ag_rp_114() (ConfigParam::set(pggErrorHandler))
798
799 #define ag_rp_115() (ConfigParam::set(pggErrorHandler))
800
801 #define ag_rp_116() (ConfigParam::set(pggErrorHandler))
802
803 #define ag_rp_117(n) (ConfigParam::set(n, pggErrorHandler))
804
805 #define ag_rp_118() (concat_string(), ConfigParam::set(1, pggErrorHandler))
806
807 #define ag_rp_119() (sss("distinguish "))
808
809 #define ag_rp_120() (set_prec(1,0))
810
811 #define ag_rp_121() (set_prec(0,1))
812
813 #define ag_rp_122() (set_prec(0,0))
814
815 #define ag_rp_123() (set_sticky())
816
817 #define ag_rp_124() (set_subgrammar())
818
819 #define ag_rp_125() (set_hidden())
820
821 #define ag_rp_126(t) (disregardList.push(t))
822
823 #define ag_rp_127() (extensionStack.push(cSegmentStack.pop()))
824
825 #define ag_rp_128() (set_lexeme())
826
827 #define ag_rp_129() (set_reserved_words())
828
829 #define ag_rp_130(oldName, newName) (at(rename_macro_list,oldName,newName))
830
831 #define ag_rp_131() ((PCB).pointer-input_base-1)
832
833 #define ag_rp_132(n) (distinguishSets.push(ParseTree(n)))
834
835 #define ag_rp_133(n) (distinguishSets.push(ParseTree(n)))
836
837 #define ag_rp_134(t) (sws(t))
838
839 #define ag_rp_135(t) (aws(t))
840
841 #define ag_rp_136() (vp_s())
842
843 #define ag_rp_137() (vp_5(vp_s()))
844
845 #define ag_rp_138() (vp_1())
846
847 #define ag_rp_139() (vp_2())
848
849 #define ag_rp_140() (vp_3())
850
851 #define ag_rp_141() (vp_4())
852
853 #define ag_rp_142(n) (vp_5(form_element_1(n)))
854
855 #define ag_rp_143(n) (vp_6(form_element_1(n)))
856
857 #define ag_rp_144(n) (vp_7(form_element_1(n)))
858
859 #define ag_rp_145() (vp_9())
860
861 #define ag_rp_146() (vp_10())
862
863 #define ag_rp_147() (proc_spec_4(0))
864
865 #define ag_rp_148() (proc_spec_4(1))
866
867 #define ag_rp_149() (proc_spec_4(0))
868
869 #define ag_rp_150() (proc_spec_4(1))
870
871 #define ag_rp_151(y) (cSegmentStack.top().end = y)
872
873 #define ag_rp_152() (cSegmentStack.push(CSegment()))
874
875 #define ag_rp_153() (PCB.pointer)
876
877 #define ag_rp_154() (PCB.pointer)
878
879 #define ag_rp_155() (cSegmentStack.push(CSegment()))
880
881 #define ag_rp_156() (cSegmentStack.top().end = PCB.pointer)
882
883 static void ag_rp_157(void) {
884 #line 636 "pgg24.syn"
885 if (nest_comments) PCB.reduction_token = pgg_c_comment_head_token;
886 #line 887 "pgg24.cpp"
887 }
888
889
890 #define READ_COUNTS
891 #define WRITE_COUNTS
892 #undef V
893 #define V(i,t) (*t (&(PCB).vs[(PCB).ssx + i]))
894 #undef VS
895 #define VS(i) (PCB).vs[(PCB).ssx + i]
896
897 #ifndef GET_CONTEXT
898 #define GET_CONTEXT CONTEXT = (PCB).input_context
899 #endif
900
901 typedef enum {
902 ag_action_1,
903 ag_action_2,
904 ag_action_3,
905 ag_action_4,
906 ag_action_5,
907 ag_action_6,
908 ag_action_7,
909 ag_action_8,
910 ag_action_9,
911 ag_action_10,
912 ag_action_11,
913 ag_action_12
914 } ag_parser_action;
915
916
917 #ifndef NULL_VALUE_INITIALIZER
918 #define NULL_VALUE_INITIALIZER = { 0 }
919 #endif
920
921 static pgg_vs_type const ag_null_value NULL_VALUE_INITIALIZER;
922
923 static const unsigned char ag_rpx[] = {
924 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
925 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 3, 0,
926 0, 0, 1, 0, 4, 0, 5, 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 9,
927 10, 11, 12, 13, 0, 0, 0, 14, 0, 15, 0, 0, 16, 0, 0, 17, 18, 19,
928 0, 20, 21, 22, 23, 24, 25, 0, 26, 27, 0, 0, 0, 0, 28, 0, 29, 30,
929 31, 32, 0, 0, 33, 34, 35, 36, 37, 38, 39, 0, 40, 0, 41, 42, 43, 44,
930 45, 46, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
931 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 49, 50, 0, 0, 51, 52, 0,
932 53, 0, 0, 54, 55, 56, 57, 58, 59, 60, 61, 62, 0, 63, 64, 0, 0, 65,
933 0, 66, 0, 67, 0, 68, 0, 0, 0, 0, 0, 0, 69, 70, 71, 72, 0, 0,
934 73, 74, 75, 76, 77, 78, 79, 80, 0, 0, 0, 0, 0, 0, 81, 0, 0, 82,
935 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 0, 0, 97, 98,
936 99,100,101,102,103,104,105,106,107,108,109,110, 0, 0, 0, 0, 0, 0,
937 0,111,112,113,114,115,116, 0,117,118,119,120,121,122,123,124, 0, 0,
938 125,126,127,128,129, 0,130, 0, 0, 0, 0, 0,131,132, 0,133,134,135,
939 136,137,138,139,140,141,142,143,144,145,146,147,148,149,150, 0, 0, 0,
940 0, 0,151,152,153, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
941 154,155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,156
942 };
943
944 static const unsigned char ag_key_itt[] = {
945 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
946 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
947 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
948 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
949 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
950 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
951 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
952 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
953 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
954 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
955 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
956 0
957 };
958
959 static const unsigned short ag_key_pt[] = {
960 0, 11, 0,154,0
961 };
962
963 static const unsigned char ag_key_ch[] = {
964 0, 42, 47,255, 47,255, 42, 47,255, 46,255, 46,255, 42, 47,255, 88,120,
965 255, 46, 47,255,114,116,255,115,255,105,255,110,120,255,102,120,255,101,
966 255,110,115,255,101,105,255,116,117,255, 46, 47,255, 45, 46, 47, 48, 58,
967 63, 93,100,101,104,108,110,114,115,119,125,255, 47,255, 42, 47,255,114,
968 116,255,115,255,105,255,110,120,255,102,120,255,101,255,110,115,255,101,
969 105,255,116,117,255, 47,100,101,104,108,110,114,115,119,255, 42, 47,255,
970 88,120,255, 47, 48, 58,255, 58,255, 42, 47,255, 46, 47,255, 46, 47,255,
971 45, 46, 47, 58, 63, 93,125,255, 45, 47,255, 42, 47,255, 88,120,255, 47,
972 48, 58, 92,255, 47,255, 47, 58,255,114,116,255,115,255,105,255,110,120,
973 255,102,120,255,101,255,110,115,255,101,105,255,116,117,255, 47,100,101,
974 104,108,110,114,115,119,255, 88,120,255, 48,255, 42, 47,255, 45, 47,255,
975 42, 47,255, 88,120,255, 47, 48,255, 88,120,255, 47, 48,255, 88,120,255,
976 47, 48, 58, 92,255, 47, 58,255,114,116,255,115,255,105,255,110,120,255,
977 102,120,255,101,255,110,115,255,101,105,255,116,117,255,100,101,104,108,
978 110,114,115,119,255, 42, 47,255, 46, 47,255, 46, 47,255, 47, 93,125,255,
979 42, 47,255, 47, 92,255, 92,255, 34, 39, 63, 92, 97, 98,102,110,114,116,
980 118,120,255, 92,255, 46, 47,255, 46, 47,255, 47, 93,125,255, 46,255, 46,
981 255, 46,255, 46, 47,255, 46, 47,255, 46, 47, 63, 93,125,255, 46, 47,255,
982 46, 47,255, 46, 47, 63, 93,125,255, 46, 47, 63,255, 46, 47,255, 46, 47,
983 255, 93,125,255, 46, 47,255, 93,255, 46, 47,255,125,255,125,255, 46,255,
984 46,255, 42, 47,255, 46, 47,255, 46, 47,255, 46, 47, 63, 93,125,255, 47,
985 107,255, 47,109,255, 47,112,255, 88,120,255, 47, 48,255, 88,120,255, 48,
986 58,255, 47, 92,255, 42, 47,255, 46, 47,255, 46, 47,255, 46, 47, 63, 93,
987 125,255
988 };
989
990 static const unsigned char ag_key_act[] = {
991 0,0,0,4,2,4,3,3,4,5,4,6,4,0,0,4,0,0,4,3,3,4,3,3,4,2,4,2,4,3,3,4,3,3,4,
992 2,4,3,3,4,2,3,4,3,3,4,3,3,4,3,2,2,2,3,3,2,2,2,3,2,3,2,2,3,2,4,3,4,0,0,
993 4,3,3,4,2,4,2,4,3,3,4,3,3,4,2,4,3,3,4,2,3,4,3,3,4,2,2,2,3,2,3,2,2,3,4,
994 0,0,4,0,0,4,2,2,3,4,3,4,0,0,4,3,3,4,3,3,4,3,7,2,3,3,2,2,4,3,3,4,0,0,4,
995 0,0,4,2,2,3,3,4,3,4,3,3,4,3,3,4,2,4,2,4,3,3,4,3,3,4,2,4,3,3,4,2,3,4,3,
996 3,4,3,2,2,3,2,3,2,2,3,4,0,0,4,2,4,0,0,4,3,2,4,0,0,4,0,0,4,2,2,4,0,0,4,
997 3,2,4,0,0,4,3,2,3,3,4,3,3,4,3,3,4,2,4,2,4,3,3,4,3,3,4,2,4,3,3,4,2,3,4,
998 3,3,4,2,2,3,2,3,2,2,3,4,0,0,4,3,3,4,3,3,4,2,2,2,4,0,0,4,2,3,4,3,4,0,0,
999 0,0,0,0,0,0,0,0,0,0,4,2,4,3,3,4,3,3,4,3,2,2,4,7,4,5,4,6,4,3,3,4,3,3,4,
1000 2,3,3,2,2,4,3,3,4,3,3,4,7,3,3,2,2,4,7,3,3,4,3,3,4,3,3,4,2,2,4,3,3,4,2,
1001 4,3,3,4,2,4,3,4,5,4,6,4,0,0,4,3,3,4,3,3,4,2,2,3,2,2,4,3,3,4,3,3,4,3,3,
1002 4,0,0,4,3,2,4,0,0,4,2,3,4,3,3,4,0,0,4,3,3,4,3,3,4,7,2,3,2,2,4
1003 };
1004
1005 static const unsigned char ag_key_parm[] = {
1006 0,239,113, 0, 0, 0,238,239, 0, 0, 0, 2, 0,239,113, 0,129,128,
1007 0,216,219, 0,202,193, 0, 0, 0, 0, 0,103,203, 0,194,205, 0, 0,
1008 0,208,206, 0, 0,196, 0,198,199, 0,215,218, 0, 2, 0, 0, 0, 87,
1009 217, 0, 0, 0,200, 0,197, 0, 0,211, 0, 0,113, 0,239,113, 0,202,
1010 193, 0, 0, 0, 0, 0,103,203, 0,194,205, 0, 0, 0,208,206, 0, 0,
1011 196, 0,198,199, 0, 0, 0, 0,200, 0,197, 0, 0,211, 0,239,113, 0,
1012 129,128, 0, 0, 0, 87, 0, 87, 0,239,113, 0,216,219, 0,215,218, 0,
1013 2, 0, 0, 87,217, 0, 0, 0, 2,113, 0,239,113, 0,129,128, 0, 0,
1014 0, 87,236, 0,239, 0,113, 87, 0,202,193, 0, 0, 0, 0, 0,103,203,
1015 0,194,205, 0, 0, 0,208,206, 0, 0,196, 0,198,199, 0,113, 0, 0,
1016 200, 0,197, 0, 0,211, 0,129,128, 0, 0, 0,239,113, 0, 2, 0, 0,
1017 239,113, 0,129,128, 0, 0, 0, 0,129,128, 0,113, 0, 0,129,128, 0,
1018 239, 0, 87,236, 0,239, 87, 0,202,193, 0, 0, 0, 0, 0,103,203, 0,
1019 194,205, 0, 0, 0,208,206, 0, 0,196, 0,198,199, 0, 0, 0,200, 0,
1020 197, 0, 0,211, 0,239,113, 0,216,219, 0,215,218, 0, 0, 0, 0, 0,
1021 239,113, 0, 0,236, 0,236, 0,177,176,175,174,167,168,169,170,171,172,
1022 173,181, 0, 0, 0,216,219, 0,215,218, 0,113, 0, 0, 0, 2, 0, 0,
1023 0, 2, 0,216,219, 0,215,218, 0, 0,113,217, 0, 0, 0,216,219, 0,
1024 215,218, 0, 0,113,217, 0, 0, 0, 0,113,217, 0,216,219, 0,215,218,
1025 0, 0, 0, 0,216,219, 0, 0, 0,215,218, 0, 0, 0,215, 0, 0, 0,
1026 2, 0,239,113, 0,216,219, 0,215,218, 0, 0, 0,217, 0, 0, 0,239,
1027 207, 0,239,209, 0,239,204, 0,129,128, 0,239, 0, 0,129,128, 0, 0,
1028 87, 0,239,236, 0,239,113, 0,216,219, 0,215,218, 0, 0, 0,217, 0,
1029 0, 0
1030 };
1031
1032 static const unsigned short ag_key_jmp[] = {
1033 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0,
1034 0, 12, 15, 0, 19, 25, 0, 22, 0, 25, 0, 33, 36, 0, 47, 49, 0, 32,
1035 0, 61, 65, 0, 37, 70, 0, 74, 79, 0, 95, 98, 0, 4, 11, 13, 16, 6,
1036 8, 19, 27, 29, 41, 35, 53, 40, 43, 88, 46, 0,102, 0, 0, 0, 0,104,
1037 110, 0, 71, 0, 74, 0,118,121, 0,132,134, 0, 81, 0,146,150, 0, 86,
1038 155, 0,159,164, 0, 68, 76, 78,126, 84,138, 89, 92,173, 0, 0, 0, 0,
1039 0, 0, 0,105,108,180, 0,182, 0, 0, 0, 0,195,198, 0,202,205, 0,
1040 184,186,117,189,191,120,123, 0,209,211, 0, 0, 0, 0, 0, 0, 0,137,
1041 140,213,215, 0,217, 0,219,221, 0,225,231, 0,153, 0,156, 0,239,242,
1042 0,253,255, 0,163, 0,267,271, 0,168,276, 0,280,285, 0,223,158,160,
1043 247,166,259,171,174,294, 0, 0, 0, 0,187, 0, 0, 0, 0,301,192, 0,
1044 0, 0, 0, 0, 0, 0,198,201, 0, 0, 0, 0,303,207, 0, 0, 0, 0,
1045 305,213,307,309, 0,311,313, 0,315,321, 0,224, 0,227, 0,329,332, 0,
1046 343,345, 0,234, 0,357,361, 0,239,366, 0,370,375, 0,229,231,337,237,
1047 349,242,245,384, 0, 0, 0, 0,391,394, 0,398,401, 0,257,260,263, 0,
1048 0, 0, 0,270,405, 0,407, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1049 0, 0, 0,278, 0,411,414, 0,418,421, 0,409,293,296, 0,425, 0, 0,
1050 0,305, 0,433,436, 0,440,443, 0,307,427,429,309,312, 0,456,459, 0,
1051 463,466, 0,447,450,452,321,324, 0,470,473,475, 0,479,482, 0,486,489,
1052 0,337,340, 0,493,496, 0,346, 0,500,503, 0,351, 0,507, 0, 0, 0,
1053 358, 0, 0, 0, 0,515,518, 0,522,525, 0,360,362,511,365,368, 0,529,
1054 531, 0,539,541, 0,546,548, 0, 0, 0, 0,551,386, 0, 0, 0, 0,392,
1055 553, 0,555,557, 0, 0, 0, 0,566,569, 0,573,576, 0,559,401,562,404,
1056 407, 0
1057 };
1058
1059 static const unsigned short ag_key_index[] = {
1060 4, 6, 49, 66, 0, 0, 0, 95, 0, 0, 0, 0, 0,111,115, 4,126, 0,
1061 134, 95, 4,134,134, 66, 66, 66, 66, 0, 0, 0, 0, 0,143,148,150, 0,
1062 0, 4,126,134,134,111, 0,177, 0, 0, 0, 0, 0, 0, 4, 0,143,190,
1063 195,204,210, 4, 4, 4,195, 66, 66,216,148,148, 0,221,115, 66, 4,248,
1064 266, 0, 0, 0, 0, 0, 4,266,273,276,204,111,291,190,190,299,204,204,
1065 190, 0,303,291,204,190,315,315,190,327,333,190,276, 66, 66,204,190, 66,
1066 0, 4,195,216, 0,148, 4, 66, 0, 66, 0,148,148,148,148,148,148,148,
1067 66, 66,148,148,148,148,148,148, 4, 0,148, 0, 66, 66, 0, 0, 0, 4,
1068 276, 0, 0, 0,291,291,291,291,291,343,349, 0,354,356,356,266, 0,371,
1069 371,371,371,204, 0, 0,204,266,266,266,190,190,276,327,299, 0,190, 0,
1070 0,221, 4,377,148,380,377,148,383,389, 0, 0,190, 0, 4, 0,148,395,
1071 95, 0, 4, 0, 0,398, 4,291,266,266,266,190,266,266,371,190,291,371,
1072 410,190,327,327, 0, 4,266,299,148,115,148,148,190,148, 66, 66, 0, 0,
1073 291, 0,266, 0,148, 66,148, 66, 0,190, 0,266,190,115,148,190, 66,148,
1074 66
1075 };
1076
1077 static const unsigned char ag_key_ends[] = {
1078 47,0, 42,0, 62,0, 58,0, 46,46,46,0, 46,46,0, 46,46,46,0,
1079 101,103,97,114,100,0, 105,110,103,117,105,115,104,0, 117,109,0,
1080 116,101,110,100,0, 105,100,100,101,110,0, 116,0, 101,109,101,0,
1081 111,110,97,115,115,111,99,0, 97,109,101,0, 101,114,118,101,0,
1082 103,104,116,0, 105,99,107,121,0, 98,103,114,97,109,109,97,114,0,
1083 114,97,112,112,101,114,0, 46,46,0, 46,46,46,0, 47,0,
1084 101,103,97,114,100,0, 105,110,103,117,105,115,104,0, 117,109,0,
1085 116,101,110,100,0, 105,100,100,101,110,0, 116,0, 101,109,101,0,
1086 111,110,97,115,115,111,99,0, 97,109,101,0, 101,114,118,101,0,
1087 103,104,116,0, 105,99,107,121,0, 98,103,114,97,109,109,97,114,0,
1088 114,97,112,112,101,114,0, 58,0, 58,0, 62,0, 46,46,0, 58,0,
1089 46,46,46,0, 46,46,0, 46,46,46,0, 46,46,0, 46,46,46,0, 62,0,
1090 47,0, 58,0, 10,0, 42,0, 47,0, 58,0, 47,0, 101,103,97,114,100,0,
1091 105,110,103,117,105,115,104,0, 117,109,0, 116,101,110,100,0,
1092 105,100,100,101,110,0, 116,0, 101,109,101,0,
1093 111,110,97,115,115,111,99,0, 97,109,101,0, 101,114,118,101,0,
1094 103,104,116,0, 105,99,107,121,0, 98,103,114,97,109,109,97,114,0,
1095 114,97,112,112,101,114,0, 62,0, 47,0, 42,0, 58,0, 10,0, 42,0,
1096 58,0, 101,103,97,114,100,0, 105,110,103,117,105,115,104,0,
1097 117,109,0, 116,101,110,100,0, 105,100,100,101,110,0, 116,0,
1098 101,109,101,0, 111,110,97,115,115,111,99,0, 97,109,101,0,
1099 101,114,118,101,0, 103,104,116,0, 105,99,107,121,0,
1100 98,103,114,97,109,109,97,114,0, 114,97,112,112,101,114,0, 46,46,0,
1101 46,46,46,0, 46,46,0, 46,46,46,0, 10,0, 10,0, 47,0, 46,46,0,
1102 46,46,46,0, 46,46,0, 46,46,46,0, 46,0, 47,0, 46,46,46,0,
1103 46,46,0, 46,46,46,0, 46,46,0, 46,46,46,0, 46,46,0, 47,0,
1104 46,46,46,0, 46,46,0, 46,46,46,0, 46,46,0, 46,46,46,0, 46,46,0,
1105 47,0, 46,46,46,0, 46,46,0, 46,46,46,0, 46,46,0, 46,46,46,0,
1106 46,46,0, 46,46,46,0, 46,46,0, 46,46,46,0, 46,46,46,0,
1107 46,46,46,0, 46,46,0, 46,46,46,0, 46,46,0, 46,46,46,0, 42,0,
1108 101,121,119,111,114,100,115,0, 42,0, 97,99,114,111,0, 42,0,
1109 99,98,0, 42,0, 58,0, 42,0, 10,0, 46,46,0, 46,46,46,0, 46,46,0,
1110 46,46,46,0, 46,46,0, 46,46,46,0,
1111 };
1112
1113 #define AG_TCV(x) ag_tcv[(x)]
1114
1115 static const unsigned char ag_tcv[] = {
1116 45,252,252,252,252,252,252,252,252,104,110,112,112,108,252,252,252,252,
1117 252,252,252,252,252,252,252,252, 45,252,252,252,252,252,104, 15,161,253,
1118 62,253,145, 33, 21, 31, 97, 25, 7, 23,253,253,134,250,250,250,250,250,
1119 250,250,251,251,184, 82, 94, 13, 93,214,253,137,137,137,137,137,137,249,
1120 249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,
1121 249, 19,179, 27,119,249,253,137,137,137,137,137,137,249,249,249,249,249,
1122 249,249,249,249,249,249,249,249,249,249,249,249,249,249,249, 17, 37, 29,
1123 35,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,
1124 252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,
1125 252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,
1126 252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,
1127 252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,
1128 252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,
1129 252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,
1130 252,252,252,252
1131 };
1132
1133 #ifndef SYNTAX_ERROR
1134 #define SYNTAX_ERROR fprintf(stderr,"%s, line %d, column %d\n", \
1135 (PCB).error_message, (PCB).line, (PCB).column)
1136 #endif
1137
1138 #ifndef FIRST_LINE
1139 #define FIRST_LINE 1
1140 #endif
1141
1142 #ifndef FIRST_COLUMN
1143 #define FIRST_COLUMN 1
1144 #endif
1145
1146 #ifndef PARSER_STACK_OVERFLOW
1147 #define PARSER_STACK_OVERFLOW {fprintf(stderr, \
1148 "\nParser stack overflow, line %d, column %d\n",\
1149 (PCB).line, (PCB).column);}
1150 #endif
1151
1152 #ifndef REDUCTION_TOKEN_ERROR
1153 #define REDUCTION_TOKEN_ERROR {fprintf(stderr, \
1154 "\nReduction token error, line %d, column %d\n", \
1155 (PCB).line, (PCB).column);}
1156 #endif
1157
1158
1159 #ifndef INPUT_CODE
1160 #define INPUT_CODE(T) (T)
1161 #endif
1162
1163 typedef enum
1164 {ag_accept_key, ag_set_key, ag_jmp_key, ag_end_key, ag_no_match_key,
1165 ag_cf_accept_key, ag_cf_set_key, ag_cf_end_key} key_words;
1166
1167 static void ag_get_key_word(int ag_k) {
1168 int ag_save = (int) ((PCB).la_ptr - (PCB).pointer);
1169 const unsigned char *ag_p;
1170 int ag_ch;
1171 while (1) {
1172 switch (ag_key_act[ag_k]) {
1173 case ag_cf_end_key: {
1174 const unsigned char *sp = ag_key_ends + ag_key_jmp[ag_k];
1175 do {
1176 if ((ag_ch = *sp++) == 0) {
1177 int ag_k1 = ag_key_parm[ag_k];
1178 int ag_k2 = ag_key_pt[ag_k1];
1179 if (ag_key_itt[ag_k2 + CONVERT_CASE(*(PCB).la_ptr)]) goto ag_fail;
1180 (PCB).token_number = (pgg_token_type) ag_key_pt[ag_k1 + 1];
1181 return;
1182 }
1183 } while (CONVERT_CASE(*(PCB).la_ptr++) == ag_ch);
1184 goto ag_fail;
1185 }
1186 case ag_end_key: {
1187 const unsigned char *sp = ag_key_ends + ag_key_jmp[ag_k];
1188 do {
1189 if ((ag_ch = *sp++) == 0) {
1190 (PCB).token_number = (pgg_token_type) ag_key_parm[ag_k];
1191 return;
1192 }
1193 } while (CONVERT_CASE(*(PCB).la_ptr++) == ag_ch);
1194 }
1195 case ag_no_match_key:
1196 ag_fail:
1197 (PCB).la_ptr = (PCB).pointer + ag_save;
1198 return;
1199 case ag_cf_set_key: {
1200 int ag_k1 = ag_key_parm[ag_k];
1201 int ag_k2 = ag_key_pt[ag_k1];
1202 ag_k = ag_key_jmp[ag_k];
1203 if (ag_key_itt[ag_k2 + CONVERT_CASE(*(PCB).la_ptr)]) break;
1204 ag_save = (int) ((PCB).la_ptr - (PCB).pointer);
1205 (PCB).token_number = (pgg_token_type) ag_key_pt[ag_k1+1];
1206 break;
1207 }
1208 case ag_set_key:
1209 ag_save = (int) ((PCB).la_ptr - (PCB).pointer);
1210 (PCB).token_number = (pgg_token_type) ag_key_parm[ag_k];
1211 case ag_jmp_key:
1212 ag_k = ag_key_jmp[ag_k];
1213 break;
1214 case ag_accept_key:
1215 (PCB).token_number = (pgg_token_type) ag_key_parm[ag_k];
1216 return;
1217 case ag_cf_accept_key: {
1218 int ag_k1 = ag_key_parm[ag_k];
1219 int ag_k2 = ag_key_pt[ag_k1];
1220 if (ag_key_itt[ag_k2 + CONVERT_CASE(*(PCB).la_ptr)])
1221 (PCB).la_ptr = (PCB).pointer + ag_save;
1222 else (PCB).token_number = (pgg_token_type) ag_key_pt[ag_k1+1];
1223 return;
1224 }
1225 }
1226 ag_ch = CONVERT_CASE(*(PCB).la_ptr++);
1227 ag_p = &ag_key_ch[ag_k];
1228 if (ag_ch <= 255) while (*ag_p < ag_ch) ag_p++;
1229 if (ag_ch > 255 || *ag_p != ag_ch) {
1230 (PCB).la_ptr = (PCB).pointer + ag_save;
1231 return;
1232 }
1233 ag_k = (int) (ag_p - ag_key_ch);
1234 }
1235 }
1236
1237
1238 #ifndef AG_NEWLINE
1239 #define AG_NEWLINE 10
1240 #endif
1241
1242 #ifndef AG_RETURN
1243 #define AG_RETURN 13
1244 #endif
1245
1246 #ifndef AG_FORMFEED
1247 #define AG_FORMFEED 12
1248 #endif
1249
1250 #ifndef AG_TABCHAR
1251 #define AG_TABCHAR 9
1252 #endif
1253
1254 static void ag_track(void) {
1255 int ag_k = (int) ((PCB).la_ptr - (PCB).pointer);
1256 while (ag_k--) {
1257 switch (*(PCB).pointer++) {
1258 case AG_NEWLINE:
1259 (PCB).column = 1, (PCB).line++;
1260 case AG_RETURN:
1261 case AG_FORMFEED:
1262 break;
1263 case AG_TABCHAR:
1264 (PCB).column += (TAB_SPACING) - ((PCB).column - 1) % (TAB_SPACING);
1265 break;
1266 default:
1267 (PCB).column++;
1268 }
1269 }
1270 }
1271
1272
1273 static void ag_prot(void) {
1274 int ag_k;
1275 ag_k = 128 - ++(PCB).btsx;
1276 if (ag_k <= (PCB).ssx) {
1277 (PCB).exit_flag = AG_STACK_ERROR_CODE;
1278 PARSER_STACK_OVERFLOW;
1279 return;
1280 }
1281 (PCB).bts[(PCB).btsx] = (PCB).sn;
1282 (PCB).bts[ag_k] = (PCB).ssx;
1283 (PCB).vs[ag_k] = (PCB).vs[(PCB).ssx];
1284 (PCB).ss[ag_k] = (PCB).ss[(PCB).ssx];
1285 (PCB).cs[ag_k] = (PCB).cs[(PCB).ssx];
1286 }
1287
1288 static void ag_undo(void) {
1289 if ((PCB).drt == -1) return;
1290 while ((PCB).btsx) {
1291 int ag_k = 128 - (PCB).btsx;
1292 (PCB).sn = (PCB).bts[(PCB).btsx--];
1293 (PCB).ssx = (PCB).bts[ag_k];
1294 (PCB).vs[(PCB).ssx] = (PCB).vs[ag_k];
1295 (PCB).ss[(PCB).ssx] = (PCB).ss[ag_k];
1296 (PCB).cs[(PCB).ssx] = (PCB).cs[ag_k];
1297 }
1298 (PCB).token_number = (pgg_token_type) (PCB).drt;
1299 (PCB).ssx = (PCB).dssx;
1300 (PCB).sn = (PCB).dsn;
1301 (PCB).drt = -1;
1302 }
1303
1304
1305
1306 static const int ag_rtt[] = {
1307 105,237, 0
1308 };
1309
1310 static const unsigned char ag_tstt[] = {
1311 249,239,137,113,110,108,104,45,21,19,17,0,3,4,5,38,105,237,
1312 253,252,251,250,249,239,238,214,184,179,161,145,137,134,119,112,110,108,104,
1313 97,94,93,82,62,37,35,33,31,29,27,25,23,21,19,17,15,13,7,0,105,237,
1314 239,104,0,3,105,237,
1315 249,137,113,110,108,45,21,19,17,0,39,40,51,109,
1316 253,252,251,250,249,214,184,179,161,145,137,134,119,112,110,108,104,97,94,
1317 93,82,62,45,37,35,33,31,29,27,25,23,21,19,17,15,13,7,0,115,116,
1318 110,0,
1319 110,108,0,109,
1320 249,239,211,208,206,205,203,202,200,199,198,197,196,194,193,137,113,112,110,
1321 108,104,103,45,35,27,21,19,17,0,3,51,105,109,111,237,
1322 249,137,45,21,19,17,0,20,41,44,46,47,48,49,53,58,59,60,61,99,220,
1323 253,252,251,250,249,214,184,179,161,145,137,134,119,112,104,97,94,93,82,62,
1324 37,35,33,31,29,27,25,23,21,19,17,15,13,7,0,
1325 110,0,
1326 110,108,0,109,
1327 110,0,
1328 251,250,249,239,137,134,129,128,119,113,110,108,104,97,87,35,33,25,23,21,0,
1329 3,4,8,9,51,105,106,107,109,237,
1330 249,137,87,0,61,63,83,99,
1331 253,252,251,250,249,239,214,184,179,161,145,137,134,119,113,112,110,108,104,
1332 97,94,93,82,62,37,35,33,31,29,27,25,23,21,19,15,13,7,0,109,222,223,224,
1333 251,250,249,239,219,218,217,216,215,214,184,145,137,134,113,110,108,104,97,
1334 94,93,87,62,45,37,31,29,27,25,23,21,13,11,7,2,0,3,4,5,105,237,
1335 249,137,0,58,60,61,99,
1336 7,0,6,
1337 249,239,211,208,206,205,203,202,200,199,198,197,196,194,193,137,113,110,108,
1338 104,103,35,27,0,3,4,5,105,187,237,
1339 253,252,251,250,249,239,214,184,179,161,145,137,134,119,113,112,104,97,94,
1340 93,82,62,37,35,33,31,29,27,25,23,21,19,15,13,7,0,51,105,221,225,228,229,
1341 237,
1342 62,13,0,12,
1343 2,0,1,54,
1344 113,110,108,0,39,51,109,
1345 113,110,108,0,39,51,109,
1346 113,110,108,0,39,51,109,
1347 113,110,108,0,39,51,109,
1348 249,137,45,21,19,17,0,20,42,43,46,47,48,49,50,53,58,59,60,61,99,220,
1349 45,0,
1350 110,0,
1351 110,0,
1352 110,108,0,107,109,
1353 253,252,251,250,249,239,236,214,184,179,161,145,137,134,129,128,119,113,112,
1354 110,108,104,97,94,93,87,62,37,35,33,31,29,27,25,23,21,19,17,15,13,7,0,3,
1355 51,105,106,107,109,237,
1356 249,239,137,104,0,88,
1357 113,110,108,97,94,93,87,31,29,27,21,7,0,84,85,92,
1358 31,0,
1359 110,0,
1360 253,252,251,250,249,239,214,184,179,161,145,137,134,119,113,112,110,108,104,
1361 97,94,93,82,62,37,35,33,31,29,27,25,23,21,19,15,13,7,0,109,222,
1362 251,250,249,239,137,134,104,0,3,105,237,
1363 62,0,
1364 7,0,6,
1365 251,250,249,239,161,137,134,129,128,119,113,110,108,104,87,35,33,29,25,23,
1366 21,19,17,15,0,3,4,8,9,51,105,106,107,109,237,
1367 249,137,0,60,61,99,
1368 249,211,208,206,205,203,202,200,199,198,197,196,194,193,137,113,110,108,103,
1369 35,27,0,39,40,51,109,
1370 27,0,26,
1371 253,252,251,250,249,214,184,179,161,145,137,134,119,112,104,97,94,93,82,62,
1372 37,35,33,31,29,27,25,23,21,19,17,15,13,7,0,243,244,245,
1373 253,252,251,250,249,214,184,179,161,145,137,134,119,112,104,97,94,93,82,62,
1374 37,35,33,31,29,27,25,23,21,19,17,15,13,7,0,246,247,248,
1375 161,0,
1376 33,0,
1377 110,108,0,109,
1378 253,252,251,250,249,239,214,184,179,161,145,137,134,119,113,112,110,108,104,
1379 97,94,93,82,62,37,35,33,31,29,27,25,23,21,19,17,15,13,7,0,226,
1380 29,0,28,
1381 253,252,251,250,249,239,236,214,184,179,161,145,137,134,129,128,119,113,112,
1382 110,108,104,97,94,93,87,62,37,35,33,31,27,25,23,21,19,17,15,13,7,0,3,4,
1383 8,9,51,105,106,107,109,237,
1384 251,250,249,161,137,134,129,128,119,35,33,25,23,21,19,17,15,0,14,16,18,20,
1385 22,24,34,61,99,117,118,121,123,125,140,141,142,143,144,146,152,153,155,
1386 158,159,
1387 239,113,110,108,104,45,7,2,0,3,4,5,105,237,
1388 251,250,249,239,161,137,134,129,128,119,113,110,108,104,45,37,35,33,25,23,
1389 21,19,17,15,13,0,3,4,5,105,237,
1390 251,250,249,161,137,134,129,128,119,113,110,108,45,37,35,33,25,23,21,19,17,
1391 15,13,0,12,57,73,75,76,77,78,
1392 249,239,137,113,112,110,108,104,45,21,19,17,0,3,51,105,109,111,237,
1393 249,239,137,113,112,110,108,104,45,21,19,17,0,3,51,105,109,111,237,
1394 249,239,137,113,112,110,108,104,45,21,19,17,0,3,51,105,109,111,237,
1395 249,239,137,113,112,110,108,104,45,37,21,19,17,2,0,1,3,36,51,54,55,56,105,
1396 109,111,237,
1397 113,110,108,45,0,39,51,52,109,
1398 113,110,108,45,0,39,51,52,109,
1399 239,104,0,3,4,105,237,
1400 249,239,137,104,0,3,4,5,105,237,
1401 249,239,137,104,0,89,
1402 97,21,0,20,86,90,91,95,96,98,
1403 249,239,137,104,87,0,3,4,5,105,237,
1404 249,137,87,0,61,63,83,99,
1405 113,110,108,97,93,31,29,27,21,7,0,
1406 249,239,137,113,110,108,104,0,3,4,8,9,51,105,106,107,109,237,
1407 249,211,208,206,205,203,202,200,199,198,197,196,194,193,137,103,35,27,0,34,
1408 61,99,102,157,188,189,190,191,192,201,
1409 239,219,218,216,215,184,113,110,108,104,45,37,29,27,13,7,0,3,4,5,105,237,
1410 253,252,251,250,249,214,184,179,161,145,137,134,119,112,110,108,104,97,94,
1411 93,82,62,37,35,33,31,29,27,25,23,21,19,17,15,13,7,0,242,
1412 253,252,251,250,249,214,184,179,145,137,134,119,112,104,97,94,93,82,62,37,
1413 35,33,31,29,27,25,23,21,19,17,15,13,7,0,243,
1414 253,252,251,250,249,214,184,179,161,145,137,134,119,112,110,108,104,97,94,
1415 93,82,62,37,35,33,31,29,27,25,23,21,19,17,15,13,7,0,242,
1416 253,252,251,250,249,214,184,179,161,145,137,134,119,112,104,97,94,93,82,62,
1417 37,35,31,29,27,25,23,21,19,17,15,13,7,0,246,
1418 110,0,
1419 253,252,251,250,249,239,214,184,179,161,145,137,134,119,113,112,110,108,104,
1420 97,94,93,82,62,37,35,33,31,27,25,23,21,19,17,15,13,7,0,51,105,228,229,
1421 230,237,
1422 239,219,218,216,215,184,113,110,108,104,45,37,29,27,13,7,0,3,4,5,105,237,
1423 253,252,251,250,249,239,236,214,184,179,161,145,137,134,119,113,112,110,108,
1424 104,97,94,93,62,37,35,33,31,27,25,23,21,19,17,15,13,7,0,3,4,8,9,51,105,
1425 106,107,109,237,
1426 253,252,251,250,249,236,214,184,179,161,145,137,134,119,112,97,94,93,62,37,
1427 35,33,31,27,25,23,21,19,17,15,13,7,0,48,81,220,232,
1428 251,250,249,239,161,137,134,129,128,119,113,110,108,104,35,33,25,23,21,19,
1429 17,15,0,3,4,8,9,51,105,106,107,109,237,
1430 251,250,249,239,161,137,134,129,128,119,113,110,108,104,87,35,33,25,23,21,
1431 19,17,15,13,0,3,4,8,9,51,105,106,107,109,237,
1432 253,252,251,250,249,214,184,181,179,177,176,175,174,173,172,171,170,169,168,
1433 167,145,137,134,119,112,104,97,94,93,82,62,37,35,33,31,29,27,25,23,21,
1434 19,17,15,13,7,0,148,149,150,151,160,162,163,164,165,178,180,
1435 251,250,249,161,137,134,129,128,119,35,33,25,23,21,19,17,15,0,68,69,75,78,
1436 251,250,249,161,137,134,129,128,119,35,33,25,23,21,19,17,15,13,0,12,68,69,
1437 71,72,73,74,75,78,
1438 214,0,
1439 251,250,249,239,137,134,129,128,119,113,110,108,104,35,33,25,23,21,0,3,4,8,
1440 9,51,105,106,107,109,237,
1441 251,250,249,239,137,134,129,128,119,113,110,108,104,35,33,25,23,21,0,3,4,8,
1442 9,51,105,106,107,109,237,
1443 251,250,134,129,128,0,124,126,127,130,
1444 253,251,250,249,214,184,179,161,145,137,134,119,97,94,93,82,62,37,35,33,31,
1445 29,27,25,23,21,19,17,15,13,7,0,
1446 154,0,
1447 253,252,251,250,249,214,184,181,179,177,176,175,174,173,172,171,170,169,168,
1448 167,161,145,137,134,119,112,104,97,94,93,82,62,37,35,31,29,27,25,23,21,
1449 19,17,15,13,7,0,122,148,149,150,151,178,180,
1450 251,250,249,239,137,134,129,128,119,113,110,108,104,35,33,25,23,21,0,3,4,8,
1451 9,51,105,106,107,109,237,
1452 251,250,249,137,134,129,128,119,35,33,25,23,21,0,20,22,24,34,61,99,117,118,
1453 121,123,125,140,142,143,144,146,152,153,
1454 219,218,217,216,215,214,184,154,145,113,110,108,45,37,31,29,27,25,23,13,11,
1455 7,0,
1456 219,218,217,216,215,214,184,154,145,113,110,108,45,37,31,29,27,25,23,13,11,
1457 7,0,
1458 251,250,249,137,134,129,128,119,35,33,25,23,21,0,20,22,24,34,61,99,117,118,
1459 121,123,125,144,146,152,153,
1460 145,0,
1461 217,214,25,23,11,0,10,22,24,
1462 251,250,249,161,137,134,129,128,119,35,33,25,23,21,19,17,15,0,14,16,18,20,
1463 22,24,34,61,79,99,117,118,121,123,125,138,139,140,141,142,143,144,146,
1464 152,153,158,159,
1465 253,252,251,250,249,236,214,184,179,161,145,137,134,119,112,97,94,93,62,37,
1466 35,33,31,27,25,23,21,19,17,15,13,7,0,48,81,220,232,
1467 113,110,108,45,37,13,7,0,6,12,73,76,
1468 37,0,36,55,
1469 251,250,249,239,161,137,134,129,128,119,113,110,108,104,35,33,25,23,21,19,
1470 17,15,0,3,4,8,9,51,105,106,107,109,237,
1471 251,250,249,161,137,134,129,128,119,35,33,25,23,21,19,17,15,0,75,77,78,
1472 37,0,36,55,
1473 110,108,45,0,109,
1474 249,239,137,113,112,110,108,104,45,21,19,17,0,3,51,105,109,111,237,
1475 249,239,137,113,112,110,108,104,45,37,21,19,17,2,0,1,3,36,51,54,55,56,105,
1476 109,111,237,
1477 239,104,0,3,105,237,
1478 249,137,0,61,99,
1479 249,239,137,104,0,3,4,5,105,237,
1480 249,239,137,113,110,108,104,97,93,31,29,27,21,7,0,3,4,5,105,237,
1481 249,137,0,61,99,
1482 97,21,0,20,86,90,91,95,96,98,
1483 97,21,0,20,91,95,96,98,
1484 93,7,0,
1485 239,104,0,3,4,105,237,
1486 239,104,0,3,4,65,105,237,
1487 239,104,0,3,4,105,237,
1488 239,104,0,3,4,105,237,
1489 239,104,0,3,4,105,195,237,
1490 239,104,0,3,4,105,237,
1491 239,104,0,3,4,105,237,
1492 113,110,108,29,7,0,6,51,67,106,107,109,212,
1493 113,110,108,29,7,0,6,51,67,106,107,109,212,
1494 239,104,0,3,4,105,195,237,
1495 239,104,0,3,4,105,195,237,
1496 239,104,0,3,4,105,195,237,
1497 239,104,0,3,4,105,195,237,
1498 239,104,0,3,4,105,195,237,
1499 239,104,0,3,4,105,195,237,
1500 239,113,110,108,104,0,3,4,8,51,105,106,107,109,237,
1501 249,137,0,61,99,
1502 251,250,249,239,137,134,104,13,0,3,4,5,105,237,
1503 249,137,0,61,99,
1504 13,0,12,
1505 113,110,108,27,0,39,40,51,109,
1506 161,0,
1507 33,0,
1508 110,108,0,109,
1509 253,252,251,250,249,239,214,184,179,161,145,137,134,119,113,112,110,108,104,
1510 97,94,93,82,62,37,35,33,31,29,27,25,23,21,19,17,15,13,7,0,226,
1511 253,252,251,250,249,236,214,184,179,161,145,137,134,119,112,97,94,93,62,37,
1512 35,33,31,27,25,23,21,19,15,13,7,0,228,229,233,234,
1513 82,0,
1514 250,134,0,
1515 251,250,137,134,0,131,136,
1516 250,134,0,
1517 250,134,0,
1518 251,137,0,
1519 251,250,137,134,0,
1520 253,252,249,214,184,181,179,177,176,175,174,173,172,171,170,169,168,167,161,
1521 145,119,112,104,97,94,93,82,62,37,35,33,31,29,27,25,23,21,19,17,15,13,7,
1522 0,148,149,150,151,165,178,180,
1523 219,218,216,215,37,29,27,13,7,0,6,12,73,76,
1524 219,216,37,27,0,26,36,70,
1525 37,0,36,70,
1526 218,37,0,36,70,
1527 37,0,36,70,
1528 215,29,0,28,
1529 239,219,218,216,215,184,113,110,108,104,45,37,29,27,13,7,0,3,4,5,105,237,
1530 251,250,137,134,0,131,136,
1531 250,134,0,
1532 251,250,134,0,
1533 239,219,218,217,216,215,214,184,154,145,113,110,108,104,45,37,31,29,27,25,
1534 23,13,11,7,0,3,4,5,105,237,
1535 239,219,218,217,216,215,214,184,154,145,113,110,108,104,45,37,31,29,27,25,
1536 23,13,11,7,0,3,4,5,105,237,
1537 251,250,239,134,129,128,119,113,110,108,104,33,25,23,0,3,4,8,9,51,105,106,
1538 107,109,237,
1539 33,23,0,32,
1540 31,25,23,0,22,24,30,
1541 251,250,249,239,137,134,129,128,119,113,110,108,104,35,33,25,23,21,0,3,4,8,
1542 9,51,105,106,107,109,237,
1543 239,219,218,216,215,184,113,110,108,104,45,37,29,27,13,7,0,3,4,5,105,237,
1544 239,219,218,216,215,184,113,110,108,104,45,37,29,27,13,7,0,3,4,5,105,237,
1545 239,219,218,216,215,184,113,110,108,104,45,37,29,27,13,7,0,3,4,5,105,237,
1546 251,250,249,137,134,129,128,119,35,33,25,23,21,0,20,22,24,34,61,99,117,118,
1547 121,123,125,142,144,146,152,153,
1548 251,250,249,137,134,129,128,119,35,33,25,23,21,0,20,22,24,34,61,99,117,118,
1549 121,123,125,142,144,146,152,153,
1550 253,252,251,250,249,236,214,184,179,161,145,137,134,119,112,97,94,93,62,37,
1551 35,33,31,27,25,23,21,19,17,15,13,7,0,48,81,220,232,
1552 217,214,25,23,11,0,10,22,24,
1553 219,218,216,215,184,113,110,108,45,37,29,27,13,7,0,80,
1554 82,0,
1555 251,250,249,161,137,134,129,128,119,35,33,25,23,21,19,17,15,0,14,16,18,20,
1556 22,24,34,61,79,99,117,118,121,123,125,138,139,140,141,142,143,144,146,
1557 152,153,158,159,
1558 249,137,0,61,99,
1559 31,0,30,
1560 249,239,137,104,87,0,3,4,5,105,237,
1561 239,113,110,108,104,97,93,31,29,27,21,7,0,3,4,5,105,237,
1562 239,207,104,0,3,105,237,
1563 239,104,17,0,3,16,105,237,
1564 239,209,104,0,3,105,237,
1565 239,207,104,0,3,105,237,
1566 239,104,17,0,3,16,105,237,
1567 239,204,104,0,3,105,237,
1568 251,250,249,239,161,137,134,129,128,119,104,35,33,25,23,21,19,17,0,3,16,18,
1569 20,22,24,34,61,99,105,117,118,121,123,125,138,140,141,142,143,144,146,
1570 152,153,158,159,237,
1571 29,0,28,
1572 249,137,0,61,99,156,
1573 251,250,249,137,134,129,128,119,35,33,29,25,23,21,0,20,22,24,34,61,99,117,
1574 118,121,123,125,140,142,143,144,146,152,153,
1575 17,0,16,
1576 251,250,249,239,137,134,113,110,108,104,17,0,3,51,105,106,107,109,237,
1577 13,0,12,
1578 251,250,249,239,137,134,104,0,3,105,237,
1579 251,250,249,161,137,134,129,128,87,25,23,0,22,24,61,63,83,99,118,123,125,
1580 158,159,
1581 249,239,211,208,206,205,203,202,200,199,198,197,196,194,193,137,113,112,110,
1582 108,104,103,35,27,0,3,34,51,61,99,102,105,109,111,157,190,191,192,201,
1583 237,
1584 110,0,
1585 253,252,251,250,249,239,214,184,179,161,145,137,134,119,113,112,110,108,104,
1586 97,94,93,82,62,37,35,33,31,29,27,25,23,21,19,17,15,13,7,0,51,105,228,
1587 229,230,237,
1588 161,0,
1589 33,0,
1590 253,252,251,250,249,239,236,214,184,179,161,145,137,134,119,112,104,97,94,
1591 93,62,37,35,33,31,27,25,23,21,19,15,13,7,0,3,105,228,229,234,237,
1592 239,113,110,108,104,45,0,3,4,5,105,237,
1593 251,250,137,134,0,136,
1594 239,219,218,216,215,214,184,113,110,108,104,45,37,29,27,13,7,0,3,4,5,105,
1595 237,
1596 239,219,218,216,215,184,113,110,108,104,45,37,29,27,13,7,0,3,4,5,105,237,
1597 239,219,218,216,215,184,113,110,108,104,45,37,29,27,13,7,0,3,4,5,105,237,
1598 251,250,249,161,137,134,129,128,119,35,33,25,23,21,19,17,15,0,69,75,78,
1599 239,219,218,216,215,184,113,110,108,104,45,37,29,27,13,7,0,3,4,5,105,237,
1600 239,219,218,216,215,184,113,110,108,104,45,37,29,27,13,7,0,3,4,5,105,237,
1601 251,250,137,134,0,136,
1602 251,250,134,129,128,119,33,25,23,0,22,24,117,118,121,123,125,153,
1603 253,252,251,250,249,214,184,181,179,177,176,175,174,173,172,171,170,169,168,
1604 167,161,145,137,134,119,112,104,97,94,93,82,62,37,35,31,29,27,25,23,21,
1605 19,17,15,13,7,0,122,148,149,150,151,178,180,
1606 239,219,218,217,216,215,214,184,154,145,113,110,108,104,45,37,31,29,27,25,
1607 23,13,11,7,0,3,4,5,105,237,
1608 239,219,218,217,216,215,214,184,145,113,110,108,104,93,45,37,31,29,27,25,23,
1609 13,11,7,0,3,4,5,105,237,
1610 251,250,249,137,134,129,128,119,35,33,25,23,21,0,20,22,24,34,61,99,117,118,
1611 121,123,125,144,146,152,153,
1612 145,0,
1613 145,0,
1614 82,0,
1615 249,239,137,113,110,108,104,0,3,4,8,9,51,105,106,107,109,237,
1616 239,219,218,216,215,113,110,108,104,45,37,29,27,0,3,4,5,105,237,
1617 219,218,216,215,184,113,110,108,45,37,29,27,13,7,0,80,
1618 239,104,0,3,4,105,237,
1619 249,137,87,0,61,63,64,66,83,99,
1620 239,104,0,3,4,105,237,
1621 239,104,0,3,4,105,195,237,
1622 251,250,249,161,137,134,129,128,119,35,33,25,23,21,19,17,0,16,18,20,22,24,
1623 34,61,99,117,118,121,123,125,138,140,141,142,143,144,146,152,153,158,
1624 159,213,
1625 239,104,17,0,3,4,5,105,237,
1626 13,0,12,
1627 25,23,0,22,24,
1628 249,137,0,61,99,156,
1629 161,0,158,159,
1630 253,252,251,250,249,214,184,181,179,177,176,175,174,173,172,171,170,169,168,
1631 167,161,145,137,134,119,112,104,97,94,93,82,62,37,35,31,29,27,25,23,21,
1632 19,17,15,13,7,0,122,148,149,150,151,178,180,
1633 33,0,32,
1634 239,219,218,216,215,184,113,110,108,104,45,37,29,27,13,7,0,3,4,5,105,237,
1635 249,137,0,185,186,
1636 239,104,17,0,3,16,105,237,
1637 113,110,108,29,7,0,6,51,67,106,107,109,212,
1638 249,239,137,104,0,3,105,210,237,
1639 113,110,108,29,7,0,6,51,67,106,107,109,212,
1640 17,0,48,220,
1641 251,250,134,129,128,119,33,25,23,0,22,24,117,118,121,123,125,
1642 33,0,32,
1643 251,250,249,239,219,218,216,215,137,134,113,110,108,104,45,37,29,27,13,7,0,
1644 3,4,5,105,237,
1645 251,250,249,137,134,129,128,119,35,33,25,23,21,0,20,22,24,34,61,99,117,118,
1646 121,123,125,140,142,143,144,146,152,153,
1647 249,137,87,0,61,63,64,83,99,
1648 251,250,249,239,137,134,104,0,3,4,105,237,
1649 251,250,249,161,137,134,129,128,119,35,33,29,25,23,21,19,17,0,16,18,20,22,
1650 24,34,61,99,117,118,121,123,125,138,140,141,142,143,144,146,152,153,158,
1651 159,
1652 25,23,0,22,24,
1653 249,239,137,104,0,3,105,210,237,
1654 251,250,249,137,134,0,
1655
1656 };
1657
1658
1659 static unsigned const char ag_astt[4178] = {
1660 5,1,5,8,8,8,1,5,5,5,5,7,1,1,1,0,1,1,3,3,3,3,3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,1,1,1,1,1,
1766 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7,1,1,1,1,1,1,1,1,7,2,1,5,5,5,5,5,5,5,
1767 5,1,5,5,5,5,5,5,7,1,1,2,1,1,2,2,7,2,1,1,9,1,7,3,1,3,1,1,8,1,8,1,7,1,1,3,1,
1768 1,1,1,2,1,2,9,7,3,3,1,1,1,8,1,8,1,7,1,1,3,1,1,1,1,1,7,2,1,5,5,5,5,5,1,1,1,
1769 1,7,2,2,2,2,2,1,2,1,7,2,10,10,10,1,5,5,5,5,10,10,5,5,5,1,5,5,5,5,5,5,7,1,1,
1770 3,1,1,5,5,2,2,5,5,5,1,1,1,1,1,1,7,1,2,2,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,2,2,
1771 1,5,1,2,3,1,1,9,9,9,1,9,9,1,7,1,1,1,1,5,5,2,2,2,5,5,5,1,1,1,5,1,1,1,1,1,7,
1772 1,1,1,2,2,1,2,1,1,1,1,1,2,2,1,2,1,1,1,1,1,1,1,1,1,1,4,1,1,2,1,2,9,7,3,3,1,
1773 1,9,9,9,9,9,4
1774 };
1775
1776
1777 static const unsigned short ag_pstt[] = {
1778 3,1,3,3,3,3,2,3,3,3,3,0,2,2,3,0,2,1,
1779 317,317,317,317,317,1,315,317,317,317,317,317,317,317,317,317,317,317,317,
1780 317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,317,
1781 317,1,318,1,
1782 1,2,4,2,2,1,
1783 8,8,4,5,5,23,8,8,8,3,7,8,6,5,
1784 9,9,9,9,9,9,9,9,9,9,9,9,9,9,132,132,9,9,9,9,9,9,132,9,9,9,9,9,9,9,9,9,9,9,9,
1785 9,9,4,9,134,
1786 127,5,
1787 10,10,6,10,
1788 24,1,24,24,24,24,24,24,24,24,24,24,24,24,24,24,4,129,12,12,128,24,24,24,24,
1789 24,24,24,7,128,11,128,12,128,1,
1790 105,105,28,13,19,15,8,14,27,28,26,25,24,23,22,18,17,52,21,16,20,
1791 131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,
1792 131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,133,
1793 126,10,
1794 29,29,11,29,
1795 124,12,
1796 6,6,6,1,6,6,6,6,6,4,30,30,32,6,6,6,6,6,6,6,13,32,32,14,14,31,32,14,14,30,1,
1797 105,105,33,14,34,35,34,16,
1798 288,288,288,288,288,288,288,288,288,288,288,288,288,288,288,288,36,36,288,
1799 288,288,288,288,288,288,288,288,288,288,288,288,288,288,288,288,288,288,
1800 15,36,37,37,290,
1801 106,106,106,1,3,3,3,3,3,3,3,3,106,106,3,3,3,38,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
1802 3,3,3,16,38,38,111,38,1,
1803 105,105,17,40,52,39,16,
1804 41,50,42,
1805 3,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,43,43,43,2,3,3,3,19,2,2,43,2,44,1,
1806 50,50,50,50,50,1,50,50,50,45,50,50,50,50,4,50,50,50,50,50,50,50,50,50,46,50,
1807 291,50,50,50,50,50,50,50,50,20,49,50,51,50,48,47,1,
1808 54,52,54,53,
1809 55,40,56,41,
1810 4,5,5,23,57,6,5,
1811 4,5,5,24,58,6,5,
1812 4,5,5,25,59,6,5,
1813 4,5,5,26,60,6,5,
1814 105,105,25,13,19,15,27,14,28,28,62,61,61,61,61,22,18,17,52,21,16,20,
1815 29,28,
1816 125,29,
1817 63,30,
1818 30,30,31,117,30,
1819 114,114,114,114,114,1,114,114,114,114,114,114,114,114,114,114,114,4,114,30,
1820 30,2,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,
1821 114,114,114,32,2,31,2,115,115,30,1,
1822 88,88,88,88,33,64,
1823 82,82,82,66,67,82,65,82,82,82,66,82,34,69,66,68,
1824 70,35,
1825 285,36,
1826 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,36,36,289,
1827 289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,
1828 37,36,287,
1829 107,107,107,1,107,107,2,4,2,2,1,
1830 54,54,
1831 41,51,42,
1832 6,6,6,1,6,6,6,6,6,6,4,30,30,32,6,6,6,6,6,6,6,6,6,6,41,32,32,8,8,31,32,8,8,
1833 30,1,
1834 105,105,42,53,39,16,
1835 71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,4,5,5,71,71,23,43,7,71,6,5,
1836 72,44,229,
1837 74,74,74,74,74,74,74,73,324,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,
1838 74,74,74,74,74,74,74,74,74,45,74,74,326,
1839 76,76,76,76,76,76,76,75,76,76,76,76,76,76,76,76,76,76,76,76,76,76,332,76,76,
1840 76,76,76,76,76,76,76,76,76,46,76,76,334,
1841 297,47,
1842 296,48,
1843 77,77,49,77,
1844 78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,78,
1845 78,78,78,298,78,78,78,78,78,78,78,78,78,50,78,
1846 79,51,284,
1847 6,6,6,6,6,1,6,6,6,6,6,6,6,6,6,6,6,4,6,30,30,32,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
1848 6,6,6,6,52,32,32,10,10,31,32,10,10,30,1,
1849 139,139,105,194,105,139,139,139,91,94,93,88,89,13,82,83,80,53,81,86,85,95,
1850 142,141,98,176,16,97,97,96,90,141,100,183,99,100,99,99,99,92,184,87,84,
1851 1,3,3,3,2,3,3,3,54,2,2,55,2,1,
1852 3,3,3,1,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,55,2,2,5,2,1,
1853 77,77,77,77,77,77,77,77,77,78,78,78,78,78,77,77,77,77,77,77,77,77,52,56,102,
1854 104,70,103,70,71,101,
1855 33,1,33,4,129,12,12,128,33,33,33,33,57,128,11,128,12,128,1,
1856 32,1,32,4,129,12,12,128,32,32,32,32,58,128,11,128,12,128,1,
1857 31,1,31,4,129,12,12,128,31,31,31,31,59,128,11,128,12,128,1,
1858 30,1,30,4,129,12,12,128,30,105,30,30,30,55,60,56,128,106,11,42,107,107,128,
1859 12,128,1,
1860 4,5,5,36,61,109,108,39,5,
1861 4,5,5,36,62,110,108,38,5,
1862 1,111,121,111,111,111,1,
1863 112,1,112,2,64,2,2,112,2,1,
1864 90,90,90,90,65,113,
1865 114,13,66,98,86,117,86,116,115,117,
1866 3,1,3,2,3,67,2,2,96,2,1,
1867 105,105,33,68,34,118,34,16,
1868 83,83,83,85,83,83,83,83,85,83,69,
1869 6,1,6,4,30,30,32,70,32,32,56,56,31,32,56,56,30,1,
1870 105,120,121,122,123,124,125,128,129,130,131,132,133,119,105,134,94,230,71,
1871 137,138,16,136,126,139,232,139,139,135,127,
1872 1,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,72,2,2,17,2,1,
1873 321,321,321,321,321,321,321,321,321,321,321,321,321,321,321,321,321,321,321,
1874 321,321,321,321,321,321,321,321,321,321,321,321,321,321,321,321,321,73,
1875 321,
1876 323,323,323,323,323,323,323,73,323,323,323,323,323,323,323,323,323,323,323,
1877 323,323,323,323,323,323,323,323,323,323,323,323,323,323,325,323,
1878 329,329,329,329,329,329,329,329,329,329,329,329,329,329,329,329,329,329,329,
1879 329,329,329,329,329,329,329,329,329,329,329,329,329,329,329,329,329,75,
1880 329,
1881 331,331,331,331,331,331,331,75,331,331,331,331,331,331,331,331,331,331,331,
1882 331,331,331,331,331,331,331,331,331,331,331,331,331,331,333,331,
1883 295,77,
1884 299,299,299,299,299,1,299,299,299,45,299,299,299,299,4,299,299,299,299,299,
1885 299,299,299,299,299,299,46,299,299,299,299,299,299,143,299,299,299,292,
1886 142,299,141,140,299,1,
1887 1,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,79,2,2,18,2,1,
1888 6,6,6,6,6,1,6,6,6,6,6,6,6,6,6,4,6,30,30,32,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
1889 6,80,32,32,11,11,31,32,11,11,30,1,
1890 306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,
1891 306,306,306,306,306,306,306,306,306,15,306,306,306,81,280,145,20,144,
1892 6,6,6,1,6,6,6,6,6,6,4,30,30,32,6,6,6,6,6,6,6,6,82,32,32,13,13,31,32,13,13,
1893 30,1,
1894 6,6,6,1,6,6,6,6,6,6,4,30,30,32,6,6,6,6,6,6,6,6,6,6,83,32,32,12,12,31,32,12,
1895 12,30,1,
1896 215,215,216,216,215,215,215,147,146,208,207,206,205,204,203,202,201,200,199,
1897 198,215,216,216,215,215,215,215,215,215,215,215,215,215,215,215,215,215,
1898 215,215,215,215,215,215,215,215,84,215,220,197,222,152,151,150,152,215,
1899 149,148,
1900 77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,85,154,61,153,101,
1901 77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,52,86,102,156,61,157,155,
1902 66,158,153,101,
1903 159,269,
1904 6,6,6,1,6,6,6,6,6,4,30,30,32,6,6,6,6,6,88,32,32,16,16,31,32,16,16,30,1,
1905 6,6,6,1,6,6,6,6,6,4,30,30,32,6,6,6,6,6,89,32,32,15,15,31,32,15,15,30,1,
1906 148,148,150,160,160,90,163,162,161,160,
1907 164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,
1908 164,164,164,164,164,164,164,164,164,164,164,164,91,
1909 165,92,
1910 166,166,166,166,166,166,166,147,146,208,207,206,205,204,203,202,201,200,199,
1911 198,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,
1912 166,166,166,166,166,166,166,166,93,166,166,166,166,166,149,148,
1913 6,6,6,1,6,6,6,6,6,4,30,30,32,6,6,6,6,6,94,32,32,21,21,31,32,21,21,30,1,
1914 139,139,105,105,139,139,139,91,94,93,88,89,13,95,95,142,141,98,176,16,97,97,
1915 96,90,141,167,99,167,99,99,99,92,
1916 175,175,175,175,175,175,175,179,175,175,175,175,175,175,175,175,175,175,175,
1917 175,175,175,96,
1918 174,174,174,174,174,174,174,178,174,174,174,174,174,174,174,174,174,174,174,
1919 174,174,174,97,
1920 139,139,105,105,139,139,139,91,94,93,88,89,13,98,95,142,141,98,176,16,97,97,
1921 96,90,141,167,167,167,92,
1922 168,160,
1923 170,171,88,89,169,182,277,172,173,
1924 139,139,105,194,105,139,139,139,91,94,93,88,89,13,82,83,80,101,174,86,85,95,
1925 142,141,98,176,176,16,97,97,96,90,141,176,157,175,176,99,175,99,99,99,
1926 92,87,84,
1927 306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,
1928 306,306,306,306,306,306,306,306,306,15,306,306,306,102,80,177,20,144,
1929 78,78,78,78,78,52,41,103,178,102,74,74,
1930 105,46,106,72,
1931 6,6,6,1,6,6,6,6,6,6,4,30,30,32,6,6,6,6,6,6,6,6,105,32,32,22,22,31,32,22,22,
1932 30,1,
1933 77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,106,103,73,101,
1934 105,45,106,44,
1935 10,10,37,108,10,
1936 35,1,35,4,129,12,12,128,35,35,35,35,109,128,11,128,12,128,1,
1937 34,1,34,4,129,12,12,128,34,105,34,34,34,55,110,56,128,106,11,42,107,107,128,
1938 12,128,1,
1939 1,2,122,2,2,1,
1940 105,105,112,89,16,
1941 179,1,179,2,113,2,2,179,2,1,
1942 3,1,3,3,3,3,2,3,3,3,3,3,3,3,114,2,2,100,2,1,
1943 105,105,101,102,16,
1944 114,13,116,98,180,117,180,116,115,117,
1945 114,13,92,98,94,116,115,104,
1946 182,181,118,
1947 1,183,119,183,183,183,1,
1948 1,184,120,184,184,257,184,1,
1949 1,185,121,185,185,185,1,
1950 1,186,122,186,186,186,1,
1951 1,187,123,187,187,187,254,1,
1952 1,188,124,188,188,188,1,
1953 1,189,125,189,189,189,1,
1954 4,30,30,190,41,126,191,31,251,190,190,30,190,
1955 4,30,30,190,41,127,192,31,250,190,190,30,190,
1956 1,187,128,187,187,187,249,1,
1957 1,187,129,187,187,187,248,1,
1958 1,187,130,187,187,187,247,1,
1959 1,187,131,187,187,187,246,1,
1960 1,187,132,187,187,187,245,1,
1961 1,187,133,187,187,187,244,1,
1962 1,4,30,30,194,134,194,194,193,31,194,193,193,30,1,
1963 105,105,135,242,16,
1964 109,109,109,1,109,109,196,195,136,196,196,195,196,1,
1965 105,105,137,236,16,
1966 52,235,197,
1967 4,5,5,23,139,198,231,6,5,
1968 305,140,
1969 304,141,
1970 199,199,142,199,
1971 200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
1972 200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,
1973 200,143,200,
1974 203,203,203,203,203,203,203,203,203,45,203,203,203,203,203,203,203,203,203,
1975 203,203,46,203,203,203,203,203,203,203,203,203,144,202,201,203,203,
1976 204,145,
1977 209,209,146,
1978 154,154,155,154,147,205,152,
1979 211,211,213,
1980 210,210,212,
1981 219,219,192,
1982 218,218,218,218,191,
1983 217,217,217,217,217,147,146,208,207,206,205,204,203,202,201,200,199,198,206,
1984 217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,217,
1985 217,217,217,217,217,152,217,221,197,223,217,149,148,
1986 78,78,78,78,78,78,78,52,41,153,178,102,69,69,
1987 207,208,105,72,154,273,209,62,
1988 105,155,209,64,
1989 210,105,68,209,62,
1990 105,67,209,65,
1991 211,79,158,271,
1992 1,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,159,2,2,270,2,1,
1993 154,154,155,154,160,212,152,
1994 151,151,144,
1995 149,149,149,143,
1996 1,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,163,2,2,138,2,1,
1997 1,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,164,2,2,136,2,1,
1998 213,213,1,213,213,213,213,4,30,30,32,213,213,213,165,32,32,213,213,31,32,
1999 213,213,30,1,
2000 215,214,166,137,
2001 216,88,89,167,172,173,177,
2002 217,217,217,1,217,217,217,217,217,4,30,30,32,217,217,217,217,217,168,32,32,
2003 217,217,31,32,217,217,30,1,
2004 1,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,169,2,2,9,2,1,
2005 1,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,170,2,2,276,2,1,
2006 1,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,171,2,2,275,2,1,
2007 139,139,105,105,139,139,139,91,94,93,88,89,13,172,95,142,141,98,176,16,97,
2008 97,96,90,141,218,218,218,218,92,
2009 139,139,105,105,139,139,139,91,94,93,88,89,13,173,95,142,141,98,176,16,97,
2010 97,96,90,141,219,219,219,219,92,
2011 306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,
2012 306,306,306,306,306,306,306,306,306,15,306,306,306,174,282,220,20,144,
2013 170,171,88,89,169,158,277,172,173,
2014 224,224,224,224,221,224,224,224,224,224,224,224,224,224,176,75,
2015 222,177,
2016 139,139,105,194,105,139,139,139,91,94,93,88,89,13,82,83,80,178,174,86,85,95,
2017 142,141,98,176,223,16,97,97,96,90,141,223,157,175,223,99,175,99,99,99,
2018 92,87,84,
2019 105,105,179,91,16,
2020 216,180,99,
2021 3,1,3,2,3,181,2,2,97,2,1,
2022 1,3,3,3,2,3,3,3,3,3,3,3,182,2,2,95,2,1,
2023 1,224,2,243,2,2,1,
2024 1,2,83,184,2,225,2,1,
2025 1,226,2,185,2,2,1,
2026 1,227,2,186,2,2,1,
2027 1,2,83,187,2,228,2,1,
2028 1,229,2,188,2,2,1,
2029 139,139,105,1,194,105,139,139,139,91,2,94,93,88,89,13,82,83,189,2,86,85,95,
2030 142,141,98,176,16,2,97,97,96,90,141,252,175,252,99,175,99,99,99,92,87,
2031 84,1,
2032 79,190,263,
2033 105,105,261,230,16,189,
2034 139,139,105,105,139,139,139,91,94,93,261,88,89,13,192,95,142,141,98,176,16,
2035 97,97,96,90,141,231,99,231,99,99,99,92,
2036 83,193,232,
2037 108,108,108,1,108,108,4,30,30,2,114,194,2,31,2,115,115,30,1,
2038 52,195,233,
2039 110,110,110,1,110,110,2,4,2,2,1,
2040 139,139,105,194,105,139,139,139,33,88,89,197,142,141,34,237,34,16,240,90,
2041 141,238,84,
2042 105,1,120,121,122,123,124,125,128,129,130,131,132,133,119,105,4,129,12,12,
2043 128,134,94,24,198,128,137,11,138,16,136,128,12,128,126,234,234,135,127,
2044 1,
2045 303,199,
2046 299,299,299,299,299,1,299,299,299,45,299,299,299,299,4,299,299,299,299,299,
2047 299,299,299,299,299,299,46,299,301,299,299,299,299,299,143,299,299,299,
2048 200,142,299,141,140,299,1,
2049 314,201,
2050 313,202,
2051 309,309,309,309,309,1,309,309,309,309,45,309,309,309,309,309,310,309,309,
2052 309,309,309,309,46,309,309,309,309,309,309,309,309,309,307,310,310,202,
2053 201,309,1,
2054 1,3,3,3,2,3,204,2,2,281,2,1,
2055 154,154,155,154,214,153,
2056 1,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,206,2,2,190,2,1,
2057 1,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,207,2,2,279,2,1,
2058 1,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,208,2,2,274,2,1,
2059 77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,209,63,153,101,
2060 1,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,210,2,2,278,2,1,
2061 1,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,211,2,2,272,2,1,
2062 154,154,155,154,147,153,
2063 139,139,139,139,139,91,234,88,89,213,142,141,181,181,181,90,141,181,
2064 235,235,235,235,235,235,235,147,146,208,207,206,205,204,203,202,201,200,199,
2065 198,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,
2066 235,235,235,235,235,235,235,235,214,235,235,235,235,235,149,148,
2067 1,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,215,2,2,20,2,1,
2068 1,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,216,2,2,19,2,1,
2069 139,139,105,105,139,139,139,91,94,93,88,89,13,217,95,142,141,98,176,16,97,
2070 97,96,90,141,165,165,165,92,
2071 168,163,
2072 168,161,
2073 236,220,
2074 237,1,237,4,30,30,32,221,32,32,237,237,31,32,237,237,30,1,
2075 1,3,3,3,3,3,3,3,2,3,3,3,3,222,2,2,81,2,1,
2076 224,224,224,224,221,224,224,224,224,224,224,224,224,224,223,76,
2077 1,238,224,238,238,238,1,
2078 105,105,33,225,34,57,239,239,34,16,
2079 1,240,226,240,240,240,1,
2080 1,187,227,187,187,187,255,1,
2081 139,139,105,194,105,139,139,139,91,94,93,88,89,13,82,83,228,86,85,95,142,
2082 141,98,176,16,97,97,96,90,141,267,175,267,99,175,99,99,99,92,87,84,241,
2083 1,2,242,229,2,2,242,2,1,
2084 52,185,243,
2085 88,89,265,172,173,
2086 105,105,232,230,16,188,
2087 194,233,239,84,
2088 244,244,244,244,244,244,244,147,146,208,207,206,205,204,203,202,201,200,199,
2089 198,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,
2090 244,244,244,244,244,244,244,244,234,244,244,244,244,244,149,148,
2091 215,235,180,
2092 1,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,236,2,2,283,2,1,
2093 226,226,237,225,245,
2094 1,2,83,238,2,246,2,1,
2095 4,30,30,190,41,239,247,31,58,190,190,30,190,
2096 258,1,258,2,240,2,2,248,1,
2097 4,30,30,190,41,241,249,31,266,190,190,30,190,
2098 15,242,253,20,
2099 139,139,139,139,139,91,234,88,89,243,142,141,186,186,187,90,141,
2100 215,244,137,
2101 227,227,227,1,3,3,3,3,227,227,3,3,3,2,3,3,3,3,3,3,245,2,2,228,2,1,
2102 139,139,105,105,139,139,139,91,94,93,88,89,13,246,95,142,141,98,176,16,97,
2103 97,96,90,141,250,99,250,99,99,99,92,
2104 105,105,33,261,34,57,60,34,16,
2105 259,259,259,1,259,259,251,248,251,251,251,1,
2106 139,139,105,194,105,139,139,139,91,94,93,261,88,89,13,82,83,249,86,85,95,
2107 142,141,98,176,16,97,97,96,90,141,268,175,268,99,175,99,99,99,92,87,84,
2108 88,89,264,172,173,
2109 258,1,258,2,251,2,2,252,1,
2110 259,259,259,259,259,256,
2111
2112 };
2113
2114
2115 static const unsigned short ag_sbt[] = {
2116 0, 18, 59, 65, 79, 119, 121, 125, 160, 181, 216, 218, 222, 224,
2117 255, 263, 305, 346, 353, 356, 386, 429, 433, 437, 444, 451, 458, 465,
2118 487, 489, 491, 493, 498, 547, 553, 569, 571, 573, 613, 624, 626, 629,
2119 664, 670, 696, 699, 737, 775, 777, 779, 783, 823, 826, 877, 920, 934,
2120 965, 996,1015,1034,1053,1079,1088,1097,1104,1114,1120,1130,1141,1149,
2121 1160,1178,1208,1230,1268,1303,1341,1376,1378,1422,1444,1492,1529,1562,
2122 1597,1654,1676,1704,1706,1735,1764,1774,1806,1808,1861,1890,1922,1945,
2123 1968,1997,1999,2008,2053,2090,2102,2106,2139,2160,2164,2169,2188,2214,
2124 2220,2225,2235,2255,2260,2270,2278,2281,2288,2296,2303,2310,2318,2325,
2125 2332,2345,2358,2366,2374,2382,2390,2398,2406,2421,2426,2440,2445,2448,
2126 2457,2459,2461,2465,2505,2541,2543,2546,2553,2556,2559,2562,2567,2617,
2127 2631,2639,2643,2648,2652,2656,2678,2685,2688,2692,2722,2752,2777,2781,
2128 2788,2817,2839,2861,2883,2913,2943,2980,2989,3005,3007,3052,3057,3060,
2129 3071,3089,3096,3104,3111,3118,3126,3133,3179,3182,3188,3221,3224,3243,
2130 3246,3257,3280,3320,3322,3367,3369,3371,3411,3423,3429,3452,3474,3496,
2131 3517,3539,3561,3567,3585,3638,3668,3698,3727,3729,3731,3733,3751,3770,
2132 3786,3793,3803,3810,3818,3860,3869,3872,3877,3883,3887,3940,3943,3965,
2133 3970,3978,3991,4000,4013,4017,4034,4037,4063,4095,4104,4116,4158,4163,
2134 4172,4178
2135 };
2136
2137
2138 static const unsigned short ag_sbe[] = {
2139 11, 56, 61, 74, 116, 120, 123, 153, 166, 215, 217, 220, 223, 244,
2140 258, 300, 340, 348, 354, 379, 421, 431, 434, 440, 447, 454, 461, 471,
2141 488, 490, 492, 495, 539, 551, 565, 570, 572, 610, 620, 625, 627, 653,
2142 666, 691, 697, 733, 771, 776, 778, 781, 821, 824, 866, 894, 928, 959,
2143 988,1008,1027,1046,1067,1083,1092,1099,1108,1118,1122,1135,1144,1159,
2144 1167,1196,1224,1266,1301,1339,1374,1377,1415,1438,1481,1524,1551,1586,
2145 1642,1671,1694,1705,1724,1753,1769,1805,1807,1853,1879,1903,1944,1967,
2146 1981,1998,2004,2025,2085,2097,2103,2128,2156,2161,2167,2181,2202,2216,
2147 2222,2229,2249,2257,2262,2272,2280,2283,2290,2298,2305,2312,2320,2327,
2148 2337,2350,2360,2368,2376,2384,2392,2400,2411,2423,2434,2442,2446,2452,
2149 2458,2460,2463,2503,2536,2542,2545,2550,2555,2558,2561,2566,2609,2626,
2150 2635,2640,2645,2649,2654,2672,2682,2687,2691,2716,2746,2766,2779,2784,
2151 2806,2833,2855,2877,2896,2926,2975,2985,3003,3006,3024,3054,3058,3065,
2152 3083,3092,3099,3107,3114,3121,3129,3151,3180,3184,3202,3222,3235,3244,
2153 3253,3268,3304,3321,3360,3368,3370,3404,3417,3427,3446,3468,3490,3513,
2154 3533,3555,3565,3576,3630,3662,3692,3711,3728,3730,3732,3740,3764,3784,
2155 3788,3796,3805,3812,3834,3863,3870,3874,3879,3884,3932,3941,3959,3967,
2156 3973,3983,3995,4005,4014,4026,4035,4057,4076,4098,4111,4133,4160,4167,
2157 4177,4178
2158 };
2159
2160
2161 static const unsigned char ag_fl[] = {
2162 1,1,2,0,1,2,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,1,0,1,0,2,4,2,2,2,2,3,
2163 3,0,1,2,2,1,2,3,1,2,3,2,1,1,1,1,2,1,3,1,3,4,1,4,1,3,1,2,2,2,2,1,1,1,2,
2164 1,1,2,2,2,3,4,0,0,1,2,4,1,2,0,1,3,1,0,4,0,5,1,1,2,4,2,4,1,3,2,1,2,1,2,
2165 1,2,3,3,2,3,2,1,1,1,2,1,2,1,0,1,2,3,1,2,3,3,2,2,2,1,2,0,1,2,1,3,3,3,0,
2166 1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,1,1,1,1,1,1,3,1,3,1,4,1,2,1,1,1,1,1,1,1,
2167 1,1,3,1,1,5,4,3,3,3,1,3,3,4,3,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
2168 2,2,1,1,2,1,1,2,2,2,1,2,1,2,0,3,1,2,2,3,0,2,3,1,3,1,2,3,3,4,3,1,2,2,2,
2169 2,2,2,2,2,2,2,3,5,2,4,7,2,1,2,0,1,1,2,6,3,4,1,3,1,3,3,4,3,4,3,3,2,4,4,
2170 2,4,2,4,3,2,1,2,0,1,2,0,2,1,1,3,2,2,0,2,1,3,1,3,2,2,0,2,1,2,2,1,1,2,2,
2171 2,1,2,2,1,1,2,1,2,0,1,2,1,1,2,1,2,0,1,2,1
2172 };
2173
2174 static const unsigned char ag_ptt[] = {
2175 0, 4, 4, 5, 5, 1, 9, 9, 6, 10, 12, 14, 16, 18, 20, 22, 24, 26,
2176 28, 30, 32, 34, 36, 40, 40, 43, 43, 44, 44, 38, 41, 41, 41, 41, 41, 41,
2177 52, 52, 42, 42, 46, 46, 46, 56, 56, 46, 54, 50, 50, 50, 53, 53, 58, 58,
2178 60, 60, 59, 64, 65, 66, 66, 68, 68, 70, 71, 71, 72, 74, 74, 69, 57, 57,
2179 57, 55, 77, 75, 75, 78, 76, 76, 73, 73, 63, 63, 85, 85, 63, 83, 88, 83,
2180 89, 83, 86, 86, 86, 84, 92, 92, 95, 91, 96, 98, 98, 90, 90, 99, 99, 99,
2181 102,102,102, 61, 3, 3, 8, 8, 8,106,106,109,109,107,107,111,111,111,
2182 39, 39, 39, 39,115,115,116,116, 51,117,117,121,118,125,125,123,123,124,
2183 124,130,130,124,126,126,127,127,131,131,136,136, 79, 79,138,138,140,140,
2184 140,143,142,142,144,144,122,122,122,122,122,146,146,146,146,146,153,153,
2185 152,152, 47, 47, 47,156,156,156,157,157,158,160,160,160,159,165,165,165,
2186 148,148,148,148,148,148,148,148,148,148,148,178,180,150,149,149,151,162,
2187 162,162,162,162,163,163,164,164, 80, 80,186,186,185, 49,189,189,187,188,
2188 188,190,190,190,190,190,190,190,190,192,191,191,191,191,191,191,191,191,
2189 191,191,191,191,191,191,210,210,212,212,212, 67,201,201,195,213,213,141,
2190 141,141,141,141,141,141,141,141,141,141,155,155,139,139, 48,222,223,223,
2191 224,224,220,221,221,225,225,225,225,225,226,226,230,230,230,230,230,230,
2192 232, 81,233,233,233,234,234,234,234,105,237,237,105,243,243,243,244,244,
2193 245,245,229,246,246,246,247,247,248,248,228,242
2194 };
2195
2196 static const unsigned char *ag_valid(int ag_k) {
2197 const unsigned char *ag_tp = &ag_tstt[ag_sbt[(PCB).sn+1]];
2198 while (*--ag_tp != (unsigned char) ag_k) if (*ag_tp == 0) return NULL;
2199 return ag_tp;
2200 }
2201
2202 int pgg_change_reduction(pgg_token_type ag_k) {
2203 if (!ag_valid(ag_k)) return 0;
2204 (PCB).reduction_token = ag_k;
2205 return 1;
2206 }
2207
2208 static void ag_default(const int *ag_tp) {
2209 (PCB).ag_dsn = (PCB).sn;
2210 (PCB).ag_dtl = ag_tp;
2211 while (!ag_valid((pgg_token_type) *ag_tp)) ag_tp++;
2212 (PCB).reduction_token = (pgg_token_type) *ag_tp;
2213 }
2214
2215
2216
2217 static void ag_ra(void)
2218 {
2219 switch(ag_rpx[(PCB).ag_ap]) {
2220 case 1: ag_rp_1(V(0,(int *))); break;
2221 case 2: ag_rp_2(); break;
2222 case 3: ag_rp_1(V(1,(int *))); break;
2223 case 4: V(0,(int *)) = ag_rp_5(V(0,(int *))); break;
2224 case 5: V(0,(int *)) = ag_rp_6(V(0,(int *))); break;
2225 case 6: V(0,(int *)) = ag_rp_7(); break;
2226 case 7: V(0,(int *)) = ag_rp_8(V(0,(int *))); break;
2227 case 8: ag_rp_9(V(0,(int *))); break;
2228 case 9: ag_rp_10(V(2,(int *))); break;
2229 case 10: V(0,(int *)) = ag_rp_11(); break;
2230 case 11: V(0,(int *)) = ag_rp_12(); break;
2231 case 12: V(0,(int *)) = ag_rp_13(); break;
2232 case 13: ag_rp_14(); break;
2233 case 14: ag_rp_15(V(0,(int *))); break;
2234 case 15: ag_rp_16(V(1,(int *))); break;
2235 case 16: ag_rp_17(V(0,(int *))); break;
2236 case 17: V(0,(int *)) = ag_rp_18(V(1,(int *))); break;
2237 case 18: ag_rp_19(V(0,(int *))); break;
2238 case 19: ag_rp_20(V(0,(int *))); break;
2239 case 20: ag_rp_21(V(1,(int *))); break;
2240 case 21: V(0,(int *)) = ag_rp_22(V(1,(int *))); break;
2241 case 22: ag_rp_23(V(1,(int *)), V(2,(int *))); break;
2242 case 23: ag_rp_24(V(2,(int *)), V(3,(int *))); break;
2243 case 24: ag_rp_25(); break;
2244 case 25: V(0,(int *)) = ag_rp_26(); break;
2245 case 26: V(0,(int *)) = ag_rp_27(); break;
2246 case 27: V(0,(int *)) = ag_rp_28(); break;
2247 case 28: ag_rp_29(); break;
2248 case 29: ag_rp_30(); break;
2249 case 30: ag_rp_31(); break;
2250 case 31: ag_rp_32(); break;
2251 case 32: ag_rp_33(); break;
2252 case 33: ag_rp_34(); break;
2253 case 34: ag_rp_35(); break;
2254 case 35: ag_rp_36(); break;
2255 case 36: ag_rp_37(); break;
2256 case 37: ag_rp_38(); break;
2257 case 38: ag_rp_39(); break;
2258 case 39: ag_rp_40(); break;
2259 case 40: ag_rp_41(); break;
2260 case 41: ag_rp_42(); break;
2261 case 42: ag_rp_43(V(0,(int *))); break;
2262 case 43: ag_rp_44(V(1,(int *))); break;
2263 case 44: ag_rp_45(V(2,(int *))); break;
2264 case 45: ag_rp_46(V(2,(int *))); break;
2265 case 46: ag_rp_47(V(1,(int *))); break;
2266 case 47: ag_rp_48(V(2,(int *))); break;
2267 case 48: V(0,(int *)) = ag_rp_49(V(1,(int *))); break;
2268 case 49: V(0,(int *)) = ag_rp_50(V(1,(int *))); break;
2269 case 50: V(0,(int *)) = ag_rp_51(V(0,(int *)), V(1,(int *))); break;
2270 case 51: V(0,(int *)) = ag_rp_52(); break;
2271 case 52: V(0,(int *)) = ag_rp_53(); break;
2272 case 53: V(0,(int *)) = ag_rp_54(V(0,(int *))); break;
2273 case 54: V(0,(int *)) = ag_rp_55(V(1,(int *))); break;
2274 case 55: V(0,(int *)) = ag_rp_56(V(0,(int *))); break;
2275 case 56: V(0,(int *)) = ag_rp_57(V(0,(int *)), V(1,(int *))); break;
2276 case 57: V(0,(int *)) = ag_rp_58(); break;
2277 case 58: V(0,(int *)) = ag_rp_59(V(0,(int *)), V(1,(int *))); break;
2278 case 59: V(0,(int *)) = ag_rp_60(V(0,(int *))); break;
2279 case 60: V(0,(int *)) = ag_rp_61(V(0,(int *)), V(1,(int *))); break;
2280 case 61: V(0,(int *)) = ag_rp_62(V(0,(int *))); break;
2281 case 62: V(0,(int *)) = ag_rp_63(V(0,(int *))); break;
2282 case 63: V(0,(int *)) = ag_rp_64(V(0,(int *))); break;
2283 case 64: V(0,(int *)) = ag_rp_65(V(0,(CharSetExpression * *))); break;
2284 case 65: V(0,(CharSetExpression * *)) = ag_rp_66(V(0,(CharSetExpression * *)), V(2,(CharSetExpression * *))); break;
2285 case 66: V(0,(CharSetExpression * *)) = ag_rp_67(V(0,(CharSetExpression * *)), V(2,(CharSetExpression * *))); break;
2286 case 67: V(0,(CharSetExpression * *)) = ag_rp_68(V(0,(CharSetExpression * *)), V(3,(CharSetExpression * *))); break;
2287 case 68: V(0,(CharSetExpression * *)) = ag_rp_69(V(1,(CharSetExpression * *))); break;
2288 case 69: V(0,(CharSetExpression * *)) = ag_rp_70(V(0,(int *))); break;
2289 case 70: V(0,(CharSetExpression * *)) = ag_rp_71(V(0,(int *))); break;
2290 case 71: V(0,(CharSetExpression * *)) = ag_rp_72(); break;
2291 case 72: V(0,(CharSetExpression * *)) = ag_rp_73(V(1,(CharSetExpression * *))); break;
2292 case 73: V(0,(CharSetExpression * *)) = ag_rp_74(V(1,(int *)), V(3,(int *))); break;
2293 case 74: V(0,(CharSetExpression * *)) = ag_rp_75(V(0,(int *)), V(3,(int *))); break;
2294 case 75: ag_rp_76(V(2,(CharSetExpression * *))); break;
2295 case 76: ag_rp_77(V(2,(int *))); break;
2296 case 77: ag_rp_78(V(2,(int *))); break;
2297 case 78: ag_rp_79(); break;
2298 case 79: ag_rp_80(V(2,(int *))); break;
2299 case 80: ag_rp_81(V(2,(int *))); break;
2300 case 81: ag_rp_82(); break;
2301 case 82: V(0,(int *)) = ag_rp_83(V(0,(int *))); break;
2302 case 83: V(0,(int *)) = ag_rp_84(); break;
2303 case 84: V(0,(int *)) = ag_rp_85(); break;
2304 case 85: V(0,(int *)) = ag_rp_86(); break;
2305 case 86: V(0,(int *)) = ag_rp_87(); break;
2306 case 87: V(0,(int *)) = ag_rp_88(); break;
2307 case 88: V(0,(int *)) = ag_rp_89(); break;
2308 case 89: V(0,(int *)) = ag_rp_90(); break;
2309 case 90: V(0,(int *)) = ag_rp_91(); break;
2310 case 91: V(0,(int *)) = ag_rp_92(); break;
2311 case 92: V(0,(int *)) = ag_rp_93(); break;
2312 case 93: V(0,(int *)) = ag_rp_94(); break;
2313 case 94: V(0,(int *)) = ag_rp_95(V(1,(int *))); break;
2314 case 95: V(0,(int *)) = ag_rp_96(V(0,(int *)), V(1,(int *))); break;
2315 case 96: V(0,(int *)) = ag_rp_97(V(0,(int *)), V(1,(int *))); break;
2316 case 97: V(0,(int *)) = ag_rp_98(V(1,(int *))); break;
2317 case 98: ag_rp_99(V(0,(int *))); break;
2318 case 99: ag_rp_100(V(0,(int *))); break;
2319 case 100: ag_rp_101(V(1,(int *))); break;
2320 case 101: ag_rp_102(V(1,(int *))); break;
2321 case 102: ag_rp_103(V(1,(int *))); break;
2322 case 103: ag_rp_104(V(0,(int *))); break;
2323 case 104: ag_rp_105(V(1,(int *))); break;
2324 case 105: ag_rp_106(V(0,(int *))); break;
2325 case 106: ag_rp_107(V(1,(int *))); break;
2326 case 107: V(0,(int *)) = ag_rp_108(); break;
2327 case 108: V(0,(int *)) = ag_rp_109(); break;
2328 case 109: ag_rp_110(V(0,(int *))); break;
2329 case 110: ag_rp_111(V(1,(int *))); break;
2330 case 111: ag_rp_112(); break;
2331 case 112: ag_rp_113(); break;
2332 case 113: ag_rp_114(); break;
2333 case 114: ag_rp_115(); break;
2334 case 115: ag_rp_116(); break;
2335 case 116: ag_rp_117(V(2,(int *))); break;
2336 case 117: ag_rp_118(); break;
2337 case 118: ag_rp_119(); break;
2338 case 119: ag_rp_120(); break;
2339 case 120: ag_rp_121(); break;
2340 case 121: ag_rp_122(); break;
2341 case 122: ag_rp_123(); break;
2342 case 123: ag_rp_124(); break;
2343 case 124: ag_rp_125(); break;
2344 case 125: ag_rp_126(V(2,(int *))); break;
2345 case 126: ag_rp_127(); break;
2346 case 127: ag_rp_128(); break;
2347 case 128: ag_rp_129(); break;
2348 case 129: ag_rp_130(V(4,(int *)), V(6,(int *))); break;
2349 case 130: V(0,(int *)) = ag_rp_131(); break;
2350 case 131: ag_rp_132(V(5,(CharSetExpression * *))); break;
2351 case 132: ag_rp_133(V(2,(CharSetExpression * *))); break;
2352 case 133: ag_rp_134(V(0,(int *))); break;
2353 case 134: ag_rp_135(V(2,(int *))); break;
2354 case 135: V(0,(int *)) = ag_rp_136(); break;
2355 case 136: V(0,(int *)) = ag_rp_137(); break;
2356 case 137: V(0,(int *)) = ag_rp_138(); break;
2357 case 138: V(0,(int *)) = ag_rp_139(); break;
2358 case 139: V(0,(int *)) = ag_rp_140(); break;
2359 case 140: V(0,(int *)) = ag_rp_141(); break;
2360 case 141: V(0,(int *)) = ag_rp_142(V(0,(CharSetExpression * *))); break;
2361 case 142: V(0,(int *)) = ag_rp_143(V(0,(CharSetExpression * *))); break;
2362 case 143: V(0,(int *)) = ag_rp_144(V(0,(CharSetExpression * *))); break;
2363 case 144: V(0,(int *)) = ag_rp_145(); break;
2364 case 145: V(0,(int *)) = ag_rp_146(); break;
2365 case 146: V(0,(int *)) = ag_rp_147(); break;
2366 case 147: V(0,(int *)) = ag_rp_148(); break;
2367 case 148: V(0,(int *)) = ag_rp_149(); break;
2368 case 149: V(0,(int *)) = ag_rp_150(); break;
2369 case 150: ag_rp_151(V(1,(unsigned char * *))); break;
2370 case 151: ag_rp_152(); break;
2371 case 152: V(0,(unsigned char * *)) = ag_rp_153(); break;
2372 case 153: V(0,(unsigned char * *)) = ag_rp_154(); break;
2373 case 154: ag_rp_155(); break;
2374 case 155: ag_rp_156(); break;
2375 case 156: ag_default(&ag_rtt[0]); ag_rp_157(); break;
2376 }
2377 (PCB).la_ptr = (PCB).pointer;
2378 }
2379
2380
2381 static const unsigned char ag_ctn[] = {
2382 0,0,105,1, 0,0, 0,0, 51,1, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0,
2383 0,0, 0,0, 59,1,220,1, 61,1, 53,1, 58,1, 49,1, 48,1, 0,0, 46,1, 41,1,
2384 41,1, 41,1, 41,1, 0,0, 0,0, 0,0, 0,0,106,1, 0,0, 83,1, 0,0, 59,2,
2385 0,0, 0,0, 0,0, 0,0, 58,1, 0,0, 58,2,187,1, 49,2,229,1,228,1,225,1,
2386 225,1,225,1, 0,0, 48,2, 0,0, 47,2, 0,0, 54,1, 54,1, 0,0, 0,0, 0,0,
2387 0,0, 42,1, 46,1, 0,0, 83,2, 83,2, 0,0, 92,1, 0,0, 0,0, 59,3,187,2,
2388 0,0, 0,0, 0,0, 0,0, 0,0,225,2, 0,0, 0,0, 0,0,155,1,141,1, 0,0,
2389 158,1,141,1,141,1,141,1, 0,0, 0,0,118,1,117,1,146,1,146,1, 0,0,146,1,
2390 0,0, 0,0,144,1,142,1,140,1, 75,1, 73,1, 0,0, 0,0, 0,0, 0,0, 0,0,
2391 0,0, 0,0, 0,0, 0,0, 83,3, 83,3, 0,0, 0,0, 0,0, 0,0, 0,0,190,1,
2392 191,1,191,1,191,1,191,1,191,1,191,1,191,1,191,1,191,1,191,1,191,1,191,1,
2393 191,1,191,1,190,1,190,1,190,1,190,1,190,1, 0,0, 0,0, 0,0, 0,0, 0,0,
2394 81,1,155,2,149,1,151,1, 0,0,149,1,160,1,160,1,160,1, 69,1, 0,0, 74,1,
2395 74,1, 74,1,141,2,141,2, 0,0,127,1,126,1,118,2,117,2,146,2,146,2,143,1,
2396 142,2, 0,0,141,2,141,2,143,2,143,2,139,1,141,1, 75,2, 73,2, 75,2, 83,4,
2397 0,0, 92,3, 0,0, 0,0, 65,1, 0,0, 0,0,195,1, 0,0, 0,0, 0,0,157,2,
2398 191,2,157,2, 0,0,190,2, 0,0,190,2, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0,
2399 155,3,131,1,158,3,141,3,141,3, 0,0,141,3,141,3,131,1,146,3,146,3, 0,0,
2400 0,0,142,3,142,1,142,1,139,2, 80,1, 73,3, 75,3,191,3, 65,2,191,3,191,3,
2401 195,2,191,3,156,1,143,1,157,3,190,3,121,1,146,4,139,3, 80,2, 0,0, 66,1,
2402 0,0,213,1,191,4,156,2,121,2, 0,0,191,5, 66,2,210,1,213,2,143,1, 0,0,
2403 210,1
2404 };
2405
2406 #ifndef MISSING_FORMAT
2407 #define MISSING_FORMAT "Missing %s"
2408 #endif
2409 #ifndef UNEXPECTED_FORMAT
2410 #define UNEXPECTED_FORMAT "Unexpected %s"
2411 #endif
2412 #ifndef UNNAMED_TOKEN
2413 #define UNNAMED_TOKEN "input"
2414 #endif
2415
2416
2417 static void ag_diagnose(void) {
2418 int ag_snd = (PCB).sn;
2419 int ag_k = ag_sbt[ag_snd];
2420
2421 if (*TOKEN_NAMES[ag_tstt[ag_k]] && ag_astt[ag_k + 1] == ag_action_8) {
2422 sprintf((PCB).ag_msg, MISSING_FORMAT, TOKEN_NAMES[ag_tstt[ag_k]]);
2423 }
2424 else if (ag_astt[ag_sbe[(PCB).sn]] == ag_action_8
2425 && (ag_k = (int) ag_sbe[(PCB).sn] + 1) == (int) ag_sbt[(PCB).sn+1] - 1
2426 && *TOKEN_NAMES[ag_tstt[ag_k]]) {
2427 sprintf((PCB).ag_msg, MISSING_FORMAT, TOKEN_NAMES[ag_tstt[ag_k]]);
2428 }
2429 else if ((PCB).token_number && *TOKEN_NAMES[(PCB).token_number]) {
2430 sprintf((PCB).ag_msg, UNEXPECTED_FORMAT, TOKEN_NAMES[(PCB).token_number]);
2431 }
2432 else if (isprint(INPUT_CODE((*(PCB).pointer))) && INPUT_CODE((*(PCB).pointer)) != '\\') {
2433 char buf[20];
2434 sprintf(buf, "\'%c\'", (char) INPUT_CODE((*(PCB).pointer)));
2435 sprintf((PCB).ag_msg, UNEXPECTED_FORMAT, buf);
2436 }
2437 else sprintf((PCB).ag_msg, UNEXPECTED_FORMAT, UNNAMED_TOKEN);
2438 (PCB).error_message = (PCB).ag_msg;
2439
2440
2441 {
2442 int ag_sx, ag_t;
2443
2444 ag_sx = (PCB).ssx;
2445 (PCB).ss[ag_sx] = (PCB).sn;
2446 do {
2447 while (ag_sx && ag_ctn[2*(ag_snd = (PCB).ss[ag_sx])] == 0) ag_sx--;
2448 if (ag_sx) {
2449 ag_t = ag_ctn[2*ag_snd];
2450 ag_sx -= ag_ctn[2*ag_snd +1];
2451 ag_snd = (PCB).ss[ag_sx];
2452 }
2453 else {
2454 ag_snd = 0;
2455 ag_t = ag_ptt[0];
2456 }
2457 } while (ag_sx && *TOKEN_NAMES[ag_t]==0);
2458 if (*TOKEN_NAMES[ag_t] == 0) ag_t = 0;
2459 (PCB).error_frame_ssx = ag_sx;
2460 (PCB).error_frame_token = (pgg_token_type) ag_t;
2461 }
2462
2463
2464 }
2465 static int ag_action_1_r_proc(void);
2466 static int ag_action_2_r_proc(void);
2467 static int ag_action_3_r_proc(void);
2468 static int ag_action_4_r_proc(void);
2469 static int ag_action_1_s_proc(void);
2470 static int ag_action_3_s_proc(void);
2471 static int ag_action_1_proc(void);
2472 static int ag_action_2_proc(void);
2473 static int ag_action_3_proc(void);
2474 static int ag_action_4_proc(void);
2475 static int ag_action_5_proc(void);
2476 static int ag_action_6_proc(void);
2477 static int ag_action_7_proc(void);
2478 static int ag_action_8_proc(void);
2479 static int ag_action_9_proc(void);
2480 static int ag_action_10_proc(void);
2481 static int ag_action_11_proc(void);
2482 static int ag_action_8_proc(void);
2483
2484
2485 static int (*const ag_r_procs_scan[])(void) = {
2486 ag_action_1_r_proc,
2487 ag_action_2_r_proc,
2488 ag_action_3_r_proc,
2489 ag_action_4_r_proc
2490 };
2491
2492 static int (*const ag_s_procs_scan[])(void) = {
2493 ag_action_1_s_proc,
2494 ag_action_2_r_proc,
2495 ag_action_3_s_proc,
2496 ag_action_4_r_proc
2497 };
2498
2499 static int (*const ag_gt_procs_scan[])(void) = {
2500 ag_action_1_proc,
2501 ag_action_2_proc,
2502 ag_action_3_proc,
2503 ag_action_4_proc,
2504 ag_action_5_proc,
2505 ag_action_6_proc,
2506 ag_action_7_proc,
2507 ag_action_8_proc,
2508 ag_action_9_proc,
2509 ag_action_10_proc,
2510 ag_action_11_proc,
2511 ag_action_8_proc
2512 };
2513
2514
2515 static int ag_rns(int ag_t, int *ag_sx, int ag_snd) {
2516 while (1) {
2517 int ag_act, ag_k = ag_sbt[ag_snd], ag_lim = ag_sbt[ag_snd+1];
2518 int ag_p;
2519
2520 while (ag_k < ag_lim && ag_tstt[ag_k] != ag_t) ag_k++;
2521 if (ag_k == ag_lim) break;
2522 ag_act = ag_astt[ag_k];
2523 ag_p = ag_pstt[ag_k];
2524 if (ag_act == ag_action_2) return ag_p;
2525 if (ag_act == ag_action_10 || ag_act == ag_action_11) {
2526 (*ag_sx)--;
2527 return ag_snd;
2528 }
2529 if (ag_act != ag_action_3 &&
2530 ag_act != ag_action_4) break;
2531 *ag_sx -= (ag_fl[ag_p] - 1);
2532 ag_snd = (PCB).ss[*ag_sx];
2533 ag_t = ag_ptt[ag_p];
2534 }
2535 return 0;
2536 }
2537
2538 static int ag_jns(int ag_t) {
2539 int ag_k;
2540
2541 ag_k = ag_sbt[(PCB).sn];
2542 while (ag_tstt[ag_k] != ag_t && ag_tstt[ag_k]) ag_k++;
2543 while (1) {
2544 int ag_p = ag_pstt[ag_k];
2545 int ag_sd;
2546
2547 switch (ag_astt[ag_k]) {
2548 case ag_action_2:
2549 GET_CONTEXT;
2550 (PCB).ss[(PCB).ssx] = (PCB).sn;
2551 return ag_p;
2552 case ag_action_10:
2553 case ag_action_11:
2554 return (PCB).ss[(PCB).ssx--];
2555 case ag_action_9:
2556 GET_CONTEXT;
2557 (PCB).ss[(PCB).ssx] = (PCB).sn;
2558 (PCB).ssx++;
2559 (PCB).sn = ag_p;
2560 ag_k = ag_sbt[(PCB).sn];
2561 while (ag_tstt[ag_k] != ag_t && ag_tstt[ag_k]) ag_k++;
2562 continue;
2563 case ag_action_3:
2564 case ag_action_4:
2565 ag_sd = ag_fl[ag_p] - 1;
2566 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
2567 else GET_CONTEXT;
2568 (PCB).ss[(PCB).ssx] = (PCB).sn;
2569 ag_t = ag_ptt[ag_p];
2570 ag_k = ag_sbt[(PCB).sn+1];
2571 while (ag_tstt[--ag_k] != ag_t);
2572 continue;
2573 case ag_action_5:
2574 case ag_action_6:
2575 if (ag_fl[ag_p]) break;
2576 (PCB).sn = ag_rns(ag_ptt[ag_p],&(PCB).ssx, (PCB).sn);
2577 (PCB).ss[++(PCB).ssx] = (PCB).sn;
2578 ag_k = ag_sbt[(PCB).sn];
2579 while (ag_tstt[ag_k] != ag_t && ag_tstt[ag_k]) ag_k++;
2580 continue;
2581 }
2582 break;
2583 }
2584 return 0;
2585 }
2586
2587
2588 static int ag_atx(int ag_t, int *ag_sx, int ag_snd) {
2589 int ag_k, ag_f;
2590 int ag_save_btsx = (PCB).btsx;
2591 int ag_flag = 1;
2592
2593 while (1) {
2594 int ag_a;
2595
2596 (PCB).bts[128 - ++(PCB).btsx] = *ag_sx;
2597 (PCB).ss[128 - (PCB).btsx] = (PCB).ss[*ag_sx];
2598 (PCB).ss[*ag_sx] = ag_snd;
2599 ag_k = ag_sbt[ag_snd];
2600 while (ag_tstt[ag_k] != ag_t && ag_tstt[ag_k]) ag_k++;
2601 ag_a = ag_astt[ag_k];
2602 if (ag_a == ag_action_2 ||
2603 ag_a == ag_action_3 ||
2604 ag_a == ag_action_10 ||
2605 ag_a == ag_action_11 ||
2606 ag_a == ag_action_1 ||
2607 ag_a == ag_action_4) break;
2608 if ((ag_a == ag_action_5 ||
2609 ag_a == ag_action_6) &&
2610 (ag_k = ag_fl[ag_f = ag_pstt[ag_k]]) == 0) {
2611 ag_snd = ag_rns(ag_ptt[ag_f],ag_sx, (PCB).ss[*ag_sx]);
2612 (*ag_sx)++;
2613 continue;
2614 }
2615 if (ag_a == ag_action_9) {
2616 ag_snd = ag_pstt[ag_k];
2617 (*ag_sx)++;
2618 continue;
2619 }
2620 ag_flag = 0;
2621 break;
2622 }
2623 while ((PCB).btsx > ag_save_btsx) {
2624 *ag_sx = (PCB).bts[128 - (PCB).btsx];
2625 (PCB).ss[*ag_sx] = (PCB).ss[128 - (PCB).btsx--];
2626 }
2627 return ag_flag;
2628 }
2629
2630
2631 static int ag_tst_tkn(void) {
2632 int ag_rk, ag_sx, ag_snd = (PCB).sn;
2633
2634 (PCB).token_number = (pgg_token_type) AG_TCV(INPUT_CODE(*(PCB).la_ptr));
2635 (PCB).la_ptr++;
2636 if (ag_key_index[(PCB).sn]) {
2637 unsigned ag_k = ag_key_index[(PCB).sn];
2638 int ag_ch = CONVERT_CASE(INPUT_CODE(*(PCB).pointer));
2639 if (ag_ch <= 255) {
2640 while (ag_key_ch[ag_k] < ag_ch) ag_k++;
2641 if (ag_key_ch[ag_k] == ag_ch) ag_get_key_word(ag_k);
2642 }
2643 }
2644 for (ag_rk = 0; ag_rk < (PCB).ag_lrss; ag_rk += 2) {
2645 ag_sx = (PCB).ag_rss[ag_rk];
2646 if (ag_sx > (PCB).ssx || ag_sx > (PCB).ag_min_depth) continue;
2647 (PCB).sn = (PCB).ag_rss[ag_rk + 1];
2648 if (ag_atx((PCB).token_number, &ag_sx, (PCB).sn)) break;
2649 }
2650 (PCB).sn = ag_snd;
2651 return ag_rk;
2652 }
2653
2654 static void ag_set_error_procs(void);
2655
2656 static void ag_auto_resynch(void) {
2657 int ag_sx, ag_rk;
2658 int ag_rk1, ag_rk2, ag_tk1;
2659 (PCB).ss[(PCB).ssx] = (PCB).sn;
2660 if ((PCB).ag_error_depth && (PCB).ag_min_depth >= (PCB).ag_error_depth) {
2661 (PCB).ssx = (PCB).ag_error_depth;
2662 (PCB).sn = (PCB).ss[(PCB).ssx];
2663 }
2664 else {
2665 ag_diagnose();
2666 SYNTAX_ERROR;
2667 if ((PCB).exit_flag != AG_RUNNING_CODE) return;
2668 (PCB).ag_error_depth = (PCB).ag_min_depth = 0;
2669 (PCB).ag_lrss = 0;
2670 (PCB).ss[ag_sx = (PCB).ssx] = (PCB).sn;
2671 (PCB).ag_min_depth = (PCB).ag_rss[(PCB).ag_lrss++] = ag_sx;
2672 (PCB).ag_rss[(PCB).ag_lrss++] = (PCB).sn;
2673 while (ag_sx && (PCB).ag_lrss < 2*128) {
2674 int ag_t = 0, ag_x, ag_s, ag_sxs = ag_sx;
2675
2676 while (ag_sx && (ag_t = ag_ctn[2*(PCB).sn]) == 0) (PCB).sn = (PCB).ss[--ag_sx];
2677 if (ag_t) (PCB).sn = (PCB).ss[ag_sx -= ag_ctn[2*(PCB).sn +1]];
2678 else {
2679 if (ag_sx == 0) (PCB).sn = 0;
2680 ag_t = ag_ptt[0];
2681 }
2682 if ((ag_s = ag_rns(ag_t, &ag_sx, (PCB).sn)) == 0) break;
2683 for (ag_x = 0; ag_x < (PCB).ag_lrss; ag_x += 2)
2684 if ((PCB).ag_rss[ag_x] == ag_sx + 1 && (PCB).ag_rss[ag_x+1] == ag_s) break;
2685 if (ag_x == (PCB).ag_lrss) {
2686 (PCB).ag_rss[(PCB).ag_lrss++] = ++ag_sx;
2687 (PCB).ag_rss[(PCB).ag_lrss++] = (PCB).sn = ag_s;
2688 }
2689 else if (ag_sx >= ag_sxs) ag_sx--;
2690 }
2691 ag_set_error_procs();
2692 }
2693 (PCB).la_ptr = (PCB).pointer;
2694 if ((PCB).ssx > (PCB).ag_min_depth) (PCB).ag_min_depth = (PCB).ssx;
2695 while (1) {
2696 ag_rk1 = ag_tst_tkn();
2697 if ((PCB).token_number == 45)
2698 {(PCB).exit_flag = AG_SYNTAX_ERROR_CODE; return;}
2699 if (ag_rk1 < (PCB).ag_lrss) break;
2700 {(PCB).la_ptr = (PCB).pointer + 1; ag_track();}
2701 }
2702 ag_tk1 = (PCB).token_number;
2703 ag_track();
2704 ag_rk2 = ag_tst_tkn();
2705 if (ag_rk2 < ag_rk1) {ag_rk = ag_rk2; ag_track();}
2706 else {ag_rk = ag_rk1; (PCB).token_number = (pgg_token_type) ag_tk1; (PCB).la_ptr = (PCB).pointer;}
2707 (PCB).ag_min_depth = (PCB).ssx = (PCB).ag_rss[ag_rk++];
2708 (PCB).sn = (PCB).ss[(PCB).ssx] = (PCB).ag_rss[ag_rk];
2709 (PCB).sn = ag_jns((PCB).token_number);
2710 if ((PCB).ag_error_depth == 0 || (PCB).ag_error_depth > (PCB).ssx)
2711 (PCB).ag_error_depth = (PCB).ssx;
2712 if (++(PCB).ssx >= 128) {
2713 (PCB).exit_flag = AG_STACK_ERROR_CODE;
2714 PARSER_STACK_OVERFLOW;
2715 return;
2716 }
2717 GET_CONTEXT;
2718 (PCB).ss[(PCB).ssx] = (PCB).sn;
2719 (PCB).ag_tmp_depth = (PCB).ag_min_depth;
2720 (PCB).la_ptr = (PCB).pointer;
2721 return;
2722 }
2723
2724
2725 static int ag_action_10_proc(void) {
2726 int ag_t = (PCB).token_number;
2727 (PCB).btsx = 0, (PCB).drt = -1;
2728 do {
2729 ag_track();
2730 (PCB).token_number = (pgg_token_type) AG_TCV(INPUT_CODE(*(PCB).la_ptr));
2731 (PCB).la_ptr++;
2732 if (ag_key_index[(PCB).sn]) {
2733 unsigned ag_k = ag_key_index[(PCB).sn];
2734 int ag_ch = CONVERT_CASE(INPUT_CODE(*(PCB).pointer));
2735 if (ag_ch <= 255) {
2736 while (ag_key_ch[ag_k] < ag_ch) ag_k++;
2737 if (ag_key_ch[ag_k] == ag_ch) ag_get_key_word(ag_k);
2738 }
2739 }
2740 } while ((PCB).token_number == (pgg_token_type) ag_t);
2741 (PCB).la_ptr = (PCB).pointer;
2742 return 1;
2743 }
2744
2745 static int ag_action_11_proc(void) {
2746 int ag_t = (PCB).token_number;
2747
2748 (PCB).btsx = 0, (PCB).drt = -1;
2749 do {
2750 (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).pointer;
2751 (PCB).ssx--;
2752 ag_track();
2753 ag_ra();
2754 if ((PCB).exit_flag != AG_RUNNING_CODE) return 0;
2755 (PCB).ssx++;
2756 (PCB).token_number = (pgg_token_type) AG_TCV(INPUT_CODE(*(PCB).la_ptr));
2757 (PCB).la_ptr++;
2758 if (ag_key_index[(PCB).sn]) {
2759 unsigned ag_k = ag_key_index[(PCB).sn];
2760 int ag_ch = CONVERT_CASE(INPUT_CODE(*(PCB).pointer));
2761 if (ag_ch <= 255) {
2762 while (ag_key_ch[ag_k] < ag_ch) ag_k++;
2763 if (ag_key_ch[ag_k] == ag_ch) ag_get_key_word(ag_k);
2764 }
2765 }
2766 }
2767 while ((PCB).token_number == (pgg_token_type) ag_t);
2768 (PCB).la_ptr = (PCB).pointer;
2769 return 1;
2770 }
2771
2772 static int ag_action_3_r_proc(void) {
2773 int ag_sd = ag_fl[(PCB).ag_ap] - 1;
2774 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
2775 (PCB).btsx = 0, (PCB).drt = -1;
2776 (PCB).reduction_token = (pgg_token_type) ag_ptt[(PCB).ag_ap];
2777 ag_ra();
2778 return (PCB).exit_flag == AG_RUNNING_CODE;
2779 }
2780
2781 static int ag_action_3_s_proc(void) {
2782 int ag_sd = ag_fl[(PCB).ag_ap] - 1;
2783 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
2784 (PCB).btsx = 0, (PCB).drt = -1;
2785 (PCB).reduction_token = (pgg_token_type) ag_ptt[(PCB).ag_ap];
2786 ag_ra();
2787 return (PCB).exit_flag == AG_RUNNING_CODE;
2788 }
2789
2790 static int ag_action_4_r_proc(void) {
2791 int ag_sd = ag_fl[(PCB).ag_ap] - 1;
2792 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
2793 (PCB).reduction_token = (pgg_token_type) ag_ptt[(PCB).ag_ap];
2794 return 1;
2795 }
2796
2797 static int ag_action_2_proc(void) {
2798 (PCB).btsx = 0, (PCB).drt = -1;
2799 if ((PCB).ssx >= 128) {
2800 (PCB).exit_flag = AG_STACK_ERROR_CODE;
2801 PARSER_STACK_OVERFLOW;
2802 }
2803 (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).pointer;
2804 GET_CONTEXT;
2805 (PCB).ss[(PCB).ssx] = (PCB).sn;
2806 (PCB).ssx++;
2807 (PCB).sn = (PCB).ag_ap;
2808 ag_track();
2809 return 0;
2810 }
2811
2812 static int ag_action_9_proc(void) {
2813 if ((PCB).drt == -1) {
2814 (PCB).drt=(PCB).token_number;
2815 (PCB).dssx=(PCB).ssx;
2816 (PCB).dsn=(PCB).sn;
2817 }
2818 ag_prot();
2819 (PCB).vs[(PCB).ssx] = ag_null_value;
2820 GET_CONTEXT;
2821 (PCB).ss[(PCB).ssx] = (PCB).sn;
2822 (PCB).ssx++;
2823 (PCB).sn = (PCB).ag_ap;
2824 (PCB).la_ptr = (PCB).pointer;
2825 return (PCB).exit_flag == AG_RUNNING_CODE;
2826 }
2827
2828 static int ag_action_2_r_proc(void) {
2829 (PCB).ssx++;
2830 (PCB).sn = (PCB).ag_ap;
2831 return 0;
2832 }
2833
2834 static int ag_action_7_proc(void) {
2835 --(PCB).ssx;
2836 (PCB).la_ptr = (PCB).pointer;
2837 (PCB).exit_flag = AG_SUCCESS_CODE;
2838 return 0;
2839 }
2840
2841 static int ag_action_1_proc(void) {
2842 ag_track();
2843 (PCB).exit_flag = AG_SUCCESS_CODE;
2844 return 0;
2845 }
2846
2847 static int ag_action_1_r_proc(void) {
2848 (PCB).exit_flag = AG_SUCCESS_CODE;
2849 return 0;
2850 }
2851
2852 static int ag_action_1_s_proc(void) {
2853 (PCB).exit_flag = AG_SUCCESS_CODE;
2854 return 0;
2855 }
2856
2857 static int ag_action_4_proc(void) {
2858 int ag_sd = ag_fl[(PCB).ag_ap] - 1;
2859 (PCB).reduction_token = (pgg_token_type) ag_ptt[(PCB).ag_ap];
2860 (PCB).btsx = 0, (PCB).drt = -1;
2861 (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).pointer;
2862 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
2863 else GET_CONTEXT;
2864 (PCB).ss[(PCB).ssx] = (PCB).sn;
2865 ag_track();
2866 while ((PCB).exit_flag == AG_RUNNING_CODE) {
2867 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
2868 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
2869 do {
2870 unsigned ag_tx = (ag_t1 + ag_t2)/2;
2871 if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1;
2872 else ag_t2 = ag_tx;
2873 } while (ag_t1 < ag_t2);
2874 if (ag_tstt[ag_t1] != (PCB).reduction_token) {
2875 (PCB).exit_flag = AG_REDUCTION_ERROR_CODE;
2876 REDUCTION_TOKEN_ERROR; break;}
2877 (PCB).ag_ap = ag_pstt[ag_t1];
2878 if ((*(PCB).s_procs[ag_astt[ag_t1]])() == 0) break;
2879 }
2880 return 0;
2881 }
2882
2883 static int ag_action_3_proc(void) {
2884 int ag_sd = ag_fl[(PCB).ag_ap] - 1;
2885 (PCB).btsx = 0, (PCB).drt = -1;
2886 (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).pointer;
2887 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
2888 else GET_CONTEXT;
2889 (PCB).ss[(PCB).ssx] = (PCB).sn;
2890 ag_track();
2891 (PCB).reduction_token = (pgg_token_type) ag_ptt[(PCB).ag_ap];
2892 ag_ra();
2893 while ((PCB).exit_flag == AG_RUNNING_CODE) {
2894 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
2895 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
2896 do {
2897 unsigned ag_tx = (ag_t1 + ag_t2)/2;
2898 if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1;
2899 else ag_t2 = ag_tx;
2900 } while (ag_t1 < ag_t2);
2901 if (ag_tstt[ag_t1] != (PCB).reduction_token) {
2902 (PCB).exit_flag = AG_REDUCTION_ERROR_CODE;
2903 REDUCTION_TOKEN_ERROR; break;}
2904 (PCB).ag_ap = ag_pstt[ag_t1];
2905 if ((*(PCB).s_procs[ag_astt[ag_t1]])() == 0) break;
2906 }
2907 return 0;
2908 }
2909
2910 static int ag_action_8_proc(void) {
2911 ag_undo();
2912 (PCB).la_ptr = (PCB).pointer;
2913 ag_auto_resynch();
2914 return (PCB).exit_flag == AG_RUNNING_CODE;
2915 }
2916
2917 static int ag_action_5_proc(void) {
2918 int ag_sd = ag_fl[(PCB).ag_ap];
2919 (PCB).btsx = 0, (PCB).drt = -1;
2920 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
2921 else {
2922 GET_CONTEXT;
2923 (PCB).ss[(PCB).ssx] = (PCB).sn;
2924 }
2925 (PCB).la_ptr = (PCB).pointer;
2926 (PCB).reduction_token = (pgg_token_type) ag_ptt[(PCB).ag_ap];
2927 ag_ra();
2928 while ((PCB).exit_flag == AG_RUNNING_CODE) {
2929 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
2930 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
2931 do {
2932 unsigned ag_tx = (ag_t1 + ag_t2)/2;
2933 if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1;
2934 else ag_t2 = ag_tx;
2935 } while (ag_t1 < ag_t2);
2936 if (ag_tstt[ag_t1] != (PCB).reduction_token) {
2937 (PCB).exit_flag = AG_REDUCTION_ERROR_CODE;
2938 REDUCTION_TOKEN_ERROR; break;}
2939 (PCB).ag_ap = ag_pstt[ag_t1];
2940 if ((*(PCB).r_procs[ag_astt[ag_t1]])() == 0) break;
2941 }
2942 return (PCB).exit_flag == AG_RUNNING_CODE;
2943 }
2944
2945 static int ag_action_6_proc(void) {
2946 int ag_sd = ag_fl[(PCB).ag_ap];
2947 (PCB).reduction_token = (pgg_token_type) ag_ptt[(PCB).ag_ap];
2948 if ((PCB).drt == -1) {
2949 (PCB).drt=(PCB).token_number;
2950 (PCB).dssx=(PCB).ssx;
2951 (PCB).dsn=(PCB).sn;
2952 }
2953 if (ag_sd) {
2954 (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
2955 }
2956 else {
2957 ag_prot();
2958 (PCB).vs[(PCB).ssx] = ag_null_value;
2959 GET_CONTEXT;
2960 (PCB).ss[(PCB).ssx] = (PCB).sn;
2961 }
2962 (PCB).la_ptr = (PCB).pointer;
2963 while ((PCB).exit_flag == AG_RUNNING_CODE) {
2964 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
2965 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
2966 do {
2967 unsigned ag_tx = (ag_t1 + ag_t2)/2;
2968 if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1;
2969 else ag_t2 = ag_tx;
2970 } while (ag_t1 < ag_t2);
2971 if (ag_tstt[ag_t1] != (PCB).reduction_token) {
2972 (PCB).exit_flag = AG_REDUCTION_ERROR_CODE;
2973 REDUCTION_TOKEN_ERROR; break;}
2974 (PCB).ag_ap = ag_pstt[ag_t1];
2975 if ((*(PCB).r_procs[ag_astt[ag_t1]])() == 0) break;
2976 }
2977 return (PCB).exit_flag == AG_RUNNING_CODE;
2978 }
2979
2980
2981 static void ag_check_depth(int ag_fl) {
2982 int ag_sx = (PCB).ssx - ag_fl;
2983 if ((PCB).ag_error_depth && ag_sx < (PCB).ag_tmp_depth) (PCB).ag_tmp_depth = ag_sx;
2984 }
2985
2986 static int ag_action_3_er_proc(void) {
2987 ag_check_depth(ag_fl[(PCB).ag_ap] - 1);
2988 return ag_action_4_r_proc();
2989 }
2990
2991 static int ag_action_2_e_proc(void) {
2992 ag_action_2_proc();
2993 (PCB).ag_min_depth = (PCB).ag_tmp_depth;
2994 return 0;
2995 }
2996
2997 static int ag_action_4_e_proc(void) {
2998 ag_check_depth(ag_fl[(PCB).ag_ap] - 1);
2999 (PCB).ag_min_depth = (PCB).ag_tmp_depth;
3000 return ag_action_4_proc();
3001 }
3002
3003 static int ag_action_6_e_proc(void) {
3004 ag_check_depth(ag_fl[(PCB).ag_ap]);
3005 return ag_action_6_proc();
3006 }
3007
3008 static int ag_action_11_e_proc(void) {
3009 return ag_action_10_proc();
3010 }
3011
3012 static int (*ag_r_procs_error[])(void) = {
3013 ag_action_1_r_proc,
3014 ag_action_2_r_proc,
3015 ag_action_3_er_proc,
3016 ag_action_3_er_proc
3017 };
3018
3019 static int (*ag_s_procs_error[])(void) = {
3020 ag_action_1_s_proc,
3021 ag_action_2_r_proc,
3022 ag_action_3_er_proc,
3023 ag_action_3_er_proc
3024 };
3025
3026 static int (*ag_gt_procs_error[])(void) = {
3027 ag_action_1_proc,
3028 ag_action_2_e_proc,
3029 ag_action_4_e_proc,
3030 ag_action_4_e_proc,
3031 ag_action_6_e_proc,
3032 ag_action_6_e_proc,
3033 ag_action_7_proc,
3034 ag_action_8_proc,
3035 ag_action_9_proc,
3036 ag_action_10_proc,
3037 ag_action_11_e_proc,
3038 ag_action_8_proc
3039 };
3040
3041 static void ag_set_error_procs(void) {
3042 (PCB).gt_procs = ag_gt_procs_error;
3043 (PCB).r_procs = ag_r_procs_error;
3044 (PCB).s_procs = ag_s_procs_error;
3045 }
3046
3047
3048 void init_pgg(void) {
3049 (PCB).la_ptr = (PCB).pointer;
3050 (PCB).gt_procs = ag_gt_procs_scan;
3051 (PCB).r_procs = ag_r_procs_scan;
3052 (PCB).s_procs = ag_s_procs_scan;
3053 (PCB).ag_error_depth = (PCB).ag_min_depth = (PCB).ag_tmp_depth = 0;
3054 (PCB).ag_resynch_active = 0;
3055 (PCB).ss[0] = (PCB).sn = (PCB).ssx = 0;
3056 (PCB).exit_flag = AG_RUNNING_CODE;
3057 (PCB).line = FIRST_LINE;
3058 (PCB).column = FIRST_COLUMN;
3059 (PCB).btsx = 0, (PCB).drt = -1;
3060 }
3061
3062 void pgg(void) {
3063 init_pgg();
3064 (PCB).exit_flag = AG_RUNNING_CODE;
3065 while ((PCB).exit_flag == AG_RUNNING_CODE) {
3066 unsigned ag_t1 = ag_sbt[(PCB).sn];
3067 if (ag_tstt[ag_t1]) {
3068 unsigned ag_t2 = ag_sbe[(PCB).sn] - 1;
3069 (PCB).token_number = (pgg_token_type) AG_TCV(INPUT_CODE(*(PCB).la_ptr));
3070 (PCB).la_ptr++;
3071 if (ag_key_index[(PCB).sn]) {
3072 unsigned ag_k = ag_key_index[(PCB).sn];
3073 int ag_ch = CONVERT_CASE(INPUT_CODE(*(PCB).pointer));
3074 if (ag_ch <= 255) {
3075 while (ag_key_ch[ag_k] < ag_ch) ag_k++;
3076 if (ag_key_ch[ag_k] == ag_ch) ag_get_key_word(ag_k);
3077 }
3078 }
3079 do {
3080 unsigned ag_tx = (ag_t1 + ag_t2)/2;
3081 if (ag_tstt[ag_tx] > (unsigned char)(PCB).token_number)
3082 ag_t1 = ag_tx + 1;
3083 else ag_t2 = ag_tx;
3084 } while (ag_t1 < ag_t2);
3085 if (ag_tstt[ag_t1] != (unsigned char)(PCB).token_number)
3086 ag_t1 = ag_sbe[(PCB).sn];
3087 }
3088 (PCB).ag_ap = ag_pstt[ag_t1];
3089 (*(PCB).gt_procs[ag_astt[ag_t1]])();
3090 }
3091 }
3092
3093