comparison tests/agcl/examples/good/ffcalc.c @ 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 /* FOUR FUNCTION CALCULATOR: FFCALC.SYN */
2 /*
3 * AnaGram, A System for Syntax Directed Programming
4 * File generated by: ...
5 *
6 * AnaGram Parsing Engine
7 * Copyright 1993-2002 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 #ifndef FFCALC_H
27 #include "ffcalc.h"
28 #endif
29
30 #ifndef FFCALC_H
31 #error Mismatched header file
32 #endif
33
34 #include <ctype.h>
35 #include <stdio.h>
36
37 #define RULE_CONTEXT (&((PCB).cs[(PCB).ssx]))
38 #define ERROR_CONTEXT ((PCB).cs[(PCB).error_frame_ssx])
39 #define CONTEXT ((PCB).cs[(PCB).ssx])
40
41
42
43 ffcalc_pcb_type ffcalc_pcb;
44 #define PCB ffcalc_pcb
45
46 /* Line -, ffcalc.syn */
47 /* -- EMBEDDED C ---------------------------------- */
48 double value[64]; /* registers */
49 int main(void) {
50 ffcalc();
51 return 0;
52 }
53
54 #ifndef CONVERT_CASE
55 #define CONVERT_CASE(c) (c)
56 #endif
57 #ifndef TAB_SPACING
58 #define TAB_SPACING 8
59 #endif
60
61 #define ag_rp_1(x) (printf("%g\n",x))
62
63 static void ag_rp_2(int n, double x) {
64 /* Line -, ffcalc.syn */
65 printf("%c = %g\n",n+'A',value[n]=x);
66 }
67
68 #define ag_rp_3(x, t) (x+t)
69
70 #define ag_rp_4(x, t) (x-t)
71
72 #define ag_rp_5(t, f) (t*f)
73
74 #define ag_rp_6(t, f) (t/f)
75
76 #define ag_rp_7(n) (value[n])
77
78 #define ag_rp_8(x) (x)
79
80 #define ag_rp_9(f) (-f)
81
82 #define ag_rp_10(c) (c-'A')
83
84 #define ag_rp_11(i, f) (i+f)
85
86 #define ag_rp_12(f) (f)
87
88 #define ag_rp_13(d) (d-'0')
89
90 #define ag_rp_14(x, d) (10*x + d-'0')
91
92 #define ag_rp_15(d) ((d-'0')/10.)
93
94 #define ag_rp_16(d, f) ((d-'0' + f)/10.)
95
96
97 #define READ_COUNTS
98 #define WRITE_COUNTS
99 #undef V
100 #define V(i,t) (*t (&(PCB).vs[(PCB).ssx + i]))
101 #undef VS
102 #define VS(i) (PCB).vs[(PCB).ssx + i]
103
104 #ifndef GET_CONTEXT
105 #define GET_CONTEXT CONTEXT = (PCB).input_context
106 #endif
107
108 typedef enum {
109 ag_action_1,
110 ag_action_2,
111 ag_action_3,
112 ag_action_4,
113 ag_action_5,
114 ag_action_6,
115 ag_action_7,
116 ag_action_8,
117 ag_action_9,
118 ag_action_10,
119 ag_action_11,
120 ag_action_12
121 } ag_parser_action;
122
123
124 #ifndef NULL_VALUE_INITIALIZER
125 #define NULL_VALUE_INITIALIZER = { 0 }
126 #endif
127
128 static ffcalc_vs_type const ag_null_value NULL_VALUE_INITIALIZER;
129
130 static const unsigned char ag_rpx[] = {
131 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 3, 4, 0, 5, 6,
132 7, 0, 8, 9, 0, 0, 0, 0, 0, 0, 10, 11, 0, 0, 0, 12, 13, 14,
133 15, 16
134 };
135
136 static const unsigned char ag_key_itt[] = {
137 0
138 };
139
140 static const unsigned short ag_key_pt[] = {
141 0
142 };
143
144 static const unsigned char ag_key_ch[] = {
145 0, 47,255, 42,255
146 };
147
148 static const unsigned char ag_key_act[] = {
149 0,3,4,3,4
150 };
151
152 static const unsigned char ag_key_parm[] = {
153 0, 24, 0, 28, 0
154 };
155
156 static const unsigned char ag_key_jmp[] = {
157 0, 0, 0, 2, 0
158 };
159
160 static const unsigned char ag_key_index[] = {
161 1, 3, 1, 0, 3, 3, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0,
162 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0,
163 0
164 };
165
166 static const unsigned char ag_key_ends[] = {
167 42,0, 47,0,
168 };
169 #define AG_TCV(x) (((int)(x) >= -1 && (int)(x) <= 255) ? ag_tcv[(x) + 1] : 0)
170
171 static const unsigned char ag_tcv[] = {
172 10, 35, 35, 35, 35, 35, 35, 35, 35, 35, 23, 38, 23, 23, 23, 35, 35, 35,
173 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 23, 35, 35,
174 35, 35, 35, 35, 35, 46, 45, 42, 40, 35, 41, 31, 43, 34, 34, 34, 34, 34,
175 34, 34, 34, 34, 34, 35, 35, 35, 39, 35, 35, 35, 47, 47, 47, 47, 47, 47,
176 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
177 47, 47, 35, 35, 35, 35, 35, 35, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
178 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 35, 35,
179 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
180 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
181 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
182 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
183 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
184 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
185 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
186 35, 35, 35, 35, 35
187 };
188
189 #ifndef SYNTAX_ERROR
190 #define SYNTAX_ERROR fprintf(stderr,"%s, line %d, column %d\n", \
191 (PCB).error_message, (PCB).line, (PCB).column)
192 #endif
193
194 #ifndef FIRST_LINE
195 #define FIRST_LINE 1
196 #endif
197
198 #ifndef FIRST_COLUMN
199 #define FIRST_COLUMN 1
200 #endif
201
202 #ifndef PARSER_STACK_OVERFLOW
203 #define PARSER_STACK_OVERFLOW {fprintf(stderr, \
204 "\nParser stack overflow, line %d, column %d\n",\
205 (PCB).line, (PCB).column);}
206 #endif
207
208 #ifndef REDUCTION_TOKEN_ERROR
209 #define REDUCTION_TOKEN_ERROR {fprintf(stderr, \
210 "\nReduction token error, line %d, column %d\n", \
211 (PCB).line, (PCB).column);}
212 #endif
213
214
215 typedef enum
216 {ag_accept_key, ag_set_key, ag_jmp_key, ag_end_key, ag_no_match_key,
217 ag_cf_accept_key, ag_cf_set_key, ag_cf_end_key} key_words;
218
219 #ifndef GET_INPUT
220 #define GET_INPUT ((PCB).input_code = getchar())
221 #endif
222
223
224 static int ag_look_ahead(void) {
225 if ((PCB).rx < (PCB).fx) {
226 return CONVERT_CASE((PCB).lab[(PCB).rx++]);
227 }
228 GET_INPUT;
229 (PCB).fx++;
230 return CONVERT_CASE((PCB).lab[(PCB).rx++] = (PCB).input_code);
231 }
232
233 static void ag_get_key_word(int ag_k) {
234 int save_index = (PCB).rx;
235 const unsigned char *sp;
236 int ag_ch;
237 while (1) {
238 switch (ag_key_act[ag_k]) {
239 case ag_cf_end_key:
240 sp = ag_key_ends + ag_key_jmp[ag_k];
241 do {
242 if ((ag_ch = *sp++) == 0) {
243 int ag_k1 = ag_key_parm[ag_k];
244 int ag_k2 = ag_key_pt[ag_k1];
245 if (ag_key_itt[ag_k2 + ag_look_ahead()]) goto ag_fail;
246 (PCB).rx--;
247 (PCB).token_number = (ffcalc_token_type) ag_key_pt[ag_k1 + 1];
248 return;
249 }
250 } while (ag_look_ahead() == ag_ch);
251 goto ag_fail;
252 case ag_end_key:
253 sp = ag_key_ends + ag_key_jmp[ag_k];
254 do {
255 if ((ag_ch = *sp++) == 0) {
256 (PCB).token_number = (ffcalc_token_type) ag_key_parm[ag_k];
257 return;
258 }
259 } while (ag_look_ahead() == ag_ch);
260 case ag_no_match_key:
261 ag_fail:
262 (PCB).rx = save_index;
263 return;
264 case ag_cf_set_key: {
265 int ag_k1 = ag_key_parm[ag_k];
266 int ag_k2 = ag_key_pt[ag_k1];
267 ag_k = ag_key_jmp[ag_k];
268 if (ag_key_itt[ag_k2 + (ag_ch = ag_look_ahead())]) break;
269 save_index = --(PCB).rx;
270 (PCB).token_number = (ffcalc_token_type) ag_key_pt[ag_k1+1];
271 break;
272 }
273 case ag_set_key:
274 save_index = (PCB).rx;
275 (PCB).token_number = (ffcalc_token_type) ag_key_parm[ag_k];
276 case ag_jmp_key:
277 ag_k = ag_key_jmp[ag_k];
278 ag_ch = ag_look_ahead();
279 break;
280 case ag_accept_key:
281 (PCB).token_number = (ffcalc_token_type) ag_key_parm[ag_k];
282 return;
283 case ag_cf_accept_key: {
284 int ag_k1 = ag_key_parm[ag_k];
285 int ag_k2 = ag_key_pt[ag_k1];
286 if (ag_key_itt[ag_k2 + ag_look_ahead()]) (PCB).rx = save_index;
287 else {
288 (PCB).rx--;
289 (PCB).token_number = (ffcalc_token_type) ag_key_pt[ag_k1+1];
290 }
291 return;
292 }
293 default:
294 /* not reachable; here to suppress compiler warnings */
295 goto ag_fail;
296 }
297 if (ag_ch <= 255) while (ag_key_ch[ag_k] < ag_ch) ag_k++;
298 if (ag_ch > 255 || ag_key_ch[ag_k] != ag_ch) {
299 (PCB).rx = save_index;
300 return;
301 }
302 }
303 }
304
305
306 #ifndef AG_NEWLINE
307 #define AG_NEWLINE 10
308 #endif
309
310 #ifndef AG_RETURN
311 #define AG_RETURN 13
312 #endif
313
314 #ifndef AG_FORMFEED
315 #define AG_FORMFEED 12
316 #endif
317
318 #ifndef AG_TABCHAR
319 #define AG_TABCHAR 9
320 #endif
321
322 static void ag_track(void) {
323 int ag_k = 0;
324 while (ag_k < (PCB).rx) {
325 int ag_ch = (PCB).lab[ag_k++];
326 switch (ag_ch) {
327 case AG_NEWLINE:
328 (PCB).column = 1, (PCB).line++;
329 case AG_RETURN:
330 case AG_FORMFEED:
331 break;
332 case AG_TABCHAR:
333 (PCB).column += (TAB_SPACING) - ((PCB).column - 1) % (TAB_SPACING);
334 break;
335 default:
336 (PCB).column++;
337 }
338 }
339 ag_k = 0;
340 while ((PCB).rx < (PCB).fx) (PCB).lab[ag_k++] = (PCB).lab[(PCB).rx++];
341 (PCB).fx = ag_k;
342 (PCB).rx = 0;
343 }
344
345
346 static void ag_prot(void) {
347 int ag_k;
348 ag_k = 128 - ++(PCB).btsx;
349 if (ag_k <= (PCB).ssx) {
350 (PCB).exit_flag = AG_STACK_ERROR_CODE;
351 PARSER_STACK_OVERFLOW;
352 return;
353 }
354 (PCB).bts[(PCB).btsx] = (PCB).sn;
355 (PCB).bts[ag_k] = (PCB).ssx;
356 (PCB).vs[ag_k] = (PCB).vs[(PCB).ssx];
357 (PCB).ss[ag_k] = (PCB).ss[(PCB).ssx];
358 }
359
360 static void ag_undo(void) {
361 if ((PCB).drt == -1) return;
362 while ((PCB).btsx) {
363 int ag_k = 128 - (PCB).btsx;
364 (PCB).sn = (PCB).bts[(PCB).btsx--];
365 (PCB).ssx = (PCB).bts[ag_k];
366 (PCB).vs[(PCB).ssx] = (PCB).vs[ag_k];
367 (PCB).ss[(PCB).ssx] = (PCB).ss[ag_k];
368 }
369 (PCB).token_number = (ffcalc_token_type) (PCB).drt;
370 (PCB).ssx = (PCB).dssx;
371 (PCB).sn = (PCB).dsn;
372 (PCB).drt = -1;
373 }
374
375
376 static const unsigned char ag_tstt[] = {
377 47,46,41,38,34,31,24,23,10,0,1,36,37,
378 47,46,45,43,42,41,40,39,38,35,34,31,28,23,0,26,27,
379 24,23,0,1,
380 47,46,41,38,34,31,14,10,0,2,3,4,5,7,8,9,11,12,15,17,18,21,29,30,44,
381 47,46,45,43,42,41,40,39,38,35,34,31,23,0,
382 28,0,
383 34,0,32,
384 45,43,42,41,40,38,34,31,24,23,0,33,
385 47,46,41,34,31,24,23,0,1,36,37,
386 47,46,41,34,31,24,23,0,1,36,37,
387 45,43,42,41,40,38,24,23,0,1,36,37,
388 47,46,41,34,31,0,2,12,17,18,21,29,30,44,
389 47,46,41,34,31,0,2,11,12,15,17,18,21,29,30,44,
390 45,43,42,41,40,39,38,24,23,0,1,36,37,
391 43,42,0,19,20,
392 43,42,41,40,39,38,0,13,
393 41,40,38,0,16,17,
394 38,0,6,
395 47,46,41,38,34,31,14,10,0,2,4,5,7,11,12,15,17,18,21,29,30,44,
396 10,0,
397 45,43,42,41,40,38,34,24,23,0,32,
398 34,0,32,
399 45,41,40,0,16,17,22,
400 47,46,41,34,31,24,23,0,1,36,37,
401 47,46,41,34,31,0,2,12,17,18,21,29,30,44,
402 47,46,41,34,31,24,23,0,1,36,37,
403 47,46,41,34,31,0,2,12,17,18,21,29,30,44,
404 47,46,41,34,31,24,23,0,1,36,37,
405 47,46,41,34,31,0,2,11,12,15,17,18,21,29,30,44,
406 47,46,41,34,31,0,2,12,15,17,18,21,29,30,44,
407 47,46,41,34,31,24,23,0,1,36,37,
408 47,46,41,34,31,0,2,12,15,17,18,21,29,30,44,
409 47,46,41,38,34,31,24,23,10,0,1,36,37,
410 45,43,42,41,40,38,24,23,0,1,36,37,
411 41,40,38,0,16,17,
412 45,43,42,41,40,38,0,19,20,
413 45,43,42,41,40,38,0,19,20,
414
415 };
416
417
418 static unsigned const char ag_astt[401] = {
419 8,8,8,8,8,8,1,1,8,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,8,1,7,1,1,1,9,5,3,1,1,1,
420 8,2,1,1,8,7,1,0,1,1,1,1,1,1,1,1,1,1,1,2,1,1,9,9,9,9,9,9,9,9,9,9,9,9,9,5,3,
421 7,1,7,2,5,5,5,5,5,5,10,1,5,5,7,3,5,5,5,5,5,1,1,7,1,1,3,5,5,5,5,5,1,1,7,1,1,
422 3,5,5,5,5,5,5,1,1,7,1,1,3,1,1,1,2,1,7,2,2,1,2,1,2,1,1,1,1,1,2,1,7,1,1,2,1,
423 1,1,1,2,1,1,5,5,5,5,5,5,5,1,1,7,1,1,3,1,1,5,1,1,4,4,4,4,1,4,7,1,1,1,4,7,1,
424 1,1,7,3,1,1,1,8,2,1,1,5,7,1,1,1,3,1,1,1,1,1,1,2,1,1,3,7,4,4,4,4,4,4,1,4,4,
425 7,2,1,5,2,1,1,1,7,1,1,2,5,5,5,5,5,1,1,7,1,1,3,1,1,1,2,1,7,2,2,1,2,1,2,1,1,
426 5,5,5,5,5,1,1,7,1,1,3,1,1,1,2,1,7,2,2,1,2,1,2,1,1,5,5,5,5,5,1,1,7,1,1,3,1,
427 1,1,2,1,7,1,1,2,1,1,1,1,2,1,1,1,1,1,2,1,7,1,2,1,1,1,1,2,1,1,5,5,5,5,5,1,1,
428 7,1,1,3,1,1,1,2,1,7,1,2,1,1,1,1,2,1,1,5,5,5,5,5,5,1,1,5,7,1,1,3,5,5,5,5,5,
429 5,1,1,7,1,1,3,1,1,4,7,1,1,4,1,1,4,4,4,7,1,1,4,1,1,4,4,4,7,1,1
430 };
431
432
433 static const unsigned char ag_pstt[] = {
434 3,3,3,3,3,3,1,2,3,0,2,2,3,
435 4,4,4,4,4,4,4,4,4,4,4,4,5,4,1,4,5,
436 1,52,54,52,
437 13,9,8,17,34,6,17,19,3,14,0,17,17,18,18,19,16,15,14,11,14,12,28,7,10,
438 24,24,24,24,24,24,24,24,24,24,24,24,24,26,
439 27,5,
440 20,6,33,
441 30,30,30,30,30,30,35,21,30,30,7,32,
442 53,53,53,53,53,1,2,8,2,2,58,
443 53,53,53,53,53,1,2,9,2,2,63,
444 53,53,53,53,53,53,1,2,10,2,2,61,
445 13,9,8,34,6,11,21,18,11,21,12,28,7,10,
446 13,9,8,34,6,12,14,22,18,14,11,14,12,28,7,10,
447 53,53,53,53,53,53,53,1,2,13,2,2,64,
448 23,25,12,26,24,
449 18,18,18,18,27,18,15,28,
450 8,30,9,16,31,29,
451 32,17,3,
452 13,9,8,17,34,6,17,7,18,14,17,17,5,16,15,14,11,14,12,28,7,10,
453 8,19,
454 36,36,36,36,36,36,20,36,36,20,37,
455 20,31,29,
456 33,8,30,22,31,29,20,
457 53,53,53,53,53,1,2,23,2,2,60,
458 13,9,8,34,6,24,17,18,11,17,12,28,7,10,
459 53,53,53,53,53,1,2,25,2,2,59,
460 13,9,8,34,6,26,16,18,11,16,12,28,7,10,
461 53,53,53,53,53,1,2,27,2,2,56,
462 13,9,8,34,6,28,14,34,18,14,11,14,12,28,7,10,
463 13,9,8,34,6,29,35,18,35,11,35,12,28,7,10,
464 53,53,53,53,53,1,2,30,2,2,57,
465 13,9,8,34,6,31,36,18,36,11,36,12,28,7,10,
466 53,53,53,53,53,53,1,2,53,32,2,2,55,
467 53,53,53,53,53,53,1,2,33,2,2,62,
468 8,30,10,34,31,29,
469 14,23,25,14,14,14,35,26,24,
470 13,23,25,13,13,13,36,26,24,
471
472 };
473
474
475 static const unsigned short ag_sbt[] = {
476 0, 13, 30, 34, 59, 73, 75, 78, 90, 101, 112, 124, 138, 154,
477 167, 172, 180, 186, 189, 211, 213, 224, 227, 234, 245, 259, 270, 284,
478 295, 311, 326, 337, 352, 365, 377, 383, 392, 401
479 };
480
481
482 static const unsigned short ag_sbe[] = {
483 9, 27, 32, 42, 72, 74, 76, 88, 97, 108, 120, 129, 143, 163,
484 169, 178, 183, 187, 197, 212, 222, 225, 230, 241, 250, 266, 275, 291,
485 300, 316, 333, 342, 361, 373, 380, 389, 398, 401
486 };
487
488
489 static const unsigned char ag_fl[] = {
490 2,0,1,2,1,2,0,1,2,1,3,1,1,3,3,1,3,3,1,1,3,2,1,1,2,0,1,3,1,3,0,1,2,2,1,
491 2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0,1,2,2,2,2,2,2,2,2,2,2
492 };
493
494 static const unsigned char ag_ptt[] = {
495 0, 5, 5, 7, 8, 8, 9, 9, 3, 4, 4, 4, 11, 11, 11, 15, 15, 15,
496 18, 18, 18, 18, 1, 26, 26, 27, 27, 1, 12, 44, 33, 33, 44, 44, 30, 30,
497 32, 32, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 36, 36, 37,
498 37, 6, 13, 16, 17, 19, 20, 2, 22, 21, 29
499 };
500
501
502 static void ag_ra(void)
503 {
504 switch(ag_rpx[(PCB).ag_ap]) {
505 case 1: ag_rp_1(V(0,(double *))); break;
506 case 2: ag_rp_2(V(0,(int *)), V(2,(double *))); break;
507 case 3: V(0,(double *)) = ag_rp_3(V(0,(double *)), V(2,(double *))); break;
508 case 4: V(0,(double *)) = ag_rp_4(V(0,(double *)), V(2,(double *))); break;
509 case 5: V(0,(double *)) = ag_rp_5(V(0,(double *)), V(2,(double *))); break;
510 case 6: V(0,(double *)) = ag_rp_6(V(0,(double *)), V(2,(double *))); break;
511 case 7: V(0,(double *)) = ag_rp_7(V(0,(int *))); break;
512 case 8: V(0,(double *)) = ag_rp_8(V(1,(double *))); break;
513 case 9: V(0,(double *)) = ag_rp_9(V(1,(double *))); break;
514 case 10: V(0,(int *)) = ag_rp_10(V(0,(int *))); break;
515 case 11: V(0,(double *)) = ag_rp_11(V(0,(double *)), V(2,(double *))); break;
516 case 12: V(0,(double *)) = ag_rp_12(V(1,(double *))); break;
517 case 13: V(0,(double *)) = ag_rp_13(V(0,(int *))); break;
518 case 14: V(0,(double *)) = ag_rp_14(V(0,(double *)), V(1,(int *))); break;
519 case 15: V(0,(double *)) = ag_rp_15(V(0,(int *))); break;
520 case 16: V(0,(double *)) = ag_rp_16(V(0,(int *)), V(1,(double *))); break;
521 }
522 }
523
524 #define TOKEN_NAMES ffcalc_token_names
525 const char *const ffcalc_token_names[48] = {
526 "calculator",
527 "white space",
528 "real",
529 "calculator",
530 "calculation",
531 "",
532 "'\\n'",
533 "",
534 "",
535 "",
536 "eof",
537 "expression",
538 "name",
539 "'='",
540 "error",
541 "term",
542 "'+'",
543 "'-'",
544 "factor",
545 "'*'",
546 "'/'",
547 "'('",
548 "')'",
549 "",
550 "\"/*\"",
551 "",
552 "",
553 "",
554 "\"*/\"",
555 "",
556 "integer part",
557 "'.'",
558 "fraction part",
559 "",
560 "digit",
561 "",
562 "",
563 "",
564 "'\\n'",
565 "'='",
566 "'+'",
567 "'-'",
568 "'*'",
569 "'/'",
570 "real",
571 "')'",
572 "'('",
573 "",
574
575 };
576
577 #ifndef MISSING_FORMAT
578 #define MISSING_FORMAT "Missing %s"
579 #endif
580 #ifndef UNEXPECTED_FORMAT
581 #define UNEXPECTED_FORMAT "Unexpected %s"
582 #endif
583 #ifndef UNNAMED_TOKEN
584 #define UNNAMED_TOKEN "input"
585 #endif
586
587
588 static void ag_diagnose(void) {
589 int ag_snd = (PCB).sn;
590 int ag_k = ag_sbt[ag_snd];
591
592 if (*TOKEN_NAMES[ag_tstt[ag_k]] && ag_astt[ag_k + 1] == ag_action_8) {
593 sprintf((PCB).ag_msg, MISSING_FORMAT, TOKEN_NAMES[ag_tstt[ag_k]]);
594 }
595 else if (ag_astt[ag_sbe[(PCB).sn]] == ag_action_8
596 && (ag_k = (int) ag_sbe[(PCB).sn] + 1) == (int) ag_sbt[(PCB).sn+1] - 1
597 && *TOKEN_NAMES[ag_tstt[ag_k]]) {
598 sprintf((PCB).ag_msg, MISSING_FORMAT, TOKEN_NAMES[ag_tstt[ag_k]]);
599 }
600 else if ((PCB).token_number && *TOKEN_NAMES[(PCB).token_number]) {
601 sprintf((PCB).ag_msg, UNEXPECTED_FORMAT, TOKEN_NAMES[(PCB).token_number]);
602 }
603 else if (isprint((*(PCB).lab)) && (*(PCB).lab) != '\\') {
604 char buf[20];
605 sprintf(buf, "\'%c\'", (char) (*(PCB).lab));
606 sprintf((PCB).ag_msg, UNEXPECTED_FORMAT, buf);
607 }
608 else sprintf((PCB).ag_msg, UNEXPECTED_FORMAT, UNNAMED_TOKEN);
609 (PCB).error_message = (PCB).ag_msg;
610
611
612 }
613 static int ag_action_1_r_proc(void);
614 static int ag_action_2_r_proc(void);
615 static int ag_action_3_r_proc(void);
616 static int ag_action_4_r_proc(void);
617 static int ag_action_1_s_proc(void);
618 static int ag_action_3_s_proc(void);
619 static int ag_action_1_proc(void);
620 static int ag_action_2_proc(void);
621 static int ag_action_3_proc(void);
622 static int ag_action_4_proc(void);
623 static int ag_action_5_proc(void);
624 static int ag_action_6_proc(void);
625 static int ag_action_7_proc(void);
626 static int ag_action_8_proc(void);
627 static int ag_action_9_proc(void);
628 static int ag_action_10_proc(void);
629 static int ag_action_11_proc(void);
630 static int ag_action_8_proc(void);
631
632
633 static int (*const ag_r_procs_scan[])(void) = {
634 ag_action_1_r_proc,
635 ag_action_2_r_proc,
636 ag_action_3_r_proc,
637 ag_action_4_r_proc
638 };
639
640 static int (*const ag_s_procs_scan[])(void) = {
641 ag_action_1_s_proc,
642 ag_action_2_r_proc,
643 ag_action_3_s_proc,
644 ag_action_4_r_proc
645 };
646
647 static int (*const ag_gt_procs_scan[])(void) = {
648 ag_action_1_proc,
649 ag_action_2_proc,
650 ag_action_3_proc,
651 ag_action_4_proc,
652 ag_action_5_proc,
653 ag_action_6_proc,
654 ag_action_7_proc,
655 ag_action_8_proc,
656 ag_action_9_proc,
657 ag_action_10_proc,
658 ag_action_11_proc,
659 ag_action_8_proc
660 };
661
662
663 static int ag_action_1_er_proc(void);
664 static int ag_action_2_er_proc(void);
665 static int ag_action_3_er_proc(void);
666 static int ag_action_4_er_proc(void);
667
668 static int (*const ag_er_procs_scan[])(void) = {
669 ag_action_1_er_proc,
670 ag_action_2_er_proc,
671 ag_action_3_er_proc,
672 ag_action_4_er_proc
673 };
674
675
676 static void ag_error_resynch(void) {
677 int ag_k;
678 int ag_ssx = (PCB).ssx;
679
680 ag_diagnose();
681 SYNTAX_ERROR;
682 if ((PCB).exit_flag != AG_RUNNING_CODE) return;
683 while (1) {
684 ag_k = ag_sbt[(PCB).sn];
685 while (ag_tstt[ag_k] != 14 && ag_tstt[ag_k]) ag_k++;
686 if (ag_tstt[ag_k] || (PCB).ssx == 0) break;
687 (PCB).sn = (PCB).ss[--(PCB).ssx];
688 }
689 if (ag_tstt[ag_k] == 0) {
690 (PCB).sn = PCB.ss[(PCB).ssx = ag_ssx];
691 (PCB).exit_flag = AG_SYNTAX_ERROR_CODE;
692 return;
693 }
694 ag_k = ag_sbt[(PCB).sn];
695 while (ag_tstt[ag_k] != 14 && ag_tstt[ag_k]) ag_k++;
696 (PCB).ag_ap = ag_pstt[ag_k];
697 (ag_er_procs_scan[ag_astt[ag_k]])();
698 while (1) {
699 ag_k = ag_sbt[(PCB).sn];
700 while (ag_tstt[ag_k] != (unsigned char) (PCB).token_number && ag_tstt[ag_k])
701 ag_k++;
702 if (ag_tstt[ag_k] && ag_astt[ag_k] != ag_action_10) break;
703 if ((PCB).token_number == 10)
704 {(PCB).exit_flag = AG_SYNTAX_ERROR_CODE; return;}
705 {(PCB).rx = 1; ag_track();}
706 if ((PCB).rx < (PCB).fx) {
707 (PCB).input_code = (PCB).lab[(PCB).rx++];
708 (PCB).token_number = (ffcalc_token_type) AG_TCV((PCB).input_code);}
709 else {
710 GET_INPUT;
711 (PCB).lab[(PCB).fx++] = (PCB).input_code;
712 (PCB).token_number = (ffcalc_token_type) AG_TCV((PCB).input_code);
713 (PCB).rx++;
714 }
715 if (ag_key_index[(PCB).sn]) {
716 unsigned ag_k = ag_key_index[(PCB).sn];
717 int ag_ch = CONVERT_CASE((PCB).input_code);
718 if (ag_ch < 255) {
719 while (ag_key_ch[ag_k] < ag_ch) ag_k++;
720 if (ag_key_ch[ag_k] == ag_ch) ag_get_key_word(ag_k);
721 }
722 }
723 }
724 (PCB).rx = 0;
725 }
726
727
728 static int ag_action_10_proc(void) {
729 int ag_t = (PCB).token_number;
730 (PCB).btsx = 0, (PCB).drt = -1;
731 do {
732 ag_track();
733 if ((PCB).rx < (PCB).fx) {
734 (PCB).input_code = (PCB).lab[(PCB).rx++];
735 (PCB).token_number = (ffcalc_token_type) AG_TCV((PCB).input_code);}
736 else {
737 GET_INPUT;
738 (PCB).lab[(PCB).fx++] = (PCB).input_code;
739 (PCB).token_number = (ffcalc_token_type) AG_TCV((PCB).input_code);
740 (PCB).rx++;
741 }
742 if (ag_key_index[(PCB).sn]) {
743 unsigned ag_k = ag_key_index[(PCB).sn];
744 int ag_ch = CONVERT_CASE((PCB).input_code);
745 if (ag_ch < 255) {
746 while (ag_key_ch[ag_k] < ag_ch) ag_k++;
747 if (ag_key_ch[ag_k] == ag_ch) ag_get_key_word(ag_k);
748 }
749 }
750 } while ((PCB).token_number == (ffcalc_token_type) ag_t);
751 (PCB).rx = 0;
752 return 1;
753 }
754
755 static int ag_action_11_proc(void) {
756 int ag_t = (PCB).token_number;
757
758 (PCB).btsx = 0, (PCB).drt = -1;
759 do {
760 (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).lab;
761 (PCB).ssx--;
762 ag_track();
763 ag_ra();
764 if ((PCB).exit_flag != AG_RUNNING_CODE) return 0;
765 (PCB).ssx++;
766 if ((PCB).rx < (PCB).fx) {
767 (PCB).input_code = (PCB).lab[(PCB).rx++];
768 (PCB).token_number = (ffcalc_token_type) AG_TCV((PCB).input_code);}
769 else {
770 GET_INPUT;
771 (PCB).lab[(PCB).fx++] = (PCB).input_code;
772 (PCB).token_number = (ffcalc_token_type) AG_TCV((PCB).input_code);
773 (PCB).rx++;
774 }
775 if (ag_key_index[(PCB).sn]) {
776 unsigned ag_k = ag_key_index[(PCB).sn];
777 int ag_ch = CONVERT_CASE((PCB).input_code);
778 if (ag_ch < 255) {
779 while (ag_key_ch[ag_k] < ag_ch) ag_k++;
780 if (ag_key_ch[ag_k] == ag_ch) ag_get_key_word(ag_k);
781 }
782 }
783 }
784 while ((PCB).token_number == (ffcalc_token_type) ag_t);
785 (PCB).rx = 0;
786 return 1;
787 }
788
789 static int ag_action_3_r_proc(void) {
790 int ag_sd = ag_fl[(PCB).ag_ap] - 1;
791 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
792 (PCB).btsx = 0, (PCB).drt = -1;
793 (PCB).reduction_token = (ffcalc_token_type) ag_ptt[(PCB).ag_ap];
794 ag_ra();
795 return (PCB).exit_flag == AG_RUNNING_CODE;
796 }
797
798 static int ag_action_3_s_proc(void) {
799 int ag_sd = ag_fl[(PCB).ag_ap] - 1;
800 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
801 (PCB).btsx = 0, (PCB).drt = -1;
802 (PCB).reduction_token = (ffcalc_token_type) ag_ptt[(PCB).ag_ap];
803 ag_ra();
804 return (PCB).exit_flag == AG_RUNNING_CODE;
805 }
806
807 static int ag_action_4_r_proc(void) {
808 int ag_sd = ag_fl[(PCB).ag_ap] - 1;
809 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
810 (PCB).reduction_token = (ffcalc_token_type) ag_ptt[(PCB).ag_ap];
811 return 1;
812 }
813
814 static int ag_action_2_proc(void) {
815 (PCB).btsx = 0, (PCB).drt = -1;
816 if ((PCB).ssx >= 128) {
817 (PCB).exit_flag = AG_STACK_ERROR_CODE;
818 PARSER_STACK_OVERFLOW;
819 }
820 (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).lab;
821 (PCB).ss[(PCB).ssx] = (PCB).sn;
822 (PCB).ssx++;
823 (PCB).sn = (PCB).ag_ap;
824 ag_track();
825 return 0;
826 }
827
828 static int ag_action_9_proc(void) {
829 if ((PCB).drt == -1) {
830 (PCB).drt=(PCB).token_number;
831 (PCB).dssx=(PCB).ssx;
832 (PCB).dsn=(PCB).sn;
833 }
834 ag_prot();
835 (PCB).vs[(PCB).ssx] = ag_null_value;
836 (PCB).ss[(PCB).ssx] = (PCB).sn;
837 (PCB).ssx++;
838 (PCB).sn = (PCB).ag_ap;
839 (PCB).rx = 0;
840 return (PCB).exit_flag == AG_RUNNING_CODE;
841 }
842
843 static int ag_action_2_r_proc(void) {
844 (PCB).ssx++;
845 (PCB).sn = (PCB).ag_ap;
846 return 0;
847 }
848
849 static int ag_action_7_proc(void) {
850 --(PCB).ssx;
851 (PCB).rx = 0;
852 (PCB).exit_flag = AG_SUCCESS_CODE;
853 return 0;
854 }
855
856 static int ag_action_1_proc(void) {
857 ag_track();
858 (PCB).exit_flag = AG_SUCCESS_CODE;
859 return 0;
860 }
861
862 static int ag_action_1_r_proc(void) {
863 (PCB).exit_flag = AG_SUCCESS_CODE;
864 return 0;
865 }
866
867 static int ag_action_1_s_proc(void) {
868 (PCB).exit_flag = AG_SUCCESS_CODE;
869 return 0;
870 }
871
872 static int ag_action_4_proc(void) {
873 int ag_sd = ag_fl[(PCB).ag_ap] - 1;
874 (PCB).reduction_token = (ffcalc_token_type) ag_ptt[(PCB).ag_ap];
875 (PCB).btsx = 0, (PCB).drt = -1;
876 (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).lab;
877 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
878 else (PCB).ss[(PCB).ssx] = (PCB).sn;
879 ag_track();
880 while ((PCB).exit_flag == AG_RUNNING_CODE) {
881 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
882 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
883 do {
884 unsigned ag_tx = (ag_t1 + ag_t2)/2;
885 if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1;
886 else ag_t2 = ag_tx;
887 } while (ag_t1 < ag_t2);
888 (PCB).ag_ap = ag_pstt[ag_t1];
889 if ((ag_s_procs_scan[ag_astt[ag_t1]])() == 0) break;
890 }
891 return 0;
892 }
893
894 static int ag_action_3_proc(void) {
895 int ag_sd = ag_fl[(PCB).ag_ap] - 1;
896 (PCB).btsx = 0, (PCB).drt = -1;
897 (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).lab;
898 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
899 else (PCB).ss[(PCB).ssx] = (PCB).sn;
900 ag_track();
901 (PCB).reduction_token = (ffcalc_token_type) ag_ptt[(PCB).ag_ap];
902 ag_ra();
903 while ((PCB).exit_flag == AG_RUNNING_CODE) {
904 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
905 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
906 do {
907 unsigned ag_tx = (ag_t1 + ag_t2)/2;
908 if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1;
909 else ag_t2 = ag_tx;
910 } while (ag_t1 < ag_t2);
911 (PCB).ag_ap = ag_pstt[ag_t1];
912 if ((ag_s_procs_scan[ag_astt[ag_t1]])() == 0) break;
913 }
914 return 0;
915 }
916
917 static int ag_action_8_proc(void) {
918 int ag_k = ag_sbt[(PCB).sn];
919 while (ag_tstt[ag_k] != 14 && ag_tstt[ag_k]) ag_k++;
920 if (ag_tstt[ag_k] == 0) ag_undo();
921 (PCB).rx = 0;
922 ag_error_resynch();
923 return (PCB).exit_flag == AG_RUNNING_CODE;
924 }
925
926 static int ag_action_5_proc(void) {
927 int ag_sd = ag_fl[(PCB).ag_ap];
928 (PCB).btsx = 0, (PCB).drt = -1;
929 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
930 else {
931 (PCB).ss[(PCB).ssx] = (PCB).sn;
932 }
933 (PCB).rx = 0;
934 (PCB).reduction_token = (ffcalc_token_type) ag_ptt[(PCB).ag_ap];
935 ag_ra();
936 while ((PCB).exit_flag == AG_RUNNING_CODE) {
937 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
938 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
939 do {
940 unsigned ag_tx = (ag_t1 + ag_t2)/2;
941 if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1;
942 else ag_t2 = ag_tx;
943 } while (ag_t1 < ag_t2);
944 (PCB).ag_ap = ag_pstt[ag_t1];
945 if ((ag_r_procs_scan[ag_astt[ag_t1]])() == 0) break;
946 }
947 return (PCB).exit_flag == AG_RUNNING_CODE;
948 }
949
950 static int ag_action_6_proc(void) {
951 int ag_sd = ag_fl[(PCB).ag_ap];
952 (PCB).reduction_token = (ffcalc_token_type) ag_ptt[(PCB).ag_ap];
953 if ((PCB).drt == -1) {
954 (PCB).drt=(PCB).token_number;
955 (PCB).dssx=(PCB).ssx;
956 (PCB).dsn=(PCB).sn;
957 }
958 if (ag_sd) {
959 (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
960 }
961 else {
962 ag_prot();
963 (PCB).vs[(PCB).ssx] = ag_null_value;
964 (PCB).ss[(PCB).ssx] = (PCB).sn;
965 }
966 (PCB).rx = 0;
967 while ((PCB).exit_flag == AG_RUNNING_CODE) {
968 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
969 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
970 do {
971 unsigned ag_tx = (ag_t1 + ag_t2)/2;
972 if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1;
973 else ag_t2 = ag_tx;
974 } while (ag_t1 < ag_t2);
975 (PCB).ag_ap = ag_pstt[ag_t1];
976 if ((ag_r_procs_scan[ag_astt[ag_t1]])() == 0) break;
977 }
978 return (PCB).exit_flag == AG_RUNNING_CODE;
979 }
980
981
982 static int ag_action_2_er_proc(void) {
983 (PCB).btsx = 0, (PCB).drt = -1;
984 (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).lab;
985 (PCB).ssx++;
986 (PCB).sn = (PCB).ag_ap;
987 return 0;
988 }
989
990 static int ag_action_1_er_proc(void) {
991 (PCB).btsx = 0, (PCB).drt = -1;
992 (PCB).exit_flag = AG_SUCCESS_CODE;
993 return 0;
994 }
995
996 static int ag_action_4_er_proc(void) {
997 int ag_sd = ag_fl[(PCB).ag_ap] - 1;
998 (PCB).btsx = 0, (PCB).drt = -1;
999 (PCB).reduction_token = (ffcalc_token_type) ag_ptt[(PCB).ag_ap];
1000 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
1001 else (PCB).ss[(PCB).ssx] = (PCB).sn;
1002 while ((PCB).exit_flag == AG_RUNNING_CODE) {
1003 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
1004 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
1005 do {
1006 unsigned ag_tx = (ag_t1 + ag_t2)/2;
1007 if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1;
1008 else ag_t2 = ag_tx;
1009 } while (ag_t1 < ag_t2);
1010 (PCB).ag_ap = ag_pstt[ag_t1];
1011 if ((ag_s_procs_scan[ag_astt[ag_t1]])() == 0) break;
1012 }
1013 return 0;
1014 }
1015
1016 static int ag_action_3_er_proc(void) {
1017 int ag_sd = ag_fl[(PCB).ag_ap] - 1;
1018 (PCB).btsx = 0, (PCB).drt = -1;
1019 if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
1020 else (PCB).ss[(PCB).ssx] = (PCB).sn;
1021 (PCB).reduction_token = (ffcalc_token_type) ag_ptt[(PCB).ag_ap];
1022 ag_ra();
1023 while ((PCB).exit_flag == AG_RUNNING_CODE) {
1024 unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
1025 unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
1026 do {
1027 unsigned ag_tx = (ag_t1 + ag_t2)/2;
1028 if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1;
1029 else ag_t2 = ag_tx;
1030 } while (ag_t1 < ag_t2);
1031 (PCB).ag_ap = ag_pstt[ag_t1];
1032 if ((ag_s_procs_scan[ag_astt[ag_t1]])() == 0) break;
1033 }
1034 return 0;
1035 }
1036
1037
1038 void init_ffcalc(void) {
1039 (PCB).rx = (PCB).fx = 0;
1040 (PCB).ss[0] = (PCB).sn = (PCB).ssx = 0;
1041 (PCB).exit_flag = AG_RUNNING_CODE;
1042 (PCB).line = FIRST_LINE;
1043 (PCB).column = FIRST_COLUMN;
1044 (PCB).btsx = 0, (PCB).drt = -1;
1045 }
1046
1047 void ffcalc(void) {
1048 init_ffcalc();
1049 (PCB).exit_flag = AG_RUNNING_CODE;
1050 while ((PCB).exit_flag == AG_RUNNING_CODE) {
1051 unsigned ag_t1 = ag_sbt[(PCB).sn];
1052 if (ag_tstt[ag_t1]) {
1053 unsigned ag_t2 = ag_sbe[(PCB).sn] - 1;
1054 if ((PCB).rx < (PCB).fx) {
1055 (PCB).input_code = (PCB).lab[(PCB).rx++];
1056 (PCB).token_number = (ffcalc_token_type) AG_TCV((PCB).input_code);}
1057 else {
1058 GET_INPUT;
1059 (PCB).lab[(PCB).fx++] = (PCB).input_code;
1060 (PCB).token_number = (ffcalc_token_type) AG_TCV((PCB).input_code);
1061 (PCB).rx++;
1062 }
1063 if (ag_key_index[(PCB).sn]) {
1064 unsigned ag_k = ag_key_index[(PCB).sn];
1065 int ag_ch = CONVERT_CASE((PCB).input_code);
1066 if (ag_ch < 255) {
1067 while (ag_key_ch[ag_k] < ag_ch) ag_k++;
1068 if (ag_key_ch[ag_k] == ag_ch) ag_get_key_word(ag_k);
1069 }
1070 }
1071 do {
1072 unsigned ag_tx = (ag_t1 + ag_t2)/2;
1073 if (ag_tstt[ag_tx] > (unsigned char)(PCB).token_number)
1074 ag_t1 = ag_tx + 1;
1075 else ag_t2 = ag_tx;
1076 } while (ag_t1 < ag_t2);
1077 if (ag_tstt[ag_t1] != (unsigned char)(PCB).token_number)
1078 ag_t1 = ag_sbe[(PCB).sn];
1079 }
1080 (PCB).ag_ap = ag_pstt[ag_t1];
1081 (ag_gt_procs_scan[ag_astt[ag_t1]])();
1082 }
1083 }
1084
1085