Mercurial > ~dholland > hg > ag > index.cgi
comparison tests/agcl/examples/good/krc.cpp @ 0:13d2b8934445
Import AnaGram (near-)release tree into Mercurial.
author | David A. Holland |
---|---|
date | Sat, 22 Dec 2007 17:52:45 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:13d2b8934445 |
---|---|
1 /* | |
2 * AnaGram, a System for Syntax Directed Programming | |
3 * C Macro preprocessor | |
4 * Sample C Grammar | |
5 * Compatible with Kernighan and Ritchie, 2nd. Edition. | |
6 * | |
7 * Copyright 1993-2000 Parsifal Software. All Rights Reserved. | |
8 * | |
9 * This software is provided 'as-is', without any express or implied | |
10 * warranty. In no event will the authors be held liable for any damages | |
11 * arising from the use of this software. | |
12 * | |
13 * Permission is granted to anyone to use this software for any purpose, | |
14 * including commercial applications, and to alter it and redistribute it | |
15 * freely, subject to the following restrictions: | |
16 * | |
17 * 1. The origin of this software must not be misrepresented; you must not | |
18 * claim that you wrote the original software. If you use this software | |
19 * in a product, an acknowledgment in the product documentation would be | |
20 * appreciated but is not required. | |
21 * 2. Altered source versions must be plainly marked as such, and must not be | |
22 * misrepresented as being the original software. | |
23 * 3. This notice may not be removed or altered from any source distribution. | |
24 */ | |
25 | |
26 #include "mpp.h" | |
27 | |
28 stack<unsigned> id_stack(100,20); | |
29 | |
30 | |
31 /* | |
32 * AnaGram, A System for Syntax Directed Programming | |
33 * File generated by: ... | |
34 * | |
35 * AnaGram Parsing Engine | |
36 * Copyright 1993-2002 Parsifal Software. All Rights Reserved. | |
37 * | |
38 * This software is provided 'as-is', without any express or implied | |
39 * warranty. In no event will the authors be held liable for any damages | |
40 * arising from the use of this software. | |
41 * | |
42 * Permission is granted to anyone to use this software for any purpose, | |
43 * including commercial applications, and to alter it and redistribute it | |
44 * freely, subject to the following restrictions: | |
45 * | |
46 * 1. The origin of this software must not be misrepresented; you must not | |
47 * claim that you wrote the original software. If you use this software | |
48 * in a product, an acknowledgment in the product documentation would be | |
49 * appreciated but is not required. | |
50 * 2. Altered source versions must be plainly marked as such, and must not be | |
51 * misrepresented as being the original software. | |
52 * 3. This notice may not be removed or altered from any source distribution. | |
53 */ | |
54 | |
55 #ifndef KRC_H | |
56 #include "krc.h" | |
57 #endif | |
58 | |
59 #ifndef KRC_H | |
60 #error Mismatched header file | |
61 #endif | |
62 | |
63 #include <ctype.h> | |
64 #include <stdio.h> | |
65 | |
66 #define RULE_CONTEXT (&((PCB).cs[(PCB).ssx])) | |
67 #define ERROR_CONTEXT ((PCB).cs[(PCB).error_frame_ssx]) | |
68 #define CONTEXT ((PCB).cs[(PCB).ssx]) | |
69 | |
70 | |
71 | |
72 cc_pcb_type cc_pcb; | |
73 #define PCB cc_pcb | |
74 #define CHANGE_REDUCTION(x) cc_change_reduction(cc_##x##_token) | |
75 int cc_change_reduction(cc_token_type); | |
76 | |
77 #define INPUT_VALUE(type) *(type *) &(PCB).input_value | |
78 | |
79 #line - "krc.syn" | |
80 // Embedded C | |
81 #include <stack.h> | |
82 | |
83 | |
84 // Macro Definitions | |
85 | |
86 #define INPUT_CODE(T) (T).id | |
87 #define SYNTAX_ERROR syntax_error(PCB.error_message) | |
88 | |
89 | |
90 // Variable definitions | |
91 | |
92 static int use_count = 0; | |
93 symbol_type_enum symbol_table[N_SYMBOLS]; | |
94 | |
95 | |
96 /* | |
97 mark_typedef() gets a non_zero argument for typedef statements, a zero | |
98 argument otherwise. If the argument is non-zero it marks all stacked | |
99 identifiers as typedef_names. It then resets the id stack. | |
100 */ | |
101 | |
102 static void mark_typedef(int mask) { | |
103 unsigned x; | |
104 if (mask) { | |
105 while (size(id_stack)) { | |
106 id_stack >> x; | |
107 symbol_table[x] = typedef_name; | |
108 } | |
109 return; | |
110 } | |
111 reset(id_stack); | |
112 } | |
113 | |
114 /* | |
115 check_typedef() resolves a semantically determined productin by determining | |
116 whether a token is a typedef_name or not. If so it changes the reduction | |
117 token appropriately. | |
118 */ | |
119 | |
120 static token check_typedef(token t) { | |
121 if (symbol_table[t.handle] == typedef_name) | |
122 CHANGE_REDUCTION(typedef_name); | |
123 return t; | |
124 } | |
125 | |
126 | |
127 // Member Functions for Class c_parser | |
128 | |
129 // Constructor | |
130 | |
131 /* | |
132 This parser has no provisions for multiple simultaneous parses or for | |
133 recursion. The purpose of use_count is to make sure that there is only one | |
134 copy of the parser active at any time. | |
135 */ | |
136 | |
137 | |
138 c_parser::c_parser() { | |
139 assert(use_count == 0); | |
140 use_count++; | |
141 reset(id_stack); | |
142 memset(symbol_table, 0, sizeof(symbol_table)); | |
143 init_cc(); // init parse | |
144 } | |
145 | |
146 | |
147 // Destructor | |
148 | |
149 c_parser::~c_parser() { | |
150 use_count--; // Makes parser available | |
151 } | |
152 | |
153 | |
154 // Reset Parser | |
155 | |
156 c_parser &reset(c_parser &c) { | |
157 reset(id_stack); | |
158 memset(symbol_table, 0, sizeof(symbol_table)); | |
159 init_cc(); // init parse | |
160 return c; | |
161 } | |
162 | |
163 | |
164 // Transmit token to c_parser | |
165 | |
166 /* | |
167 The overloaded operator "<<" is used to transmit data to a parser. | |
168 Newline tokens are filtered out, since they are passed along by the | |
169 token scanner only in case text output of the preprocessor is | |
170 required. | |
171 | |
172 If the parser has encountered an error, there is no point in giving | |
173 it any further input. | |
174 | |
175 Otherwise, the input_code and input_value fields of the pcb are set | |
176 up and cc() is called to deal with the token. | |
177 */ | |
178 | |
179 token_sink &c_parser::operator << (token c) { | |
180 if (PCB.exit_flag != AG_RUNNING_CODE || (int) c.id == '\n') return *this; | |
181 PCB.input_code = c.id; | |
182 PCB.input_value = c; | |
183 cc(); | |
184 return *this; | |
185 } | |
186 | |
187 token_sink &c_parser::operator << (token *s) { | |
188 while (s->id != END_OF_FILE && PCB.exit_flag == AG_RUNNING_CODE) { | |
189 if ((int) s->id == 10) continue; | |
190 PCB.input_code = s->id; | |
191 PCB.input_value = *s++; | |
192 cc(); | |
193 } | |
194 return *this; | |
195 } | |
196 | |
197 #line - "krc.cpp" | |
198 | |
199 #ifndef CONVERT_CASE | |
200 #define CONVERT_CASE(c) (c) | |
201 #endif | |
202 #ifndef TAB_SPACING | |
203 #define TAB_SPACING 8 | |
204 #endif | |
205 | |
206 static void ag_rp_1(int m) { | |
207 #line - "krc.syn" | |
208 mark_typedef(m); | |
209 #line - "krc.cpp" | |
210 } | |
211 | |
212 static int ag_rp_2(void) { | |
213 #line - "krc.syn" | |
214 return 0; | |
215 #line - "krc.cpp" | |
216 } | |
217 | |
218 static int ag_rp_3(void) { | |
219 #line - "krc.syn" | |
220 return 0; | |
221 #line - "krc.cpp" | |
222 } | |
223 | |
224 static int ag_rp_4(int m, int v) { | |
225 #line - "krc.syn" | |
226 return m | v; | |
227 #line - "krc.cpp" | |
228 } | |
229 | |
230 static int ag_rp_5(void) { | |
231 #line - "krc.syn" | |
232 return 0; | |
233 #line - "krc.cpp" | |
234 } | |
235 | |
236 static int ag_rp_6(void) { | |
237 #line - "krc.syn" | |
238 return 0; | |
239 #line - "krc.cpp" | |
240 } | |
241 | |
242 static int ag_rp_7(void) { | |
243 #line - "krc.syn" | |
244 return 0; | |
245 #line - "krc.cpp" | |
246 } | |
247 | |
248 static int ag_rp_8(void) { | |
249 #line - "krc.syn" | |
250 return 0; | |
251 #line - "krc.cpp" | |
252 } | |
253 | |
254 static int ag_rp_9(void) { | |
255 #line - "krc.syn" | |
256 return 1; | |
257 #line - "krc.cpp" | |
258 } | |
259 | |
260 static void ag_rp_10(void) { | |
261 #line - "krc.syn" | |
262 ++id_stack; | |
263 #line - "krc.cpp" | |
264 } | |
265 | |
266 static void ag_rp_11(void) { | |
267 #line - "krc.syn" | |
268 --id_stack; | |
269 #line - "krc.cpp" | |
270 } | |
271 | |
272 static void ag_rp_12(token n) { | |
273 #line - "krc.syn" | |
274 id_stack << n.handle; | |
275 #line - "krc.cpp" | |
276 } | |
277 | |
278 static token ag_rp_13(token n) { | |
279 #line - "krc.syn" | |
280 return check_typedef(n); | |
281 #line - "krc.cpp" | |
282 } | |
283 | |
284 | |
285 #ifndef AG_TRACE_FILE_NAME | |
286 #define AG_TRACE_FILE_NAME "krc.etr" | |
287 #endif | |
288 | |
289 static void ag_trace_error(void) { | |
290 FILE *ag_file = fopen(AG_TRACE_FILE_NAME, "w"); | |
291 int i; | |
292 if (ag_file == NULL) return; | |
293 fprintf(ag_file, "%d\n", (PCB).ssx); | |
294 for (i = 0; i < (PCB).ssx; i++) fprintf(ag_file, "%d\n", (PCB).ss[i]); | |
295 fprintf(ag_file, "%d\n", (PCB).sn); | |
296 fprintf(ag_file, "%d\n", (PCB).token_number); | |
297 fclose(ag_file); | |
298 } | |
299 | |
300 | |
301 #define READ_COUNTS | |
302 #define WRITE_COUNTS | |
303 #undef V | |
304 #define V(i,t) (*t (&(PCB).vs[(PCB).ssx + i])) | |
305 #undef VS | |
306 #define VS(i) (PCB).vs[(PCB).ssx + i] | |
307 | |
308 #ifndef GET_CONTEXT | |
309 #define GET_CONTEXT CONTEXT = (PCB).input_context | |
310 #endif | |
311 | |
312 typedef enum { | |
313 ag_action_1, | |
314 ag_action_2, | |
315 ag_action_3, | |
316 ag_action_4, | |
317 ag_action_5, | |
318 ag_action_6, | |
319 ag_action_7, | |
320 ag_action_8, | |
321 ag_action_9, | |
322 ag_action_10, | |
323 ag_action_11, | |
324 ag_action_12 | |
325 } ag_parser_action; | |
326 | |
327 | |
328 #ifndef NULL_VALUE_INITIALIZER | |
329 #define NULL_VALUE_INITIALIZER = { 0 } | |
330 #endif | |
331 | |
332 static cc_vs_type const ag_null_value NULL_VALUE_INITIALIZER; | |
333 | |
334 static const unsigned char ag_rpx[] = { | |
335 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 3, | |
336 4, 0, 0, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
337 0, 0, 0, 0, 0, 0, 10, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
338 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
339 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
340 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
341 0, 0, 0, 0, 0, 13 | |
342 }; | |
343 | |
344 #define AG_TCV(x) ag_tcv[(x)] | |
345 | |
346 static const unsigned char ag_tcv[] = { | |
347 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
348 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,153, 0, 0, | |
349 0,146,129, 0, 62, 63, 70,142, 48,143,157,145, 0, 0, 0, 0, 0, 0, | |
350 0, 0, 0, 0, 55, 14,134, 49,135,119, 0,123,115,158, 0,149,109, 74, | |
351 131,117,137,148,136,139,113,110,112,108,132,116,121,111,140,114,165,160, | |
352 0, 64, 0, 66,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
353 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,125, 43, | |
354 152, 0, 0,161,162,163,164, 83, 18,103, 89, 24, 35,102, 90, 99, 29, 96, | |
355 57, 21, 28,100,101, 95, 26, 27, 19,104, 25, 30,151, 20, 44, 97, 22, 45, | |
356 31, 23, 36, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
357 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
358 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
359 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
360 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
361 0, 0, 0, 0 | |
362 }; | |
363 | |
364 #ifndef SYNTAX_ERROR | |
365 #define SYNTAX_ERROR fprintf(stderr,"%s, line %d, column %d\n", \ | |
366 (PCB).error_message, (PCB).line, (PCB).column) | |
367 #endif | |
368 | |
369 #ifndef FIRST_LINE | |
370 #define FIRST_LINE 1 | |
371 #endif | |
372 | |
373 #ifndef FIRST_COLUMN | |
374 #define FIRST_COLUMN 1 | |
375 #endif | |
376 | |
377 #ifndef PARSER_STACK_OVERFLOW | |
378 #define PARSER_STACK_OVERFLOW {fprintf(stderr, \ | |
379 "\nParser stack overflow, line %d, column %d\n",\ | |
380 (PCB).line, (PCB).column);} | |
381 #endif | |
382 | |
383 #ifndef REDUCTION_TOKEN_ERROR | |
384 #define REDUCTION_TOKEN_ERROR {fprintf(stderr, \ | |
385 "\nReduction token error, line %d, column %d\n", \ | |
386 (PCB).line, (PCB).column);} | |
387 #endif | |
388 | |
389 | |
390 #ifndef AG_NEWLINE | |
391 #define AG_NEWLINE 10 | |
392 #endif | |
393 | |
394 #ifndef AG_RETURN | |
395 #define AG_RETURN 13 | |
396 #endif | |
397 | |
398 #ifndef AG_FORMFEED | |
399 #define AG_FORMFEED 12 | |
400 #endif | |
401 | |
402 #ifndef AG_TABCHAR | |
403 #define AG_TABCHAR 9 | |
404 #endif | |
405 | |
406 static void ag_track(void) { | |
407 switch ((PCB).input_code) { | |
408 case AG_NEWLINE: | |
409 (PCB).column = 1, (PCB).line++; | |
410 case AG_RETURN: | |
411 case AG_FORMFEED: | |
412 break; | |
413 case AG_TABCHAR: | |
414 (PCB).column += (TAB_SPACING) - ((PCB).column - 1) % (TAB_SPACING); | |
415 break; | |
416 default: | |
417 (PCB).column++; | |
418 } | |
419 (PCB).read_flag = 1; | |
420 } | |
421 | |
422 | |
423 static void ag_prot(void) { | |
424 int ag_k; | |
425 ag_k = 128 - ++(PCB).btsx; | |
426 if (ag_k <= (PCB).ssx) { | |
427 ag_trace_error(); | |
428 (PCB).exit_flag = AG_STACK_ERROR_CODE; | |
429 PARSER_STACK_OVERFLOW; | |
430 return; | |
431 } | |
432 (PCB).bts[(PCB).btsx] = (PCB).sn; | |
433 (PCB).bts[ag_k] = (PCB).ssx; | |
434 (PCB).vs[ag_k] = (PCB).vs[(PCB).ssx]; | |
435 (PCB).ss[ag_k] = (PCB).ss[(PCB).ssx]; | |
436 } | |
437 | |
438 static void ag_undo(void) { | |
439 if ((PCB).drt == -1) return; | |
440 while ((PCB).btsx) { | |
441 int ag_k = 128 - (PCB).btsx; | |
442 (PCB).sn = (PCB).bts[(PCB).btsx--]; | |
443 (PCB).ssx = (PCB).bts[ag_k]; | |
444 (PCB).vs[(PCB).ssx] = (PCB).vs[ag_k]; | |
445 (PCB).ss[(PCB).ssx] = (PCB).ss[ag_k]; | |
446 } | |
447 (PCB).token_number = (cc_token_type) (PCB).drt; | |
448 (PCB).ssx = (PCB).dssx; | |
449 (PCB).sn = (PCB).dsn; | |
450 (PCB).drt = -1; | |
451 } | |
452 | |
453 | |
454 | |
455 static const int ag_rtt[] = { | |
456 38, 34, 0 | |
457 }; | |
458 | |
459 static const unsigned char ag_tstt[] = { | |
460 83,70,62,57,45,44,36,35,31,30,29,28,27,26,25,24,23,22,21,20,19,18,0,1,3,5,6, | |
461 7,8,11,15,16,17,32,33,34,37,38,60,61, | |
462 83,41,0,38,39, | |
463 83,41,0,38,39, | |
464 83,70,64,63,62,48,36,35,0,17,71,72, | |
465 83,70,62,0,8,38,60,61, | |
466 83,62,0,38,60, | |
467 64,62,0, | |
468 83,70,62,57,45,44,36,35,31,30,29,28,27,26,25,24,23,22,21,20,19,18,14,0,8,12, | |
469 13,15,16,17,32,33,34,37,38,47,60,61, | |
470 83,57,45,44,41,36,35,31,30,29,28,27,26,25,24,23,22,21,20,19,18,0,7,9,10,11, | |
471 15,16,17,32,33,34,37, | |
472 83,70,62,57,45,44,36,35,31,30,29,28,27,26,25,24,23,22,21,20,19,18,4,0,5,6,7, | |
473 8,11,15,16,17,32,33,34,37,38,60,61, | |
474 83,70,64,63,62,57,55,48,45,44,41,36,35,31,30,29,28,27,26,25,24,23,22,21,20, | |
475 19,18,14,0, | |
476 41,0, | |
477 83,70,64,63,62,57,55,48,45,44,41,36,35,31,30,29,28,27,26,25,24,23,22,21,20, | |
478 19,18,14,0, | |
479 41,0,40, | |
480 36,35,0,17, | |
481 70,0,61, | |
482 63,0, | |
483 64,62,0, | |
484 83,63,57,45,44,36,35,31,30,29,28,27,26,25,24,23,22,21,20,19,18,0,11,15,16, | |
485 17,32,33,34,37,38,67,68,69,73,75, | |
486 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,66,62,0,38,56, | |
487 65,105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
488 48,0, | |
489 14,0, | |
490 83,57,49,45,44,41,36,35,31,30,29,28,27,26,25,24,23,22,21,20,19,18,0,7,9,10, | |
491 11,15,16,17,32,33,34,37, | |
492 83,70,62,57,45,44,36,35,31,30,29,28,27,26,25,24,23,22,21,20,19,18,14,0,8,12, | |
493 13,15,16,17,32,33,34,37,38,47,60,61, | |
494 83,57,45,44,41,36,35,31,30,29,28,27,26,25,24,23,22,21,20,19,18,0,7,9,11,15, | |
495 16,17,32,33,34,37, | |
496 165,164,163,162,161,160,153,152,151,149,148,143,142,129,104,103,102,101,100, | |
497 99,98,97,95,90,89,83,70,63,62,57,45,44,43,41,36,35,31,30,29,28,27,26,25, | |
498 24,23,22,21,20,19,18,14,0,2,7,9,10,11,15,16,17,32,33,34,37,38,78,84,85, | |
499 86,87,88,91,92,93,94,105,106,118,120,122,124,126,128,130,133,138,141, | |
500 144,147,150,154,159, | |
501 83,0,38,58,59, | |
502 41,0, | |
503 48,0, | |
504 63,0, | |
505 83,70,64,63,62,57,48,45,44,36,35,31,30,29,28,27,26,25,24,23,22,21,20,19,18, | |
506 0,8,15,16,17,32,33,34,37,38,60,61,76,77,81, | |
507 48,0, | |
508 63,0, | |
509 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
510 147,150,154,159, | |
511 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
512 144,147,150,154,159, | |
513 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
514 147,150,154,159, | |
515 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
516 147,150,154,159, | |
517 158,157,149,148,64,62,0, | |
518 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,57,45,44, | |
519 36,35,31,30,29,28,27,26,25,24,23,0,16,17,32,33,34,37,38,51,78,80,91,105, | |
520 106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
521 146,145,70,0, | |
522 143,142,0, | |
523 140,139,0, | |
524 137,136,135,134,0, | |
525 132,131,0, | |
526 129,0, | |
527 127,0, | |
528 125,0, | |
529 123,0, | |
530 121,119,0, | |
531 66,0, | |
532 83,70,62,0,8,38,47,60,61, | |
533 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,41,0,38,50, | |
534 78,105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
535 83,57,45,44,41,36,35,31,30,29,28,27,26,25,24,23,22,21,20,19,18,0,7,9,11,15, | |
536 16,17,32,33,34,37, | |
537 49,0, | |
538 165,164,163,162,161,160,153,152,151,149,148,143,142,129,104,103,102,101,100, | |
539 99,98,97,95,90,89,83,70,63,62,57,45,44,43,41,36,35,31,30,29,28,27,26,25, | |
540 24,23,22,21,20,19,18,14,0,2,7,9,11,15,16,17,32,33,34,37,38,78,84,85,86, | |
541 87,88,91,92,93,94,105,106,118,120,122,124,126,128,130,133,138,141,144, | |
542 147,150,154,159, | |
543 117,116,115,114,113,112,111,110,109,108,49,0,107, | |
544 48,0, | |
545 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,14,0,38,78, | |
546 91,92,105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154, | |
547 159, | |
548 14,0, | |
549 14,0, | |
550 83,0,38, | |
551 62,0, | |
552 165,164,163,162,161,160,153,152,151,149,148,143,142,129,104,103,102,101,100, | |
553 99,98,97,95,90,89,83,70,62,41,14,0,2,9,38,78,84,85,86,87,88,91,92,105, | |
554 106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
555 62,0, | |
556 62,0, | |
557 62,0, | |
558 14,0, | |
559 55,0, | |
560 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,56, | |
561 105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
562 55,0, | |
563 165,164,163,162,161,160,153,152,151,149,148,143,142,129,104,103,102,101,100, | |
564 99,98,97,95,90,89,83,70,63,62,43,41,14,0,2,9,38,78,84,85,86,87,88,91,92, | |
565 105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
566 43,0, | |
567 49,0, | |
568 48,43,0, | |
569 83,57,45,44,36,35,31,30,29,28,27,26,25,24,23,0,16,17,32,33,34,37,42,46,51, | |
570 83,0,38, | |
571 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,66,62,0,38,56, | |
572 65,105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
573 64,62,0, | |
574 83,70,64,63,62,57,45,44,36,35,31,30,29,28,27,26,25,24,23,22,21,20,19,18,0,8, | |
575 11,15,16,17,32,33,34,37,38,60,61,67,73,75,76,81,82, | |
576 83,64,62,0,38,60,81, | |
577 83,74,57,45,44,36,35,31,30,29,28,27,26,25,24,23,22,21,20,19,18,0,11,15,16, | |
578 17,32,33,34,37,75, | |
579 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,57,45,44, | |
580 36,35,31,30,29,28,27,26,25,24,23,0,16,17,32,33,34,37,38,51,78,80,91,105, | |
581 106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
582 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,78,91, | |
583 105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
584 83,0,38, | |
585 83,0,38, | |
586 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,63,62,0,38,78, | |
587 105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,155,156, | |
588 159, | |
589 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,78,91, | |
590 105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
591 63,48,0, | |
592 83,70,64,63,62,57,45,44,36,35,31,30,29,28,27,26,25,24,23,0,16,17,32,33,34, | |
593 37,61,76,77,81, | |
594 63,0, | |
595 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
596 144,147,150,154,159, | |
597 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
598 144,147,150,154,159, | |
599 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
600 144,147,150,154,159, | |
601 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
602 141,144,147,150,154,159, | |
603 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
604 141,144,147,150,154,159, | |
605 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
606 138,141,144,147,150,154,159, | |
607 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
608 138,141,144,147,150,154,159, | |
609 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
610 133,138,141,144,147,150,154,159, | |
611 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
612 133,138,141,144,147,150,154,159, | |
613 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
614 133,138,141,144,147,150,154,159, | |
615 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
616 133,138,141,144,147,150,154,159, | |
617 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
618 130,133,138,141,144,147,150,154,159, | |
619 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
620 130,133,138,141,144,147,150,154,159, | |
621 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
622 128,130,133,138,141,144,147,150,154,159, | |
623 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
624 126,128,130,133,138,141,144,147,150,154,159, | |
625 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
626 124,126,128,130,133,138,141,144,147,150,154,159, | |
627 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
628 122,124,126,128,130,133,138,141,144,147,150,154,159, | |
629 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
630 120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
631 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,78,91, | |
632 105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
633 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,41,0,38,50, | |
634 78,79,105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154, | |
635 159, | |
636 43,0, | |
637 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,78, | |
638 105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
639 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,78, | |
640 105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
641 14,0, | |
642 14,0, | |
643 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,14,0,38,78, | |
644 91,92,105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154, | |
645 159, | |
646 98,0, | |
647 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,78,91, | |
648 105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
649 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,78,91, | |
650 105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
651 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,78,91, | |
652 105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
653 165,164,163,162,161,160,153,152,151,149,148,143,142,129,104,103,102,101,100, | |
654 99,98,97,95,90,89,83,70,62,41,14,0,2,9,38,78,84,85,86,87,88,91,92,105, | |
655 106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
656 55,0, | |
657 165,164,163,162,161,160,153,152,151,149,148,143,142,129,104,103,102,101,100, | |
658 99,98,97,95,90,89,83,70,62,41,14,0,2,9,38,78,84,85,86,87,88,91,92,105, | |
659 106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
660 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,56, | |
661 105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
662 83,0,38,59, | |
663 83,70,62,57,55,45,44,36,35,31,30,29,28,27,26,25,24,23,0,8,16,17,32,33,34,37, | |
664 38,52,53,54,60,61, | |
665 83,57,45,44,43,36,35,31,30,29,28,27,26,25,24,23,0,16,17,32,33,34,37,46,51, | |
666 66,0, | |
667 83,63,57,45,44,36,35,31,30,29,28,27,26,25,24,23,22,21,20,19,18,0,11,15,16, | |
668 17,32,33,34,37,67,73,75,82, | |
669 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,66,62,0,38,56, | |
670 65,105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
671 63,0, | |
672 63,0, | |
673 64,62,0, | |
674 63,0, | |
675 48,0, | |
676 63,0, | |
677 66,48,0, | |
678 83,70,64,63,62,57,45,44,36,35,31,30,29,28,27,26,25,24,23,22,21,20,19,18,0, | |
679 11,15,16,17,32,33,34,37,61,67,73,75,76,81,82, | |
680 64,62,0,81, | |
681 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,106, | |
682 144,147,150,154,159, | |
683 146,145,70,0, | |
684 146,145,70,0, | |
685 143,142,0, | |
686 143,142,0, | |
687 140,139,0, | |
688 140,139,0, | |
689 140,139,0, | |
690 140,139,0, | |
691 137,136,135,134,0, | |
692 137,136,135,134,0, | |
693 132,131,0, | |
694 129,0, | |
695 127,0, | |
696 125,0, | |
697 123,0, | |
698 55,48,0, | |
699 48,43,0, | |
700 14,0, | |
701 62,0, | |
702 63,48,0, | |
703 63,48,0, | |
704 63,48,0, | |
705 165,164,163,162,161,160,153,152,151,149,148,143,142,129,104,103,102,101,100, | |
706 99,98,97,95,90,89,83,70,62,41,14,0,2,9,38,78,84,85,86,87,88,91,92,105, | |
707 106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
708 55,0, | |
709 55,48,14,0, | |
710 48,14,0, | |
711 63,0, | |
712 66,0, | |
713 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,78, | |
714 105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
715 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,105, | |
716 106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
717 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,43,41,0,38, | |
718 50,78,105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154, | |
719 159, | |
720 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,14,0,38,78, | |
721 91,92,105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154, | |
722 159, | |
723 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,78,91, | |
724 105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
725 165,164,163,162,161,160,153,152,151,149,148,143,142,129,104,103,102,101,100, | |
726 99,98,97,95,90,89,83,70,62,41,14,0,2,9,38,78,84,85,86,87,88,91,92,105, | |
727 106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
728 165,164,163,162,161,160,153,152,151,149,148,143,142,129,104,103,102,101,100, | |
729 99,98,97,95,90,89,83,70,62,41,14,0,2,9,38,78,84,85,86,87,88,91,92,105, | |
730 106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
731 165,164,163,162,161,160,153,152,151,149,148,143,142,129,104,103,102,101,100, | |
732 99,98,97,95,90,89,83,70,62,41,14,0,2,9,38,78,84,85,86,87,88,91,92,105, | |
733 106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
734 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,62,0,38,56, | |
735 105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
736 83,70,62,55,0,8,38,53,54,60,61, | |
737 14,0, | |
738 63,48,0, | |
739 96,0, | |
740 165,164,163,162,161,160,153,152,151,149,148,143,142,129,83,70,63,62,0,38,78, | |
741 91,92,105,106,118,120,122,124,126,128,130,133,138,141,144,147,150,154, | |
742 159, | |
743 14,0, | |
744 165,164,163,162,161,160,153,152,151,149,148,143,142,129,104,103,102,101,100, | |
745 99,98,97,95,90,89,83,70,62,41,14,0,2,9,38,78,84,85,86,87,88,91,92,105, | |
746 106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
747 63,0, | |
748 165,164,163,162,161,160,153,152,151,149,148,143,142,129,104,103,102,101,100, | |
749 99,98,97,95,90,89,83,70,62,41,14,0,2,9,38,78,84,85,86,87,88,91,92,105, | |
750 106,118,120,122,124,126,128,130,133,138,141,144,147,150,154,159, | |
751 0 | |
752 }; | |
753 | |
754 | |
755 static unsigned const char ag_astt[3496] = { | |
756 2,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,7,0,1,1,1,1,1,1,1,2,2,2,2,2,1, | |
757 2,1,1,2,8,7,1,1,2,5,7,1,1,5,8,5,5,5,5,1,1,7,1,1,1,2,1,1,7,1,2,1,1,2,1,7,2, | |
758 1,1,1,5,2,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1,1,1, | |
849 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,8,7,3,3,1,1,3,3,3,3,3,1,1, | |
850 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,11 | |
851 }; | |
852 | |
853 | |
854 static const unsigned char ag_pstt[] = { | |
855 113,3,4,1,2,2,17,17,16,16,16,16,16,16,16,16,16,25,24,23,22,21,0,0,9,9,9,9,8, | |
856 7,7,16,17,16,16,16,2,72,6,5, | |
857 113,11,1,10,11, | |
858 113,40,2,12,13, | |
859 81,15,81,81,81,81,14,14,3,14,14,15, | |
860 113,3,4,4,16,72,6,5, | |
861 113,4,5,72,17, | |
862 19,18,70, | |
863 113,3,4,1,2,2,20,20,19,19,19,19,19,19,19,19,19,25,24,23,22,21,21,7,22,20,21, | |
864 18,19,20,19,19,19,2,72,20,6,5, | |
865 113,1,2,2,25,17,17,16,16,16,16,16,16,16,16,16,25,24,23,22,21,8,24,6,24,23, | |
866 23,16,17,16,16,16,2, | |
867 113,3,4,1,2,2,17,17,16,16,16,16,16,16,16,16,16,25,24,23,22,21,1,9,3,3,3,8,7, | |
868 7,16,17,16,16,16,2,72,6,5, | |
869 65,65,65,65,65,65,65,65,65,65,41,65,65,65,65,65,65,65,65,65,65,65,65,65,65, | |
870 65,65,65,10, | |
871 26,11, | |
872 44,44,44,44,44,44,44,44,44,44,41,44,44,44,44,44,44,44,44,44,44,44,44,44,44, | |
873 44,44,44,12, | |
874 42,13,27, | |
875 86,86,82,86, | |
876 3,83,84, | |
877 73,16, | |
878 19,18,71, | |
879 113,29,1,2,2,17,17,16,16,16,16,16,16,16,16,16,25,24,23,22,21,18,30,30,16,17, | |
880 16,16,16,2,28,32,28,29,31,31, | |
881 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,49,38,19,37,49,49,49,39,48, | |
882 47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
883 50,11, | |
884 12,21, | |
885 113,1,51,2,2,25,17,17,16,16,16,16,16,16,16,16,16,25,24,23,22,21,51,52,8,52, | |
886 23,23,16,17,16,16,16,2, | |
887 113,3,4,1,2,2,20,20,19,19,19,19,19,19,19,19,19,25,24,23,22,21,21,23,53,20, | |
888 21,18,19,20,19,19,19,2,72,20,6,5, | |
889 113,1,2,2,25,17,17,16,16,16,16,16,16,16,16,16,25,24,23,22,21,24,14,7,23,23, | |
890 16,17,16,16,16,2, | |
891 37,37,37,37,37,37,34,34,33,35,36,34,34,34,57,58,59,60,61,62,63,64,65,67,68, | |
892 113,34,123,38,1,2,2,71,25,17,17,16,16,16,16,16,16,16,16,16,25,24,23,22, | |
893 21,66,25,70,54,70,54,23,23,16,17,16,16,16,2,69,56,70,70,70,70,70,56,66, | |
894 70,71,56,55,48,47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
895 113,26,72,73,73, | |
896 74,27, | |
897 75,79, | |
898 80,29, | |
899 113,3,76,92,78,1,92,2,2,20,20,19,19,19,19,19,19,19,19,19,25,24,23,22,21,30, | |
900 91,18,19,20,19,19,19,2,72,6,79,94,94,77, | |
901 80,87, | |
902 77,32, | |
903 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,81,33,37,194,37,34,37,37, | |
904 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,34,37,193,193,37,34,37, | |
905 37, | |
906 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,82,35,37,192,37,34,37,37, | |
907 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,82,36,37,191,37,34,37,37, | |
908 83,84,210,209,86,85,190, | |
909 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,1,2,2,88,88,88,88,88,88, | |
910 88,88,88,88,88,38,88,88,88,88,88,2,37,88,87,89,87,87,55,48,47,46,45,44, | |
911 43,42,41,40,39,39,37,34,37,37, | |
912 90,91,92,181, | |
913 93,94,178, | |
914 95,96,173, | |
915 97,98,99,100,170, | |
916 101,102,168, | |
917 103,166, | |
918 104,164, | |
919 105,162, | |
920 106,160, | |
921 107,108,157, | |
922 76,49, | |
923 113,3,4,50,53,72,50,6,5, | |
924 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,109,51,37,52,52,52,55, | |
925 48,47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
926 113,1,2,2,25,17,17,16,16,16,16,16,16,16,16,16,25,24,23,22,21,52,14,9,23,23, | |
927 16,17,16,16,16,2, | |
928 51,51, | |
929 37,37,37,37,37,37,34,34,33,35,36,34,34,34,57,58,59,60,61,62,63,64,65,67,68, | |
930 113,34,123,38,1,2,2,110,25,17,17,16,16,16,16,16,16,16,16,16,25,24,23,22, | |
931 21,66,54,70,14,70,23,23,16,17,16,16,16,2,69,56,70,70,70,70,70,56,66,70, | |
932 110,56,55,48,47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
933 111,111,111,111,111,111,111,111,111,111,111,188,111, | |
934 112,124, | |
935 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,113,57,37,56,56,113,56, | |
936 55,48,47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
937 140,58, | |
938 139,59, | |
939 113,60,114, | |
940 115,61, | |
941 37,37,37,37,37,37,34,34,33,35,36,34,34,34,57,58,59,60,61,62,63,64,65,67,68, | |
942 113,34,38,25,66,62,116,116,69,56,116,116,116,116,116,56,66,56,55,48,47, | |
943 46,45,44,43,42,41,40,39,39,37,34,37,37, | |
944 117,63, | |
945 118,64, | |
946 119,65, | |
947 125,66, | |
948 120,67, | |
949 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,68,37,121,121,39,48,47, | |
950 46,45,44,43,42,41,40,39,39,37,34,37,37, | |
951 122,211, | |
952 37,37,37,37,37,37,34,34,33,35,36,34,34,34,57,58,59,60,61,62,63,64,65,67,68, | |
953 113,34,123,38,127,25,66,70,131,131,69,56,131,131,131,131,131,56,66,56, | |
954 55,48,47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
955 128,71, | |
956 123,68, | |
957 124,64,73, | |
958 113,1,2,2,125,125,125,125,125,125,125,125,125,125,125,74,125,125,125,125, | |
959 125,2,126,126,125, | |
960 113,75,96, | |
961 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,127,38,76,37,127,127,127, | |
962 39,48,47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
963 129,128,104, | |
964 113,3,76,130,78,1,2,2,17,17,16,16,16,16,16,16,16,16,16,25,24,23,22,21,78,16, | |
965 30,30,16,17,16,16,16,2,72,6,79,130,31,31,131,77,130, | |
966 113,76,78,103,72,17,132, | |
967 113,88,1,2,2,17,17,16,16,16,16,16,16,16,16,16,25,24,23,22,21,80,30,30,16,17, | |
968 16,16,16,2,90, | |
969 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,1,2,2,88,88,88,88,88,88, | |
970 88,88,88,88,88,81,88,88,88,88,88,2,37,88,87,133,87,87,55,48,47,46,45,44, | |
971 43,42,41,40,39,39,37,34,37,37, | |
972 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,82,37,87,87,87,55,48,47, | |
973 46,45,44,43,42,41,40,39,39,37,34,37,37, | |
974 113,83,208, | |
975 113,84,207, | |
976 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,135,38,85,37,134,134,55,48, | |
977 47,46,45,44,43,42,41,40,39,39,37,34,37,134,135,37, | |
978 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,86,37,136,136,136,55,48, | |
979 47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
980 214,112,87, | |
981 113,3,76,92,137,1,2,2,57,57,56,56,56,56,56,56,56,56,56,88,56,57,56,56,56,2, | |
982 138,102,102,77, | |
983 139,89, | |
984 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,90,37,187,187,37,34,37, | |
985 37, | |
986 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,91,37,186,186,37,34,37, | |
987 37, | |
988 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,92,37,185,185,37,34,37, | |
989 37, | |
990 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,93,37,140,140,140,37,34, | |
991 37,37, | |
992 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,94,37,141,141,141,37,34, | |
993 37,37, | |
994 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,95,37,39,142,39,39,37, | |
995 34,37,37, | |
996 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,96,37,39,143,39,39,37, | |
997 34,37,37, | |
998 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,97,37,39,144,40,39,39, | |
999 37,34,37,37, | |
1000 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,98,37,39,145,40,39,39, | |
1001 37,34,37,37, | |
1002 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,99,37,39,146,40,39,39, | |
1003 37,34,37,37, | |
1004 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,100,37,39,147,40,39,39, | |
1005 37,34,37,37, | |
1006 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,101,37,39,148,41,40,39, | |
1007 39,37,34,37,37, | |
1008 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,102,37,39,149,41,40,39, | |
1009 39,37,34,37,37, | |
1010 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,103,37,39,150,42,41,40, | |
1011 39,39,37,34,37,37, | |
1012 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,104,37,39,151,43,42,41, | |
1013 40,39,39,37,34,37,37, | |
1014 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,105,37,39,152,44,43,42, | |
1015 41,40,39,39,37,34,37,37, | |
1016 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,106,37,39,153,45,44,43, | |
1017 42,41,40,39,39,37,34,37,37, | |
1018 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,107,37,39,154,46,45,44, | |
1019 43,42,41,40,39,39,37,34,37,37, | |
1020 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,108,37,155,155,155,55, | |
1021 48,47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1022 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,109,109,37,156,156,156, | |
1023 156,55,48,47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1024 129,110, | |
1025 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,111,37,145,145,55,48,47, | |
1026 46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1027 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,112,37,143,143,55,48,47, | |
1028 46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1029 141,113, | |
1030 138,114, | |
1031 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,157,115,37,56,56,157,56, | |
1032 55,48,47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1033 158,116, | |
1034 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,117,37,159,159,159,55, | |
1035 48,47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1036 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,118,37,160,160,160,55, | |
1037 48,47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1038 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,119,37,161,161,161,55, | |
1039 48,47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1040 37,37,37,37,37,37,34,34,33,35,36,34,34,34,57,58,59,60,61,62,63,64,65,67,68, | |
1041 113,34,38,25,66,120,122,122,69,56,122,122,122,122,122,56,66,56,55,48,47, | |
1042 46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1043 162,121, | |
1044 37,37,37,37,37,37,34,34,33,35,36,34,34,34,57,58,59,60,61,62,63,64,65,67,68, | |
1045 113,34,38,25,66,122,120,120,69,56,120,120,120,120,120,56,66,56,55,48,47, | |
1046 46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1047 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,123,37,69,69,39,48,47, | |
1048 46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1049 113,124,72,67, | |
1050 113,3,4,1,163,2,2,57,57,56,56,56,56,56,56,56,56,56,125,164,56,57,56,56,56,2, | |
1051 72,165,165,163,6,5, | |
1052 113,1,2,2,43,125,125,125,125,125,125,125,125,125,125,125,126,125,125,125, | |
1053 125,125,2,48,125, | |
1054 107,127, | |
1055 113,166,1,2,2,17,17,16,16,16,16,16,16,16,16,16,25,24,23,22,21,128,30,30,16, | |
1056 17,16,16,16,2,166,31,31,166, | |
1057 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,167,38,129,37,167,167,167, | |
1058 39,48,47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1059 111,130, | |
1060 106,131, | |
1061 129,128,105, | |
1062 195,133, | |
1063 168,205, | |
1064 206,135, | |
1065 203,112,136, | |
1066 113,3,76,130,137,1,2,2,17,17,16,16,16,16,16,16,16,16,16,25,24,23,22,21,137, | |
1067 30,30,16,17,16,16,16,2,138,130,31,31,131,77,130, | |
1068 76,137,103,132, | |
1069 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,139,37,189,189,37,34,37, | |
1070 37, | |
1071 90,91,92,183, | |
1072 90,91,92,182, | |
1073 93,94,180, | |
1074 93,94,179, | |
1075 95,96,177, | |
1076 95,96,176, | |
1077 95,96,175, | |
1078 95,96,174, | |
1079 97,98,99,100,172, | |
1080 97,98,99,100,171, | |
1081 101,102,169, | |
1082 103,167, | |
1083 104,165, | |
1084 105,163, | |
1085 106,161, | |
1086 169,112,155, | |
1087 170,98,156, | |
1088 171,157, | |
1089 172,158, | |
1090 173,112,159, | |
1091 174,112,160, | |
1092 175,112,161, | |
1093 37,37,37,37,37,37,34,34,33,35,36,34,34,34,57,58,59,60,61,62,63,64,65,67,68, | |
1094 113,34,38,25,66,162,121,121,69,56,121,121,121,121,121,56,66,56,55,48,47, | |
1095 46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1096 176,163, | |
1097 62,60,60,164, | |
1098 177,53,165, | |
1099 112,166, | |
1100 108,167, | |
1101 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,168,37,216,216,55,48,47, | |
1102 46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1103 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,169,37,158,39,48,47,46, | |
1104 45,44,43,42,41,40,39,39,37,34,37,37, | |
1105 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,99,109,170,37,101,101, | |
1106 101,55,48,47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1107 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,178,171,37,56,56,178,56, | |
1108 55,48,47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1109 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,172,37,179,179,179,55, | |
1110 48,47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1111 37,37,37,37,37,37,34,34,33,35,36,34,34,34,57,58,59,60,61,62,63,64,65,67,68, | |
1112 113,34,38,25,66,173,135,135,69,56,135,135,135,135,135,56,66,56,55,48,47, | |
1113 46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1114 37,37,37,37,37,37,34,34,33,35,36,34,34,34,57,58,59,60,61,62,63,64,65,67,68, | |
1115 113,34,38,25,66,174,134,134,69,56,134,134,134,134,134,56,66,56,55,48,47, | |
1116 46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1117 37,37,37,37,37,37,34,34,33,35,36,34,34,34,57,58,59,60,61,62,63,64,65,67,68, | |
1118 113,34,38,25,66,175,180,180,69,56,180,180,180,180,180,56,66,56,55,48,47, | |
1119 46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1120 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,38,176,37,63,63,39,48,47, | |
1121 46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1122 113,3,4,163,177,164,72,59,163,6,5, | |
1123 181,178, | |
1124 182,112,179, | |
1125 183,132, | |
1126 37,37,37,37,37,37,34,34,33,35,36,34,34,34,113,34,184,38,181,37,56,56,184,56, | |
1127 55,48,47,46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1128 136,182, | |
1129 37,37,37,37,37,37,34,34,33,35,36,34,34,34,57,58,59,60,61,62,63,64,65,67,68, | |
1130 113,34,38,25,66,183,133,133,69,56,133,133,133,133,133,56,66,56,55,48,47, | |
1131 46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1132 185,184, | |
1133 37,37,37,37,37,37,34,34,33,35,36,34,34,34,57,58,59,60,61,62,63,64,65,67,68, | |
1134 113,34,38,25,66,185,137,137,69,56,137,137,137,137,137,56,66,56,55,48,47, | |
1135 46,45,44,43,42,41,40,39,39,37,34,37,37, | |
1136 0 | |
1137 }; | |
1138 | |
1139 | |
1140 static const unsigned short ag_sbt[] = { | |
1141 0, 40, 45, 50, 62, 70, 75, 78, 116, 149, 188, 217, 219, 248, | |
1142 251, 255, 258, 260, 263, 299, 338, 340, 342, 376, 414, 446, 538, 543, | |
1143 545, 547, 549, 589, 591, 593, 617, 642, 666, 690, 697, 757, 761, 764, | |
1144 767, 772, 775, 777, 779, 781, 783, 786, 788, 797, 836, 868, 870, 961, | |
1145 974, 976,1016,1018,1020,1023,1025,1084,1086,1088,1090,1092,1094,1131, | |
1146 1133,1194,1196,1198,1201,1226,1229,1268,1271,1314,1321,1352,1412,1450, | |
1147 1453,1456,1496,1534,1537,1567,1569,1594,1619,1644,1670,1696,1723,1750, | |
1148 1778,1806,1834,1862,1891,1920,1950,1981,2013,2046,2080,2118,2158,2160, | |
1149 2197,2234,2236,2238,2278,2280,2318,2356,2394,2453,2455,2514,2551,2555, | |
1150 2587,2612,2614,2648,2687,2689,2691,2694,2696,2698,2700,2703,2743,2747, | |
1151 2772,2776,2780,2783,2786,2789,2792,2795,2798,2803,2808,2811,2813,2815, | |
1152 2817,2819,2822,2825,2827,2829,2832,2835,2838,2897,2899,2903,2906,2908, | |
1153 2910,2947,2983,3023,3063,3101,3160,3219,3278,3315,3326,3328,3331,3333, | |
1154 3373,3375,3434,3436,3495 | |
1155 }; | |
1156 | |
1157 | |
1158 static const unsigned short ag_sbe[] = { | |
1159 22, 42, 47, 58, 65, 72, 77, 101, 137, 172, 216, 218, 247, 249, | |
1160 253, 256, 259, 262, 284, 317, 339, 341, 364, 399, 435, 497, 539, 544, | |
1161 546, 548, 574, 590, 592, 610, 634, 659, 683, 696, 728, 760, 763, 766, | |
1162 771, 774, 776, 778, 780, 782, 785, 787, 791, 815, 857, 869, 921, 972, | |
1163 975, 994,1017,1019,1021,1024,1055,1085,1087,1089,1091,1093,1111,1132, | |
1164 1165,1195,1197,1200,1216,1227,1247,1270,1295,1317,1342,1383,1429,1451, | |
1165 1454,1474,1513,1536,1556,1568,1586,1611,1636,1661,1687,1713,1740,1767, | |
1166 1795,1823,1851,1879,1908,1937,1967,1998,2030,2063,2097,2136,2159,2177, | |
1167 2214,2235,2237,2256,2279,2297,2335,2373,2424,2454,2485,2531,2552,2573, | |
1168 2603,2613,2635,2666,2688,2690,2693,2695,2697,2699,2702,2727,2745,2764, | |
1169 2775,2779,2782,2785,2788,2791,2794,2797,2802,2807,2810,2812,2814,2816, | |
1170 2818,2821,2824,2826,2828,2831,2834,2837,2868,2898,2902,2905,2907,2909, | |
1171 2927,2964,3002,3041,3080,3131,3190,3249,3295,3319,3327,3330,3332,3351, | |
1172 3374,3405,3435,3466,3495 | |
1173 }; | |
1174 | |
1175 | |
1176 static const unsigned char ag_fl[] = { | |
1177 1,2,1,2,1,1,2,3,3,4,0,1,3,1,2,1,1,1,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1, | |
1178 1,1,1,1,1,0,1,0,6,2,1,1,1,2,1,3,1,3,3,1,1,2,2,1,3,1,0,1,3,5,2,1,3,1,3, | |
1179 1,2,1,3,0,1,4,4,0,1,4,0,1,2,3,1,2,1,3,1,3,2,0,1,2,1,3,1,3,4,1,3,2,1,1, | |
1180 2,3,3,4,0,1,3,4,1,1,1,1,1,1,1,3,4,3,0,1,2,0,1,3,4,1,2,5,7,5,5,7,9,3,2, | |
1181 2,3,1,3,1,3,1,1,1,1,1,1,1,1,1,1,1,1,5,1,1,3,1,3,1,3,1,3,1,3,1,3,3,1,3, | |
1182 3,3,3,1,3,3,1,3,3,1,3,3,3,1,4,1,2,2,2,2,4,1,1,1,1,1,1,1,4,0,1,4,3,3,2, | |
1183 2,1,1,1,3,1,3,1,1,1,1,1 | |
1184 }; | |
1185 | |
1186 static const unsigned char ag_ptt[] = { | |
1187 0, 1, 3, 3, 5, 5, 6, 6, 6, 6, 13, 13, 7, 10, 10, 11, 11, 11, | |
1188 11, 11, 11, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, | |
1189 16, 16, 17, 17, 39, 39, 40, 32, 32, 37, 37, 42, 42, 12, 12, 47, 47, 46, | |
1190 51, 51, 51, 51, 52, 52, 53, 54, 54, 53, 33, 33, 58, 58, 59, 59, 8, 8, | |
1191 60, 60, 65, 65, 60, 60, 69, 69, 60, 72, 72, 61, 61, 71, 71, 67, 67, 73, | |
1192 73, 75, 77, 77, 75, 68, 68, 50, 50, 50, 79, 79, 80, 76, 76, 76, 81, 81, | |
1193 81, 82, 82, 81, 81, 38, 2, 2, 2, 2, 2, 2, 84, 84, 84, 92, 92, 85, | |
1194 94, 94, 9, 9, 93, 93, 86, 86, 86, 87, 87, 87, 88, 88, 88, 88, 91, 91, | |
1195 78, 78,107,107,107,107,107,107,107,107,107,107,107,105,105, 56,118,118, | |
1196 120,120,122,122,124,124,126,126,128,128,128,130,130,130,130,130,133,133, | |
1197 133,138,138,138,141,141,141,141,144,144,106,106,106,106,106,106,150,150, | |
1198 150,150,150,150,147,147,156,156,147,147,147,147,147,154,154,154,154,155, | |
1199 155,159,159,159,159,159 | |
1200 }; | |
1201 | |
1202 static const unsigned char *ag_valid(int ag_k) { | |
1203 const unsigned char *ag_tp = &ag_tstt[ag_sbt[(PCB).sn+1]]; | |
1204 while (*--ag_tp != (unsigned char) ag_k) if (*ag_tp == 0) return NULL; | |
1205 return ag_tp; | |
1206 } | |
1207 | |
1208 int cc_change_reduction(cc_token_type ag_k) { | |
1209 if (!ag_valid(ag_k)) return 0; | |
1210 (PCB).reduction_token = ag_k; | |
1211 return 1; | |
1212 } | |
1213 | |
1214 static void ag_default(const int *ag_tp) { | |
1215 (PCB).ag_dsn = (PCB).sn; | |
1216 (PCB).ag_dtl = ag_tp; | |
1217 while (!ag_valid((cc_token_type) *ag_tp)) ag_tp++; | |
1218 (PCB).reduction_token = (cc_token_type) *ag_tp; | |
1219 } | |
1220 | |
1221 | |
1222 | |
1223 static void ag_ra(void) | |
1224 { | |
1225 switch(ag_rpx[(PCB).ag_ap]) { | |
1226 case 1: ag_rp_1(V(0,(int *))); break; | |
1227 case 2: V(0,(int *)) = ag_rp_2(); break; | |
1228 case 3: V(0,(int *)) = ag_rp_3(); break; | |
1229 case 4: V(0,(int *)) = ag_rp_4(V(0,(int *)), V(1,(int *))); break; | |
1230 case 5: V(0,(int *)) = ag_rp_5(); break; | |
1231 case 6: V(0,(int *)) = ag_rp_6(); break; | |
1232 case 7: V(0,(int *)) = ag_rp_7(); break; | |
1233 case 8: V(0,(int *)) = ag_rp_8(); break; | |
1234 case 9: V(0,(int *)) = ag_rp_9(); break; | |
1235 case 10: ag_rp_10(); break; | |
1236 case 11: ag_rp_11(); break; | |
1237 case 12: ag_rp_12(V(0,(token *))); break; | |
1238 case 13: ag_default(&ag_rtt[0]); V(0,(token *)) = ag_rp_13(V(0,(token *))); break; | |
1239 } | |
1240 } | |
1241 | |
1242 #define TOKEN_NAMES cc_token_names | |
1243 const char *const cc_token_names[166] = { | |
1244 "program", | |
1245 "program", | |
1246 "statement", | |
1247 "translation unit", | |
1248 "eof", | |
1249 "external declaration", | |
1250 "function definition", | |
1251 "declaration", | |
1252 "declarator", | |
1253 "compound statement", | |
1254 "declaration list", | |
1255 "declaration specifiers", | |
1256 "init declarator list", | |
1257 "", | |
1258 "';'", | |
1259 "storage class specifier", | |
1260 "type specifier", | |
1261 "type qualifier", | |
1262 "AUTO", | |
1263 "REGISTER", | |
1264 "STATIC", | |
1265 "EXTERN", | |
1266 "TYPEDEF", | |
1267 "VOIDkey", | |
1268 "CHAR", | |
1269 "SHORT", | |
1270 "INT", | |
1271 "LONG", | |
1272 "FLOAT", | |
1273 "DOUBLE", | |
1274 "SIGNED", | |
1275 "UNSIGNED", | |
1276 "struct or union specifier", | |
1277 "enum specifier", | |
1278 "typedef name", | |
1279 "CONSTANT", | |
1280 "VOLATILE", | |
1281 "struct or union", | |
1282 "identifier", | |
1283 "", | |
1284 "", | |
1285 "'{'", | |
1286 "struct declaration list", | |
1287 "'}'", | |
1288 "STRUCT", | |
1289 "UNION", | |
1290 "struct declaration", | |
1291 "init declarator", | |
1292 "','", | |
1293 "'='", | |
1294 "initializer", | |
1295 "specifier qualifier list", | |
1296 "struct declarator list", | |
1297 "struct declarator", | |
1298 "", | |
1299 "':'", | |
1300 "constant expression", | |
1301 "ENUM", | |
1302 "enumerator list", | |
1303 "enumerator", | |
1304 "direct declarator", | |
1305 "pointer", | |
1306 "'('", | |
1307 "')'", | |
1308 "'['", | |
1309 "", | |
1310 "']'", | |
1311 "parameter type list", | |
1312 "identifier list", | |
1313 "", | |
1314 "'*'", | |
1315 "type qualifier list", | |
1316 "", | |
1317 "parameter list", | |
1318 "ELLIPSIS", | |
1319 "parameter declaration", | |
1320 "abstract declarator", | |
1321 "", | |
1322 "assignment expression", | |
1323 "initializer list", | |
1324 "type name", | |
1325 "direct abstract declarator", | |
1326 "", | |
1327 "NAME", | |
1328 "labeled statement", | |
1329 "expression statement", | |
1330 "selection statement", | |
1331 "iteration statement", | |
1332 "jump statement", | |
1333 "CASE", | |
1334 "DEFAULT", | |
1335 "expression", | |
1336 "", | |
1337 "statement list", | |
1338 "", | |
1339 "IF", | |
1340 "ELSE", | |
1341 "SWITCH", | |
1342 "WHILE", | |
1343 "DO", | |
1344 "FOR", | |
1345 "GOTO", | |
1346 "CONTINUE", | |
1347 "BREAK", | |
1348 "RETURN", | |
1349 "conditional expression", | |
1350 "unary expression", | |
1351 "assignment operator", | |
1352 "MULTassign", | |
1353 "DIVassign", | |
1354 "MODassign", | |
1355 "PLUSassign", | |
1356 "MINUSassign", | |
1357 "LSassign", | |
1358 "RSassign", | |
1359 "ANDassign", | |
1360 "ORassign", | |
1361 "ERassign", | |
1362 "logical or expression", | |
1363 "'\\?'", | |
1364 "logical and expression", | |
1365 "OROR", | |
1366 "inclusive or expression", | |
1367 "ANDAND", | |
1368 "exclusive or expression", | |
1369 "'|'", | |
1370 "and expression", | |
1371 "'^'", | |
1372 "equality expression", | |
1373 "'&'", | |
1374 "relational expression", | |
1375 "EQ", | |
1376 "NE", | |
1377 "shift expression", | |
1378 "'<'", | |
1379 "'>'", | |
1380 "LE", | |
1381 "GE", | |
1382 "additive expression", | |
1383 "LS", | |
1384 "RS", | |
1385 "multiplicative expression", | |
1386 "'+'", | |
1387 "'-'", | |
1388 "cast expression", | |
1389 "'/'", | |
1390 "'%'", | |
1391 "postfix expression", | |
1392 "ICR", | |
1393 "DECR", | |
1394 "unary operator", | |
1395 "SIZEOF", | |
1396 "'~'", | |
1397 "'!'", | |
1398 "primary expression", | |
1399 "argument expression list", | |
1400 "", | |
1401 "'.'", | |
1402 "ARROW", | |
1403 "constant", | |
1404 "STRINGliteral", | |
1405 "HEXconstant", | |
1406 "OCTconstant", | |
1407 "DECconstant", | |
1408 "FLOATconstant", | |
1409 "CHARACTERconstant", | |
1410 | |
1411 }; | |
1412 | |
1413 #ifndef MISSING_FORMAT | |
1414 #define MISSING_FORMAT "Missing %s" | |
1415 #endif | |
1416 #ifndef UNEXPECTED_FORMAT | |
1417 #define UNEXPECTED_FORMAT "Unexpected %s" | |
1418 #endif | |
1419 #ifndef UNNAMED_TOKEN | |
1420 #define UNNAMED_TOKEN "input" | |
1421 #endif | |
1422 | |
1423 | |
1424 static void ag_diagnose(void) { | |
1425 int ag_snd = (PCB).sn; | |
1426 int ag_k = ag_sbt[ag_snd]; | |
1427 | |
1428 if (*TOKEN_NAMES[ag_tstt[ag_k]] && ag_astt[ag_k + 1] == ag_action_8) { | |
1429 sprintf((PCB).ag_msg, MISSING_FORMAT, TOKEN_NAMES[ag_tstt[ag_k]]); | |
1430 } | |
1431 else if (ag_astt[ag_sbe[(PCB).sn]] == ag_action_8 | |
1432 && (ag_k = (int) ag_sbe[(PCB).sn] + 1) == (int) ag_sbt[(PCB).sn+1] - 1 | |
1433 && *TOKEN_NAMES[ag_tstt[ag_k]]) { | |
1434 sprintf((PCB).ag_msg, MISSING_FORMAT, TOKEN_NAMES[ag_tstt[ag_k]]); | |
1435 } | |
1436 else if ((PCB).token_number && *TOKEN_NAMES[(PCB).token_number]) { | |
1437 sprintf((PCB).ag_msg, UNEXPECTED_FORMAT, TOKEN_NAMES[(PCB).token_number]); | |
1438 } | |
1439 else if (isprint(((PCB).input_code)) && ((PCB).input_code) != '\\') { | |
1440 char buf[20]; | |
1441 sprintf(buf, "\'%c\'", (char) ((PCB).input_code)); | |
1442 sprintf((PCB).ag_msg, UNEXPECTED_FORMAT, buf); | |
1443 } | |
1444 else sprintf((PCB).ag_msg, UNEXPECTED_FORMAT, UNNAMED_TOKEN); | |
1445 (PCB).error_message = (PCB).ag_msg; | |
1446 | |
1447 | |
1448 } | |
1449 static int ag_action_1_r_proc(void); | |
1450 static int ag_action_2_r_proc(void); | |
1451 static int ag_action_3_r_proc(void); | |
1452 static int ag_action_4_r_proc(void); | |
1453 static int ag_action_1_s_proc(void); | |
1454 static int ag_action_3_s_proc(void); | |
1455 static int ag_action_1_proc(void); | |
1456 static int ag_action_2_proc(void); | |
1457 static int ag_action_3_proc(void); | |
1458 static int ag_action_4_proc(void); | |
1459 static int ag_action_5_proc(void); | |
1460 static int ag_action_6_proc(void); | |
1461 static int ag_action_7_proc(void); | |
1462 static int ag_action_8_proc(void); | |
1463 static int ag_action_9_proc(void); | |
1464 static int ag_action_10_proc(void); | |
1465 static int ag_action_11_proc(void); | |
1466 static int ag_action_8_proc(void); | |
1467 | |
1468 | |
1469 static int (*const ag_r_procs_scan[])(void) = { | |
1470 ag_action_1_r_proc, | |
1471 ag_action_2_r_proc, | |
1472 ag_action_3_r_proc, | |
1473 ag_action_4_r_proc | |
1474 }; | |
1475 | |
1476 static int (*const ag_s_procs_scan[])(void) = { | |
1477 ag_action_1_s_proc, | |
1478 ag_action_2_r_proc, | |
1479 ag_action_3_s_proc, | |
1480 ag_action_4_r_proc | |
1481 }; | |
1482 | |
1483 static int (*const ag_gt_procs_scan[])(void) = { | |
1484 ag_action_1_proc, | |
1485 ag_action_2_proc, | |
1486 ag_action_3_proc, | |
1487 ag_action_4_proc, | |
1488 ag_action_5_proc, | |
1489 ag_action_6_proc, | |
1490 ag_action_7_proc, | |
1491 ag_action_8_proc, | |
1492 ag_action_9_proc, | |
1493 ag_action_10_proc, | |
1494 ag_action_11_proc, | |
1495 ag_action_8_proc | |
1496 }; | |
1497 | |
1498 | |
1499 static int ag_action_10_proc(void) { | |
1500 (PCB).btsx = 0, (PCB).drt = -1; | |
1501 ag_track(); | |
1502 return 0; | |
1503 } | |
1504 | |
1505 static int ag_action_11_proc(void) { | |
1506 (PCB).btsx = 0, (PCB).drt = -1; | |
1507 (*(token *) &(PCB).vs[(PCB).ssx]) = (PCB).input_value; | |
1508 (PCB).ssx--; | |
1509 ag_ra(); | |
1510 (PCB).ssx++; | |
1511 ag_track(); | |
1512 return 0; | |
1513 } | |
1514 | |
1515 static int ag_action_3_r_proc(void) { | |
1516 int ag_sd = ag_fl[(PCB).ag_ap] - 1; | |
1517 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd]; | |
1518 (PCB).btsx = 0, (PCB).drt = -1; | |
1519 (PCB).reduction_token = (cc_token_type) ag_ptt[(PCB).ag_ap]; | |
1520 ag_ra(); | |
1521 return (PCB).exit_flag == AG_RUNNING_CODE; | |
1522 } | |
1523 | |
1524 static int ag_action_3_s_proc(void) { | |
1525 int ag_sd = ag_fl[(PCB).ag_ap] - 1; | |
1526 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd]; | |
1527 (PCB).btsx = 0, (PCB).drt = -1; | |
1528 (PCB).reduction_token = (cc_token_type) ag_ptt[(PCB).ag_ap]; | |
1529 ag_ra(); | |
1530 return (PCB).exit_flag == AG_RUNNING_CODE; | |
1531 } | |
1532 | |
1533 static int ag_action_4_r_proc(void) { | |
1534 int ag_sd = ag_fl[(PCB).ag_ap] - 1; | |
1535 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd]; | |
1536 (PCB).reduction_token = (cc_token_type) ag_ptt[(PCB).ag_ap]; | |
1537 return 1; | |
1538 } | |
1539 | |
1540 static int ag_action_2_proc(void) { | |
1541 (PCB).btsx = 0, (PCB).drt = -1; | |
1542 if ((PCB).ssx >= 128) { | |
1543 ag_trace_error(); | |
1544 (PCB).exit_flag = AG_STACK_ERROR_CODE; | |
1545 PARSER_STACK_OVERFLOW; | |
1546 } | |
1547 (*(token *) &(PCB).vs[(PCB).ssx]) = (PCB).input_value; | |
1548 (PCB).ss[(PCB).ssx] = (PCB).sn; | |
1549 (PCB).ssx++; | |
1550 (PCB).sn = (PCB).ag_ap; | |
1551 ag_track(); | |
1552 return 0; | |
1553 } | |
1554 | |
1555 static int ag_action_9_proc(void) { | |
1556 if ((PCB).drt == -1) { | |
1557 (PCB).drt=(PCB).token_number; | |
1558 (PCB).dssx=(PCB).ssx; | |
1559 (PCB).dsn=(PCB).sn; | |
1560 } | |
1561 ag_prot(); | |
1562 (PCB).ss[(PCB).ssx] = (PCB).sn; | |
1563 (PCB).ssx++; | |
1564 (PCB).sn = (PCB).ag_ap; | |
1565 return (PCB).exit_flag == AG_RUNNING_CODE; | |
1566 } | |
1567 | |
1568 static int ag_action_2_r_proc(void) { | |
1569 (PCB).ssx++; | |
1570 (PCB).sn = (PCB).ag_ap; | |
1571 return 0; | |
1572 } | |
1573 | |
1574 static int ag_action_7_proc(void) { | |
1575 --(PCB).ssx; | |
1576 (PCB).exit_flag = AG_SUCCESS_CODE; | |
1577 return 0; | |
1578 } | |
1579 | |
1580 static int ag_action_1_proc(void) { | |
1581 (PCB).exit_flag = AG_SUCCESS_CODE; | |
1582 ag_track(); | |
1583 return 0; | |
1584 } | |
1585 | |
1586 static int ag_action_1_r_proc(void) { | |
1587 (PCB).exit_flag = AG_SUCCESS_CODE; | |
1588 return 0; | |
1589 } | |
1590 | |
1591 static int ag_action_1_s_proc(void) { | |
1592 (PCB).exit_flag = AG_SUCCESS_CODE; | |
1593 return 0; | |
1594 } | |
1595 | |
1596 static int ag_action_4_proc(void) { | |
1597 int ag_sd = ag_fl[(PCB).ag_ap] - 1; | |
1598 (PCB).reduction_token = (cc_token_type) ag_ptt[(PCB).ag_ap]; | |
1599 (PCB).btsx = 0, (PCB).drt = -1; | |
1600 (*(token *) &(PCB).vs[(PCB).ssx]) = (PCB).input_value; | |
1601 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd]; | |
1602 else (PCB).ss[(PCB).ssx] = (PCB).sn; | |
1603 ag_track(); | |
1604 while ((PCB).exit_flag == AG_RUNNING_CODE) { | |
1605 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1; | |
1606 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1; | |
1607 do { | |
1608 unsigned ag_tx = (ag_t1 + ag_t2)/2; | |
1609 if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1; | |
1610 else ag_t2 = ag_tx; | |
1611 } while (ag_t1 < ag_t2); | |
1612 if (ag_tstt[ag_t1] != (PCB).reduction_token) { | |
1613 (PCB).exit_flag = AG_REDUCTION_ERROR_CODE; ag_trace_error(); | |
1614 REDUCTION_TOKEN_ERROR; break;} | |
1615 (PCB).ag_ap = ag_pstt[ag_t1]; | |
1616 if ((ag_s_procs_scan[ag_astt[ag_t1]])() == 0) break; | |
1617 } | |
1618 return 0; | |
1619 } | |
1620 | |
1621 static int ag_action_3_proc(void) { | |
1622 int ag_sd = ag_fl[(PCB).ag_ap] - 1; | |
1623 (PCB).btsx = 0, (PCB).drt = -1; | |
1624 (*(token *) &(PCB).vs[(PCB).ssx]) = (PCB).input_value; | |
1625 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd]; | |
1626 else (PCB).ss[(PCB).ssx] = (PCB).sn; | |
1627 ag_track(); | |
1628 (PCB).reduction_token = (cc_token_type) ag_ptt[(PCB).ag_ap]; | |
1629 ag_ra(); | |
1630 while ((PCB).exit_flag == AG_RUNNING_CODE) { | |
1631 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1; | |
1632 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1; | |
1633 do { | |
1634 unsigned ag_tx = (ag_t1 + ag_t2)/2; | |
1635 if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1; | |
1636 else ag_t2 = ag_tx; | |
1637 } while (ag_t1 < ag_t2); | |
1638 if (ag_tstt[ag_t1] != (PCB).reduction_token) { | |
1639 (PCB).exit_flag = AG_REDUCTION_ERROR_CODE; ag_trace_error(); | |
1640 REDUCTION_TOKEN_ERROR; break;} | |
1641 (PCB).ag_ap = ag_pstt[ag_t1]; | |
1642 if ((ag_s_procs_scan[ag_astt[ag_t1]])() == 0) break; | |
1643 } | |
1644 return 0; | |
1645 } | |
1646 | |
1647 static int ag_action_8_proc(void) { | |
1648 ag_undo(); | |
1649 ag_trace_error(); | |
1650 (PCB).exit_flag = AG_SYNTAX_ERROR_CODE; | |
1651 ag_diagnose(); | |
1652 SYNTAX_ERROR; | |
1653 ag_track(); | |
1654 return (PCB).exit_flag == AG_RUNNING_CODE; | |
1655 } | |
1656 | |
1657 static int ag_action_5_proc(void) { | |
1658 int ag_sd = ag_fl[(PCB).ag_ap]; | |
1659 (PCB).btsx = 0, (PCB).drt = -1; | |
1660 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd]; | |
1661 else { | |
1662 (PCB).ss[(PCB).ssx] = (PCB).sn; | |
1663 } | |
1664 (PCB).reduction_token = (cc_token_type) ag_ptt[(PCB).ag_ap]; | |
1665 ag_ra(); | |
1666 while ((PCB).exit_flag == AG_RUNNING_CODE) { | |
1667 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1; | |
1668 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1; | |
1669 do { | |
1670 unsigned ag_tx = (ag_t1 + ag_t2)/2; | |
1671 if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1; | |
1672 else ag_t2 = ag_tx; | |
1673 } while (ag_t1 < ag_t2); | |
1674 if (ag_tstt[ag_t1] != (PCB).reduction_token) { | |
1675 (PCB).exit_flag = AG_REDUCTION_ERROR_CODE; ag_trace_error(); | |
1676 REDUCTION_TOKEN_ERROR; break;} | |
1677 (PCB).ag_ap = ag_pstt[ag_t1]; | |
1678 if ((ag_r_procs_scan[ag_astt[ag_t1]])() == 0) break; | |
1679 } | |
1680 return (PCB).exit_flag == AG_RUNNING_CODE; | |
1681 } | |
1682 | |
1683 static int ag_action_6_proc(void) { | |
1684 int ag_sd = ag_fl[(PCB).ag_ap]; | |
1685 (PCB).reduction_token = (cc_token_type) ag_ptt[(PCB).ag_ap]; | |
1686 if ((PCB).drt == -1) { | |
1687 (PCB).drt=(PCB).token_number; | |
1688 (PCB).dssx=(PCB).ssx; | |
1689 (PCB).dsn=(PCB).sn; | |
1690 } | |
1691 if (ag_sd) { | |
1692 (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd]; | |
1693 } | |
1694 else { | |
1695 ag_prot(); | |
1696 (PCB).vs[(PCB).ssx] = ag_null_value; | |
1697 (PCB).ss[(PCB).ssx] = (PCB).sn; | |
1698 } | |
1699 while ((PCB).exit_flag == AG_RUNNING_CODE) { | |
1700 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1; | |
1701 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1; | |
1702 do { | |
1703 unsigned ag_tx = (ag_t1 + ag_t2)/2; | |
1704 if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1; | |
1705 else ag_t2 = ag_tx; | |
1706 } while (ag_t1 < ag_t2); | |
1707 if (ag_tstt[ag_t1] != (PCB).reduction_token) { | |
1708 (PCB).exit_flag = AG_REDUCTION_ERROR_CODE; ag_trace_error(); | |
1709 REDUCTION_TOKEN_ERROR; break;} | |
1710 (PCB).ag_ap = ag_pstt[ag_t1]; | |
1711 if ((ag_r_procs_scan[ag_astt[ag_t1]])() == 0) break; | |
1712 } | |
1713 return (PCB).exit_flag == AG_RUNNING_CODE; | |
1714 } | |
1715 | |
1716 | |
1717 void init_cc(void) { | |
1718 unsigned ag_t1; | |
1719 ag_t1 = 0; | |
1720 (PCB).ss[0] = (PCB).sn = (PCB).ssx = 0; | |
1721 (PCB).exit_flag = AG_RUNNING_CODE; | |
1722 (PCB).line = FIRST_LINE; | |
1723 (PCB).column = FIRST_COLUMN; | |
1724 (PCB).btsx = 0, (PCB).drt = -1; | |
1725 while (ag_tstt[ag_t1] == 0) { | |
1726 (PCB).ag_ap = ag_pstt[ag_t1]; | |
1727 (ag_gt_procs_scan[ag_astt[ag_t1]])(); | |
1728 ag_t1 = ag_sbt[(PCB).sn]; | |
1729 } | |
1730 } | |
1731 | |
1732 void cc(void) { | |
1733 (PCB).token_number = (cc_token_type) AG_TCV((PCB).input_code); | |
1734 while (1) { | |
1735 unsigned ag_t1 = ag_sbt[(PCB).sn]; | |
1736 unsigned ag_t2 = ag_sbe[(PCB).sn] - 1; | |
1737 do { | |
1738 unsigned ag_tx = (ag_t1 + ag_t2)/2; | |
1739 if (ag_tstt[ag_tx] > (unsigned char)(PCB).token_number) | |
1740 ag_t1 = ag_tx + 1; | |
1741 else ag_t2 = ag_tx; | |
1742 } while (ag_t1 < ag_t2); | |
1743 if (ag_tstt[ag_t1] != (unsigned char)(PCB).token_number) | |
1744 ag_t1 = ag_sbe[(PCB).sn]; | |
1745 (PCB).ag_ap = ag_pstt[ag_t1]; | |
1746 if ((ag_gt_procs_scan[ag_astt[ag_t1]])() == 0) break; | |
1747 } | |
1748 } | |
1749 | |
1750 |