]>
Commit | Line | Data |
---|---|---|
96bdbd82 | 1 | diff -ur bacisrc/ccomp/baccutil.c bacisrc.ok/ccomp/baccutil.c |
2 | --- bacisrc/ccomp/baccutil.c 2004-04-15 13:31:24.000000000 +0200 | |
3 | +++ bacisrc.ok/ccomp/baccutil.c 2005-10-26 22:11:03.000000000 +0200 | |
4 | @@ -13,6 +13,7 @@ | |
5 | #include "../include/computil.h" | |
6 | #include "../include/pcode.h" | |
7 | #include "../include/incfiles.h" | |
8 | +#include "../include/writetab.h" | |
9 | ||
10 | extern int fprintf(FILE*,const char*,...); | |
11 | ||
12 | @@ -165,9 +166,13 @@ | |
13 | /* when name of main pgm is seen in parsing, it's next stid */ | |
14 | } /* global_init */ | |
15 | ||
16 | + | |
17 | /* | |
18 | * | |
19 | * $Log$ | |
20 | + * Revision 2.6 2004/07/21 19:16:54 bynum | |
21 | + * add writetab.h include | |
22 | + * | |
23 | * Revision 2.5 2003/06/25 17:09:46 bynum | |
24 | * change to Moti Ben-Ari's filename suffix convention | |
25 | * | |
26 | diff -ur bacisrc/ccomp/bac.l bacisrc.ok/ccomp/bac.l | |
27 | --- bacisrc/ccomp/bac.l 2004-04-15 13:31:23.000000000 +0200 | |
28 | +++ bacisrc.ok/ccomp/bac.l 2005-10-26 22:11:03.000000000 +0200 | |
29 | @@ -342,7 +342,7 @@ | |
30 | } | |
31 | } while (reading); | |
32 | } | |
33 | - return ((esc < 256) ? esc : 0x20); | |
34 | + return esc; | |
35 | } | |
36 | ||
37 | ||
38 | @@ -409,6 +409,9 @@ | |
39 | /* | |
40 | * | |
41 | * $Log$ | |
42 | + * Revision 2.15 2005/10/26 20:03:23 bynum | |
43 | + * remove extraneous test in get_escape | |
44 | + * | |
45 | * Revision 2.14 2004/04/13 15:39:50 bynum | |
46 | * add \r case to get rid of errors when reading MS-DOS/WIN source files | |
47 | * | |
48 | diff -ur bacisrc/ccomp/bac.y bacisrc.ok/ccomp/bac.y | |
49 | --- bacisrc/ccomp/bac.y 2004-04-15 13:31:23.000000000 +0200 | |
50 | +++ bacisrc.ok/ccomp/bac.y 2005-10-26 22:11:03.000000000 +0200 | |
51 | @@ -49,6 +49,7 @@ | |
52 | BUFFER pbuf; /* string buffer for parsing */ | |
53 | /* constants for passing synthesized information back up the parse tree */ | |
54 | int dx,level=0; | |
55 | +int maxlevel = 0; | |
56 | /* for passing type of constant back to constant productions */ | |
57 | TYPES consttype; | |
58 | /* for passing back information to productions using 'type' prod */ | |
59 | @@ -103,7 +104,6 @@ | |
60 | ||
61 | int in_func_decl; /* 1 if declaring a function, 0 otherwise */ | |
62 | int void_function; /* 1 if function has VOID return type, 0 otherwise */ | |
63 | -int func_tab; /* tab index of function being declared */ | |
64 | ||
65 | #define MAXBREAK 200 | |
66 | /* max # breaks in a nest of loop and switch stmts */ | |
67 | @@ -360,6 +360,7 @@ | |
68 | prt = last_tab; | |
69 | enter_block(&last_btab,&level,last_tab); | |
70 | btab[last_btab].lastpar = last_tab; /* no parms */ | |
71 | + if (maxlevel < level) maxlevel = level; | |
72 | main_declared = 1; | |
73 | $$ = prt; | |
74 | btab[0].lastpar = prt; /* save main's tabix for the interp */ | |
75 | @@ -385,6 +386,7 @@ | |
76 | if (main_declared) | |
77 | yyerror("main() proc must be last"); | |
78 | if (void_function) { | |
79 | + if (curr_ret >= 0) process_returns(); | |
80 | if (tab[$1].mon) emit(EXITMON); | |
81 | emit(EXIT_PROC); | |
82 | } | |
83 | @@ -464,9 +466,9 @@ | |
84 | vis_level = real_level = level; | |
85 | } | |
86 | $$ = prt = enter(lastident(),function,real_level,vis_level); | |
87 | - func_tab = prt; | |
88 | if (in_mon_decl) tab[prt].mon = mtab[mon] - last_predeclared; | |
89 | enter_block(&last_btab,&level,prt); | |
90 | + if (maxlevel < level) maxlevel = level; | |
91 | curr_parm_offset = btab[display[level]].vsize; | |
92 | delta_vsize = curr_parm_offset - btab[display[level]].psize; | |
93 | tab[$$].adr = (extern_decl ? -1 : lc); | |
94 | @@ -511,8 +513,9 @@ | |
95 | elem_ref = 0; | |
96 | elem_size = 1; /* a pointer */ | |
97 | elem_typ = strings; | |
98 | - elem_tix = -1; | |
99 | + elem_tix = -1; /* not in symbol table */ | |
100 | by_value = 0; /* pass-by-reference */ | |
101 | + $$ = -1; /* not in symbol table */ | |
102 | } | |
103 | ; | |
104 | ||
105 | @@ -536,6 +539,7 @@ | |
106 | yyerror("Monitors can only be declared at the global level"); | |
107 | enter_block(&last_btab,&level,last_tab); | |
108 | btab[last_btab].lastpar = last_tab; /* no parms */ | |
109 | + if (maxlevel < level) maxlevel = level; | |
110 | } | |
111 | ; | |
112 | ||
113 | @@ -868,7 +872,9 @@ | |
114 | ; | |
115 | ||
116 | for_expr_list : expr | |
117 | + { free_expr($1); } | |
118 | | for_expr_list ',' expr | |
119 | + { free_expr($3); } | |
120 | ; | |
121 | ||
122 | stmt : selection_stmt | |
123 | @@ -1014,10 +1020,10 @@ | |
124 | /* the current case of the enclosing switch block is one */ | |
125 | /* less than the first case of this block */ | |
126 | curr_case = switch_block[switch_level].first_case - 1; | |
127 | + free_expr(switch_block[switch_level].expr_index); | |
128 | switch_level--; | |
129 | process_breaks(); | |
130 | leave_break_block(&break_level,&curr_break,&curr_cont); | |
131 | - free_expr($1); | |
132 | } | |
133 | ; | |
134 | ||
135 | @@ -1297,23 +1303,31 @@ | |
136 | return_stmt : the_return opt_expr ';' | |
137 | { | |
138 | if (void_function) { | |
139 | - if ($2 < 0) | |
140 | - emit(EXIT_PROC); | |
141 | + if ($2 < 0) { | |
142 | + if (++curr_ret == MAXRETURN) | |
143 | + cfatal( | |
144 | + "No more thn %d 'return' statements can appear in a function",MAXRETURN); | |
145 | + else | |
146 | + return_loc[curr_ret] = lc; /* mark the JUMP loc */ | |
147 | + emit(JUMP); | |
148 | + } | |
149 | else | |
150 | yyerror("Cannot return a value from a 'void' function"); | |
151 | } | |
152 | - if ($2 >= 0) | |
153 | - gen_exprval($2); | |
154 | - else /* no expression to push */ | |
155 | - emit1(PUSH_LIT,0); | |
156 | - emit(STORE); | |
157 | - if (++curr_ret == MAXRETURN) | |
158 | - cfatal( | |
159 | + else { // non void function | |
160 | + if ($2 >= 0) | |
161 | + gen_exprval($2); | |
162 | + else /* no expression to push */ | |
163 | + emit1(PUSH_LIT,0); | |
164 | + emit(STORE); | |
165 | + if (++curr_ret == MAXRETURN) | |
166 | + cfatal( | |
167 | "No more thn %d 'return' statements can appear in a function",MAXRETURN); | |
168 | - else | |
169 | - return_loc[curr_ret] = lc; /* mark the JUMP loc */ | |
170 | - emit(JUMP); /* jump to fcn exit*/ | |
171 | - } | |
172 | + else | |
173 | + return_loc[curr_ret] = lc; /* mark the JUMP loc */ | |
174 | + emit(JUMP); /* jump to fcn exit*/ | |
175 | + } | |
176 | + } | |
177 | ; | |
178 | ||
179 | the_return : RETURN | |
180 | @@ -1321,7 +1335,7 @@ | |
181 | if (!in_func_decl) | |
182 | yyerror("'return' is inappropriate outside a function"); | |
183 | else if (!void_function) | |
184 | - emit2(LOAD_ADDR,tab[func_tab].lev+1,0); | |
185 | + emit2(LOAD_ADDR,tab[prt].lev+1,0); | |
186 | } | |
187 | ; | |
188 | ||
189 | @@ -1369,6 +1383,7 @@ | |
190 | emit1(READ,expr[$3].typ); | |
191 | } else /* array element */ | |
192 | emit1(READ,expr[$3].typ); | |
193 | + free_expr($3); | |
194 | } | |
195 | ; | |
196 | ||
197 | @@ -1377,6 +1392,7 @@ | |
198 | opt_expr : /* empty */ | |
199 | { $$ = -1; } | |
200 | | expr | |
201 | + { free_expr($1); } | |
202 | ; | |
203 | ||
204 | expr_stmt : expr ';' | |
205 | @@ -1410,6 +1426,7 @@ | |
206 | else | |
207 | yyerror("Type mismatch in assignment"); | |
208 | $$ = $2; | |
209 | + expr[$$].tix = $1; | |
210 | assign_cnt--; | |
211 | } | |
212 | | array_var_becomes expr | |
213 | @@ -1420,7 +1437,7 @@ | |
214 | (expr[$1].typ == conds)) | |
215 | yyerror("Cannot assign to 'semaphore' or 'condition'"); | |
216 | else if (expr[$1].typ == arrays) | |
217 | - emit1(COPY_BLOCK,atab[tab[$1].ref].size); | |
218 | + emit1(COPY_BLOCK,atab[expr[$1].ref].size); | |
219 | else /* standard types */ | |
220 | if (assign_cnt > 1) /* multiple assignments */ | |
221 | emit(STORE_KEEP); | |
222 | @@ -1429,6 +1446,7 @@ | |
223 | } | |
224 | else | |
225 | yyerror("Type mismatch in assignment"); | |
226 | + free_expr($2); | |
227 | expr[$1].isval = 1; | |
228 | $$ = $1; | |
229 | assign_cnt--; | |
230 | @@ -1439,9 +1457,6 @@ | |
231 | { | |
232 | assign_cnt++; | |
233 | if ((tab[$1].obj == variable)||(tab[$1].obj == ext_variable)) { | |
234 | - if ((tab[$1].typ == sems)||(tab[$1].typ == bsems)) | |
235 | - yyerror("Must use `initialsem' to initialize a 'semaphore'"); | |
236 | - else | |
237 | emit_push_addr(tab[$1]); | |
238 | } | |
239 | else | |
240 | @@ -1758,7 +1773,7 @@ | |
241 | else{ /* legal func call */ | |
242 | pfstack[toppfs].tix = last_pf; | |
243 | pfstack[toppfs].pct = parmct = 0; | |
244 | - first_stringerr = first_parmcterr = 1; | |
245 | + first_parmcterr = 1; | |
246 | if (tab[$1].lev != -1){ /* regular proc call */ | |
247 | if ((tab[$1].mon)&&(tab[prt].mon)&& | |
248 | (tab[$1].mon != tab[prt].mon)) | |
249 | @@ -1811,6 +1826,7 @@ | |
250 | ||
251 | right_stringparm : ',' expr ')' | |
252 | { | |
253 | + $$ = $2; | |
254 | if (expr[$2].typ != strings) { | |
255 | yyerror("right parameter is not of type 'string'"); | |
256 | last_eltyp = notyp; | |
257 | @@ -2174,6 +2190,9 @@ | |
258 | /* | |
259 | * | |
260 | * $Log$ | |
261 | + * Revision 2.26 2004/07/21 19:17:28 bynum | |
262 | + * correct minor errors discovered in writing the Java version of bacc | |
263 | + * | |
264 | * Revision 2.25 2004/04/13 18:18:40 bynum | |
265 | * revise grammar to handle C-style expressions | |
266 | * | |
267 | diff -ur bacisrc/ccomp/gram.c bacisrc.ok/ccomp/gram.c | |
268 | --- bacisrc/ccomp/gram.c 2004-04-15 13:31:23.000000000 +0200 | |
269 | +++ bacisrc.ok/ccomp/gram.c 2005-10-26 22:11:03.000000000 +0200 | |
270 | @@ -1,61 +1,169 @@ | |
271 | -/* A Bison parser, made from bac.y | |
272 | - by GNU bison 1.35. */ | |
273 | +/* A Bison parser, made by GNU Bison 1.875. */ | |
274 | ||
275 | -#define YYBISON 1 /* Identify Bison output. */ | |
276 | +/* Skeleton parser for Yacc-like parsing with Bison, | |
277 | + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. | |
278 | ||
279 | -# define UNSIGNED_INT 257 | |
280 | -# define STRING 258 | |
281 | -# define RAWSTRING 259 | |
282 | -# define STRINGCONCAT 260 | |
283 | -# define STRINGCOMPARE 261 | |
284 | -# define STRINGCOPY 262 | |
285 | -# define STRINGLENGTH 263 | |
286 | -# define IDENTIFIER 264 | |
287 | -# define CHARCON 265 | |
288 | -# define INCLUDE 266 | |
289 | -# define FNSTRING 267 | |
290 | -# define NE 268 | |
291 | -# define LE 269 | |
292 | -# define GE 270 | |
293 | -# define EQ 271 | |
294 | -# define OR 272 | |
295 | -# define AND 273 | |
296 | -# define PLPL 274 | |
297 | -# define MIMI 275 | |
298 | -# define IF 276 | |
299 | -# define ELSE 277 | |
300 | -# define SWITCH 278 | |
301 | -# define CASE 279 | |
302 | -# define DEFAULT 280 | |
303 | -# define WHILE 281 | |
304 | -# define DO 282 | |
305 | -# define FOR 283 | |
306 | -# define CBEGIN 284 | |
307 | -# define CONST 285 | |
308 | -# define TYPEDEF 286 | |
309 | -# define VOID 287 | |
310 | -# define INT 288 | |
311 | -# define CHAR 289 | |
312 | -# define CONTINUE 290 | |
313 | -# define BREAK 291 | |
314 | -# define RETURN 292 | |
315 | -# define COUT 293 | |
316 | -# define LTLT 294 | |
317 | -# define ENDL 295 | |
318 | -# define CIN 296 | |
319 | -# define GTGT 297 | |
320 | -# define MAIN 298 | |
321 | -# define MONITOR 299 | |
322 | -# define INIT 300 | |
323 | -# define ATOMIC 301 | |
324 | -# define SEND 302 | |
325 | -# define RECEIVE 303 | |
326 | -# define BROADCAST 304 | |
327 | -# define EXTERN 305 | |
328 | -# define SSCANF 306 | |
329 | -# define SPRINTF 307 | |
330 | -# define LOWER_THAN_ELSE 308 | |
331 | + This program is free software; you can redistribute it and/or modify | |
332 | + it under the terms of the GNU General Public License as published by | |
333 | + the Free Software Foundation; either version 2, or (at your option) | |
334 | + any later version. | |
335 | + | |
336 | + This program is distributed in the hope that it will be useful, | |
337 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
338 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
339 | + GNU General Public License for more details. | |
340 | + | |
341 | + You should have received a copy of the GNU General Public License | |
342 | + along with this program; if not, write to the Free Software | |
343 | + Foundation, Inc., 59 Temple Place - Suite 330, | |
344 | + Boston, MA 02111-1307, USA. */ | |
345 | + | |
346 | +/* As a special exception, when this file is copied by Bison into a | |
347 | + Bison output file, you may use that output file without restriction. | |
348 | + This special exception was added by the Free Software Foundation | |
349 | + in version 1.24 of Bison. */ | |
350 | + | |
351 | +/* Written by Richard Stallman by simplifying the original so called | |
352 | + ``semantic'' parser. */ | |
353 | + | |
354 | +/* All symbols defined below should begin with yy or YY, to avoid | |
355 | + infringing on user name space. This should be done even for local | |
356 | + variables, as they might otherwise be expanded by user macros. | |
357 | + There are some unavoidable exceptions within include files to | |
358 | + define necessary library symbols; they are noted "INFRINGES ON | |
359 | + USER NAME SPACE" below. */ | |
360 | + | |
361 | +/* Identify Bison output. */ | |
362 | +#define YYBISON 1 | |
363 | + | |
364 | +/* Skeleton name. */ | |
365 | +#define YYSKELETON_NAME "yacc.c" | |
366 | + | |
367 | +/* Pure parsers. */ | |
368 | +#define YYPURE 0 | |
369 | + | |
370 | +/* Using locations. */ | |
371 | +#define YYLSP_NEEDED 0 | |
372 | + | |
373 | + | |
374 | + | |
375 | +/* Tokens. */ | |
376 | +#ifndef YYTOKENTYPE | |
377 | +# define YYTOKENTYPE | |
378 | + /* Put the tokens into the symbol table, so that GDB and other debuggers | |
379 | + know about them. */ | |
380 | + enum yytokentype { | |
381 | + UNSIGNED_INT = 258, | |
382 | + STRING = 259, | |
383 | + RAWSTRING = 260, | |
384 | + STRINGCONCAT = 261, | |
385 | + STRINGCOMPARE = 262, | |
386 | + STRINGCOPY = 263, | |
387 | + STRINGLENGTH = 264, | |
388 | + IDENTIFIER = 265, | |
389 | + CHARCON = 266, | |
390 | + INCLUDE = 267, | |
391 | + FNSTRING = 268, | |
392 | + NE = 269, | |
393 | + LE = 270, | |
394 | + GE = 271, | |
395 | + EQ = 272, | |
396 | + OR = 273, | |
397 | + AND = 274, | |
398 | + PLPL = 275, | |
399 | + MIMI = 276, | |
400 | + IF = 277, | |
401 | + ELSE = 278, | |
402 | + SWITCH = 279, | |
403 | + CASE = 280, | |
404 | + DEFAULT = 281, | |
405 | + WHILE = 282, | |
406 | + DO = 283, | |
407 | + FOR = 284, | |
408 | + CBEGIN = 285, | |
409 | + CONST = 286, | |
410 | + TYPEDEF = 287, | |
411 | + VOID = 288, | |
412 | + INT = 289, | |
413 | + CHAR = 290, | |
414 | + CONTINUE = 291, | |
415 | + BREAK = 292, | |
416 | + RETURN = 293, | |
417 | + COUT = 294, | |
418 | + LTLT = 295, | |
419 | + ENDL = 296, | |
420 | + CIN = 297, | |
421 | + GTGT = 298, | |
422 | + MAIN = 299, | |
423 | + MONITOR = 300, | |
424 | + INIT = 301, | |
425 | + ATOMIC = 302, | |
426 | + SEND = 303, | |
427 | + RECEIVE = 304, | |
428 | + BROADCAST = 305, | |
429 | + EXTERN = 306, | |
430 | + SSCANF = 307, | |
431 | + SPRINTF = 308, | |
432 | + LOWER_THAN_ELSE = 309 | |
433 | + }; | |
434 | +#endif | |
435 | +#define UNSIGNED_INT 258 | |
436 | +#define STRING 259 | |
437 | +#define RAWSTRING 260 | |
438 | +#define STRINGCONCAT 261 | |
439 | +#define STRINGCOMPARE 262 | |
440 | +#define STRINGCOPY 263 | |
441 | +#define STRINGLENGTH 264 | |
442 | +#define IDENTIFIER 265 | |
443 | +#define CHARCON 266 | |
444 | +#define INCLUDE 267 | |
445 | +#define FNSTRING 268 | |
446 | +#define NE 269 | |
447 | +#define LE 270 | |
448 | +#define GE 271 | |
449 | +#define EQ 272 | |
450 | +#define OR 273 | |
451 | +#define AND 274 | |
452 | +#define PLPL 275 | |
453 | +#define MIMI 276 | |
454 | +#define IF 277 | |
455 | +#define ELSE 278 | |
456 | +#define SWITCH 279 | |
457 | +#define CASE 280 | |
458 | +#define DEFAULT 281 | |
459 | +#define WHILE 282 | |
460 | +#define DO 283 | |
461 | +#define FOR 284 | |
462 | +#define CBEGIN 285 | |
463 | +#define CONST 286 | |
464 | +#define TYPEDEF 287 | |
465 | +#define VOID 288 | |
466 | +#define INT 289 | |
467 | +#define CHAR 290 | |
468 | +#define CONTINUE 291 | |
469 | +#define BREAK 292 | |
470 | +#define RETURN 293 | |
471 | +#define COUT 294 | |
472 | +#define LTLT 295 | |
473 | +#define ENDL 296 | |
474 | +#define CIN 297 | |
475 | +#define GTGT 298 | |
476 | +#define MAIN 299 | |
477 | +#define MONITOR 300 | |
478 | +#define INIT 301 | |
479 | +#define ATOMIC 302 | |
480 | +#define SEND 303 | |
481 | +#define RECEIVE 304 | |
482 | +#define BROADCAST 305 | |
483 | +#define EXTERN 306 | |
484 | +#define SSCANF 307 | |
485 | +#define SPRINTF 308 | |
486 | +#define LOWER_THAN_ELSE 309 | |
487 | ||
488 | + | |
489 | + | |
490 | + | |
491 | +/* Copy the first part of user declarations. */ | |
492 | #line 1 "bac.y" | |
493 | ||
494 | /* yacc grammar for BenAri Concurrent C */ | |
495 | @@ -108,6 +216,7 @@ | |
496 | BUFFER pbuf; /* string buffer for parsing */ | |
497 | /* constants for passing synthesized information back up the parse tree */ | |
498 | int dx,level=0; | |
499 | +int maxlevel = 0; | |
500 | /* for passing type of constant back to constant productions */ | |
501 | TYPES consttype; | |
502 | /* for passing back information to productions using 'type' prod */ | |
503 | @@ -162,7 +271,6 @@ | |
504 | ||
505 | int in_func_decl; /* 1 if declaring a function, 0 otherwise */ | |
506 | int void_function; /* 1 if function has VOID return type, 0 otherwise */ | |
507 | -int func_tab; /* tab index of function being declared */ | |
508 | ||
509 | #define MAXBREAK 200 | |
510 | /* max # breaks in a nest of loop and switch stmts */ | |
511 | @@ -293,25 +401,153 @@ | |
512 | emit2(((x).normal ? LOAD_ADDR : LOAD_VALUE), (x).lev, (x).adr)) | |
513 | ||
514 | ||
515 | -#ifndef YYSTYPE | |
516 | -# define YYSTYPE int | |
517 | -# define YYSTYPE_IS_TRIVIAL 1 | |
518 | -#endif | |
519 | + | |
520 | + | |
521 | +/* Enabling traces. */ | |
522 | #ifndef YYDEBUG | |
523 | # define YYDEBUG 1 | |
524 | #endif | |
525 | ||
526 | +/* Enabling verbose error messages. */ | |
527 | +#ifdef YYERROR_VERBOSE | |
528 | +# undef YYERROR_VERBOSE | |
529 | +# define YYERROR_VERBOSE 1 | |
530 | +#else | |
531 | +# define YYERROR_VERBOSE 0 | |
532 | +#endif | |
533 | + | |
534 | +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) | |
535 | +typedef int YYSTYPE; | |
536 | +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ | |
537 | +# define YYSTYPE_IS_DECLARED 1 | |
538 | +# define YYSTYPE_IS_TRIVIAL 1 | |
539 | +#endif | |
540 | + | |
541 | + | |
542 | + | |
543 | +/* Copy the second part of user declarations. */ | |
544 | + | |
545 | + | |
546 | +/* Line 214 of yacc.c. */ | |
547 | +#line 432 "y.tab.c" | |
548 | + | |
549 | +#if ! defined (yyoverflow) || YYERROR_VERBOSE | |
550 | + | |
551 | +/* The parser invokes alloca or malloc; define the necessary symbols. */ | |
552 | + | |
553 | +# if YYSTACK_USE_ALLOCA | |
554 | +# define YYSTACK_ALLOC alloca | |
555 | +# else | |
556 | +# ifndef YYSTACK_USE_ALLOCA | |
557 | +# if defined (alloca) || defined (_ALLOCA_H) | |
558 | +# define YYSTACK_ALLOC alloca | |
559 | +# else | |
560 | +# ifdef __GNUC__ | |
561 | +# define YYSTACK_ALLOC __builtin_alloca | |
562 | +# endif | |
563 | +# endif | |
564 | +# endif | |
565 | +# endif | |
566 | + | |
567 | +# ifdef YYSTACK_ALLOC | |
568 | + /* Pacify GCC's `empty if-body' warning. */ | |
569 | +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) | |
570 | +# else | |
571 | +# if defined (__STDC__) || defined (__cplusplus) | |
572 | +# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | |
573 | +# define YYSIZE_T size_t | |
574 | +# endif | |
575 | +# define YYSTACK_ALLOC malloc | |
576 | +# define YYSTACK_FREE free | |
577 | +# endif | |
578 | +#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ | |
579 | + | |
580 | + | |
581 | +#if (! defined (yyoverflow) \ | |
582 | + && (! defined (__cplusplus) \ | |
583 | + || (YYSTYPE_IS_TRIVIAL))) | |
584 | + | |
585 | +/* A type that is properly aligned for any stack member. */ | |
586 | +union yyalloc | |
587 | +{ | |
588 | + short yyss; | |
589 | + YYSTYPE yyvs; | |
590 | + }; | |
591 | ||
592 | +/* The size of the maximum gap between one aligned stack and the next. */ | |
593 | +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) | |
594 | + | |
595 | +/* The size of an array large to enough to hold all stacks, each with | |
596 | + N elements. */ | |
597 | +# define YYSTACK_BYTES(N) \ | |
598 | + ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ | |
599 | + + YYSTACK_GAP_MAXIMUM) | |
600 | ||
601 | -#define YYFINAL 437 | |
602 | -#define YYFLAG -32768 | |
603 | -#define YYNTBASE 75 | |
604 | +/* Copy COUNT objects from FROM to TO. The source and destination do | |
605 | + not overlap. */ | |
606 | +# ifndef YYCOPY | |
607 | +# if 1 < __GNUC__ | |
608 | +# define YYCOPY(To, From, Count) \ | |
609 | + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) | |
610 | +# else | |
611 | +# define YYCOPY(To, From, Count) \ | |
612 | + do \ | |
613 | + { \ | |
614 | + register YYSIZE_T yyi; \ | |
615 | + for (yyi = 0; yyi < (Count); yyi++) \ | |
616 | + (To)[yyi] = (From)[yyi]; \ | |
617 | + } \ | |
618 | + while (0) | |
619 | +# endif | |
620 | +# endif | |
621 | ||
622 | -/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ | |
623 | -#define YYTRANSLATE(x) ((unsigned)(x) <= 308 ? yytranslate[x] : 218) | |
624 | +/* Relocate STACK from its old location to the new one. The | |
625 | + local variables YYSIZE and YYSTACKSIZE give the old and new number of | |
626 | + elements in the stack, and YYPTR gives the new location of the | |
627 | + stack. Advance YYPTR to a properly aligned location for the next | |
628 | + stack. */ | |
629 | +# define YYSTACK_RELOCATE(Stack) \ | |
630 | + do \ | |
631 | + { \ | |
632 | + YYSIZE_T yynewbytes; \ | |
633 | + YYCOPY (&yyptr->Stack, Stack, yysize); \ | |
634 | + Stack = &yyptr->Stack; \ | |
635 | + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ | |
636 | + yyptr += yynewbytes / sizeof (*yyptr); \ | |
637 | + } \ | |
638 | + while (0) | |
639 | ||
640 | -/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ | |
641 | -static const char yytranslate[] = | |
642 | +#endif | |
643 | + | |
644 | +#if defined (__STDC__) || defined (__cplusplus) | |
645 | + typedef signed char yysigned_char; | |
646 | +#else | |
647 | + typedef short yysigned_char; | |
648 | +#endif | |
649 | + | |
650 | +/* YYFINAL -- State number of the termination state. */ | |
651 | +#define YYFINAL 3 | |
652 | +/* YYLAST -- Last index in YYTABLE. */ | |
653 | +#define YYLAST 1059 | |
654 | + | |
655 | +/* YYNTOKENS -- Number of terminals. */ | |
656 | +#define YYNTOKENS 75 | |
657 | +/* YYNNTS -- Number of nonterminals. */ | |
658 | +#define YYNNTS 144 | |
659 | +/* YYNRULES -- Number of rules. */ | |
660 | +#define YYNRULES 261 | |
661 | +/* YYNRULES -- Number of states. */ | |
662 | +#define YYNSTATES 437 | |
663 | + | |
664 | +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ | |
665 | +#define YYUNDEFTOK 2 | |
666 | +#define YYMAXUTOK 309 | |
667 | + | |
668 | +#define YYTRANSLATE(YYX) \ | |
669 | + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) | |
670 | + | |
671 | +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ | |
672 | +static const unsigned char yytranslate[] = | |
673 | { | |
674 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
675 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
676 | @@ -338,166 +574,166 @@ | |
677 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
678 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
679 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
680 | - 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, | |
681 | - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, | |
682 | - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, | |
683 | - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, | |
684 | - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, | |
685 | - 46, 47, 48, 49, 50, 51, 52, 53, 54 | |
686 | + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, | |
687 | + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, | |
688 | + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, | |
689 | + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, | |
690 | + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, | |
691 | + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54 | |
692 | }; | |
693 | ||
694 | #if YYDEBUG | |
695 | -static const short yyprhs[] = | |
696 | -{ | |
697 | - 0, 0, 4, 7, 8, 10, 13, 15, 17, 19, | |
698 | - 21, 23, 25, 27, 30, 33, 34, 37, 42, 43, | |
699 | - 45, 47, 52, 56, 59, 62, 64, 67, 69, 71, | |
700 | - 74, 78, 82, 84, 88, 89, 91, 93, 95, 99, | |
701 | - 102, 104, 107, 109, 114, 117, 120, 122, 125, 127, | |
702 | - 129, 131, 132, 137, 139, 144, 147, 151, 153, 156, | |
703 | - 158, 160, 164, 166, 168, 173, 175, 177, 181, 183, | |
704 | - 187, 189, 192, 194, 197, 201, 206, 211, 213, 220, | |
705 | - 222, 225, 228, 230, 232, 234, 236, 238, 240, 242, | |
706 | - 244, 248, 250, 253, 256, 259, 261, 264, 267, 270, | |
707 | - 271, 273, 275, 279, 281, 283, 285, 287, 289, 291, | |
708 | - 293, 295, 297, 299, 301, 303, 305, 307, 309, 316, | |
709 | - 319, 322, 325, 330, 336, 338, 342, 345, 350, 356, | |
710 | - 361, 363, 365, 370, 372, 375, 379, 381, 384, 389, | |
711 | - 390, 391, 392, 395, 398, 403, 407, 414, 421, 423, | |
712 | - 427, 429, 430, 432, 436, 440, 443, 444, 446, 448, | |
713 | - 449, 451, 453, 456, 459, 463, 465, 469, 472, 476, | |
714 | - 478, 480, 482, 487, 489, 490, 492, 495, 497, 499, | |
715 | - 502, 505, 508, 511, 513, 517, 519, 521, 525, 527, | |
716 | - 529, 533, 535, 537, 539, 541, 543, 545, 547, 549, | |
717 | - 552, 555, 559, 561, 563, 565, 567, 571, 573, 575, | |
718 | - 577, 579, 581, 583, 585, 589, 592, 594, 597, 600, | |
719 | - 603, 606, 608, 610, 612, 614, 617, 619, 621, 623, | |
720 | - 626, 630, 634, 636, 638, 640, 642, 644, 646, 648, | |
721 | - 652, 656, 660, 662, 666, 670, 673, 677, 681, 686, | |
722 | - 692, 694, 698, 702, 708, 711, 713, 718, 722, 727, | |
723 | - 729 | |
724 | +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in | |
725 | + YYRHS. */ | |
726 | +static const unsigned short yyprhs[] = | |
727 | +{ | |
728 | + 0, 0, 3, 7, 10, 11, 13, 16, 18, 20, | |
729 | + 22, 24, 26, 28, 30, 33, 36, 37, 40, 45, | |
730 | + 46, 48, 50, 55, 59, 62, 65, 67, 70, 72, | |
731 | + 74, 77, 81, 85, 87, 91, 92, 94, 96, 98, | |
732 | + 102, 105, 107, 110, 112, 117, 120, 123, 125, 128, | |
733 | + 130, 132, 134, 135, 140, 142, 147, 150, 154, 156, | |
734 | + 159, 161, 163, 167, 169, 171, 176, 178, 180, 184, | |
735 | + 186, 190, 192, 195, 197, 200, 204, 209, 214, 216, | |
736 | + 223, 225, 228, 231, 233, 235, 237, 239, 241, 243, | |
737 | + 245, 247, 251, 253, 256, 259, 262, 264, 267, 270, | |
738 | + 273, 274, 276, 278, 282, 284, 286, 288, 290, 292, | |
739 | + 294, 296, 298, 300, 302, 304, 306, 308, 310, 312, | |
740 | + 319, 322, 325, 328, 333, 339, 341, 345, 348, 353, | |
741 | + 359, 364, 366, 368, 373, 375, 378, 382, 384, 387, | |
742 | + 392, 393, 394, 395, 398, 401, 406, 410, 417, 424, | |
743 | + 426, 430, 432, 433, 435, 439, 443, 446, 447, 449, | |
744 | + 451, 452, 454, 456, 459, 462, 466, 468, 472, 475, | |
745 | + 479, 481, 483, 485, 490, 492, 493, 495, 498, 500, | |
746 | + 502, 505, 508, 511, 514, 516, 520, 522, 524, 528, | |
747 | + 530, 532, 536, 538, 540, 542, 544, 546, 548, 550, | |
748 | + 552, 555, 558, 562, 564, 566, 568, 570, 574, 576, | |
749 | + 578, 580, 582, 584, 586, 588, 592, 595, 597, 600, | |
750 | + 603, 606, 609, 611, 613, 615, 617, 620, 622, 624, | |
751 | + 626, 629, 633, 637, 639, 641, 643, 645, 647, 649, | |
752 | + 651, 655, 659, 663, 665, 669, 673, 676, 680, 684, | |
753 | + 689, 695, 697, 701, 705, 711, 714, 716, 721, 725, | |
754 | + 730, 732 | |
755 | }; | |
756 | + | |
757 | +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ | |
758 | static const short yyrhs[] = | |
759 | { | |
760 | - 76, 77, 81, 0, 76, 81, 0, 0, 78, 0, | |
761 | - 77, 78, 0, 79, 0, 85, 0, 96, 0, 114, | |
762 | - 0, 116, 0, 107, 0, 120, 0, 80, 13, 0, | |
763 | - 55, 12, 0, 0, 82, 84, 0, 83, 44, 56, | |
764 | - 57, 0, 0, 34, 0, 33, 0, 58, 105, 126, | |
765 | - 59, 0, 58, 126, 59, 0, 58, 59, 0, 86, | |
766 | - 84, 0, 87, 0, 47, 87, 0, 88, 0, 89, | |
767 | - 0, 90, 91, 0, 33, 90, 91, 0, 108, 90, | |
768 | - 91, 0, 10, 0, 56, 92, 57, 0, 0, 33, | |
769 | - 0, 93, 0, 94, 0, 93, 60, 94, 0, 95, | |
770 | - 217, 0, 108, 0, 108, 61, 0, 4, 0, 97, | |
771 | - 58, 98, 59, 0, 45, 217, 0, 99, 101, 0, | |
772 | - 100, 0, 99, 100, 0, 85, 0, 116, 0, 107, | |
773 | - 0, 0, 102, 58, 126, 59, 0, 46, 0, 97, | |
774 | - 58, 104, 59, 0, 86, 62, 0, 104, 86, 62, | |
775 | - 0, 106, 0, 105, 106, 0, 107, 0, 120, 0, | |
776 | - 108, 109, 62, 0, 34, 0, 35, 0, 4, 63, | |
777 | - 118, 64, 0, 216, 0, 110, 0, 109, 60, 110, | |
778 | - 0, 217, 0, 217, 65, 117, 0, 111, 0, 217, | |
779 | - 112, 0, 113, 0, 112, 113, 0, 63, 118, 64, | |
780 | - 0, 115, 108, 217, 62, 0, 115, 108, 111, 62, | |
781 | - 0, 32, 0, 31, 108, 217, 65, 117, 62, 0, | |
782 | - 118, 0, 66, 118, 0, 67, 118, 0, 11, 0, | |
783 | - 119, 0, 216, 0, 3, 0, 121, 0, 123, 0, | |
784 | - 124, 0, 125, 0, 122, 86, 62, 0, 51, 0, | |
785 | - 122, 107, 0, 122, 111, 0, 122, 103, 0, 129, | |
786 | - 0, 126, 129, 0, 1, 62, 0, 1, 59, 0, | |
787 | - 0, 128, 0, 175, 0, 128, 60, 175, 0, 137, | |
788 | - 0, 84, 0, 150, 0, 151, 0, 174, 0, 164, | |
789 | - 0, 165, 0, 166, 0, 168, 0, 171, 0, 172, | |
790 | - 0, 130, 0, 131, 0, 133, 0, 134, 0, 48, | |
791 | - 132, 60, 175, 57, 62, 0, 56, 203, 0, 56, | |
792 | - 175, 0, 50, 207, 0, 135, 60, 136, 57, 0, | |
793 | - 53, 56, 175, 60, 203, 0, 175, 0, 136, 60, | |
794 | - 175, 0, 138, 139, 0, 138, 139, 140, 129, 0, | |
795 | - 141, 58, 142, 148, 59, 0, 22, 56, 175, 57, | |
796 | - 0, 129, 0, 23, 0, 24, 56, 175, 57, 0, | |
797 | - 143, 0, 142, 143, 0, 144, 147, 126, 0, 145, | |
798 | - 0, 144, 145, 0, 25, 146, 175, 68, 0, 0, | |
799 | - 0, 0, 149, 126, 0, 26, 68, 0, 163, 58, | |
800 | - 126, 59, 0, 152, 153, 129, 0, 154, 155, 129, | |
801 | - 156, 157, 62, 0, 158, 160, 161, 162, 57, 129, | |
802 | - 0, 27, 0, 56, 175, 57, 0, 28, 0, 0, | |
803 | - 27, 0, 56, 175, 57, 0, 159, 127, 62, 0, | |
804 | - 29, 56, 0, 0, 175, 0, 62, 0, 0, 128, | |
805 | - 0, 30, 0, 36, 62, 0, 37, 62, 0, 167, | |
806 | - 173, 62, 0, 38, 0, 39, 169, 62, 0, 40, | |
807 | - 170, 0, 169, 40, 170, 0, 175, 0, 41, 0, | |
808 | - 5, 0, 42, 43, 175, 62, 0, 62, 0, 0, | |
809 | - 175, 0, 175, 62, 0, 179, 0, 176, 0, 177, | |
810 | - 175, 0, 178, 175, 0, 216, 65, 0, 212, 65, | |
811 | - 0, 181, 0, 180, 18, 181, 0, 179, 0, 183, | |
812 | - 0, 182, 19, 183, 0, 181, 0, 186, 0, 184, | |
813 | - 185, 186, 0, 186, 0, 17, 0, 69, 0, 70, | |
814 | - 0, 15, 0, 16, 0, 14, 0, 189, 0, 67, | |
815 | - 189, 0, 66, 189, 0, 187, 188, 189, 0, 186, | |
816 | - 0, 67, 0, 66, 0, 192, 0, 190, 191, 192, | |
817 | - 0, 189, 0, 71, 0, 72, 0, 73, 0, 193, | |
818 | - 0, 119, 0, 11, 0, 56, 175, 57, 0, 74, | |
819 | - 192, 0, 194, 0, 194, 20, 0, 20, 194, 0, | |
820 | - 194, 21, 0, 21, 194, 0, 195, 0, 212, 0, | |
821 | - 215, 0, 216, 0, 196, 197, 0, 200, 0, 211, | |
822 | - 0, 216, 0, 56, 57, 0, 56, 198, 57, 0, | |
823 | - 198, 60, 199, 0, 199, 0, 175, 0, 201, 0, | |
824 | - 204, 0, 205, 0, 206, 0, 208, 0, 6, 132, | |
825 | - 202, 0, 60, 175, 57, 0, 60, 203, 57, 0, | |
826 | - 5, 0, 8, 132, 202, 0, 7, 132, 202, 0, | |
827 | - 9, 207, 0, 56, 175, 57, 0, 56, 5, 57, | |
828 | - 0, 209, 60, 210, 57, 0, 52, 56, 175, 60, | |
829 | - 203, 0, 175, 0, 210, 60, 175, 0, 49, 132, | |
830 | - 57, 0, 49, 132, 60, 175, 57, 0, 213, 214, | |
831 | - 0, 216, 0, 214, 63, 175, 64, 0, 63, 175, | |
832 | - 64, 0, 34, 56, 175, 57, 0, 10, 0, 10, | |
833 | - 0 | |
834 | + 76, 0, -1, 77, 78, 82, -1, 77, 82, -1, | |
835 | + -1, 79, -1, 78, 79, -1, 80, -1, 86, -1, | |
836 | + 97, -1, 115, -1, 117, -1, 108, -1, 121, -1, | |
837 | + 81, 13, -1, 55, 12, -1, -1, 83, 85, -1, | |
838 | + 84, 44, 56, 57, -1, -1, 34, -1, 33, -1, | |
839 | + 58, 106, 127, 59, -1, 58, 127, 59, -1, 58, | |
840 | + 59, -1, 87, 85, -1, 88, -1, 47, 88, -1, | |
841 | + 89, -1, 90, -1, 91, 92, -1, 33, 91, 92, | |
842 | + -1, 109, 91, 92, -1, 10, -1, 56, 93, 57, | |
843 | + -1, -1, 33, -1, 94, -1, 95, -1, 94, 60, | |
844 | + 95, -1, 96, 218, -1, 109, -1, 109, 61, -1, | |
845 | + 4, -1, 98, 58, 99, 59, -1, 45, 218, -1, | |
846 | + 100, 102, -1, 101, -1, 100, 101, -1, 86, -1, | |
847 | + 117, -1, 108, -1, -1, 103, 58, 127, 59, -1, | |
848 | + 46, -1, 98, 58, 105, 59, -1, 87, 62, -1, | |
849 | + 105, 87, 62, -1, 107, -1, 106, 107, -1, 108, | |
850 | + -1, 121, -1, 109, 110, 62, -1, 34, -1, 35, | |
851 | + -1, 4, 63, 119, 64, -1, 217, -1, 111, -1, | |
852 | + 110, 60, 111, -1, 218, -1, 218, 65, 118, -1, | |
853 | + 112, -1, 218, 113, -1, 114, -1, 113, 114, -1, | |
854 | + 63, 119, 64, -1, 116, 109, 218, 62, -1, 116, | |
855 | + 109, 112, 62, -1, 32, -1, 31, 109, 218, 65, | |
856 | + 118, 62, -1, 119, -1, 66, 119, -1, 67, 119, | |
857 | + -1, 11, -1, 120, -1, 217, -1, 3, -1, 122, | |
858 | + -1, 124, -1, 125, -1, 126, -1, 123, 87, 62, | |
859 | + -1, 51, -1, 123, 108, -1, 123, 112, -1, 123, | |
860 | + 104, -1, 130, -1, 127, 130, -1, 1, 62, -1, | |
861 | + 1, 59, -1, -1, 129, -1, 176, -1, 129, 60, | |
862 | + 176, -1, 138, -1, 85, -1, 151, -1, 152, -1, | |
863 | + 175, -1, 165, -1, 166, -1, 167, -1, 169, -1, | |
864 | + 172, -1, 173, -1, 131, -1, 132, -1, 134, -1, | |
865 | + 135, -1, 48, 133, 60, 176, 57, 62, -1, 56, | |
866 | + 204, -1, 56, 176, -1, 50, 208, -1, 136, 60, | |
867 | + 137, 57, -1, 53, 56, 176, 60, 204, -1, 176, | |
868 | + -1, 137, 60, 176, -1, 139, 140, -1, 139, 140, | |
869 | + 141, 130, -1, 142, 58, 143, 149, 59, -1, 22, | |
870 | + 56, 176, 57, -1, 130, -1, 23, -1, 24, 56, | |
871 | + 176, 57, -1, 144, -1, 143, 144, -1, 145, 148, | |
872 | + 127, -1, 146, -1, 145, 146, -1, 25, 147, 176, | |
873 | + 68, -1, -1, -1, -1, 150, 127, -1, 26, 68, | |
874 | + -1, 164, 58, 127, 59, -1, 153, 154, 130, -1, | |
875 | + 155, 156, 130, 157, 158, 62, -1, 159, 161, 162, | |
876 | + 163, 57, 130, -1, 27, -1, 56, 176, 57, -1, | |
877 | + 28, -1, -1, 27, -1, 56, 176, 57, -1, 160, | |
878 | + 128, 62, -1, 29, 56, -1, -1, 176, -1, 62, | |
879 | + -1, -1, 129, -1, 30, -1, 36, 62, -1, 37, | |
880 | + 62, -1, 168, 174, 62, -1, 38, -1, 39, 170, | |
881 | + 62, -1, 40, 171, -1, 170, 40, 171, -1, 176, | |
882 | + -1, 41, -1, 5, -1, 42, 43, 176, 62, -1, | |
883 | + 62, -1, -1, 176, -1, 176, 62, -1, 180, -1, | |
884 | + 177, -1, 178, 176, -1, 179, 176, -1, 217, 65, | |
885 | + -1, 213, 65, -1, 182, -1, 181, 18, 182, -1, | |
886 | + 180, -1, 184, -1, 183, 19, 184, -1, 182, -1, | |
887 | + 187, -1, 185, 186, 187, -1, 187, -1, 17, -1, | |
888 | + 69, -1, 70, -1, 15, -1, 16, -1, 14, -1, | |
889 | + 190, -1, 67, 190, -1, 66, 190, -1, 188, 189, | |
890 | + 190, -1, 187, -1, 67, -1, 66, -1, 193, -1, | |
891 | + 191, 192, 193, -1, 190, -1, 71, -1, 72, -1, | |
892 | + 73, -1, 194, -1, 120, -1, 11, -1, 56, 176, | |
893 | + 57, -1, 74, 193, -1, 195, -1, 195, 20, -1, | |
894 | + 20, 195, -1, 195, 21, -1, 21, 195, -1, 196, | |
895 | + -1, 213, -1, 216, -1, 217, -1, 197, 198, -1, | |
896 | + 201, -1, 212, -1, 217, -1, 56, 57, -1, 56, | |
897 | + 199, 57, -1, 199, 60, 200, -1, 200, -1, 176, | |
898 | + -1, 202, -1, 205, -1, 206, -1, 207, -1, 209, | |
899 | + -1, 6, 133, 203, -1, 60, 176, 57, -1, 60, | |
900 | + 204, 57, -1, 5, -1, 8, 133, 203, -1, 7, | |
901 | + 133, 203, -1, 9, 208, -1, 56, 176, 57, -1, | |
902 | + 56, 5, 57, -1, 210, 60, 211, 57, -1, 52, | |
903 | + 56, 176, 60, 204, -1, 176, -1, 211, 60, 176, | |
904 | + -1, 49, 133, 57, -1, 49, 133, 60, 176, 57, | |
905 | + -1, 214, 215, -1, 217, -1, 215, 63, 176, 64, | |
906 | + -1, 63, 176, 64, -1, 34, 56, 176, 57, -1, | |
907 | + 10, -1, 10, -1 | |
908 | }; | |
909 | ||
910 | -#endif | |
911 | - | |
912 | -#if YYDEBUG | |
913 | -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ | |
914 | -static const short yyrline[] = | |
915 | +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ | |
916 | +static const unsigned short yyrline[] = | |
917 | { | |
918 | - 0, 260, 267, 276, 292, 293, 296, 297, 298, 299, | |
919 | - 300, 301, 302, 305, 316, 320, 333, 356, 372, 373, | |
920 | - 375, 378, 379, 380, 383, 405, 407, 411, 417, 425, | |
921 | - 434, 441, 457, 477, 481, 482, 483, 486, 487, 490, | |
922 | - 505, 507, 509, 520, 527, 543, 546, 547, 550, 551, | |
923 | - 552, 555, 565, 575, 582, 591, 593, 597, 598, 601, | |
924 | - 602, 609, 612, 619, 626, 636, 649, 650, 653, 661, | |
925 | - 697, 701, 734, 736, 739, 756, 767, 782, 786, 798, | |
926 | - 800, 802, 804, 808, 810, 819, 823, 824, 825, 826, | |
927 | - 829, 837, 841, 845, 852, 856, 857, 858, 860, 865, | |
928 | - 867, 870, 871, 874, 875, 876, 877, 884, 885, 886, | |
929 | - 887, 888, 889, 890, 891, 894, 895, 896, 899, 926, | |
930 | - 928, 943, 957, 965, 976, 988, 1002, 1004, 1006, 1024, | |
931 | - 1028, 1032, 1036, 1050, 1051, 1054, 1057, 1059, 1063, 1083, | |
932 | - 1092, 1103, 1105, 1108, 1112, 1116, 1122, 1127, 1154, 1161, | |
933 | - 1170, 1176, 1180, 1184, 1194, 1200, 1213, 1215, 1225, 1232, | |
934 | - 1237, 1246, 1258, 1278, 1297, 1319, 1328, 1331, 1332, 1335, | |
935 | - 1351, 1353, 1360, 1375, 1377, 1379, 1382, 1390, 1391, 1394, | |
936 | - 1415, 1438, 1452, 1456, 1457, 1471, 1475, 1476, 1490, 1494, | |
937 | - 1495, 1512, 1516, 1517, 1518, 1519, 1520, 1521, 1524, 1525, | |
938 | - 1534, 1545, 1562, 1566, 1567, 1570, 1571, 1592, 1596, 1597, | |
939 | - 1598, 1601, 1602, 1610, 1618, 1620, 1633, 1634, 1646, 1658, | |
940 | - 1670, 1682, 1683, 1684, 1687, 1700, 1745, 1746, 1749, 1773, | |
941 | - 1774, 1777, 1778, 1781, 1792, 1793, 1794, 1795, 1796, 1799, | |
942 | - 1812, 1825, 1829, 1841, 1854, 1873, 1892, 1903, 1915, 1930, | |
943 | - 1941, 1950, 1961, 1975, 2000, 2013, 2043, 2053, 2065, 2072, | |
944 | - 2076 | |
945 | + 0, 260, 260, 267, 277, 292, 293, 296, 297, 298, | |
946 | + 299, 300, 301, 302, 305, 316, 321, 333, 356, 373, | |
947 | + 374, 376, 379, 380, 381, 384, 407, 409, 413, 419, | |
948 | + 427, 436, 443, 459, 479, 483, 484, 485, 488, 489, | |
949 | + 492, 507, 509, 511, 523, 530, 547, 550, 551, 554, | |
950 | + 555, 556, 560, 569, 579, 586, 595, 597, 601, 602, | |
951 | + 605, 606, 613, 616, 623, 630, 640, 653, 654, 657, | |
952 | + 665, 701, 705, 738, 740, 743, 760, 771, 786, 790, | |
953 | + 802, 804, 806, 808, 812, 814, 823, 827, 828, 829, | |
954 | + 830, 833, 841, 845, 849, 856, 860, 861, 862, 864, | |
955 | + 870, 871, 874, 876, 880, 881, 882, 883, 890, 891, | |
956 | + 892, 893, 894, 895, 896, 897, 900, 901, 902, 905, | |
957 | + 932, 934, 949, 963, 971, 982, 994, 1008, 1010, 1012, | |
958 | + 1030, 1034, 1038, 1042, 1056, 1057, 1060, 1063, 1065, 1069, | |
959 | + 1090, 1099, 1110, 1111, 1114, 1118, 1122, 1128, 1133, 1160, | |
960 | + 1167, 1176, 1183, 1186, 1190, 1200, 1206, 1220, 1221, 1231, | |
961 | + 1239, 1243, 1252, 1264, 1284, 1303, 1333, 1342, 1345, 1346, | |
962 | + 1349, 1365, 1367, 1374, 1390, 1393, 1394, 1398, 1406, 1407, | |
963 | + 1410, 1432, 1456, 1467, 1471, 1472, 1486, 1490, 1491, 1505, | |
964 | + 1509, 1510, 1527, 1531, 1532, 1533, 1534, 1535, 1536, 1539, | |
965 | + 1540, 1549, 1560, 1577, 1581, 1582, 1585, 1586, 1607, 1611, | |
966 | + 1612, 1613, 1616, 1617, 1625, 1633, 1635, 1648, 1649, 1661, | |
967 | + 1673, 1685, 1697, 1698, 1699, 1702, 1715, 1760, 1761, 1764, | |
968 | + 1788, 1789, 1792, 1793, 1796, 1807, 1808, 1809, 1810, 1811, | |
969 | + 1814, 1827, 1841, 1845, 1857, 1870, 1889, 1908, 1919, 1931, | |
970 | + 1946, 1957, 1966, 1977, 1991, 2016, 2029, 2059, 2069, 2081, | |
971 | + 2088, 2092 | |
972 | }; | |
973 | #endif | |
974 | ||
975 | - | |
976 | -#if (YYDEBUG) || defined YYERROR_VERBOSE | |
977 | - | |
978 | -/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ | |
979 | +#if YYDEBUG || YYERROR_VERBOSE | |
980 | +/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. | |
981 | + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ | |
982 | static const char *const yytname[] = | |
983 | { | |
984 | - "$", "error", "$undefined.", "UNSIGNED_INT", "STRING", "RAWSTRING", | |
985 | + "$end", "error", "$undefined", "UNSIGNED_INT", "STRING", "RAWSTRING", | |
986 | "STRINGCONCAT", "STRINGCOMPARE", "STRINGCOPY", "STRINGLENGTH", | |
987 | "IDENTIFIER", "CHARCON", "INCLUDE", "FNSTRING", "NE", "LE", "GE", "EQ", | |
988 | "OR", "AND", "PLPL", "MIMI", "IF", "ELSE", "SWITCH", "CASE", "DEFAULT", | |
989 | @@ -507,7 +743,7 @@ | |
990 | "BROADCAST", "EXTERN", "SSCANF", "SPRINTF", "LOWER_THAN_ELSE", "'#'", | |
991 | "'('", "')'", "'{'", "'}'", "','", "'&'", "';'", "'['", "']'", "'='", | |
992 | "'-'", "'+'", "':'", "'<'", "'>'", "'*'", "'/'", "'%'", "'!'", | |
993 | - "program", "init_outerscope", "outer_decls", "outer_decl", | |
994 | + "$accept", "program", "init_outerscope", "outer_decls", "outer_decl", | |
995 | "include_decl", "start_include", "opt_main_decl", "main_hdr", | |
996 | "opt_main_type", "compound_stmt", "function_decl", "func_proto", | |
997 | "func_hdr", "untyped_func_hdr", "typed_func_hdr", "function_id", | |
998 | @@ -545,572 +781,503 @@ | |
999 | }; | |
1000 | #endif | |
1001 | ||
1002 | -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ | |
1003 | -static const short yyr1[] = | |
1004 | +# ifdef YYPRINT | |
1005 | +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to | |
1006 | + token YYLEX-NUM. */ | |
1007 | +static const unsigned short yytoknum[] = | |
1008 | +{ | |
1009 | + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, | |
1010 | + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, | |
1011 | + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, | |
1012 | + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, | |
1013 | + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, | |
1014 | + 305, 306, 307, 308, 309, 35, 40, 41, 123, 125, | |
1015 | + 44, 38, 59, 91, 93, 61, 45, 43, 58, 60, | |
1016 | + 62, 42, 47, 37, 33 | |
1017 | +}; | |
1018 | +# endif | |
1019 | + | |
1020 | +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ | |
1021 | +static const unsigned char yyr1[] = | |
1022 | { | |
1023 | - 0, 75, 75, 76, 77, 77, 78, 78, 78, 78, | |
1024 | - 78, 78, 78, 79, 80, 81, 81, 82, 83, 83, | |
1025 | - 83, 84, 84, 84, 85, 86, 86, 87, 87, 88, | |
1026 | - 89, 89, 90, 91, 92, 92, 92, 93, 93, 94, | |
1027 | - 95, 95, 95, 96, 97, 98, 99, 99, 100, 100, | |
1028 | - 100, 101, 101, 102, 103, 104, 104, 105, 105, 106, | |
1029 | - 106, 107, 108, 108, 108, 108, 109, 109, 110, 110, | |
1030 | - 110, 111, 112, 112, 113, 114, 114, 115, 116, 117, | |
1031 | - 117, 117, 117, 118, 118, 119, 120, 120, 120, 120, | |
1032 | - 121, 122, 123, 124, 125, 126, 126, 126, 126, 127, | |
1033 | - 127, 128, 128, 129, 129, 129, 129, 129, 129, 129, | |
1034 | - 129, 129, 129, 129, 129, 130, 130, 130, 131, 132, | |
1035 | - 132, 133, 134, 135, 136, 136, 137, 137, 137, 138, | |
1036 | - 139, 140, 141, 142, 142, 143, 144, 144, 145, 146, | |
1037 | - 147, 148, 148, 149, 150, 151, 151, 151, 152, 153, | |
1038 | - 154, 155, 156, 157, 158, 159, 160, 160, 161, 162, | |
1039 | - 162, 163, 164, 165, 166, 167, 168, 169, 169, 170, | |
1040 | - 170, 170, 171, 172, 173, 173, 174, 175, 175, 176, | |
1041 | - 176, 177, 178, 179, 179, 180, 181, 181, 182, 183, | |
1042 | - 183, 184, 185, 185, 185, 185, 185, 185, 186, 186, | |
1043 | - 186, 186, 187, 188, 188, 189, 189, 190, 191, 191, | |
1044 | - 191, 192, 192, 192, 192, 192, 193, 193, 193, 193, | |
1045 | - 193, 193, 193, 193, 194, 195, 195, 195, 196, 197, | |
1046 | - 197, 198, 198, 199, 200, 200, 200, 200, 200, 201, | |
1047 | - 202, 202, 203, 204, 205, 206, 207, 207, 208, 209, | |
1048 | - 210, 210, 211, 211, 212, 213, 214, 214, 215, 216, | |
1049 | - 217 | |
1050 | + 0, 75, 76, 76, 77, 78, 78, 79, 79, 79, | |
1051 | + 79, 79, 79, 79, 80, 81, 82, 82, 83, 84, | |
1052 | + 84, 84, 85, 85, 85, 86, 87, 87, 88, 88, | |
1053 | + 89, 90, 90, 91, 92, 93, 93, 93, 94, 94, | |
1054 | + 95, 96, 96, 96, 97, 98, 99, 100, 100, 101, | |
1055 | + 101, 101, 102, 102, 103, 104, 105, 105, 106, 106, | |
1056 | + 107, 107, 108, 109, 109, 109, 109, 110, 110, 111, | |
1057 | + 111, 111, 112, 113, 113, 114, 115, 115, 116, 117, | |
1058 | + 118, 118, 118, 118, 119, 119, 120, 121, 121, 121, | |
1059 | + 121, 122, 123, 124, 125, 126, 127, 127, 127, 127, | |
1060 | + 128, 128, 129, 129, 130, 130, 130, 130, 130, 130, | |
1061 | + 130, 130, 130, 130, 130, 130, 131, 131, 131, 132, | |
1062 | + 133, 133, 134, 135, 136, 137, 137, 138, 138, 138, | |
1063 | + 139, 140, 141, 142, 143, 143, 144, 145, 145, 146, | |
1064 | + 147, 148, 149, 149, 150, 151, 152, 152, 152, 153, | |
1065 | + 154, 155, 156, 157, 158, 159, 160, 161, 161, 162, | |
1066 | + 163, 163, 164, 165, 166, 167, 168, 169, 170, 170, | |
1067 | + 171, 171, 171, 172, 173, 174, 174, 175, 176, 176, | |
1068 | + 177, 177, 178, 179, 180, 180, 181, 182, 182, 183, | |
1069 | + 184, 184, 185, 186, 186, 186, 186, 186, 186, 187, | |
1070 | + 187, 187, 187, 188, 189, 189, 190, 190, 191, 192, | |
1071 | + 192, 192, 193, 193, 193, 193, 193, 194, 194, 194, | |
1072 | + 194, 194, 194, 194, 194, 195, 196, 196, 196, 197, | |
1073 | + 198, 198, 199, 199, 200, 201, 201, 201, 201, 201, | |
1074 | + 202, 203, 203, 204, 205, 206, 207, 208, 208, 209, | |
1075 | + 210, 211, 211, 212, 212, 213, 214, 215, 215, 216, | |
1076 | + 217, 218 | |
1077 | }; | |
1078 | ||
1079 | -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ | |
1080 | -static const short yyr2[] = | |
1081 | +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ | |
1082 | +static const unsigned char yyr2[] = | |
1083 | { | |
1084 | - 0, 3, 2, 0, 1, 2, 1, 1, 1, 1, | |
1085 | - 1, 1, 1, 2, 2, 0, 2, 4, 0, 1, | |
1086 | - 1, 4, 3, 2, 2, 1, 2, 1, 1, 2, | |
1087 | - 3, 3, 1, 3, 0, 1, 1, 1, 3, 2, | |
1088 | - 1, 2, 1, 4, 2, 2, 1, 2, 1, 1, | |
1089 | - 1, 0, 4, 1, 4, 2, 3, 1, 2, 1, | |
1090 | - 1, 3, 1, 1, 4, 1, 1, 3, 1, 3, | |
1091 | - 1, 2, 1, 2, 3, 4, 4, 1, 6, 1, | |
1092 | - 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, | |
1093 | - 3, 1, 2, 2, 2, 1, 2, 2, 2, 0, | |
1094 | - 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, | |
1095 | - 1, 1, 1, 1, 1, 1, 1, 1, 6, 2, | |
1096 | - 2, 2, 4, 5, 1, 3, 2, 4, 5, 4, | |
1097 | - 1, 1, 4, 1, 2, 3, 1, 2, 4, 0, | |
1098 | - 0, 0, 2, 2, 4, 3, 6, 6, 1, 3, | |
1099 | - 1, 0, 1, 3, 3, 2, 0, 1, 1, 0, | |
1100 | - 1, 1, 2, 2, 3, 1, 3, 2, 3, 1, | |
1101 | - 1, 1, 4, 1, 0, 1, 2, 1, 1, 2, | |
1102 | - 2, 2, 2, 1, 3, 1, 1, 3, 1, 1, | |
1103 | - 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, | |
1104 | - 2, 3, 1, 1, 1, 1, 3, 1, 1, 1, | |
1105 | - 1, 1, 1, 1, 3, 2, 1, 2, 2, 2, | |
1106 | - 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, | |
1107 | - 3, 3, 1, 1, 1, 1, 1, 1, 1, 3, | |
1108 | - 3, 3, 1, 3, 3, 2, 3, 3, 4, 5, | |
1109 | - 1, 3, 3, 5, 2, 1, 4, 3, 4, 1, | |
1110 | - 1 | |
1111 | + 0, 2, 3, 2, 0, 1, 2, 1, 1, 1, | |
1112 | + 1, 1, 1, 1, 2, 2, 0, 2, 4, 0, | |
1113 | + 1, 1, 4, 3, 2, 2, 1, 2, 1, 1, | |
1114 | + 2, 3, 3, 1, 3, 0, 1, 1, 1, 3, | |
1115 | + 2, 1, 2, 1, 4, 2, 2, 1, 2, 1, | |
1116 | + 1, 1, 0, 4, 1, 4, 2, 3, 1, 2, | |
1117 | + 1, 1, 3, 1, 1, 4, 1, 1, 3, 1, | |
1118 | + 3, 1, 2, 1, 2, 3, 4, 4, 1, 6, | |
1119 | + 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, | |
1120 | + 1, 3, 1, 2, 2, 2, 1, 2, 2, 2, | |
1121 | + 0, 1, 1, 3, 1, 1, 1, 1, 1, 1, | |
1122 | + 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, | |
1123 | + 2, 2, 2, 4, 5, 1, 3, 2, 4, 5, | |
1124 | + 4, 1, 1, 4, 1, 2, 3, 1, 2, 4, | |
1125 | + 0, 0, 0, 2, 2, 4, 3, 6, 6, 1, | |
1126 | + 3, 1, 0, 1, 3, 3, 2, 0, 1, 1, | |
1127 | + 0, 1, 1, 2, 2, 3, 1, 3, 2, 3, | |
1128 | + 1, 1, 1, 4, 1, 0, 1, 2, 1, 1, | |
1129 | + 2, 2, 2, 2, 1, 3, 1, 1, 3, 1, | |
1130 | + 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, | |
1131 | + 2, 2, 3, 1, 1, 1, 1, 3, 1, 1, | |
1132 | + 1, 1, 1, 1, 1, 3, 2, 1, 2, 2, | |
1133 | + 2, 2, 1, 1, 1, 1, 2, 1, 1, 1, | |
1134 | + 2, 3, 3, 1, 1, 1, 1, 1, 1, 1, | |
1135 | + 3, 3, 3, 1, 3, 3, 2, 3, 3, 4, | |
1136 | + 5, 1, 3, 3, 5, 2, 1, 4, 3, 4, | |
1137 | + 1, 1 | |
1138 | }; | |
1139 | ||
1140 | -/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE | |
1141 | - doesn't specify something else to do. Zero means the default is an | |
1142 | - error. */ | |
1143 | -static const short yydefact[] = | |
1144 | -{ | |
1145 | - 3, 15, 0, 32, 0, 77, 20, 19, 63, 0, | |
1146 | - 0, 91, 0, 15, 4, 6, 0, 2, 0, 0, | |
1147 | - 7, 0, 25, 27, 28, 0, 8, 0, 11, 0, | |
1148 | - 9, 0, 10, 12, 86, 0, 87, 88, 89, 65, | |
1149 | - 0, 259, 62, 0, 32, 0, 260, 44, 0, 26, | |
1150 | - 0, 14, 5, 1, 13, 0, 16, 0, 24, 34, | |
1151 | - 29, 0, 260, 0, 0, 66, 70, 68, 0, 32, | |
1152 | - 0, 0, 94, 92, 93, 0, 85, 0, 83, 84, | |
1153 | - 0, 30, 0, 0, 0, 0, 0, 213, 0, 0, | |
1154 | - 0, 0, 148, 150, 0, 161, 62, 0, 0, 165, | |
1155 | - 0, 0, 0, 0, 0, 0, 0, 0, 23, 173, | |
1156 | - 0, 0, 0, 104, 0, 57, 59, 0, 212, 60, | |
1157 | - 0, 95, 114, 115, 116, 117, 0, 103, 0, 0, | |
1158 | - 105, 106, 0, 151, 156, 99, 0, 108, 109, 110, | |
1159 | - 174, 111, 112, 113, 107, 0, 178, 0, 0, 177, | |
1160 | - 0, 183, 0, 186, 0, 189, 0, 198, 0, 205, | |
1161 | - 211, 216, 221, 0, 226, 234, 235, 236, 237, 238, | |
1162 | - 0, 227, 222, 0, 223, 224, 0, 42, 35, 0, | |
1163 | - 36, 37, 0, 40, 48, 0, 51, 46, 50, 49, | |
1164 | - 31, 0, 61, 0, 0, 71, 72, 0, 0, 90, | |
1165 | - 0, 64, 0, 98, 97, 0, 0, 0, 0, 0, | |
1166 | - 245, 218, 224, 220, 0, 0, 155, 0, 162, 163, | |
1167 | - 0, 0, 0, 0, 0, 121, 0, 0, 0, 0, | |
1168 | - 224, 200, 222, 224, 199, 215, 58, 0, 22, 96, | |
1169 | - 0, 130, 126, 0, 0, 0, 0, 0, 157, 0, | |
1170 | - 100, 101, 0, 0, 175, 176, 179, 180, 0, 0, | |
1171 | - 197, 195, 196, 192, 193, 194, 0, 204, 203, 0, | |
1172 | - 208, 209, 210, 0, 217, 219, 0, 225, 0, 182, | |
1173 | - 0, 254, 181, 17, 33, 0, 39, 41, 43, 53, | |
1174 | - 47, 45, 0, 67, 0, 82, 0, 0, 69, 79, | |
1175 | - 73, 76, 75, 0, 0, 0, 242, 120, 119, 0, | |
1176 | - 239, 244, 243, 0, 0, 0, 0, 0, 171, 170, | |
1177 | - 167, 169, 0, 166, 0, 0, 252, 0, 0, 0, | |
1178 | - 214, 21, 0, 124, 131, 0, 139, 141, 133, 140, | |
1179 | - 136, 0, 145, 0, 158, 159, 154, 0, 0, 164, | |
1180 | - 184, 187, 190, 201, 206, 229, 233, 0, 232, 250, | |
1181 | - 0, 0, 0, 38, 0, 74, 80, 81, 55, 54, | |
1182 | - 0, 78, 0, 0, 247, 246, 129, 132, 258, 168, | |
1183 | - 172, 0, 0, 0, 0, 122, 0, 127, 0, 0, | |
1184 | - 134, 0, 0, 137, 0, 149, 152, 0, 160, 0, | |
1185 | - 102, 144, 230, 0, 248, 0, 257, 0, 0, 56, | |
1186 | - 240, 241, 0, 253, 249, 123, 125, 0, 143, 128, | |
1187 | - 142, 135, 0, 0, 0, 231, 251, 256, 52, 118, | |
1188 | - 138, 0, 146, 147, 153, 0, 0, 0 | |
1189 | +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state | |
1190 | + STATE-NUM when YYTABLE doesn't specify something else to do. Zero | |
1191 | + means the default is an error. */ | |
1192 | +static const unsigned short yydefact[] = | |
1193 | +{ | |
1194 | + 4, 0, 16, 1, 0, 33, 0, 78, 21, 20, | |
1195 | + 64, 0, 0, 92, 0, 16, 5, 7, 0, 3, | |
1196 | + 0, 0, 8, 0, 26, 28, 29, 0, 9, 0, | |
1197 | + 12, 0, 10, 0, 11, 13, 87, 0, 88, 89, | |
1198 | + 90, 66, 0, 260, 63, 0, 33, 0, 261, 45, | |
1199 | + 0, 27, 0, 15, 6, 2, 14, 0, 17, 0, | |
1200 | + 25, 35, 30, 0, 261, 0, 0, 67, 71, 69, | |
1201 | + 0, 33, 0, 0, 95, 93, 94, 0, 86, 0, | |
1202 | + 84, 85, 0, 31, 0, 0, 0, 0, 0, 214, | |
1203 | + 0, 0, 0, 0, 149, 151, 0, 162, 63, 0, | |
1204 | + 0, 166, 0, 0, 0, 0, 0, 0, 0, 0, | |
1205 | + 24, 174, 0, 0, 0, 105, 0, 58, 60, 0, | |
1206 | + 213, 61, 0, 96, 115, 116, 117, 118, 0, 104, | |
1207 | + 0, 0, 106, 107, 0, 152, 157, 100, 0, 109, | |
1208 | + 110, 111, 175, 112, 113, 114, 108, 0, 179, 0, | |
1209 | + 0, 178, 0, 184, 0, 187, 0, 190, 0, 199, | |
1210 | + 0, 206, 212, 217, 222, 0, 227, 235, 236, 237, | |
1211 | + 238, 239, 0, 228, 223, 0, 224, 225, 0, 43, | |
1212 | + 36, 0, 37, 38, 0, 41, 49, 0, 52, 47, | |
1213 | + 51, 50, 32, 0, 62, 0, 0, 72, 73, 0, | |
1214 | + 0, 91, 0, 65, 0, 99, 98, 0, 0, 0, | |
1215 | + 0, 0, 246, 219, 225, 221, 0, 0, 156, 0, | |
1216 | + 163, 164, 0, 0, 0, 0, 0, 122, 0, 0, | |
1217 | + 0, 0, 225, 201, 223, 225, 200, 216, 59, 0, | |
1218 | + 23, 97, 0, 131, 127, 0, 0, 0, 0, 0, | |
1219 | + 158, 0, 101, 102, 0, 0, 176, 177, 180, 181, | |
1220 | + 0, 0, 198, 196, 197, 193, 194, 195, 0, 205, | |
1221 | + 204, 0, 209, 210, 211, 0, 218, 220, 0, 226, | |
1222 | + 0, 183, 0, 255, 182, 18, 34, 0, 40, 42, | |
1223 | + 44, 54, 48, 46, 0, 68, 0, 83, 0, 0, | |
1224 | + 70, 80, 74, 77, 76, 0, 0, 0, 243, 121, | |
1225 | + 120, 0, 240, 245, 244, 0, 0, 0, 0, 0, | |
1226 | + 172, 171, 168, 170, 0, 167, 0, 0, 253, 0, | |
1227 | + 0, 0, 215, 22, 0, 125, 132, 0, 140, 142, | |
1228 | + 134, 141, 137, 0, 146, 0, 159, 160, 155, 0, | |
1229 | + 0, 165, 185, 188, 191, 202, 207, 230, 234, 0, | |
1230 | + 233, 251, 0, 0, 0, 39, 0, 75, 81, 82, | |
1231 | + 56, 55, 0, 79, 0, 0, 248, 247, 130, 133, | |
1232 | + 259, 169, 173, 0, 0, 0, 0, 123, 0, 128, | |
1233 | + 0, 0, 135, 0, 0, 138, 0, 150, 153, 0, | |
1234 | + 161, 0, 103, 145, 231, 0, 249, 0, 258, 0, | |
1235 | + 0, 57, 241, 242, 0, 254, 250, 124, 126, 0, | |
1236 | + 144, 129, 143, 136, 0, 0, 0, 232, 252, 257, | |
1237 | + 53, 119, 139, 0, 147, 148, 154 | |
1238 | }; | |
1239 | ||
1240 | +/* YYDEFGOTO[NTERM-NUM]. */ | |
1241 | static const short yydefgoto[] = | |
1242 | { | |
1243 | - 435, 1, 13, 14, 15, 16, 17, 18, 19, 113, | |
1244 | - 20, 21, 22, 23, 24, 25, 60, 179, 180, 181, | |
1245 | - 182, 26, 27, 185, 186, 187, 291, 292, 72, 304, | |
1246 | - 114, 115, 28, 29, 64, 65, 66, 195, 196, 30, | |
1247 | - 31, 32, 298, 299, 118, 33, 34, 35, 36, 37, | |
1248 | - 38, 120, 249, 250, 121, 122, 123, 206, 124, 125, | |
1249 | - 126, 332, 127, 128, 242, 335, 129, 337, 338, 339, | |
1250 | - 340, 388, 394, 391, 392, 130, 131, 132, 245, 133, | |
1251 | - 246, 397, 423, 134, 135, 247, 345, 399, 136, 137, | |
1252 | - 138, 139, 140, 141, 221, 320, 142, 143, 253, 144, | |
1253 | - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, | |
1254 | - 266, 155, 156, 269, 157, 158, 273, 159, 160, 161, | |
1255 | - 162, 163, 277, 357, 358, 164, 165, 310, 308, 166, | |
1256 | - 167, 168, 210, 169, 170, 360, 171, 172, 173, 281, | |
1257 | - 174, 230, 67 | |
1258 | + -1, 1, 2, 15, 16, 17, 18, 19, 20, 21, | |
1259 | + 115, 22, 23, 24, 25, 26, 27, 62, 181, 182, | |
1260 | + 183, 184, 28, 29, 187, 188, 189, 293, 294, 74, | |
1261 | + 306, 116, 117, 30, 31, 66, 67, 68, 197, 198, | |
1262 | + 32, 33, 34, 300, 301, 120, 35, 36, 37, 38, | |
1263 | + 39, 40, 122, 251, 252, 123, 124, 125, 208, 126, | |
1264 | + 127, 128, 334, 129, 130, 244, 337, 131, 339, 340, | |
1265 | + 341, 342, 390, 396, 393, 394, 132, 133, 134, 247, | |
1266 | + 135, 248, 399, 425, 136, 137, 249, 347, 401, 138, | |
1267 | + 139, 140, 141, 142, 143, 223, 322, 144, 145, 255, | |
1268 | + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, | |
1269 | + 156, 268, 157, 158, 271, 159, 160, 275, 161, 162, | |
1270 | + 163, 164, 165, 279, 359, 360, 166, 167, 312, 310, | |
1271 | + 168, 169, 170, 212, 171, 172, 362, 173, 174, 175, | |
1272 | + 283, 176, 232, 69 | |
1273 | }; | |
1274 | ||
1275 | +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing | |
1276 | + STATE-NUM. */ | |
1277 | +#define YYPACT_NINF -303 | |
1278 | static const short yypact[] = | |
1279 | { | |
1280 | - -32768, 1019, -40, 20, 223,-32768, 43, 54,-32768, 64, | |
1281 | - 58,-32768, 72, 1019,-32768,-32768, 82,-32768, 41, 68, | |
1282 | - -32768, 41,-32768,-32768,-32768, 91,-32768, 70,-32768, 145, | |
1283 | - -32768, 223,-32768,-32768,-32768, 178,-32768,-32768,-32768,-32768, | |
1284 | - 15,-32768,-32768, 64,-32768, 91,-32768,-32768, 43,-32768, | |
1285 | - 43,-32768,-32768,-32768,-32768, 321,-32768, 103,-32768, 235, | |
1286 | - -32768, 170, 107, 91, 44,-32768,-32768, 71, 64, 16, | |
1287 | - 110, 141,-32768,-32768,-32768, 144,-32768, 150,-32768,-32768, | |
1288 | - 154,-32768, -30, 168, 168, 168, 172,-32768, 216, 216, | |
1289 | - 181, 193,-32768,-32768, 195,-32768, 197, 192, 201,-32768, | |
1290 | - 194, 224, 168, 168, 172, 218, 219, 972,-32768,-32768, | |
1291 | - 991, 991, 991,-32768, 390,-32768,-32768, 64,-32768,-32768, | |
1292 | - 514,-32768,-32768,-32768,-32768,-32768, 217,-32768, 762, 222, | |
1293 | - -32768,-32768, 220,-32768, 972, 972, 225,-32768,-32768,-32768, | |
1294 | - 972,-32768,-32768,-32768,-32768, 226,-32768, 972, 972, 264, | |
1295 | - 269, 271, 272,-32768, 31, 55, 84, 124, 159,-32768, | |
1296 | - -32768, 96,-32768, 236,-32768,-32768,-32768,-32768,-32768,-32768, | |
1297 | - 233,-32768, 229, 232,-32768, 10, 240, -40,-32768, 242, | |
1298 | - 243,-32768, 64, 239,-32768, 247, 175,-32768,-32768,-32768, | |
1299 | - -32768, 64,-32768, 15, 11, 144,-32768, 245, 114,-32768, | |
1300 | - 231,-32768, 11,-32768,-32768, 851, 250, 250, 250, 921, | |
1301 | - -32768,-32768,-32768,-32768, 972, 972,-32768, 972,-32768,-32768, | |
1302 | - 832, 3, 972, 251, 26,-32768, 972, 972, 197, 255, | |
1303 | - -7, 124,-32768, 33, 124,-32768,-32768, 576,-32768,-32768, | |
1304 | - 972,-32768, 290, 289, 972, 762, 762, 256,-32768, 258, | |
1305 | - 257,-32768, 452, 259,-32768,-32768,-32768,-32768, 972, 972, | |
1306 | - -32768,-32768,-32768,-32768,-32768,-32768, 972,-32768,-32768, 991, | |
1307 | - -32768,-32768,-32768, 991,-32768,-32768, 902,-32768, 972,-32768, | |
1308 | - 972, 263,-32768,-32768,-32768, 238,-32768,-32768,-32768,-32768, | |
1309 | - -32768,-32768, 275,-32768, 270,-32768, 15, 15,-32768,-32768, | |
1310 | - -32768,-32768,-32768, 274, 119, 276,-32768,-32768,-32768, 851, | |
1311 | - -32768,-32768,-32768, 280, 282, 283, 287, 295,-32768,-32768, | |
1312 | - -32768,-32768, 832,-32768, 291, 972,-32768, 972, 301, 302, | |
1313 | - -32768,-32768, 37,-32768,-32768, 762,-32768, 161,-32768, 289, | |
1314 | - -32768, 307,-32768, 338,-32768, 972,-32768, 972, 638,-32768, | |
1315 | - 271,-32768, 123, 124,-32768,-32768,-32768, 75,-32768,-32768, | |
1316 | - 85, 303, 972,-32768, 452,-32768,-32768,-32768,-32768,-32768, | |
1317 | - 304,-32768, 311, 318,-32768,-32768,-32768,-32768,-32768,-32768, | |
1318 | - -32768, 319, 324, 373, 373,-32768, 972,-32768, 972, 314, | |
1319 | - -32768, 325, 452,-32768, 452,-32768,-32768, 329, 257, 332, | |
1320 | - -32768,-32768,-32768, 972,-32768, 972,-32768, 322, 700,-32768, | |
1321 | - -32768,-32768, 328,-32768,-32768,-32768,-32768, 334,-32768,-32768, | |
1322 | - 762, 762, 972, 330, 762,-32768,-32768,-32768,-32768,-32768, | |
1323 | - -32768, 346,-32768,-32768,-32768, 404, 405,-32768 | |
1324 | + -303, 32, 278, -303, -21, 45, 42, -303, 49, 78, | |
1325 | + -303, 82, 191, -303, 85, 278, -303, -303, 123, -303, | |
1326 | + 64, 96, -303, 64, -303, -303, -303, 99, -303, 118, | |
1327 | + -303, 162, -303, 42, -303, -303, -303, 240, -303, -303, | |
1328 | + -303, -303, 48, -303, -303, 82, -303, 99, -303, -303, | |
1329 | + 49, -303, 49, -303, -303, -303, -303, 334, -303, 125, | |
1330 | + -303, 293, -303, 387, 135, 99, 92, -303, -303, 129, | |
1331 | + 82, 6, 122, 145, -303, -303, -303, 130, -303, 140, | |
1332 | + -303, -303, 141, -303, 47, 158, 158, 158, 163, -303, | |
1333 | + 217, 217, 177, 178, -303, -303, 183, -303, 185, 180, | |
1334 | + 184, -303, 207, 205, 158, 158, 163, 193, 196, 934, | |
1335 | + -303, -303, 985, 985, 985, -303, 403, -303, -303, 82, | |
1336 | + -303, -303, 527, -303, -303, -303, -303, -303, 197, -303, | |
1337 | + 775, 195, -303, -303, 208, -303, 934, 934, 209, -303, | |
1338 | + -303, -303, 934, -303, -303, -303, -303, 201, -303, 934, | |
1339 | + 934, 247, 248, 252, 253, -303, 147, 113, 1, 114, | |
1340 | + 117, -303, -303, 84, -303, 221, -303, -303, -303, -303, | |
1341 | + -303, -303, 218, -303, 215, 226, -303, 8, 233, -21, | |
1342 | + -303, 234, 232, -303, 82, 238, -303, 236, 812, -303, | |
1343 | + -303, -303, -303, 82, -303, 48, 12, 130, -303, 244, | |
1344 | + 69, -303, 853, -303, 12, -303, -303, 845, 254, 254, | |
1345 | + 254, 864, -303, -303, -303, -303, 934, 934, -303, 934, | |
1346 | + -303, -303, 202, -6, 934, 256, 54, -303, 934, 934, | |
1347 | + 185, 243, 24, 114, -303, -20, 114, -303, -303, 589, | |
1348 | + -303, -303, 934, -303, 284, 294, 934, 775, 775, 262, | |
1349 | + -303, 268, 274, -303, 465, 285, -303, -303, -303, -303, | |
1350 | + 934, 934, -303, -303, -303, -303, -303, -303, 934, -303, | |
1351 | + -303, 985, -303, -303, -303, 985, -303, -303, 915, -303, | |
1352 | + 934, -303, 934, 273, -303, -303, -303, 91, -303, -303, | |
1353 | + -303, -303, -303, -303, 288, -303, 286, -303, 48, 48, | |
1354 | + -303, -303, -303, -303, -303, 287, 27, 289, -303, -303, | |
1355 | + -303, 845, -303, -303, -303, 291, 295, 296, 300, 302, | |
1356 | + -303, -303, -303, -303, 202, -303, 298, 934, -303, 934, | |
1357 | + 305, 306, -303, -303, 61, -303, -303, 775, -303, 171, | |
1358 | + -303, 294, -303, 310, -303, 347, -303, 934, -303, 934, | |
1359 | + 651, -303, 252, -303, 50, 114, -303, -303, -303, 81, | |
1360 | + -303, -303, 93, 311, 934, -303, 465, -303, -303, -303, | |
1361 | + -303, -303, 315, -303, 321, 322, -303, -303, -303, -303, | |
1362 | + -303, -303, -303, 323, 324, 383, 383, -303, 934, -303, | |
1363 | + 934, 326, -303, 330, 465, -303, 465, -303, -303, 339, | |
1364 | + 274, 341, -303, -303, -303, 934, -303, 934, -303, 335, | |
1365 | + 713, -303, -303, -303, 340, -303, -303, -303, -303, 337, | |
1366 | + -303, -303, 775, 775, 934, 353, 775, -303, -303, -303, | |
1367 | + -303, -303, -303, 346, -303, -303, -303 | |
1368 | }; | |
1369 | ||
1370 | +/* YYPGOTO[NTERM-NUM]. */ | |
1371 | static const short yypgoto[] = | |
1372 | { | |
1373 | - -32768,-32768,-32768, 393,-32768,-32768, 394,-32768,-32768, 125, | |
1374 | - -46, -33, 398,-32768,-32768, 32, -6,-32768,-32768, 128, | |
1375 | - -32768,-32768, 374,-32768,-32768, 230,-32768,-32768,-32768,-32768, | |
1376 | - -32768, 308, -11, 0,-32768, 244, -16,-32768, 228,-32768, | |
1377 | - -32768, -45, 213, -35, -37, -38,-32768,-32768,-32768,-32768, | |
1378 | - -32768, -108,-32768, 76, -119,-32768,-32768, 46,-32768,-32768, | |
1379 | - -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 93,-32768, | |
1380 | - 92,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, | |
1381 | - -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, | |
1382 | - -32768,-32768,-32768,-32768,-32768, 111,-32768,-32768,-32768,-32768, | |
1383 | - -107,-32768,-32768,-32768,-32768,-32768, 176,-32768, 177,-32768, | |
1384 | - -32768, 171,-32768,-32768, -99,-32768,-32768, -105,-32768, 104, | |
1385 | - -32768,-32768,-32768,-32768, 42,-32768,-32768, 39, -296,-32768, | |
1386 | - -32768,-32768, 340,-32768,-32768,-32768,-32768, -75,-32768,-32768, | |
1387 | - -32768, 50, -1 | |
1388 | + -303, -303, -303, -303, 401, -303, -303, 402, -303, -303, | |
1389 | + 128, -53, -36, 407, -303, -303, 41, 0, -303, -303, | |
1390 | + 139, -303, -303, 391, -303, -303, 241, -303, -303, -303, | |
1391 | + -303, -303, 319, -13, -4, -303, 250, -16, -303, 239, | |
1392 | + -303, -303, -49, 242, -37, -39, -31, -303, -303, -303, | |
1393 | + -303, -303, -110, -303, 97, -105, -303, -303, -5, -303, | |
1394 | + -303, -303, -303, -303, -303, -303, -303, -303, -303, 108, | |
1395 | + -303, 107, -303, -303, -303, -303, -303, -303, -303, -303, | |
1396 | + -303, -303, -303, -303, -303, -303, -303, -303, -303, -303, | |
1397 | + -303, -303, -303, -303, -303, -303, 126, -303, -303, -303, | |
1398 | + -303, -109, -303, -303, -303, -303, -303, 189, -303, 199, | |
1399 | + -303, -303, 190, -303, -303, -93, -303, -303, -107, -303, | |
1400 | + 109, -303, -303, -303, -303, 52, -303, -303, 21, -302, | |
1401 | + -303, -303, -303, 356, -303, -303, -303, -303, -101, -303, | |
1402 | + -303, -303, 33, -7 | |
1403 | }; | |
1404 | ||
1405 | - | |
1406 | -#define YYLAST 1074 | |
1407 | - | |
1408 | - | |
1409 | +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If | |
1410 | + positive, shift that token. If negative, reduce the rule which | |
1411 | + number is the opposite. If zero, do what YYDEFACT says. | |
1412 | + If YYTABLE_NINF, syntax error. */ | |
1413 | +#define YYTABLE_NINF -262 | |
1414 | static const short yytable[] = | |
1415 | { | |
1416 | - 229, 239, 70, 78, 43, 77, 237, 235, 47, 241, | |
1417 | - 50, 231, 234, 373, 76, 184, 189, 119, 76, 74, | |
1418 | - -65, 41, 295, 40, 73, 41, -259, 248, 251, 203, | |
1419 | - -259, 68, 204, 254, 75, 232, 232, 232, 45, 81, | |
1420 | - 256, 257, 80, 322, 116, 260, 261, 262, 263, -228, | |
1421 | - 188, 39, 197, 44, 39, 117, -255, 190, 282, 183, | |
1422 | - 39, 63, 2, 39, -62, 323, -228, 198, 3, -191, | |
1423 | - -191, -191, -191, -255, 46, 282, 119, 296, 297, -260, | |
1424 | - 45, 39, 63, 326, 51, 39, 327, 414, 415, -228, | |
1425 | - 79, 48, 42, 8, 385, 54, -255, 386, 307, 55, | |
1426 | - 264, 265, 314, 116, 191, 175, 192, 315, 316, 39, | |
1427 | - 317, 39, 57, 321, 117, 324, 274, 275, 239, 328, | |
1428 | - 329, -202, -202, 2, -191, -191, 342, 343, 61, 3, | |
1429 | - 207, 208, 402, 333, 193, 403, 194, 341, 212, 212, | |
1430 | - 184, 189, 404, 56, 348, 405, 58, 59, 223, 224, | |
1431 | - 267, 268, 48, 42, 8, 62, 78, 78, 294, 176, | |
1432 | - 233, 233, 233, -32, 175, 78, 10, 303, 354, 356, | |
1433 | - 353, 359, 199, 361, 2, 188, 302, 193, 369, 2, | |
1434 | - 3, 286, 2, 232, 232, 3, 336, 389, 69, -202, | |
1435 | - -202, 232, 211, 213, 232, -207, -207, -207, 232, 200, | |
1436 | - 50, 4, 372, 48, 42, 8, 4, 193, 48, 42, | |
1437 | - 8, 48, 42, 8, 201, 321, 387, 10, 381, 202, | |
1438 | - 382, 289, 10, 9, 205, 10, 41, 2, 209, 239, | |
1439 | - 270, 271, 272, 41, 220, 2, 39, 214, 251, 177, | |
1440 | - 400, 3, 177, 79, 79, 41, 311, 312, 41, 215, | |
1441 | - 39, 216, 79, 217, 218, 407, 408, 42, 8, 78, | |
1442 | - 78, 366, 367, 219, 48, 42, 8, 222, 178, 42, | |
1443 | - 8, 370, 42, 8, 226, 227, 244, 240, 10, 416, | |
1444 | - 243, 417, -185, 252, 420, 183, 421, 258, 255, 239, | |
1445 | - -188, 259, 276, 278, 279, 280, 356, 283, 426, 284, | |
1446 | - 287, 239, 239, 285, 50, 433, 288, 301, 233, 233, | |
1447 | - 309, 325, 330, 334, 336, 431, 233, 347, 344, 233, | |
1448 | - 346, 349, 82, 233, 76, 2, 362, 83, 84, 85, | |
1449 | - 86, 41, 87, 364, 365, 39, 368, 374, 371, 375, | |
1450 | - 376, 88, 89, 90, 377, 91, 79, 79, 92, 93, | |
1451 | - 94, 95, 378, 380, 39, 96, 8, 97, 98, 99, | |
1452 | - 100, 383, 384, 101, 395, 396, 409, 406, 410, 102, | |
1453 | - 103, 104, 11, 105, 106, 411, 412, 107, 306, 55, | |
1454 | - 108, 413, 418, 109, 419, 422, 427, 110, 111, 424, | |
1455 | - 429, 82, 432, 76, 2, 112, 83, 84, 85, 86, | |
1456 | - 41, 87, 430, 434, 436, 437, 52, 53, 49, 71, | |
1457 | - 88, 89, 90, 363, 91, 305, 290, 92, 93, 94, | |
1458 | - 95, 398, 236, 300, 96, 8, 97, 98, 99, 100, | |
1459 | - 390, 393, 101, 379, 350, 293, 351, 352, 102, 103, | |
1460 | - 104, 11, 105, 106, 225, 425, 107, 0, 55, 0, | |
1461 | - 0, 0, 109, 82, 0, 76, 110, 111, 83, 84, | |
1462 | - 85, 86, 41, 87, 112, 0, 0, 0, 0, 0, | |
1463 | - 0, 0, 88, 89, 90, 0, 91, 0, 0, 92, | |
1464 | - 93, 94, 95, 0, 0, 0, 228, 0, 97, 98, | |
1465 | - 99, 100, 0, 0, 101, 0, 0, 0, 0, 0, | |
1466 | - 102, 103, 104, 0, 105, 106, 0, 0, 107, 0, | |
1467 | - 55, 0, 0, 0, 109, 0, 0, 76, 110, 111, | |
1468 | - 83, 84, 85, 86, 41, 87, 112, 0, 0, 0, | |
1469 | - 0, 0, 0, 0, 88, 89, 90, 0, 91, 0, | |
1470 | - 0, 92, 93, 94, 95, 0, 0, 0, 228, 0, | |
1471 | - 97, 98, 99, 100, 0, 0, 101, 0, 0, 0, | |
1472 | - 0, 0, 102, 103, 104, 0, 105, 106, 0, 0, | |
1473 | - 107, 0, 55, 238, 0, 0, 109, 0, 0, 76, | |
1474 | - 110, 111, 83, 84, 85, 86, 41, 87, 112, 0, | |
1475 | - 0, 0, 0, 0, 0, 0, 88, 89, 90, 0, | |
1476 | - 91, 0, 0, 92, 93, 94, 95, 0, 0, 0, | |
1477 | - 228, 0, 97, 98, 99, 100, 0, 0, 101, 0, | |
1478 | - 0, 0, 0, 0, 102, 103, 104, 0, 105, 106, | |
1479 | - 0, 0, 107, 0, 55, 331, 0, 0, 109, 0, | |
1480 | - 0, 76, 110, 111, 83, 84, 85, 86, 41, 87, | |
1481 | - 112, 0, 0, 0, 0, 0, 0, 0, 88, 89, | |
1482 | - 90, 0, 91, 0, 0, 92, 93, 94, 95, 0, | |
1483 | - 0, 0, 228, 0, 97, 98, 99, 100, 0, 0, | |
1484 | - 101, 0, 0, 0, 0, 0, 102, 103, 104, 0, | |
1485 | - 105, 106, 0, 0, 107, 0, 55, 401, 0, 0, | |
1486 | - 109, 0, 0, 76, 110, 111, 83, 84, 85, 86, | |
1487 | - 41, 87, 112, 0, 0, 0, 0, 0, 0, 0, | |
1488 | - 88, 89, 90, 0, 91, 0, 0, 92, 93, 94, | |
1489 | - 95, 0, 0, 0, 228, 0, 97, 98, 99, 100, | |
1490 | - 0, 0, 101, 0, 0, 0, 0, 0, 102, 103, | |
1491 | - 104, 0, 105, 106, 0, 0, 107, 0, 55, 428, | |
1492 | - 0, 0, 109, 0, 0, 76, 110, 111, 83, 84, | |
1493 | - 85, 86, 41, 87, 112, 0, 0, 0, 0, 0, | |
1494 | - 0, 0, 88, 89, 90, 0, 91, 0, 0, 92, | |
1495 | - 93, 94, 95, 0, 0, 0, 228, 0, 97, 98, | |
1496 | - 99, 100, 0, 0, 101, 0, 0, 0, 0, 0, | |
1497 | - 102, 103, 104, 0, 105, 106, 0, 0, 107, 0, | |
1498 | - 55, 0, 0, 0, 109, 0, 0, 0, 110, 111, | |
1499 | - 0, 0, 0, 0, 0, 76, 112, 318, 83, 84, | |
1500 | - 85, 86, 41, 87, 0, 0, 0, 0, 0, 0, | |
1501 | - 0, 0, 88, 89, 76, 0, 306, 83, 84, 85, | |
1502 | - 86, 41, 87, 0, 0, 0, 228, 0, 0, 0, | |
1503 | - 0, 88, 89, 319, 0, 0, 0, 0, 0, 0, | |
1504 | - 0, 103, 0, 0, 105, 228, 0, 0, 107, 0, | |
1505 | - 0, 0, 0, 0, 0, 0, 0, 0, 110, 111, | |
1506 | - 103, 0, 0, 105, 0, 76, 112, 107, 83, 84, | |
1507 | - 85, 86, 41, 87, 0, 0, 0, 110, 111, 0, | |
1508 | - 0, 0, 88, 89, 76, 112, 313, 83, 84, 85, | |
1509 | - 86, 41, 87, 0, 0, 0, 228, 0, 0, 0, | |
1510 | - 0, 88, 89, 0, 0, 0, 0, 0, 0, 0, | |
1511 | - 0, 103, 0, 0, 105, 228, 0, 0, 107, 355, | |
1512 | - 0, 0, 0, 0, 0, 0, 0, 0, 110, 111, | |
1513 | - 103, 0, 0, 105, 0, 76, 112, 107, 83, 84, | |
1514 | - 85, 86, 41, 87, 0, 0, 0, 110, 111, 0, | |
1515 | - 0, 0, 88, 89, 76, 112, 0, 83, 84, 85, | |
1516 | - 86, 41, 87, 0, 0, 0, 228, 0, 0, 0, | |
1517 | - 0, 88, 89, 0, 0, 0, 0, 0, 0, 0, | |
1518 | - 0, 103, 0, 2, 105, 228, 0, 0, 107, 3, | |
1519 | - 0, 0, 0, 0, 0, 0, 0, 0, 110, 111, | |
1520 | - 103, 0, 0, 105, 0, 0, 112, 107, 0, 0, | |
1521 | - 4, 5, 6, 7, 8, 0, 0, 0, 0, 0, | |
1522 | - 0, 0, 0, -18, 9, 112, 10, 0, 0, 0, | |
1523 | - 11, 0, 0, 0, 12 | |
1524 | + 231, 72, 45, 80, 49, 79, 239, 237, 52, 375, | |
1525 | + 186, 234, 234, 234, 191, 78, -260, 241, -66, 233, | |
1526 | + 236, 76, 43, 297, 75, 243, 121, 250, 253, 70, | |
1527 | + 77, 4, 3, 256, 324, 41, -229, 5, 82, 41, | |
1528 | + 258, 259, 42, -256, 118, 41, 4, 83, 41, 47, | |
1529 | + 190, 78, 43, 119, 199, -260, 325, 185, 43, 46, | |
1530 | + 50, 44, 10, 200, -229, 192, 41, 269, 270, -261, | |
1531 | + 41, -256, 65, 284, 12, 81, 44, 10, 298, 299, | |
1532 | + -229, 209, 210, 416, 417, 121, 371, -256, -63, 284, | |
1533 | + 177, 47, 48, 65, 41, 179, 41, 53, 309, 225, | |
1534 | + 226, 43, 316, 118, 276, 277, 205, 317, 318, 206, | |
1535 | + 319, 328, 119, 323, 329, 326, -203, -203, 387, 330, | |
1536 | + 331, 388, 57, 214, 214, 44, 10, -192, -192, -192, | |
1537 | + -192, 304, 195, 335, 241, 186, 56, 343, 404, 191, | |
1538 | + 59, 405, 344, 345, 350, 235, 235, 235, 58, 177, | |
1539 | + 406, 60, 193, 407, 194, 61, 80, 80, 296, 234, | |
1540 | + 234, 262, 263, 264, 265, 80, 305, 234, 356, 358, | |
1541 | + 234, 361, 64, 363, 234, 190, 63, 288, 355, -203, | |
1542 | + -203, 178, -192, -192, 201, -208, -208, -208, 272, 273, | |
1543 | + 274, -33, 195, 195, 196, 4, 338, 391, 52, 213, | |
1544 | + 215, 5, 374, 202, 203, 78, 204, 320, 85, 86, | |
1545 | + 87, 88, 43, 89, 207, 323, 266, 267, 383, 211, | |
1546 | + 384, 41, 90, 91, 50, 44, 10, 43, 81, 81, | |
1547 | + 313, 314, 389, 216, 217, 41, 230, 81, 253, 218, | |
1548 | + 402, 219, 220, 321, 4, 241, 221, 222, 224, 228, | |
1549 | + 71, 105, 229, 245, 107, 409, 410, 242, 109, 80, | |
1550 | + 80, 368, 369, 257, 246, -186, 260, 254, 112, 113, | |
1551 | + 372, -189, 261, 50, 44, 10, 114, 278, 280, 418, | |
1552 | + 281, 419, 4, 185, 422, 11, 423, 12, 5, 282, | |
1553 | + 285, 286, 287, 235, 235, 290, 358, 179, 428, 289, | |
1554 | + 332, 235, 52, 43, 235, 241, 303, 336, 235, 6, | |
1555 | + 7, 8, 9, 10, 311, 433, 327, 241, 241, 338, | |
1556 | + 41, 435, -19, 11, 346, 12, 180, 44, 10, 13, | |
1557 | + 348, 81, 81, 14, 349, 84, 364, 78, 4, 41, | |
1558 | + 85, 86, 87, 88, 43, 89, 366, 351, 376, 370, | |
1559 | + 367, 373, 377, 378, 90, 91, 92, 379, 93, 380, | |
1560 | + 382, 94, 95, 96, 97, 385, 386, 397, 98, 10, | |
1561 | + 99, 100, 101, 102, 398, 408, 103, 411, 412, 413, | |
1562 | + 414, 415, 104, 105, 106, 13, 107, 108, 308, 421, | |
1563 | + 109, 4, 57, 110, 420, 424, 111, 5, 426, 429, | |
1564 | + 112, 113, 431, 436, 84, 432, 78, 4, 114, 85, | |
1565 | + 86, 87, 88, 43, 89, 434, 54, 55, 6, 51, | |
1566 | + 50, 44, 10, 90, 91, 92, 365, 93, 73, 292, | |
1567 | + 94, 95, 96, 97, 12, 238, 302, 98, 10, 99, | |
1568 | + 100, 101, 102, 295, 400, 103, 307, 392, 395, 352, | |
1569 | + 381, 104, 105, 106, 13, 107, 108, 427, 354, 109, | |
1570 | + 353, 57, 227, 0, 0, 111, 84, 0, 78, 112, | |
1571 | + 113, 85, 86, 87, 88, 43, 89, 114, 0, 0, | |
1572 | + 0, 0, 0, 0, 0, 90, 91, 92, 0, 93, | |
1573 | + 0, 0, 94, 95, 96, 97, 0, 0, 0, 230, | |
1574 | + 0, 99, 100, 101, 102, 0, 0, 103, 0, 0, | |
1575 | + 0, 0, 0, 104, 105, 106, 0, 107, 108, 0, | |
1576 | + 0, 109, 0, 57, 0, 0, 0, 111, 0, 0, | |
1577 | + 78, 112, 113, 85, 86, 87, 88, 43, 89, 114, | |
1578 | + 0, 0, 0, 0, 0, 0, 0, 90, 91, 92, | |
1579 | + 0, 93, 0, 0, 94, 95, 96, 97, 0, 0, | |
1580 | + 0, 230, 0, 99, 100, 101, 102, 0, 0, 103, | |
1581 | + 0, 0, 0, 0, 0, 104, 105, 106, 0, 107, | |
1582 | + 108, 0, 0, 109, 0, 57, 240, 0, 0, 111, | |
1583 | + 0, 0, 78, 112, 113, 85, 86, 87, 88, 43, | |
1584 | + 89, 114, 0, 0, 0, 0, 0, 0, 0, 90, | |
1585 | + 91, 92, 0, 93, 0, 0, 94, 95, 96, 97, | |
1586 | + 0, 0, 0, 230, 0, 99, 100, 101, 102, 0, | |
1587 | + 0, 103, 0, 0, 0, 0, 0, 104, 105, 106, | |
1588 | + 0, 107, 108, 0, 0, 109, 0, 57, 333, 0, | |
1589 | + 0, 111, 0, 0, 78, 112, 113, 85, 86, 87, | |
1590 | + 88, 43, 89, 114, 0, 0, 0, 0, 0, 0, | |
1591 | + 0, 90, 91, 92, 0, 93, 0, 0, 94, 95, | |
1592 | + 96, 97, 0, 0, 0, 230, 0, 99, 100, 101, | |
1593 | + 102, 0, 0, 103, 0, 0, 0, 0, 0, 104, | |
1594 | + 105, 106, 0, 107, 108, 0, 0, 109, 0, 57, | |
1595 | + 403, 0, 0, 111, 0, 0, 78, 112, 113, 85, | |
1596 | + 86, 87, 88, 43, 89, 114, 0, 0, 0, 0, | |
1597 | + 0, 0, 0, 90, 91, 92, 0, 93, 0, 0, | |
1598 | + 94, 95, 96, 97, 0, 0, 0, 230, 0, 99, | |
1599 | + 100, 101, 102, 0, 0, 103, 0, 0, 0, 0, | |
1600 | + 0, 104, 105, 106, 0, 107, 108, 0, 0, 109, | |
1601 | + 0, 57, 430, 0, 0, 111, 0, 0, 78, 112, | |
1602 | + 113, 85, 86, 87, 88, 43, 89, 114, 0, 0, | |
1603 | + 0, 0, 0, 0, 0, 90, 91, 92, 0, 93, | |
1604 | + 0, 0, 94, 95, 96, 97, 0, 0, 0, 230, | |
1605 | + 0, 99, 100, 101, 102, 0, 4, 103, 0, 0, | |
1606 | + 0, 0, 5, 104, 105, 106, 0, 107, 108, 0, | |
1607 | + 0, 109, 0, 57, 0, 0, 0, 111, 0, 0, | |
1608 | + 0, 112, 113, 6, 0, 50, 44, 10, 78, 114, | |
1609 | + 308, 85, 86, 87, 88, 43, 89, 4, 291, 12, | |
1610 | + 0, 0, 0, 5, 0, 90, 91, 78, 0, 315, | |
1611 | + 85, 86, 87, 88, 43, 89, 0, 0, 0, 230, | |
1612 | + 0, 0, 0, 0, 90, 91, 50, 44, 10, 0, | |
1613 | + 0, 0, 0, 0, 105, 0, 0, 107, 230, 0, | |
1614 | + 12, 109, 0, 0, 0, 0, 0, 0, 0, 0, | |
1615 | + 0, 112, 113, 105, 0, 0, 107, 0, 78, 114, | |
1616 | + 109, 85, 86, 87, 88, 43, 89, 0, 0, 0, | |
1617 | + 112, 113, 0, 0, 0, 90, 91, 78, 114, 0, | |
1618 | + 85, 86, 87, 88, 43, 89, 0, 0, 0, 230, | |
1619 | + 0, 0, 0, 0, 90, 91, 0, 0, 0, 0, | |
1620 | + 0, 0, 0, 0, 105, 0, 0, 107, 230, 0, | |
1621 | + 0, 109, 357, 0, 0, 0, 0, 0, 0, 0, | |
1622 | + 0, 112, 113, 105, 0, 0, 107, 0, 78, 114, | |
1623 | + 109, 85, 86, 87, 88, 43, 89, 0, 0, 0, | |
1624 | + 112, 113, 0, 0, 0, 90, 91, 0, 114, 0, | |
1625 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, | |
1626 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
1627 | + 0, 0, 0, 0, 105, 0, 0, 107, 0, 0, | |
1628 | + 0, 109, 0, 0, 0, 0, 0, 0, 0, 0, | |
1629 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 114 | |
1630 | }; | |
1631 | ||
1632 | static const short yycheck[] = | |
1633 | { | |
1634 | - 107, 120, 35, 40, 4, 40, 114, 112, 9, 128, | |
1635 | - 10, 110, 111, 309, 3, 61, 61, 55, 3, 35, | |
1636 | - 10, 10, 11, 63, 35, 10, 10, 134, 135, 59, | |
1637 | - 10, 31, 62, 140, 35, 110, 111, 112, 6, 45, | |
1638 | - 147, 148, 43, 40, 55, 14, 15, 16, 17, 56, | |
1639 | - 61, 1, 68, 10, 4, 55, 63, 63, 65, 59, | |
1640 | - 10, 29, 4, 13, 10, 62, 56, 68, 10, 14, | |
1641 | - 15, 16, 17, 63, 10, 65, 114, 66, 67, 63, | |
1642 | - 48, 31, 50, 57, 12, 35, 60, 383, 384, 56, | |
1643 | - 40, 33, 34, 35, 57, 13, 63, 60, 205, 58, | |
1644 | - 69, 70, 209, 114, 60, 55, 62, 214, 215, 59, | |
1645 | - 217, 61, 44, 220, 114, 222, 20, 21, 237, 226, | |
1646 | - 227, 66, 67, 4, 69, 70, 245, 246, 58, 10, | |
1647 | - 84, 85, 57, 240, 63, 60, 65, 244, 88, 89, | |
1648 | - 186, 186, 57, 18, 252, 60, 21, 56, 102, 103, | |
1649 | - 66, 67, 33, 34, 35, 10, 193, 194, 193, 56, | |
1650 | - 110, 111, 112, 56, 114, 202, 47, 200, 273, 276, | |
1651 | - 269, 278, 62, 280, 4, 186, 62, 63, 59, 4, | |
1652 | - 10, 182, 4, 258, 259, 10, 25, 26, 10, 66, | |
1653 | - 67, 266, 88, 89, 269, 71, 72, 73, 273, 58, | |
1654 | - 200, 31, 309, 33, 34, 35, 31, 63, 33, 34, | |
1655 | - 35, 33, 34, 35, 64, 322, 335, 47, 325, 65, | |
1656 | - 327, 46, 47, 45, 56, 47, 10, 4, 56, 348, | |
1657 | - 71, 72, 73, 10, 40, 4, 186, 56, 345, 4, | |
1658 | - 347, 10, 4, 193, 194, 10, 207, 208, 10, 56, | |
1659 | - 200, 56, 202, 56, 62, 362, 364, 34, 35, 296, | |
1660 | - 297, 296, 297, 62, 33, 34, 35, 43, 33, 34, | |
1661 | - 35, 304, 34, 35, 56, 56, 56, 60, 47, 386, | |
1662 | - 58, 388, 18, 58, 392, 285, 394, 18, 62, 408, | |
1663 | - 19, 19, 56, 60, 65, 63, 403, 57, 405, 57, | |
1664 | - 61, 420, 421, 60, 304, 424, 59, 62, 258, 259, | |
1665 | - 60, 60, 57, 23, 25, 422, 266, 60, 62, 269, | |
1666 | - 62, 62, 1, 273, 3, 4, 63, 6, 7, 8, | |
1667 | - 9, 10, 11, 58, 64, 285, 62, 57, 62, 57, | |
1668 | - 57, 20, 21, 22, 57, 24, 296, 297, 27, 28, | |
1669 | - 29, 30, 57, 62, 304, 34, 35, 36, 37, 38, | |
1670 | - 39, 60, 60, 42, 57, 27, 62, 64, 57, 48, | |
1671 | - 49, 50, 51, 52, 53, 57, 57, 56, 5, 58, | |
1672 | - 59, 57, 68, 62, 59, 56, 64, 66, 67, 57, | |
1673 | - 62, 1, 62, 3, 4, 74, 6, 7, 8, 9, | |
1674 | - 10, 11, 68, 57, 0, 0, 13, 13, 10, 35, | |
1675 | - 20, 21, 22, 285, 24, 202, 186, 27, 28, 29, | |
1676 | - 30, 345, 114, 195, 34, 35, 36, 37, 38, 39, | |
1677 | - 337, 339, 42, 322, 258, 191, 259, 266, 48, 49, | |
1678 | - 50, 51, 52, 53, 104, 403, 56, -1, 58, -1, | |
1679 | - -1, -1, 62, 1, -1, 3, 66, 67, 6, 7, | |
1680 | - 8, 9, 10, 11, 74, -1, -1, -1, -1, -1, | |
1681 | - -1, -1, 20, 21, 22, -1, 24, -1, -1, 27, | |
1682 | - 28, 29, 30, -1, -1, -1, 34, -1, 36, 37, | |
1683 | - 38, 39, -1, -1, 42, -1, -1, -1, -1, -1, | |
1684 | - 48, 49, 50, -1, 52, 53, -1, -1, 56, -1, | |
1685 | - 58, -1, -1, -1, 62, -1, -1, 3, 66, 67, | |
1686 | - 6, 7, 8, 9, 10, 11, 74, -1, -1, -1, | |
1687 | - -1, -1, -1, -1, 20, 21, 22, -1, 24, -1, | |
1688 | - -1, 27, 28, 29, 30, -1, -1, -1, 34, -1, | |
1689 | - 36, 37, 38, 39, -1, -1, 42, -1, -1, -1, | |
1690 | - -1, -1, 48, 49, 50, -1, 52, 53, -1, -1, | |
1691 | - 56, -1, 58, 59, -1, -1, 62, -1, -1, 3, | |
1692 | - 66, 67, 6, 7, 8, 9, 10, 11, 74, -1, | |
1693 | - -1, -1, -1, -1, -1, -1, 20, 21, 22, -1, | |
1694 | - 24, -1, -1, 27, 28, 29, 30, -1, -1, -1, | |
1695 | - 34, -1, 36, 37, 38, 39, -1, -1, 42, -1, | |
1696 | - -1, -1, -1, -1, 48, 49, 50, -1, 52, 53, | |
1697 | - -1, -1, 56, -1, 58, 59, -1, -1, 62, -1, | |
1698 | - -1, 3, 66, 67, 6, 7, 8, 9, 10, 11, | |
1699 | - 74, -1, -1, -1, -1, -1, -1, -1, 20, 21, | |
1700 | - 22, -1, 24, -1, -1, 27, 28, 29, 30, -1, | |
1701 | - -1, -1, 34, -1, 36, 37, 38, 39, -1, -1, | |
1702 | - 42, -1, -1, -1, -1, -1, 48, 49, 50, -1, | |
1703 | - 52, 53, -1, -1, 56, -1, 58, 59, -1, -1, | |
1704 | - 62, -1, -1, 3, 66, 67, 6, 7, 8, 9, | |
1705 | - 10, 11, 74, -1, -1, -1, -1, -1, -1, -1, | |
1706 | - 20, 21, 22, -1, 24, -1, -1, 27, 28, 29, | |
1707 | - 30, -1, -1, -1, 34, -1, 36, 37, 38, 39, | |
1708 | - -1, -1, 42, -1, -1, -1, -1, -1, 48, 49, | |
1709 | - 50, -1, 52, 53, -1, -1, 56, -1, 58, 59, | |
1710 | - -1, -1, 62, -1, -1, 3, 66, 67, 6, 7, | |
1711 | - 8, 9, 10, 11, 74, -1, -1, -1, -1, -1, | |
1712 | - -1, -1, 20, 21, 22, -1, 24, -1, -1, 27, | |
1713 | - 28, 29, 30, -1, -1, -1, 34, -1, 36, 37, | |
1714 | - 38, 39, -1, -1, 42, -1, -1, -1, -1, -1, | |
1715 | - 48, 49, 50, -1, 52, 53, -1, -1, 56, -1, | |
1716 | - 58, -1, -1, -1, 62, -1, -1, -1, 66, 67, | |
1717 | - -1, -1, -1, -1, -1, 3, 74, 5, 6, 7, | |
1718 | - 8, 9, 10, 11, -1, -1, -1, -1, -1, -1, | |
1719 | - -1, -1, 20, 21, 3, -1, 5, 6, 7, 8, | |
1720 | - 9, 10, 11, -1, -1, -1, 34, -1, -1, -1, | |
1721 | - -1, 20, 21, 41, -1, -1, -1, -1, -1, -1, | |
1722 | - -1, 49, -1, -1, 52, 34, -1, -1, 56, -1, | |
1723 | - -1, -1, -1, -1, -1, -1, -1, -1, 66, 67, | |
1724 | - 49, -1, -1, 52, -1, 3, 74, 56, 6, 7, | |
1725 | - 8, 9, 10, 11, -1, -1, -1, 66, 67, -1, | |
1726 | - -1, -1, 20, 21, 3, 74, 5, 6, 7, 8, | |
1727 | - 9, 10, 11, -1, -1, -1, 34, -1, -1, -1, | |
1728 | - -1, 20, 21, -1, -1, -1, -1, -1, -1, -1, | |
1729 | - -1, 49, -1, -1, 52, 34, -1, -1, 56, 57, | |
1730 | - -1, -1, -1, -1, -1, -1, -1, -1, 66, 67, | |
1731 | - 49, -1, -1, 52, -1, 3, 74, 56, 6, 7, | |
1732 | - 8, 9, 10, 11, -1, -1, -1, 66, 67, -1, | |
1733 | - -1, -1, 20, 21, 3, 74, -1, 6, 7, 8, | |
1734 | - 9, 10, 11, -1, -1, -1, 34, -1, -1, -1, | |
1735 | - -1, 20, 21, -1, -1, -1, -1, -1, -1, -1, | |
1736 | - -1, 49, -1, 4, 52, 34, -1, -1, 56, 10, | |
1737 | - -1, -1, -1, -1, -1, -1, -1, -1, 66, 67, | |
1738 | - 49, -1, -1, 52, -1, -1, 74, 56, -1, -1, | |
1739 | - 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, | |
1740 | - -1, -1, -1, 44, 45, 74, 47, -1, -1, -1, | |
1741 | - 51, -1, -1, -1, 55 | |
1742 | + 109, 37, 6, 42, 11, 42, 116, 114, 12, 311, | |
1743 | + 63, 112, 113, 114, 63, 3, 10, 122, 10, 112, | |
1744 | + 113, 37, 10, 11, 37, 130, 57, 136, 137, 33, | |
1745 | + 37, 4, 0, 142, 40, 2, 56, 10, 45, 6, | |
1746 | + 149, 150, 63, 63, 57, 12, 4, 47, 15, 8, | |
1747 | + 63, 3, 10, 57, 70, 10, 62, 61, 10, 10, | |
1748 | + 33, 34, 35, 70, 56, 65, 33, 66, 67, 63, | |
1749 | + 37, 63, 31, 65, 47, 42, 34, 35, 66, 67, | |
1750 | + 56, 86, 87, 385, 386, 116, 59, 63, 10, 65, | |
1751 | + 57, 50, 10, 52, 61, 4, 63, 12, 207, 104, | |
1752 | + 105, 10, 211, 116, 20, 21, 59, 216, 217, 62, | |
1753 | + 219, 57, 116, 222, 60, 224, 66, 67, 57, 228, | |
1754 | + 229, 60, 58, 90, 91, 34, 35, 14, 15, 16, | |
1755 | + 17, 62, 63, 242, 239, 188, 13, 246, 57, 188, | |
1756 | + 44, 60, 247, 248, 254, 112, 113, 114, 20, 116, | |
1757 | + 57, 23, 60, 60, 62, 56, 195, 196, 195, 260, | |
1758 | + 261, 14, 15, 16, 17, 204, 202, 268, 275, 278, | |
1759 | + 271, 280, 10, 282, 275, 188, 58, 184, 271, 66, | |
1760 | + 67, 56, 69, 70, 62, 71, 72, 73, 71, 72, | |
1761 | + 73, 56, 63, 63, 65, 4, 25, 26, 202, 90, | |
1762 | + 91, 10, 311, 58, 64, 3, 65, 5, 6, 7, | |
1763 | + 8, 9, 10, 11, 56, 324, 69, 70, 327, 56, | |
1764 | + 329, 188, 20, 21, 33, 34, 35, 10, 195, 196, | |
1765 | + 209, 210, 337, 56, 56, 202, 34, 204, 347, 56, | |
1766 | + 349, 56, 62, 41, 4, 350, 62, 40, 43, 56, | |
1767 | + 10, 49, 56, 58, 52, 364, 366, 60, 56, 298, | |
1768 | + 299, 298, 299, 62, 56, 18, 18, 58, 66, 67, | |
1769 | + 306, 19, 19, 33, 34, 35, 74, 56, 60, 388, | |
1770 | + 65, 390, 4, 287, 394, 45, 396, 47, 10, 63, | |
1771 | + 57, 57, 60, 260, 261, 59, 405, 4, 407, 61, | |
1772 | + 57, 268, 306, 10, 271, 410, 62, 23, 275, 31, | |
1773 | + 32, 33, 34, 35, 60, 424, 60, 422, 423, 25, | |
1774 | + 287, 426, 44, 45, 62, 47, 33, 34, 35, 51, | |
1775 | + 62, 298, 299, 55, 60, 1, 63, 3, 4, 306, | |
1776 | + 6, 7, 8, 9, 10, 11, 58, 62, 57, 62, | |
1777 | + 64, 62, 57, 57, 20, 21, 22, 57, 24, 57, | |
1778 | + 62, 27, 28, 29, 30, 60, 60, 57, 34, 35, | |
1779 | + 36, 37, 38, 39, 27, 64, 42, 62, 57, 57, | |
1780 | + 57, 57, 48, 49, 50, 51, 52, 53, 5, 59, | |
1781 | + 56, 4, 58, 59, 68, 56, 62, 10, 57, 64, | |
1782 | + 66, 67, 62, 57, 1, 68, 3, 4, 74, 6, | |
1783 | + 7, 8, 9, 10, 11, 62, 15, 15, 31, 12, | |
1784 | + 33, 34, 35, 20, 21, 22, 287, 24, 37, 188, | |
1785 | + 27, 28, 29, 30, 47, 116, 197, 34, 35, 36, | |
1786 | + 37, 38, 39, 193, 347, 42, 204, 339, 341, 260, | |
1787 | + 324, 48, 49, 50, 51, 52, 53, 405, 268, 56, | |
1788 | + 261, 58, 106, -1, -1, 62, 1, -1, 3, 66, | |
1789 | + 67, 6, 7, 8, 9, 10, 11, 74, -1, -1, | |
1790 | + -1, -1, -1, -1, -1, 20, 21, 22, -1, 24, | |
1791 | + -1, -1, 27, 28, 29, 30, -1, -1, -1, 34, | |
1792 | + -1, 36, 37, 38, 39, -1, -1, 42, -1, -1, | |
1793 | + -1, -1, -1, 48, 49, 50, -1, 52, 53, -1, | |
1794 | + -1, 56, -1, 58, -1, -1, -1, 62, -1, -1, | |
1795 | + 3, 66, 67, 6, 7, 8, 9, 10, 11, 74, | |
1796 | + -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, | |
1797 | + -1, 24, -1, -1, 27, 28, 29, 30, -1, -1, | |
1798 | + -1, 34, -1, 36, 37, 38, 39, -1, -1, 42, | |
1799 | + -1, -1, -1, -1, -1, 48, 49, 50, -1, 52, | |
1800 | + 53, -1, -1, 56, -1, 58, 59, -1, -1, 62, | |
1801 | + -1, -1, 3, 66, 67, 6, 7, 8, 9, 10, | |
1802 | + 11, 74, -1, -1, -1, -1, -1, -1, -1, 20, | |
1803 | + 21, 22, -1, 24, -1, -1, 27, 28, 29, 30, | |
1804 | + -1, -1, -1, 34, -1, 36, 37, 38, 39, -1, | |
1805 | + -1, 42, -1, -1, -1, -1, -1, 48, 49, 50, | |
1806 | + -1, 52, 53, -1, -1, 56, -1, 58, 59, -1, | |
1807 | + -1, 62, -1, -1, 3, 66, 67, 6, 7, 8, | |
1808 | + 9, 10, 11, 74, -1, -1, -1, -1, -1, -1, | |
1809 | + -1, 20, 21, 22, -1, 24, -1, -1, 27, 28, | |
1810 | + 29, 30, -1, -1, -1, 34, -1, 36, 37, 38, | |
1811 | + 39, -1, -1, 42, -1, -1, -1, -1, -1, 48, | |
1812 | + 49, 50, -1, 52, 53, -1, -1, 56, -1, 58, | |
1813 | + 59, -1, -1, 62, -1, -1, 3, 66, 67, 6, | |
1814 | + 7, 8, 9, 10, 11, 74, -1, -1, -1, -1, | |
1815 | + -1, -1, -1, 20, 21, 22, -1, 24, -1, -1, | |
1816 | + 27, 28, 29, 30, -1, -1, -1, 34, -1, 36, | |
1817 | + 37, 38, 39, -1, -1, 42, -1, -1, -1, -1, | |
1818 | + -1, 48, 49, 50, -1, 52, 53, -1, -1, 56, | |
1819 | + -1, 58, 59, -1, -1, 62, -1, -1, 3, 66, | |
1820 | + 67, 6, 7, 8, 9, 10, 11, 74, -1, -1, | |
1821 | + -1, -1, -1, -1, -1, 20, 21, 22, -1, 24, | |
1822 | + -1, -1, 27, 28, 29, 30, -1, -1, -1, 34, | |
1823 | + -1, 36, 37, 38, 39, -1, 4, 42, -1, -1, | |
1824 | + -1, -1, 10, 48, 49, 50, -1, 52, 53, -1, | |
1825 | + -1, 56, -1, 58, -1, -1, -1, 62, -1, -1, | |
1826 | + -1, 66, 67, 31, -1, 33, 34, 35, 3, 74, | |
1827 | + 5, 6, 7, 8, 9, 10, 11, 4, 46, 47, | |
1828 | + -1, -1, -1, 10, -1, 20, 21, 3, -1, 5, | |
1829 | + 6, 7, 8, 9, 10, 11, -1, -1, -1, 34, | |
1830 | + -1, -1, -1, -1, 20, 21, 33, 34, 35, -1, | |
1831 | + -1, -1, -1, -1, 49, -1, -1, 52, 34, -1, | |
1832 | + 47, 56, -1, -1, -1, -1, -1, -1, -1, -1, | |
1833 | + -1, 66, 67, 49, -1, -1, 52, -1, 3, 74, | |
1834 | + 56, 6, 7, 8, 9, 10, 11, -1, -1, -1, | |
1835 | + 66, 67, -1, -1, -1, 20, 21, 3, 74, -1, | |
1836 | + 6, 7, 8, 9, 10, 11, -1, -1, -1, 34, | |
1837 | + -1, -1, -1, -1, 20, 21, -1, -1, -1, -1, | |
1838 | + -1, -1, -1, -1, 49, -1, -1, 52, 34, -1, | |
1839 | + -1, 56, 57, -1, -1, -1, -1, -1, -1, -1, | |
1840 | + -1, 66, 67, 49, -1, -1, 52, -1, 3, 74, | |
1841 | + 56, 6, 7, 8, 9, 10, 11, -1, -1, -1, | |
1842 | + 66, 67, -1, -1, -1, 20, 21, -1, 74, -1, | |
1843 | + -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, | |
1844 | + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
1845 | + -1, -1, -1, -1, 49, -1, -1, 52, -1, -1, | |
1846 | + -1, 56, -1, -1, -1, -1, -1, -1, -1, -1, | |
1847 | + -1, -1, -1, -1, -1, -1, -1, -1, -1, 74 | |
1848 | }; | |
1849 | -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ | |
1850 | -#line 3 "/usr/share/bison/bison.simple" | |
1851 | - | |
1852 | -/* Skeleton output parser for bison, | |
1853 | - | |
1854 | - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software | |
1855 | - Foundation, Inc. | |
1856 | - | |
1857 | - This program is free software; you can redistribute it and/or modify | |
1858 | - it under the terms of the GNU General Public License as published by | |
1859 | - the Free Software Foundation; either version 2, or (at your option) | |
1860 | - any later version. | |
1861 | - | |
1862 | - This program is distributed in the hope that it will be useful, | |
1863 | - but WITHOUT ANY WARRANTY; without even the implied warranty of | |
1864 | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
1865 | - GNU General Public License for more details. | |
1866 | - | |
1867 | - You should have received a copy of the GNU General Public License | |
1868 | - along with this program; if not, write to the Free Software | |
1869 | - Foundation, Inc., 59 Temple Place - Suite 330, | |
1870 | - Boston, MA 02111-1307, USA. */ | |
1871 | - | |
1872 | -/* As a special exception, when this file is copied by Bison into a | |
1873 | - Bison output file, you may use that output file without restriction. | |
1874 | - This special exception was added by the Free Software Foundation | |
1875 | - in version 1.24 of Bison. */ | |
1876 | - | |
1877 | -/* This is the parser code that is written into each bison parser when | |
1878 | - the %semantic_parser declaration is not specified in the grammar. | |
1879 | - It was written by Richard Stallman by simplifying the hairy parser | |
1880 | - used when %semantic_parser is specified. */ | |
1881 | - | |
1882 | -/* All symbols defined below should begin with yy or YY, to avoid | |
1883 | - infringing on user name space. This should be done even for local | |
1884 | - variables, as they might otherwise be expanded by user macros. | |
1885 | - There are some unavoidable exceptions within include files to | |
1886 | - define necessary library symbols; they are noted "INFRINGES ON | |
1887 | - USER NAME SPACE" below. */ | |
1888 | - | |
1889 | -#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) | |
1890 | - | |
1891 | -/* The parser invokes alloca or malloc; define the necessary symbols. */ | |
1892 | - | |
1893 | -# if YYSTACK_USE_ALLOCA | |
1894 | -# define YYSTACK_ALLOC alloca | |
1895 | -# else | |
1896 | -# ifndef YYSTACK_USE_ALLOCA | |
1897 | -# if defined (alloca) || defined (_ALLOCA_H) | |
1898 | -# define YYSTACK_ALLOC alloca | |
1899 | -# else | |
1900 | -# ifdef __GNUC__ | |
1901 | -# define YYSTACK_ALLOC __builtin_alloca | |
1902 | -# endif | |
1903 | -# endif | |
1904 | -# endif | |
1905 | -# endif | |
1906 | ||
1907 | -# ifdef YYSTACK_ALLOC | |
1908 | - /* Pacify GCC's `empty if-body' warning. */ | |
1909 | -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) | |
1910 | -# else | |
1911 | -# if defined (__STDC__) || defined (__cplusplus) | |
1912 | -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | |
1913 | -# define YYSIZE_T size_t | |
1914 | -# endif | |
1915 | -# define YYSTACK_ALLOC malloc | |
1916 | -# define YYSTACK_FREE free | |
1917 | -# endif | |
1918 | -#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ | |
1919 | - | |
1920 | - | |
1921 | -#if (! defined (yyoverflow) \ | |
1922 | - && (! defined (__cplusplus) \ | |
1923 | - || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) | |
1924 | - | |
1925 | -/* A type that is properly aligned for any stack member. */ | |
1926 | -union yyalloc | |
1927 | -{ | |
1928 | - short yyss; | |
1929 | - YYSTYPE yyvs; | |
1930 | -# if YYLSP_NEEDED | |
1931 | - YYLTYPE yyls; | |
1932 | -# endif | |
1933 | +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing | |
1934 | + symbol of state STATE-NUM. */ | |
1935 | +static const unsigned char yystos[] = | |
1936 | +{ | |
1937 | + 0, 76, 77, 0, 4, 10, 31, 32, 33, 34, | |
1938 | + 35, 45, 47, 51, 55, 78, 79, 80, 81, 82, | |
1939 | + 83, 84, 86, 87, 88, 89, 90, 91, 97, 98, | |
1940 | + 108, 109, 115, 116, 117, 121, 122, 123, 124, 125, | |
1941 | + 126, 217, 63, 10, 34, 109, 10, 91, 10, 218, | |
1942 | + 33, 88, 109, 12, 79, 82, 13, 58, 85, 44, | |
1943 | + 85, 56, 92, 58, 10, 91, 110, 111, 112, 218, | |
1944 | + 109, 10, 87, 98, 104, 108, 112, 218, 3, 119, | |
1945 | + 120, 217, 218, 92, 1, 6, 7, 8, 9, 11, | |
1946 | + 20, 21, 22, 24, 27, 28, 29, 30, 34, 36, | |
1947 | + 37, 38, 39, 42, 48, 49, 50, 52, 53, 56, | |
1948 | + 59, 62, 66, 67, 74, 85, 106, 107, 108, 109, | |
1949 | + 120, 121, 127, 130, 131, 132, 134, 135, 136, 138, | |
1950 | + 139, 142, 151, 152, 153, 155, 159, 160, 164, 165, | |
1951 | + 166, 167, 168, 169, 172, 173, 175, 176, 177, 178, | |
1952 | + 179, 180, 181, 182, 183, 184, 185, 187, 188, 190, | |
1953 | + 191, 193, 194, 195, 196, 197, 201, 202, 205, 206, | |
1954 | + 207, 209, 210, 212, 213, 214, 216, 217, 56, 4, | |
1955 | + 33, 93, 94, 95, 96, 109, 86, 99, 100, 101, | |
1956 | + 108, 117, 92, 60, 62, 63, 65, 113, 114, 112, | |
1957 | + 218, 62, 58, 64, 65, 59, 62, 56, 133, 133, | |
1958 | + 133, 56, 208, 195, 217, 195, 56, 56, 56, 56, | |
1959 | + 62, 62, 40, 170, 43, 133, 133, 208, 56, 56, | |
1960 | + 34, 176, 217, 190, 213, 217, 190, 193, 107, 127, | |
1961 | + 59, 130, 60, 130, 140, 58, 56, 154, 156, 161, | |
1962 | + 176, 128, 129, 176, 58, 174, 176, 62, 176, 176, | |
1963 | + 18, 19, 14, 15, 16, 17, 69, 70, 186, 66, | |
1964 | + 67, 189, 71, 72, 73, 192, 20, 21, 56, 198, | |
1965 | + 60, 65, 63, 215, 65, 57, 57, 60, 218, 61, | |
1966 | + 59, 46, 101, 102, 103, 111, 119, 11, 66, 67, | |
1967 | + 118, 119, 114, 62, 62, 87, 105, 118, 5, 176, | |
1968 | + 204, 60, 203, 203, 203, 5, 176, 176, 176, 176, | |
1969 | + 5, 41, 171, 176, 40, 62, 176, 60, 57, 60, | |
1970 | + 176, 176, 57, 59, 137, 176, 23, 141, 25, 143, | |
1971 | + 144, 145, 146, 176, 130, 130, 62, 162, 62, 60, | |
1972 | + 127, 62, 182, 184, 187, 190, 193, 57, 176, 199, | |
1973 | + 200, 176, 211, 176, 63, 95, 58, 64, 119, 119, | |
1974 | + 62, 59, 87, 62, 176, 204, 57, 57, 57, 57, | |
1975 | + 57, 171, 62, 176, 176, 60, 60, 57, 60, 130, | |
1976 | + 147, 26, 144, 149, 150, 146, 148, 57, 27, 157, | |
1977 | + 129, 163, 176, 59, 57, 60, 57, 60, 64, 176, | |
1978 | + 127, 62, 57, 57, 57, 57, 204, 204, 176, 176, | |
1979 | + 68, 59, 127, 127, 56, 158, 57, 200, 176, 64, | |
1980 | + 59, 62, 68, 176, 62, 130, 57 | |
1981 | }; | |
1982 | ||
1983 | -/* The size of the maximum gap between one aligned stack and the next. */ | |
1984 | -# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) | |
1985 | - | |
1986 | -/* The size of an array large to enough to hold all stacks, each with | |
1987 | - N elements. */ | |
1988 | -# if YYLSP_NEEDED | |
1989 | -# define YYSTACK_BYTES(N) \ | |
1990 | - ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ | |
1991 | - + 2 * YYSTACK_GAP_MAX) | |
1992 | -# else | |
1993 | -# define YYSTACK_BYTES(N) \ | |
1994 | - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ | |
1995 | - + YYSTACK_GAP_MAX) | |
1996 | -# endif | |
1997 | - | |
1998 | -/* Copy COUNT objects from FROM to TO. The source and destination do | |
1999 | - not overlap. */ | |
2000 | -# ifndef YYCOPY | |
2001 | -# if 1 < __GNUC__ | |
2002 | -# define YYCOPY(To, From, Count) \ | |
2003 | - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) | |
2004 | -# else | |
2005 | -# define YYCOPY(To, From, Count) \ | |
2006 | - do \ | |
2007 | - { \ | |
2008 | - register YYSIZE_T yyi; \ | |
2009 | - for (yyi = 0; yyi < (Count); yyi++) \ | |
2010 | - (To)[yyi] = (From)[yyi]; \ | |
2011 | - } \ | |
2012 | - while (0) | |
2013 | -# endif | |
2014 | -# endif | |
2015 | - | |
2016 | -/* Relocate STACK from its old location to the new one. The | |
2017 | - local variables YYSIZE and YYSTACKSIZE give the old and new number of | |
2018 | - elements in the stack, and YYPTR gives the new location of the | |
2019 | - stack. Advance YYPTR to a properly aligned location for the next | |
2020 | - stack. */ | |
2021 | -# define YYSTACK_RELOCATE(Stack) \ | |
2022 | - do \ | |
2023 | - { \ | |
2024 | - YYSIZE_T yynewbytes; \ | |
2025 | - YYCOPY (&yyptr->Stack, Stack, yysize); \ | |
2026 | - Stack = &yyptr->Stack; \ | |
2027 | - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ | |
2028 | - yyptr += yynewbytes / sizeof (*yyptr); \ | |
2029 | - } \ | |
2030 | - while (0) | |
2031 | - | |
2032 | -#endif | |
2033 | - | |
2034 | - | |
2035 | #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) | |
2036 | # define YYSIZE_T __SIZE_TYPE__ | |
2037 | #endif | |
2038 | @@ -1129,29 +1296,34 @@ | |
2039 | ||
2040 | #define yyerrok (yyerrstatus = 0) | |
2041 | #define yyclearin (yychar = YYEMPTY) | |
2042 | -#define YYEMPTY -2 | |
2043 | +#define YYEMPTY (-2) | |
2044 | #define YYEOF 0 | |
2045 | + | |
2046 | #define YYACCEPT goto yyacceptlab | |
2047 | -#define YYABORT goto yyabortlab | |
2048 | +#define YYABORT goto yyabortlab | |
2049 | #define YYERROR goto yyerrlab1 | |
2050 | + | |
2051 | /* Like YYERROR except do call yyerror. This remains here temporarily | |
2052 | to ease the transition to the new meaning of YYERROR, for GCC. | |
2053 | Once GCC version 2 has supplanted version 1, this can go. */ | |
2054 | + | |
2055 | #define YYFAIL goto yyerrlab | |
2056 | + | |
2057 | #define YYRECOVERING() (!!yyerrstatus) | |
2058 | + | |
2059 | #define YYBACKUP(Token, Value) \ | |
2060 | do \ | |
2061 | if (yychar == YYEMPTY && yylen == 1) \ | |
2062 | { \ | |
2063 | yychar = (Token); \ | |
2064 | yylval = (Value); \ | |
2065 | - yychar1 = YYTRANSLATE (yychar); \ | |
2066 | + yytoken = YYTRANSLATE (yychar); \ | |
2067 | YYPOPSTACK; \ | |
2068 | goto yybackup; \ | |
2069 | } \ | |
2070 | else \ | |
2071 | { \ | |
2072 | - yyerror ("syntax error: cannot back up"); \ | |
2073 | + yyerror ("syntax error: cannot back up");\ | |
2074 | YYERROR; \ | |
2075 | } \ | |
2076 | while (0) | |
2077 | @@ -1159,41 +1331,24 @@ | |
2078 | #define YYTERROR 1 | |
2079 | #define YYERRCODE 256 | |
2080 | ||
2081 | - | |
2082 | /* YYLLOC_DEFAULT -- Compute the default location (before the actions | |
2083 | - are run). | |
2084 | - | |
2085 | - When YYLLOC_DEFAULT is run, CURRENT is set the location of the | |
2086 | - first token. By default, to implement support for ranges, extend | |
2087 | - its range to the last symbol. */ | |
2088 | + are run). */ | |
2089 | ||
2090 | #ifndef YYLLOC_DEFAULT | |
2091 | -# define YYLLOC_DEFAULT(Current, Rhs, N) \ | |
2092 | - Current.last_line = Rhs[N].last_line; \ | |
2093 | - Current.last_column = Rhs[N].last_column; | |
2094 | +# define YYLLOC_DEFAULT(Current, Rhs, N) \ | |
2095 | + Current.first_line = Rhs[1].first_line; \ | |
2096 | + Current.first_column = Rhs[1].first_column; \ | |
2097 | + Current.last_line = Rhs[N].last_line; \ | |
2098 | + Current.last_column = Rhs[N].last_column; | |
2099 | #endif | |
2100 | ||
2101 | - | |
2102 | /* YYLEX -- calling `yylex' with the right arguments. */ | |
2103 | ||
2104 | -#if YYPURE | |
2105 | -# if YYLSP_NEEDED | |
2106 | -# ifdef YYLEX_PARAM | |
2107 | -# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) | |
2108 | -# else | |
2109 | -# define YYLEX yylex (&yylval, &yylloc) | |
2110 | -# endif | |
2111 | -# else /* !YYLSP_NEEDED */ | |
2112 | -# ifdef YYLEX_PARAM | |
2113 | -# define YYLEX yylex (&yylval, YYLEX_PARAM) | |
2114 | -# else | |
2115 | -# define YYLEX yylex (&yylval) | |
2116 | -# endif | |
2117 | -# endif /* !YYLSP_NEEDED */ | |
2118 | -#else /* !YYPURE */ | |
2119 | -# define YYLEX yylex () | |
2120 | -#endif /* !YYPURE */ | |
2121 | - | |
2122 | +#ifdef YYLEX_PARAM | |
2123 | +# define YYLEX yylex (YYLEX_PARAM) | |
2124 | +#else | |
2125 | +# define YYLEX yylex () | |
2126 | +#endif | |
2127 | ||
2128 | /* Enable debugging if requested. */ | |
2129 | #if YYDEBUG | |
2130 | @@ -1208,13 +1363,93 @@ | |
2131 | if (yydebug) \ | |
2132 | YYFPRINTF Args; \ | |
2133 | } while (0) | |
2134 | + | |
2135 | +# define YYDSYMPRINT(Args) \ | |
2136 | +do { \ | |
2137 | + if (yydebug) \ | |
2138 | + yysymprint Args; \ | |
2139 | +} while (0) | |
2140 | + | |
2141 | +# define YYDSYMPRINTF(Title, Token, Value, Location) \ | |
2142 | +do { \ | |
2143 | + if (yydebug) \ | |
2144 | + { \ | |
2145 | + YYFPRINTF (stderr, "%s ", Title); \ | |
2146 | + yysymprint (stderr, \ | |
2147 | + Token, Value); \ | |
2148 | + YYFPRINTF (stderr, "\n"); \ | |
2149 | + } \ | |
2150 | +} while (0) | |
2151 | + | |
2152 | +/*------------------------------------------------------------------. | |
2153 | +| yy_stack_print -- Print the state stack from its BOTTOM up to its | | |
2154 | +| TOP (cinluded). | | |
2155 | +`------------------------------------------------------------------*/ | |
2156 | + | |
2157 | +#if defined (__STDC__) || defined (__cplusplus) | |
2158 | +static void | |
2159 | +yy_stack_print (short *bottom, short *top) | |
2160 | +#else | |
2161 | +static void | |
2162 | +yy_stack_print (bottom, top) | |
2163 | + short *bottom; | |
2164 | + short *top; | |
2165 | +#endif | |
2166 | +{ | |
2167 | + YYFPRINTF (stderr, "Stack now"); | |
2168 | + for (/* Nothing. */; bottom <= top; ++bottom) | |
2169 | + YYFPRINTF (stderr, " %d", *bottom); | |
2170 | + YYFPRINTF (stderr, "\n"); | |
2171 | +} | |
2172 | + | |
2173 | +# define YY_STACK_PRINT(Bottom, Top) \ | |
2174 | +do { \ | |
2175 | + if (yydebug) \ | |
2176 | + yy_stack_print ((Bottom), (Top)); \ | |
2177 | +} while (0) | |
2178 | + | |
2179 | + | |
2180 | +/*------------------------------------------------. | |
2181 | +| Report that the YYRULE is going to be reduced. | | |
2182 | +`------------------------------------------------*/ | |
2183 | + | |
2184 | +#if defined (__STDC__) || defined (__cplusplus) | |
2185 | +static void | |
2186 | +yy_reduce_print (int yyrule) | |
2187 | +#else | |
2188 | +static void | |
2189 | +yy_reduce_print (yyrule) | |
2190 | + int yyrule; | |
2191 | +#endif | |
2192 | +{ | |
2193 | + int yyi; | |
2194 | + unsigned int yylineno = yyrline[yyrule]; | |
2195 | + YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", | |
2196 | + yyrule - 1, yylineno); | |
2197 | + /* Print the symbols being reduced, and their result. */ | |
2198 | + for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) | |
2199 | + YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); | |
2200 | + YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); | |
2201 | +} | |
2202 | + | |
2203 | +# define YY_REDUCE_PRINT(Rule) \ | |
2204 | +do { \ | |
2205 | + if (yydebug) \ | |
2206 | + yy_reduce_print (Rule); \ | |
2207 | +} while (0) | |
2208 | + | |
2209 | /* Nonzero means print parse trace. It is left uninitialized so that | |
2210 | multiple parsers can coexist. */ | |
2211 | int yydebug; | |
2212 | #else /* !YYDEBUG */ | |
2213 | # define YYDPRINTF(Args) | |
2214 | +# define YYDSYMPRINT(Args) | |
2215 | +# define YYDSYMPRINTF(Title, Token, Value, Location) | |
2216 | +# define YY_STACK_PRINT(Bottom, Top) | |
2217 | +# define YY_REDUCE_PRINT(Rule) | |
2218 | #endif /* !YYDEBUG */ | |
2219 | ||
2220 | + | |
2221 | /* YYINITDEPTH -- initial size of the parser's stacks. */ | |
2222 | #ifndef YYINITDEPTH | |
2223 | # define YYINITDEPTH 200 | |
2224 | @@ -1234,8 +1469,10 @@ | |
2225 | #ifndef YYMAXDEPTH | |
2226 | # define YYMAXDEPTH 10000 | |
2227 | #endif | |
2228 | + | |
2229 | \f | |
2230 | -#ifdef YYERROR_VERBOSE | |
2231 | + | |
2232 | +#if YYERROR_VERBOSE | |
2233 | ||
2234 | # ifndef yystrlen | |
2235 | # if defined (__GLIBC__) && defined (_STRING_H) | |
2236 | @@ -1285,86 +1522,134 @@ | |
2237 | } | |
2238 | # endif | |
2239 | # endif | |
2240 | -#endif | |
2241 | + | |
2242 | +#endif /* !YYERROR_VERBOSE */ | |
2243 | + | |
2244 | \f | |
2245 | -#line 315 "/usr/share/bison/bison.simple" | |
2246 | ||
2247 | +#if YYDEBUG | |
2248 | +/*--------------------------------. | |
2249 | +| Print this symbol on YYOUTPUT. | | |
2250 | +`--------------------------------*/ | |
2251 | + | |
2252 | +#if defined (__STDC__) || defined (__cplusplus) | |
2253 | +static void | |
2254 | +yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) | |
2255 | +#else | |
2256 | +static void | |
2257 | +yysymprint (yyoutput, yytype, yyvaluep) | |
2258 | + FILE *yyoutput; | |
2259 | + int yytype; | |
2260 | + YYSTYPE *yyvaluep; | |
2261 | +#endif | |
2262 | +{ | |
2263 | + /* Pacify ``unused variable'' warnings. */ | |
2264 | + (void) yyvaluep; | |
2265 | ||
2266 | -/* The user can define YYPARSE_PARAM as the name of an argument to be passed | |
2267 | - into yyparse. The argument should have type void *. | |
2268 | - It should actually point to an object. | |
2269 | - Grammar actions can access the variable by casting it | |
2270 | - to the proper pointer type. */ | |
2271 | + if (yytype < YYNTOKENS) | |
2272 | + { | |
2273 | + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); | |
2274 | +# ifdef YYPRINT | |
2275 | + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); | |
2276 | +# endif | |
2277 | + } | |
2278 | + else | |
2279 | + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); | |
2280 | + | |
2281 | + switch (yytype) | |
2282 | + { | |
2283 | + default: | |
2284 | + break; | |
2285 | + } | |
2286 | + YYFPRINTF (yyoutput, ")"); | |
2287 | +} | |
2288 | + | |
2289 | +#endif /* ! YYDEBUG */ | |
2290 | +/*-----------------------------------------------. | |
2291 | +| Release the memory associated to this symbol. | | |
2292 | +`-----------------------------------------------*/ | |
2293 | + | |
2294 | +#if defined (__STDC__) || defined (__cplusplus) | |
2295 | +static void | |
2296 | +yydestruct (int yytype, YYSTYPE *yyvaluep) | |
2297 | +#else | |
2298 | +static void | |
2299 | +yydestruct (yytype, yyvaluep) | |
2300 | + int yytype; | |
2301 | + YYSTYPE *yyvaluep; | |
2302 | +#endif | |
2303 | +{ | |
2304 | + /* Pacify ``unused variable'' warnings. */ | |
2305 | + (void) yyvaluep; | |
2306 | + | |
2307 | + switch (yytype) | |
2308 | + { | |
2309 | + | |
2310 | + default: | |
2311 | + break; | |
2312 | + } | |
2313 | +} | |
2314 | +\f | |
2315 | + | |
2316 | +/* Prevent warnings from -Wmissing-prototypes. */ | |
2317 | ||
2318 | #ifdef YYPARSE_PARAM | |
2319 | # if defined (__STDC__) || defined (__cplusplus) | |
2320 | -# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM | |
2321 | -# define YYPARSE_PARAM_DECL | |
2322 | +int yyparse (void *YYPARSE_PARAM); | |
2323 | # else | |
2324 | -# define YYPARSE_PARAM_ARG YYPARSE_PARAM | |
2325 | -# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; | |
2326 | -# endif | |
2327 | -#else /* !YYPARSE_PARAM */ | |
2328 | -# define YYPARSE_PARAM_ARG | |
2329 | -# define YYPARSE_PARAM_DECL | |
2330 | -#endif /* !YYPARSE_PARAM */ | |
2331 | - | |
2332 | -/* Prevent warning if -Wstrict-prototypes. */ | |
2333 | -#ifdef __GNUC__ | |
2334 | -# ifdef YYPARSE_PARAM | |
2335 | -int yyparse (void *); | |
2336 | -# else | |
2337 | -int yyparse (void); | |
2338 | +int yyparse (); | |
2339 | # endif | |
2340 | +#else /* ! YYPARSE_PARAM */ | |
2341 | +#if defined (__STDC__) || defined (__cplusplus) | |
2342 | +int yyparse (void); | |
2343 | +#else | |
2344 | +int yyparse (); | |
2345 | #endif | |
2346 | +#endif /* ! YYPARSE_PARAM */ | |
2347 | ||
2348 | -/* YY_DECL_VARIABLES -- depending whether we use a pure parser, | |
2349 | - variables are global, or local to YYPARSE. */ | |
2350 | ||
2351 | -#define YY_DECL_NON_LSP_VARIABLES \ | |
2352 | -/* The lookahead symbol. */ \ | |
2353 | -int yychar; \ | |
2354 | - \ | |
2355 | -/* The semantic value of the lookahead symbol. */ \ | |
2356 | -YYSTYPE yylval; \ | |
2357 | - \ | |
2358 | -/* Number of parse errors so far. */ \ | |
2359 | -int yynerrs; | |
2360 | ||
2361 | -#if YYLSP_NEEDED | |
2362 | -# define YY_DECL_VARIABLES \ | |
2363 | -YY_DECL_NON_LSP_VARIABLES \ | |
2364 | - \ | |
2365 | -/* Location data for the lookahead symbol. */ \ | |
2366 | -YYLTYPE yylloc; | |
2367 | -#else | |
2368 | -# define YY_DECL_VARIABLES \ | |
2369 | -YY_DECL_NON_LSP_VARIABLES | |
2370 | -#endif | |
2371 | +/* The lookahead symbol. */ | |
2372 | +int yychar; | |
2373 | + | |
2374 | +/* The semantic value of the lookahead symbol. */ | |
2375 | +YYSTYPE yylval; | |
2376 | + | |
2377 | +/* Number of syntax errors so far. */ | |
2378 | +int yynerrs; | |
2379 | ||
2380 | ||
2381 | -/* If nonreentrant, generate the variables here. */ | |
2382 | ||
2383 | -#if !YYPURE | |
2384 | -YY_DECL_VARIABLES | |
2385 | -#endif /* !YYPURE */ | |
2386 | +/*----------. | |
2387 | +| yyparse. | | |
2388 | +`----------*/ | |
2389 | ||
2390 | +#ifdef YYPARSE_PARAM | |
2391 | +# if defined (__STDC__) || defined (__cplusplus) | |
2392 | +int yyparse (void *YYPARSE_PARAM) | |
2393 | +# else | |
2394 | +int yyparse (YYPARSE_PARAM) | |
2395 | + void *YYPARSE_PARAM; | |
2396 | +# endif | |
2397 | +#else /* ! YYPARSE_PARAM */ | |
2398 | +#if defined (__STDC__) || defined (__cplusplus) | |
2399 | int | |
2400 | -yyparse (YYPARSE_PARAM_ARG) | |
2401 | - YYPARSE_PARAM_DECL | |
2402 | -{ | |
2403 | - /* If reentrant, generate the variables here. */ | |
2404 | -#if YYPURE | |
2405 | - YY_DECL_VARIABLES | |
2406 | -#endif /* !YYPURE */ | |
2407 | +yyparse (void) | |
2408 | +#else | |
2409 | +int | |
2410 | +yyparse () | |
2411 | ||
2412 | +#endif | |
2413 | +#endif | |
2414 | +{ | |
2415 | + | |
2416 | register int yystate; | |
2417 | register int yyn; | |
2418 | int yyresult; | |
2419 | /* Number of tokens to shift before error messages enabled. */ | |
2420 | int yyerrstatus; | |
2421 | /* Lookahead token as an internal (translated) token number. */ | |
2422 | - int yychar1 = 0; | |
2423 | + int yytoken = 0; | |
2424 | ||
2425 | /* Three stacks and their tools: | |
2426 | `yyss': related to states, | |
2427 | @@ -1374,7 +1659,7 @@ | |
2428 | Refer to the stacks thru separate pointers, to allow yyoverflow | |
2429 | to reallocate them elsewhere. */ | |
2430 | ||
2431 | - /* The state stack. */ | |
2432 | + /* The state stack. */ | |
2433 | short yyssa[YYINITDEPTH]; | |
2434 | short *yyss = yyssa; | |
2435 | register short *yyssp; | |
2436 | @@ -1384,31 +1669,19 @@ | |
2437 | YYSTYPE *yyvs = yyvsa; | |
2438 | register YYSTYPE *yyvsp; | |
2439 | ||
2440 | -#if YYLSP_NEEDED | |
2441 | - /* The location stack. */ | |
2442 | - YYLTYPE yylsa[YYINITDEPTH]; | |
2443 | - YYLTYPE *yyls = yylsa; | |
2444 | - YYLTYPE *yylsp; | |
2445 | -#endif | |
2446 | ||
2447 | -#if YYLSP_NEEDED | |
2448 | -# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) | |
2449 | -#else | |
2450 | -# define YYPOPSTACK (yyvsp--, yyssp--) | |
2451 | -#endif | |
2452 | ||
2453 | - YYSIZE_T yystacksize = YYINITDEPTH; | |
2454 | +#define YYPOPSTACK (yyvsp--, yyssp--) | |
2455 | ||
2456 | + YYSIZE_T yystacksize = YYINITDEPTH; | |
2457 | ||
2458 | /* The variables used to return semantic value and location from the | |
2459 | action routines. */ | |
2460 | YYSTYPE yyval; | |
2461 | -#if YYLSP_NEEDED | |
2462 | - YYLTYPE yyloc; | |
2463 | -#endif | |
2464 | + | |
2465 | ||
2466 | /* When reducing, the number of symbols on the RHS of the reduced | |
2467 | - rule. */ | |
2468 | + rule. */ | |
2469 | int yylen; | |
2470 | ||
2471 | YYDPRINTF ((stderr, "Starting parse\n")); | |
2472 | @@ -1425,9 +1698,7 @@ | |
2473 | ||
2474 | yyssp = yyss; | |
2475 | yyvsp = yyvs; | |
2476 | -#if YYLSP_NEEDED | |
2477 | - yylsp = yyls; | |
2478 | -#endif | |
2479 | + | |
2480 | goto yysetstate; | |
2481 | ||
2482 | /*------------------------------------------------------------. | |
2483 | @@ -1442,7 +1713,7 @@ | |
2484 | yysetstate: | |
2485 | *yyssp = yystate; | |
2486 | ||
2487 | - if (yyssp >= yyss + yystacksize - 1) | |
2488 | + if (yyss + yystacksize - 1 <= yyssp) | |
2489 | { | |
2490 | /* Get the current used size of the three stacks, in elements. */ | |
2491 | YYSIZE_T yysize = yyssp - yyss + 1; | |
2492 | @@ -1455,24 +1726,17 @@ | |
2493 | YYSTYPE *yyvs1 = yyvs; | |
2494 | short *yyss1 = yyss; | |
2495 | ||
2496 | + | |
2497 | /* Each stack pointer address is followed by the size of the | |
2498 | - data in use in that stack, in bytes. */ | |
2499 | -# if YYLSP_NEEDED | |
2500 | - YYLTYPE *yyls1 = yyls; | |
2501 | - /* This used to be a conditional around just the two extra args, | |
2502 | - but that might be undefined if yyoverflow is a macro. */ | |
2503 | - yyoverflow ("parser stack overflow", | |
2504 | - &yyss1, yysize * sizeof (*yyssp), | |
2505 | - &yyvs1, yysize * sizeof (*yyvsp), | |
2506 | - &yyls1, yysize * sizeof (*yylsp), | |
2507 | - &yystacksize); | |
2508 | - yyls = yyls1; | |
2509 | -# else | |
2510 | + data in use in that stack, in bytes. This used to be a | |
2511 | + conditional around just the two extra args, but that might | |
2512 | + be undefined if yyoverflow is a macro. */ | |
2513 | yyoverflow ("parser stack overflow", | |
2514 | &yyss1, yysize * sizeof (*yyssp), | |
2515 | &yyvs1, yysize * sizeof (*yyvsp), | |
2516 | + | |
2517 | &yystacksize); | |
2518 | -# endif | |
2519 | + | |
2520 | yyss = yyss1; | |
2521 | yyvs = yyvs1; | |
2522 | } | |
2523 | @@ -1481,10 +1745,10 @@ | |
2524 | goto yyoverflowlab; | |
2525 | # else | |
2526 | /* Extend the stack our own way. */ | |
2527 | - if (yystacksize >= YYMAXDEPTH) | |
2528 | + if (YYMAXDEPTH <= yystacksize) | |
2529 | goto yyoverflowlab; | |
2530 | yystacksize *= 2; | |
2531 | - if (yystacksize > YYMAXDEPTH) | |
2532 | + if (YYMAXDEPTH < yystacksize) | |
2533 | yystacksize = YYMAXDEPTH; | |
2534 | ||
2535 | { | |
2536 | @@ -1495,10 +1759,8 @@ | |
2537 | goto yyoverflowlab; | |
2538 | YYSTACK_RELOCATE (yyss); | |
2539 | YYSTACK_RELOCATE (yyvs); | |
2540 | -# if YYLSP_NEEDED | |
2541 | - YYSTACK_RELOCATE (yyls); | |
2542 | -# endif | |
2543 | -# undef YYSTACK_RELOCATE | |
2544 | + | |
2545 | +# undef YYSTACK_RELOCATE | |
2546 | if (yyss1 != yyssa) | |
2547 | YYSTACK_FREE (yyss1); | |
2548 | } | |
2549 | @@ -1507,14 +1769,12 @@ | |
2550 | ||
2551 | yyssp = yyss + yysize - 1; | |
2552 | yyvsp = yyvs + yysize - 1; | |
2553 | -#if YYLSP_NEEDED | |
2554 | - yylsp = yyls + yysize - 1; | |
2555 | -#endif | |
2556 | + | |
2557 | ||
2558 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", | |
2559 | (unsigned long int) yystacksize)); | |
2560 | ||
2561 | - if (yyssp >= yyss + yystacksize - 1) | |
2562 | + if (yyss + yystacksize - 1 <= yyssp) | |
2563 | YYABORT; | |
2564 | } | |
2565 | ||
2566 | @@ -1522,7 +1782,6 @@ | |
2567 | ||
2568 | goto yybackup; | |
2569 | ||
2570 | - | |
2571 | /*-----------. | |
2572 | | yybackup. | | |
2573 | `-----------*/ | |
2574 | @@ -1535,88 +1794,55 @@ | |
2575 | /* First try to decide what to do without reference to lookahead token. */ | |
2576 | ||
2577 | yyn = yypact[yystate]; | |
2578 | - if (yyn == YYFLAG) | |
2579 | + if (yyn == YYPACT_NINF) | |
2580 | goto yydefault; | |
2581 | ||
2582 | /* Not known => get a lookahead token if don't already have one. */ | |
2583 | ||
2584 | - /* yychar is either YYEMPTY or YYEOF | |
2585 | - or a valid token in external form. */ | |
2586 | - | |
2587 | + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ | |
2588 | if (yychar == YYEMPTY) | |
2589 | { | |
2590 | YYDPRINTF ((stderr, "Reading a token: ")); | |
2591 | yychar = YYLEX; | |
2592 | } | |
2593 | ||
2594 | - /* Convert token to internal form (in yychar1) for indexing tables with */ | |
2595 | - | |
2596 | - if (yychar <= 0) /* This means end of input. */ | |
2597 | + if (yychar <= YYEOF) | |
2598 | { | |
2599 | - yychar1 = 0; | |
2600 | - yychar = YYEOF; /* Don't call YYLEX any more */ | |
2601 | - | |
2602 | + yychar = yytoken = YYEOF; | |
2603 | YYDPRINTF ((stderr, "Now at end of input.\n")); | |
2604 | } | |
2605 | else | |
2606 | { | |
2607 | - yychar1 = YYTRANSLATE (yychar); | |
2608 | - | |
2609 | -#if YYDEBUG | |
2610 | - /* We have to keep this `#if YYDEBUG', since we use variables | |
2611 | - which are defined only if `YYDEBUG' is set. */ | |
2612 | - if (yydebug) | |
2613 | - { | |
2614 | - YYFPRINTF (stderr, "Next token is %d (%s", | |
2615 | - yychar, yytname[yychar1]); | |
2616 | - /* Give the individual parser a way to print the precise | |
2617 | - meaning of a token, for further debugging info. */ | |
2618 | -# ifdef YYPRINT | |
2619 | - YYPRINT (stderr, yychar, yylval); | |
2620 | -# endif | |
2621 | - YYFPRINTF (stderr, ")\n"); | |
2622 | - } | |
2623 | -#endif | |
2624 | + yytoken = YYTRANSLATE (yychar); | |
2625 | + YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); | |
2626 | } | |
2627 | ||
2628 | - yyn += yychar1; | |
2629 | - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) | |
2630 | + /* If the proper action on seeing token YYTOKEN is to reduce or to | |
2631 | + detect an error, take that action. */ | |
2632 | + yyn += yytoken; | |
2633 | + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) | |
2634 | goto yydefault; | |
2635 | - | |
2636 | yyn = yytable[yyn]; | |
2637 | - | |
2638 | - /* yyn is what to do for this token type in this state. | |
2639 | - Negative => reduce, -yyn is rule number. | |
2640 | - Positive => shift, yyn is new state. | |
2641 | - New state is final state => don't bother to shift, | |
2642 | - just return success. | |
2643 | - 0, or most negative number => error. */ | |
2644 | - | |
2645 | - if (yyn < 0) | |
2646 | + if (yyn <= 0) | |
2647 | { | |
2648 | - if (yyn == YYFLAG) | |
2649 | + if (yyn == 0 || yyn == YYTABLE_NINF) | |
2650 | goto yyerrlab; | |
2651 | yyn = -yyn; | |
2652 | goto yyreduce; | |
2653 | } | |
2654 | - else if (yyn == 0) | |
2655 | - goto yyerrlab; | |
2656 | ||
2657 | if (yyn == YYFINAL) | |
2658 | YYACCEPT; | |
2659 | ||
2660 | /* Shift the lookahead token. */ | |
2661 | - YYDPRINTF ((stderr, "Shifting token %d (%s), ", | |
2662 | - yychar, yytname[yychar1])); | |
2663 | + YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); | |
2664 | ||
2665 | /* Discard the token being shifted unless it is eof. */ | |
2666 | if (yychar != YYEOF) | |
2667 | yychar = YYEMPTY; | |
2668 | ||
2669 | *++yyvsp = yylval; | |
2670 | -#if YYLSP_NEEDED | |
2671 | - *++yylsp = yylloc; | |
2672 | -#endif | |
2673 | + | |
2674 | ||
2675 | /* Count tokens shifted since error; after three, turn off error | |
2676 | status. */ | |
2677 | @@ -1647,60 +1873,40 @@ | |
2678 | /* If YYLEN is nonzero, implement the default value of the action: | |
2679 | `$$ = $1'. | |
2680 | ||
2681 | - Otherwise, the following line sets YYVAL to the semantic value of | |
2682 | - the lookahead token. This behavior is undocumented and Bison | |
2683 | + Otherwise, the following line sets YYVAL to garbage. | |
2684 | + This behavior is undocumented and Bison | |
2685 | users should not rely upon it. Assigning to YYVAL | |
2686 | unconditionally makes the parser a bit smaller, and it avoids a | |
2687 | GCC warning that YYVAL may be used uninitialized. */ | |
2688 | yyval = yyvsp[1-yylen]; | |
2689 | ||
2690 | -#if YYLSP_NEEDED | |
2691 | - /* Similarly for the default location. Let the user run additional | |
2692 | - commands if for instance locations are ranges. */ | |
2693 | - yyloc = yylsp[1-yylen]; | |
2694 | - YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); | |
2695 | -#endif | |
2696 | - | |
2697 | -#if YYDEBUG | |
2698 | - /* We have to keep this `#if YYDEBUG', since we use variables which | |
2699 | - are defined only if `YYDEBUG' is set. */ | |
2700 | - if (yydebug) | |
2701 | - { | |
2702 | - int yyi; | |
2703 | - | |
2704 | - YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", | |
2705 | - yyn, yyrline[yyn]); | |
2706 | - | |
2707 | - /* Print the symbols being reduced, and their result. */ | |
2708 | - for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) | |
2709 | - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); | |
2710 | - YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); | |
2711 | - } | |
2712 | -#endif | |
2713 | - | |
2714 | - switch (yyn) { | |
2715 | ||
2716 | -case 1: | |
2717 | + YY_REDUCE_PRINT (yyn); | |
2718 | + switch (yyn) | |
2719 | + { | |
2720 | + case 2: | |
2721 | #line 261 "bac.y" | |
2722 | -{ | |
2723 | + { | |
2724 | if (!making_objfile&&!main_declared) | |
2725 | yyerror("No 'main' function declared"); | |
2726 | if (main_declared) | |
2727 | emit(SHORTRET); | |
2728 | } | |
2729 | break; | |
2730 | -case 2: | |
2731 | + | |
2732 | + case 3: | |
2733 | #line 268 "bac.y" | |
2734 | -{ | |
2735 | + { | |
2736 | if (!making_objfile&&!main_declared) | |
2737 | yyerror("No 'main' function declared"); | |
2738 | if (main_declared) | |
2739 | emit(SHORTRET); | |
2740 | } | |
2741 | break; | |
2742 | -case 3: | |
2743 | + | |
2744 | + case 4: | |
2745 | #line 277 "bac.y" | |
2746 | -{ | |
2747 | + { | |
2748 | level = 0; | |
2749 | extern_decl = 0; | |
2750 | enter(outerblock_name,outerblock,level,level); | |
2751 | @@ -1714,9 +1920,10 @@ | |
2752 | display[last_btab] = level; | |
2753 | } | |
2754 | break; | |
2755 | -case 13: | |
2756 | + | |
2757 | + case 14: | |
2758 | #line 306 "bac.y" | |
2759 | -{ | |
2760 | + { | |
2761 | if (strcmp(laststring,infile[curr_infile].fname) == 0) | |
2762 | yyerror("Recursive file inclusion"); | |
2763 | else { | |
2764 | @@ -1725,13 +1932,15 @@ | |
2765 | in_include = 0; | |
2766 | } | |
2767 | break; | |
2768 | -case 14: | |
2769 | + | |
2770 | + case 15: | |
2771 | #line 317 "bac.y" | |
2772 | -{ in_include = 1; } | |
2773 | + { in_include = 1; } | |
2774 | break; | |
2775 | -case 15: | |
2776 | + | |
2777 | + case 16: | |
2778 | #line 321 "bac.y" | |
2779 | -{ int i; | |
2780 | + { int i; | |
2781 | tab[ob_tix].adr = lc; /* outerblock entry pt */ | |
2782 | for (i = 0; i <= mon; i++){ | |
2783 | /* don't emit CALL_MONINIT for ext_monitor objects */ | |
2784 | @@ -1744,9 +1953,10 @@ | |
2785 | process_var_inits(level); | |
2786 | } | |
2787 | break; | |
2788 | -case 16: | |
2789 | + | |
2790 | + case 17: | |
2791 | #line 334 "bac.y" | |
2792 | -{ | |
2793 | + { | |
2794 | int i; | |
2795 | emit(HALT); | |
2796 | btab[tab[yyvsp[-1]].ref].last = last_tab; /* set last var ref in main */ | |
2797 | @@ -1766,14 +1976,16 @@ | |
2798 | process_var_inits(level-1); /* outer block variables, too */ | |
2799 | } | |
2800 | break; | |
2801 | -case 17: | |
2802 | + | |
2803 | + case 18: | |
2804 | #line 357 "bac.y" | |
2805 | -{ | |
2806 | + { | |
2807 | extern_decl = 0; | |
2808 | enter("main",mainproc,level,level); | |
2809 | prt = last_tab; | |
2810 | enter_block(&last_btab,&level,last_tab); | |
2811 | btab[last_btab].lastpar = last_tab; /* no parms */ | |
2812 | + if (maxlevel < level) maxlevel = level; | |
2813 | main_declared = 1; | |
2814 | yyval = prt; | |
2815 | btab[0].lastpar = prt; /* save main's tabix for the interp */ | |
2816 | @@ -1782,16 +1994,19 @@ | |
2817 | emit(SHORTCALL); /* will have to backpatch addr later */ | |
2818 | } | |
2819 | break; | |
2820 | -case 19: | |
2821 | -#line 374 "bac.y" | |
2822 | -{ yyval = int_loc; } | |
2823 | + | |
2824 | + case 20: | |
2825 | +#line 375 "bac.y" | |
2826 | + { yyval = int_loc; } | |
2827 | break; | |
2828 | -case 24: | |
2829 | -#line 384 "bac.y" | |
2830 | -{ | |
2831 | + | |
2832 | + case 25: | |
2833 | +#line 385 "bac.y" | |
2834 | + { | |
2835 | if (main_declared) | |
2836 | yyerror("main() proc must be last"); | |
2837 | if (void_function) { | |
2838 | + if (curr_ret >= 0) process_returns(); | |
2839 | if (tab[yyvsp[-1]].mon) emit(EXITMON); | |
2840 | emit(EXIT_PROC); | |
2841 | } | |
2842 | @@ -1808,51 +2023,58 @@ | |
2843 | curr_ret = -1; | |
2844 | } | |
2845 | break; | |
2846 | -case 25: | |
2847 | -#line 406 "bac.y" | |
2848 | -{ tab[yyvsp[0]].atomic = 0; } | |
2849 | - break; | |
2850 | -case 26: | |
2851 | + | |
2852 | + case 26: | |
2853 | #line 408 "bac.y" | |
2854 | -{ tab[yyvsp[0]].atomic = 1; yyval = yyvsp[0]; } | |
2855 | + { tab[yyvsp[0]].atomic = 0; } | |
2856 | break; | |
2857 | -case 27: | |
2858 | -#line 412 "bac.y" | |
2859 | -{ | |
2860 | + | |
2861 | + case 27: | |
2862 | +#line 410 "bac.y" | |
2863 | + { tab[yyvsp[0]].atomic = 1; yyval = yyvsp[0]; } | |
2864 | + break; | |
2865 | + | |
2866 | + case 28: | |
2867 | +#line 414 "bac.y" | |
2868 | + { | |
2869 | btab[display[level]].psize = curr_parm_offset; | |
2870 | btab[display[level]].vsize = curr_parm_offset + delta_vsize; | |
2871 | in_func_decl = 1; | |
2872 | } | |
2873 | break; | |
2874 | -case 28: | |
2875 | -#line 418 "bac.y" | |
2876 | -{ | |
2877 | + | |
2878 | + case 29: | |
2879 | +#line 420 "bac.y" | |
2880 | + { | |
2881 | btab[display[level]].psize = curr_parm_offset; | |
2882 | btab[display[level]].vsize = curr_parm_offset + delta_vsize; | |
2883 | in_func_decl = 1; | |
2884 | } | |
2885 | break; | |
2886 | -case 29: | |
2887 | -#line 426 "bac.y" | |
2888 | -{ | |
2889 | + | |
2890 | + case 30: | |
2891 | +#line 428 "bac.y" | |
2892 | + { | |
2893 | tab[yyvsp[-1]].typ = ints; | |
2894 | cnonfatal("Type of function %s defaults to int",tab[yyvsp[-1]].name); | |
2895 | tab[yyvsp[0]].obj = (extern_decl ? ext_function : function ); | |
2896 | void_function = 0; | |
2897 | } | |
2898 | break; | |
2899 | -case 30: | |
2900 | -#line 435 "bac.y" | |
2901 | -{ | |
2902 | + | |
2903 | + case 31: | |
2904 | +#line 437 "bac.y" | |
2905 | + { | |
2906 | tab[yyvsp[-1]].typ = notyp; | |
2907 | tab[yyvsp[-1]].obj = (extern_decl ? ext_procedure : procedure); | |
2908 | yyval = yyvsp[-1]; | |
2909 | void_function = 1; | |
2910 | } | |
2911 | break; | |
2912 | -case 31: | |
2913 | -#line 442 "bac.y" | |
2914 | -{ | |
2915 | + | |
2916 | + case 32: | |
2917 | +#line 444 "bac.y" | |
2918 | + { | |
2919 | if ((tab[yyvsp[-2]].typ != ints)&&(tab[yyvsp[-2]].typ != chars)){ | |
2920 | sprintf(pbuf,"'%s' is not a valid function return type", | |
2921 | tab[yyvsp[-2]].name); | |
2922 | @@ -1866,9 +2088,10 @@ | |
2923 | void_function = 0; | |
2924 | } | |
2925 | break; | |
2926 | -case 32: | |
2927 | -#line 458 "bac.y" | |
2928 | -{ int vis_level,real_level; | |
2929 | + | |
2930 | + case 33: | |
2931 | +#line 460 "bac.y" | |
2932 | + { int vis_level,real_level; | |
2933 | if (in_mon_decl) { | |
2934 | real_level = level; | |
2935 | vis_level = ((level > 0) ? level -1 : 0); | |
2936 | @@ -1877,22 +2100,24 @@ | |
2937 | vis_level = real_level = level; | |
2938 | } | |
2939 | yyval = prt = enter(lastident(),function,real_level,vis_level); | |
2940 | - func_tab = prt; | |
2941 | if (in_mon_decl) tab[prt].mon = mtab[mon] - last_predeclared; | |
2942 | enter_block(&last_btab,&level,prt); | |
2943 | + if (maxlevel < level) maxlevel = level; | |
2944 | curr_parm_offset = btab[display[level]].vsize; | |
2945 | delta_vsize = curr_parm_offset - btab[display[level]].psize; | |
2946 | tab[yyval].adr = (extern_decl ? -1 : lc); | |
2947 | if (in_mon_decl&&!extern_decl) emit1(ENTERMON,tab[prt].mon); | |
2948 | } | |
2949 | break; | |
2950 | -case 33: | |
2951 | -#line 478 "bac.y" | |
2952 | -{ btab[display[level]].lastpar = last_tab;} | |
2953 | + | |
2954 | + case 34: | |
2955 | +#line 480 "bac.y" | |
2956 | + { btab[display[level]].lastpar = last_tab;} | |
2957 | break; | |
2958 | -case 39: | |
2959 | -#line 491 "bac.y" | |
2960 | -{ | |
2961 | + | |
2962 | + case 40: | |
2963 | +#line 493 "bac.y" | |
2964 | + { | |
2965 | tab[yyvsp[0]].typ = elem_typ; | |
2966 | tab[yyvsp[0]].ref = elem_ref; | |
2967 | tab[yyvsp[0]].obj = variable; | |
2968 | @@ -1905,34 +2130,40 @@ | |
2969 | curr_parm_offset++; /* pointers occupy 1 stack word */ | |
2970 | } | |
2971 | break; | |
2972 | -case 40: | |
2973 | -#line 506 "bac.y" | |
2974 | -{ by_value = 1; } | |
2975 | - break; | |
2976 | -case 41: | |
2977 | + | |
2978 | + case 41: | |
2979 | #line 508 "bac.y" | |
2980 | -{ by_value = 0; } | |
2981 | + { by_value = 1; } | |
2982 | break; | |
2983 | -case 42: | |
2984 | + | |
2985 | + case 42: | |
2986 | #line 510 "bac.y" | |
2987 | -{ /* allow strings of indefinite length */ | |
2988 | + { by_value = 0; } | |
2989 | + break; | |
2990 | + | |
2991 | + case 43: | |
2992 | +#line 512 "bac.y" | |
2993 | + { /* allow strings of indefinite length */ | |
2994 | elem_ref = 0; | |
2995 | elem_size = 1; /* a pointer */ | |
2996 | elem_typ = strings; | |
2997 | - elem_tix = -1; | |
2998 | + elem_tix = -1; /* not in symbol table */ | |
2999 | by_value = 0; /* pass-by-reference */ | |
3000 | + yyval = -1; /* not in symbol table */ | |
3001 | } | |
3002 | break; | |
3003 | -case 43: | |
3004 | -#line 521 "bac.y" | |
3005 | -{ | |
3006 | + | |
3007 | + case 44: | |
3008 | +#line 524 "bac.y" | |
3009 | + { | |
3010 | leave_block(&level); | |
3011 | in_mon_decl = 0; | |
3012 | } | |
3013 | break; | |
3014 | -case 44: | |
3015 | -#line 528 "bac.y" | |
3016 | -{ | |
3017 | + | |
3018 | + case 45: | |
3019 | +#line 531 "bac.y" | |
3020 | + { | |
3021 | if (mon == MAXMON) | |
3022 | cfatal("No more than %d monitors can be declared",MAXMON); | |
3023 | tab[yyvsp[0]].obj = (extern_decl ? ext_monitor : monitor); | |
3024 | @@ -1943,11 +2174,13 @@ | |
3025 | yyerror("Monitors can only be declared at the global level"); | |
3026 | enter_block(&last_btab,&level,last_tab); | |
3027 | btab[last_btab].lastpar = last_tab; /* no parms */ | |
3028 | + if (maxlevel < level) maxlevel = level; | |
3029 | } | |
3030 | break; | |
3031 | -case 51: | |
3032 | -#line 556 "bac.y" | |
3033 | -{ | |
3034 | + | |
3035 | + case 52: | |
3036 | +#line 560 "bac.y" | |
3037 | + { | |
3038 | if (tab[mtab[mon]].obj == monitor) { | |
3039 | /* don't do the following for ext_monitor objects */ | |
3040 | tab[mtab[mon]].adr = lc; /* addr of monitor init code */ | |
3041 | @@ -1957,9 +2190,10 @@ | |
3042 | } | |
3043 | } | |
3044 | break; | |
3045 | -case 52: | |
3046 | -#line 566 "bac.y" | |
3047 | -{ | |
3048 | + | |
3049 | + case 53: | |
3050 | +#line 570 "bac.y" | |
3051 | + { | |
3052 | if (tab[mtab[mon]].obj == monitor) { | |
3053 | /* don't do the following for ext_monitor objects */ | |
3054 | /* main pgm will CALL_MONINIT, even if no init code */ | |
3055 | @@ -1967,58 +2201,66 @@ | |
3056 | } | |
3057 | } | |
3058 | break; | |
3059 | -case 53: | |
3060 | -#line 576 "bac.y" | |
3061 | -{ | |
3062 | + | |
3063 | + case 54: | |
3064 | +#line 580 "bac.y" | |
3065 | + { | |
3066 | tab[mtab[mon]].adr = lc; /* addr of monitor init code */ | |
3067 | process_var_inits(level); | |
3068 | } | |
3069 | break; | |
3070 | -case 54: | |
3071 | -#line 583 "bac.y" | |
3072 | -{ | |
3073 | + | |
3074 | + case 55: | |
3075 | +#line 587 "bac.y" | |
3076 | + { | |
3077 | leave_block(&level); | |
3078 | tab[yyvsp[-3]].adr = -1; | |
3079 | extern_decl = 0; | |
3080 | in_mon_decl = 0; | |
3081 | } | |
3082 | break; | |
3083 | -case 55: | |
3084 | -#line 592 "bac.y" | |
3085 | -{ leave_block(&level); } | |
3086 | - break; | |
3087 | -case 56: | |
3088 | -#line 594 "bac.y" | |
3089 | -{ leave_block(&level); } | |
3090 | + | |
3091 | + case 56: | |
3092 | +#line 596 "bac.y" | |
3093 | + { leave_block(&level); } | |
3094 | break; | |
3095 | -case 60: | |
3096 | -#line 603 "bac.y" | |
3097 | -{ | |
3098 | + | |
3099 | + case 57: | |
3100 | +#line 598 "bac.y" | |
3101 | + { leave_block(&level); } | |
3102 | + break; | |
3103 | + | |
3104 | + case 61: | |
3105 | +#line 607 "bac.y" | |
3106 | + { | |
3107 | if (level > 0) | |
3108 | yyerror("Externals must be declared at the outer (global) level"); | |
3109 | } | |
3110 | break; | |
3111 | -case 62: | |
3112 | -#line 613 "bac.y" | |
3113 | -{ | |
3114 | + | |
3115 | + case 63: | |
3116 | +#line 617 "bac.y" | |
3117 | + { | |
3118 | yyval = elem_tix = int_loc; | |
3119 | elem_size = stacksize(tab[int_loc].adr); /* tab has byte size */ | |
3120 | elem_typ = tab[int_loc].typ; | |
3121 | elem_ref = tab[int_loc].ref; | |
3122 | } | |
3123 | break; | |
3124 | -case 63: | |
3125 | -#line 620 "bac.y" | |
3126 | -{ | |
3127 | + | |
3128 | + case 64: | |
3129 | +#line 624 "bac.y" | |
3130 | + { | |
3131 | yyval = elem_tix = char_loc; | |
3132 | elem_size = stacksize(tab[char_loc].adr); | |
3133 | elem_typ = tab[char_loc].typ; | |
3134 | elem_ref = tab[char_loc].ref; | |
3135 | } | |
3136 | break; | |
3137 | -case 64: | |
3138 | -#line 627 "bac.y" | |
3139 | -{ | |
3140 | + | |
3141 | + case 65: | |
3142 | +#line 631 "bac.y" | |
3143 | + { | |
3144 | if (yyvsp[-1] <= 0) | |
3145 | yyerror("A string of non-positive length is not valid"); | |
3146 | else { | |
3147 | @@ -2028,9 +2270,10 @@ | |
3148 | } | |
3149 | } | |
3150 | break; | |
3151 | -case 65: | |
3152 | -#line 637 "bac.y" | |
3153 | -{ | |
3154 | + | |
3155 | + case 66: | |
3156 | +#line 641 "bac.y" | |
3157 | + { | |
3158 | if (tab[yyvsp[0]].obj != type){ | |
3159 | sprintf(pbuf,"'%s' is not a valid type",tab[yyvsp[0]].name); | |
3160 | yyerror(pbuf); | |
3161 | @@ -2041,9 +2284,10 @@ | |
3162 | elem_tix = yyvsp[0]; | |
3163 | } | |
3164 | break; | |
3165 | -case 68: | |
3166 | -#line 654 "bac.y" | |
3167 | -{ | |
3168 | + | |
3169 | + case 69: | |
3170 | +#line 658 "bac.y" | |
3171 | + { | |
3172 | tab[yyvsp[0]].typ = elem_typ; | |
3173 | tab[yyvsp[0]].obj = (extern_decl ? ext_variable : variable); | |
3174 | tab[yyvsp[0]].ref = elem_ref; | |
3175 | @@ -2051,9 +2295,10 @@ | |
3176 | btab[display[level]].vsize += elem_size; | |
3177 | } | |
3178 | break; | |
3179 | -case 69: | |
3180 | -#line 662 "bac.y" | |
3181 | -{ | |
3182 | + | |
3183 | + case 70: | |
3184 | +#line 666 "bac.y" | |
3185 | + { | |
3186 | if (extern_decl) | |
3187 | yyerror("External variables cannot be initialized"); | |
3188 | else { | |
3189 | @@ -2089,13 +2334,15 @@ | |
3190 | } /* else not extern */ | |
3191 | } | |
3192 | break; | |
3193 | -case 70: | |
3194 | -#line 698 "bac.y" | |
3195 | -{ in_typedef = 0; } | |
3196 | - break; | |
3197 | -case 71: | |
3198 | + | |
3199 | + case 71: | |
3200 | #line 702 "bac.y" | |
3201 | -{ | |
3202 | + { in_typedef = 0; } | |
3203 | + break; | |
3204 | + | |
3205 | + case 72: | |
3206 | +#line 706 "bac.y" | |
3207 | + { | |
3208 | int i; | |
3209 | TYPES eltyp; | |
3210 | int elsize,elref; | |
3211 | @@ -2126,13 +2373,15 @@ | |
3212 | array_defined = yyvsp[-1]; | |
3213 | } | |
3214 | break; | |
3215 | -case 72: | |
3216 | -#line 735 "bac.y" | |
3217 | -{ yyval = yyvsp[0]; /* only want to pass on atab index for first dim */} | |
3218 | + | |
3219 | + case 73: | |
3220 | +#line 739 "bac.y" | |
3221 | + { yyval = yyvsp[0]; /* only want to pass on atab index for first dim */} | |
3222 | break; | |
3223 | -case 74: | |
3224 | -#line 740 "bac.y" | |
3225 | -{ | |
3226 | + | |
3227 | + case 75: | |
3228 | +#line 744 "bac.y" | |
3229 | + { | |
3230 | if (last_atab == AMAX) | |
3231 | cfatal("Array table full with %d entries",AMAX); | |
3232 | atab[++last_atab].inxtyp = consttype; | |
3233 | @@ -2147,9 +2396,10 @@ | |
3234 | yyval = last_atab; /* pass array tab index up the parse tree */ | |
3235 | } | |
3236 | break; | |
3237 | -case 75: | |
3238 | -#line 757 "bac.y" | |
3239 | -{ | |
3240 | + | |
3241 | + case 76: | |
3242 | +#line 761 "bac.y" | |
3243 | + { | |
3244 | yyval = yyvsp[-1]; | |
3245 | if (yyvsp[-1] > 0) { | |
3246 | tab[yyvsp[-1]].obj = type; | |
3247 | @@ -2160,9 +2410,10 @@ | |
3248 | in_typedef = 0; | |
3249 | } | |
3250 | break; | |
3251 | -case 76: | |
3252 | -#line 768 "bac.y" | |
3253 | -{ | |
3254 | + | |
3255 | + case 77: | |
3256 | +#line 772 "bac.y" | |
3257 | + { | |
3258 | yyval = array_defined; | |
3259 | if (array_defined > 0) { | |
3260 | tab[array_defined].obj = type; | |
3261 | @@ -2175,13 +2426,15 @@ | |
3262 | in_typedef = 0; | |
3263 | } | |
3264 | break; | |
3265 | -case 77: | |
3266 | -#line 783 "bac.y" | |
3267 | -{ in_typedef = 1; } | |
3268 | - break; | |
3269 | -case 78: | |
3270 | + | |
3271 | + case 78: | |
3272 | #line 787 "bac.y" | |
3273 | -{ | |
3274 | + { in_typedef = 1; } | |
3275 | + break; | |
3276 | + | |
3277 | + case 79: | |
3278 | +#line 791 "bac.y" | |
3279 | + { | |
3280 | if ((tab[yyvsp[-4]].typ != ints)&&(tab[yyvsp[-4]].typ != chars)) | |
3281 | yyerror("Constants must be of type 'int' or 'char'"); | |
3282 | else { | |
3283 | @@ -2191,90 +2444,117 @@ | |
3284 | } | |
3285 | } | |
3286 | break; | |
3287 | -case 79: | |
3288 | -#line 799 "bac.y" | |
3289 | -{ yyval = yyvsp[0]; } | |
3290 | - break; | |
3291 | -case 80: | |
3292 | -#line 801 "bac.y" | |
3293 | -{ yyval = - yyvsp[0]; } | |
3294 | - break; | |
3295 | -case 81: | |
3296 | + | |
3297 | + case 80: | |
3298 | #line 803 "bac.y" | |
3299 | -{ yyval = yyvsp[0]; } | |
3300 | + { yyval = yyvsp[0]; } | |
3301 | break; | |
3302 | -case 82: | |
3303 | + | |
3304 | + case 81: | |
3305 | #line 805 "bac.y" | |
3306 | -{ consttype = chars; yyval = laststring[0]; } | |
3307 | + { yyval = - yyvsp[0]; } | |
3308 | + break; | |
3309 | + | |
3310 | + case 82: | |
3311 | +#line 807 "bac.y" | |
3312 | + { yyval = yyvsp[0]; } | |
3313 | break; | |
3314 | -case 83: | |
3315 | + | |
3316 | + case 83: | |
3317 | #line 809 "bac.y" | |
3318 | -{ consttype = ints; } | |
3319 | + { consttype = chars; yyval = laststring[0]; } | |
3320 | break; | |
3321 | -case 84: | |
3322 | -#line 811 "bac.y" | |
3323 | -{ yyval = get_constant(tab[yyvsp[0]].name,level,&consttype); | |
3324 | + | |
3325 | + case 84: | |
3326 | +#line 813 "bac.y" | |
3327 | + { consttype = ints; } | |
3328 | + break; | |
3329 | + | |
3330 | + case 85: | |
3331 | +#line 815 "bac.y" | |
3332 | + { yyval = get_constant(tab[yyvsp[0]].name,level,&consttype); | |
3333 | if ((consttype != ints)&&(consttype != chars)) { | |
3334 | yyerror("'int' or 'char' type expected"); | |
3335 | consttype = notyp; | |
3336 | } | |
3337 | } | |
3338 | break; | |
3339 | -case 85: | |
3340 | -#line 820 "bac.y" | |
3341 | -{ yyval = strtoi(numbertext,numberbase); } | |
3342 | + | |
3343 | + case 86: | |
3344 | +#line 824 "bac.y" | |
3345 | + { yyval = strtoi(numbertext,numberbase); } | |
3346 | break; | |
3347 | -case 90: | |
3348 | -#line 830 "bac.y" | |
3349 | -{ | |
3350 | + | |
3351 | + case 91: | |
3352 | +#line 834 "bac.y" | |
3353 | + { | |
3354 | leave_block(&level); | |
3355 | in_func_decl = 0; | |
3356 | extern_decl = 0; | |
3357 | } | |
3358 | break; | |
3359 | -case 91: | |
3360 | -#line 838 "bac.y" | |
3361 | -{ extern_decl = 1; } | |
3362 | - break; | |
3363 | -case 92: | |
3364 | + | |
3365 | + case 92: | |
3366 | #line 842 "bac.y" | |
3367 | -{ extern_decl = 0; } | |
3368 | + { extern_decl = 1; } | |
3369 | break; | |
3370 | -case 93: | |
3371 | + | |
3372 | + case 93: | |
3373 | #line 846 "bac.y" | |
3374 | -{ | |
3375 | + { extern_decl = 0; } | |
3376 | + break; | |
3377 | + | |
3378 | + case 94: | |
3379 | +#line 850 "bac.y" | |
3380 | + { | |
3381 | extern_decl = 0; | |
3382 | in_typedef = 0; | |
3383 | } | |
3384 | break; | |
3385 | -case 94: | |
3386 | -#line 853 "bac.y" | |
3387 | -{ extern_decl = 0; } | |
3388 | - break; | |
3389 | -case 97: | |
3390 | -#line 859 "bac.y" | |
3391 | -{ yyerrok; } | |
3392 | - break; | |
3393 | -case 98: | |
3394 | -#line 861 "bac.y" | |
3395 | -{ yyerrok; } | |
3396 | - break; | |
3397 | -case 99: | |
3398 | -#line 866 "bac.y" | |
3399 | -{ yyval = -1; /* send back news that expr_list was empty */ } | |
3400 | + | |
3401 | + case 95: | |
3402 | +#line 857 "bac.y" | |
3403 | + { extern_decl = 0; } | |
3404 | break; | |
3405 | -case 106: | |
3406 | -#line 878 "bac.y" | |
3407 | -{ | |
3408 | + | |
3409 | + case 98: | |
3410 | +#line 863 "bac.y" | |
3411 | + { yyerrok; } | |
3412 | + break; | |
3413 | + | |
3414 | + case 99: | |
3415 | +#line 865 "bac.y" | |
3416 | + { yyerrok; } | |
3417 | + break; | |
3418 | + | |
3419 | + case 100: | |
3420 | +#line 870 "bac.y" | |
3421 | + { yyval = -1; /* send back news that expr_list was empty */ } | |
3422 | + break; | |
3423 | + | |
3424 | + case 102: | |
3425 | +#line 875 "bac.y" | |
3426 | + { free_expr(yyvsp[0]); } | |
3427 | + break; | |
3428 | + | |
3429 | + case 103: | |
3430 | +#line 877 "bac.y" | |
3431 | + { free_expr(yyvsp[0]); } | |
3432 | + break; | |
3433 | + | |
3434 | + case 107: | |
3435 | +#line 884 "bac.y" | |
3436 | + { | |
3437 | process_breaks(); | |
3438 | /* continue loc is passed back on the value stack */ | |
3439 | process_continues(yyvsp[0]); | |
3440 | leave_break_block(&break_level,&curr_break,&curr_cont); | |
3441 | } | |
3442 | break; | |
3443 | -case 118: | |
3444 | -#line 900 "bac.y" | |
3445 | -{ | |
3446 | + | |
3447 | + case 119: | |
3448 | +#line 906 "bac.y" | |
3449 | + { | |
3450 | yyval = new_expr(); | |
3451 | expr[yyval].obj = function; | |
3452 | expr[yyval].typ = ints; | |
3453 | @@ -2299,13 +2579,15 @@ | |
3454 | free_expr(yyvsp[-4]); free_expr(yyvsp[-2]); | |
3455 | } | |
3456 | break; | |
3457 | -case 119: | |
3458 | -#line 927 "bac.y" | |
3459 | -{ yyval = yyvsp[0]; } | |
3460 | + | |
3461 | + case 120: | |
3462 | +#line 933 "bac.y" | |
3463 | + { yyval = yyvsp[0]; } | |
3464 | break; | |
3465 | -case 120: | |
3466 | -#line 929 "bac.y" | |
3467 | -{ | |
3468 | + | |
3469 | + case 121: | |
3470 | +#line 935 "bac.y" | |
3471 | + { | |
3472 | if (expr[yyvsp[0]].typ == strings) { | |
3473 | /* left parm is a string. If it's not an array elt, */ | |
3474 | /* put the address of the string n the stack */ | |
3475 | @@ -2317,9 +2599,10 @@ | |
3476 | yyval = yyvsp[0]; | |
3477 | } | |
3478 | break; | |
3479 | -case 121: | |
3480 | -#line 944 "bac.y" | |
3481 | -{ | |
3482 | + | |
3483 | + case 122: | |
3484 | +#line 950 "bac.y" | |
3485 | + { | |
3486 | if (expr[yyvsp[0]].typ == rawstrings) /* raw str message */ | |
3487 | emit1(BROADCAST_RAWSTRING,expr[yyvsp[0]].adr); | |
3488 | else if (expr[yyvsp[0]].typ == strings) /* msg is a string var */ | |
3489 | @@ -2331,17 +2614,19 @@ | |
3490 | free_expr(yyvsp[0]); | |
3491 | } | |
3492 | break; | |
3493 | -case 122: | |
3494 | -#line 958 "bac.y" | |
3495 | -{ | |
3496 | + | |
3497 | + case 123: | |
3498 | +#line 964 "bac.y" | |
3499 | + { | |
3500 | /* push the parm count for interp's SPRINTF_OP to use */ | |
3501 | emit1(PUSH_LIT,varargs_cnt); | |
3502 | emit1(SPRINTF_OP,yyvsp[-3]); | |
3503 | } | |
3504 | break; | |
3505 | -case 123: | |
3506 | -#line 966 "bac.y" | |
3507 | -{ | |
3508 | + | |
3509 | + case 124: | |
3510 | +#line 972 "bac.y" | |
3511 | + { | |
3512 | if (expr[yyvsp[-2]].typ != strings) | |
3513 | yyerror("Leftmost sprintf parameter must be of type 'string'"); | |
3514 | yyval = expr[yyvsp[0]].adr; /* pass raw string index up the tree */ | |
3515 | @@ -2350,9 +2635,10 @@ | |
3516 | varargs_cnt = 0; | |
3517 | } | |
3518 | break; | |
3519 | -case 124: | |
3520 | -#line 977 "bac.y" | |
3521 | -{ | |
3522 | + | |
3523 | + case 125: | |
3524 | +#line 983 "bac.y" | |
3525 | + { | |
3526 | if ((expr[yyvsp[0]].typ != ints)&&(expr[yyvsp[0]].typ != strings)) | |
3527 | yyerror( | |
3528 | "sprintf parameter must be either of type 'int' or type 'string'"); | |
3529 | @@ -2364,9 +2650,10 @@ | |
3530 | free_expr(yyvsp[0]); | |
3531 | } | |
3532 | break; | |
3533 | -case 125: | |
3534 | -#line 989 "bac.y" | |
3535 | -{ | |
3536 | + | |
3537 | + case 126: | |
3538 | +#line 995 "bac.y" | |
3539 | + { | |
3540 | if ((expr[yyvsp[0]].typ != ints)&&(expr[yyvsp[0]].typ != strings)) | |
3541 | yyerror( | |
3542 | "sprintf parameter must be either of type 'int' or type 'string'"); | |
3543 | @@ -2378,17 +2665,20 @@ | |
3544 | free_expr(yyvsp[0]); | |
3545 | } | |
3546 | break; | |
3547 | -case 126: | |
3548 | -#line 1003 "bac.y" | |
3549 | -{ code[yyvsp[-1]].y = yyvsp[0]; } | |
3550 | - break; | |
3551 | -case 127: | |
3552 | -#line 1005 "bac.y" | |
3553 | -{ code[yyvsp[-3]].y = yyvsp[-1]; code[yyvsp[-2]].y = lc; } | |
3554 | - break; | |
3555 | -case 128: | |
3556 | -#line 1007 "bac.y" | |
3557 | -{ int i; | |
3558 | + | |
3559 | + case 127: | |
3560 | +#line 1009 "bac.y" | |
3561 | + { code[yyvsp[-1]].y = yyvsp[0]; } | |
3562 | + break; | |
3563 | + | |
3564 | + case 128: | |
3565 | +#line 1011 "bac.y" | |
3566 | + { code[yyvsp[-3]].y = yyvsp[-1]; code[yyvsp[-2]].y = lc; } | |
3567 | + break; | |
3568 | + | |
3569 | + case 129: | |
3570 | +#line 1013 "bac.y" | |
3571 | + { int i; | |
3572 | /* switch_level is incremented in switch_hdr rule */ | |
3573 | /* grammar also forces at least one case in every switch */ | |
3574 | i = case_loc[curr_case]; | |
3575 | @@ -2398,27 +2688,31 @@ | |
3576 | /* the current case of the enclosing switch block is one */ | |
3577 | /* less than the first case of this block */ | |
3578 | curr_case = switch_block[switch_level].first_case - 1; | |
3579 | + free_expr(switch_block[switch_level].expr_index); | |
3580 | switch_level--; | |
3581 | process_breaks(); | |
3582 | leave_break_block(&break_level,&curr_break,&curr_cont); | |
3583 | - free_expr(yyvsp[-4]); | |
3584 | } | |
3585 | break; | |
3586 | -case 129: | |
3587 | -#line 1025 "bac.y" | |
3588 | -{ gen_exprval(yyvsp[-1]); yyval = lc; emit(JZER); free_expr(yyvsp[-1]); } | |
3589 | + | |
3590 | + case 130: | |
3591 | +#line 1031 "bac.y" | |
3592 | + { gen_exprval(yyvsp[-1]); yyval = lc; emit(JZER); free_expr(yyvsp[-1]); } | |
3593 | break; | |
3594 | -case 130: | |
3595 | -#line 1029 "bac.y" | |
3596 | -{ yyval = lc; } | |
3597 | + | |
3598 | + case 131: | |
3599 | +#line 1035 "bac.y" | |
3600 | + { yyval = lc; } | |
3601 | break; | |
3602 | -case 131: | |
3603 | -#line 1033 "bac.y" | |
3604 | -{ emit(JUMP); yyval = lc; } | |
3605 | + | |
3606 | + case 132: | |
3607 | +#line 1039 "bac.y" | |
3608 | + { emit(JUMP); yyval = lc; } | |
3609 | break; | |
3610 | -case 132: | |
3611 | -#line 1037 "bac.y" | |
3612 | -{ | |
3613 | + | |
3614 | + case 133: | |
3615 | +#line 1043 "bac.y" | |
3616 | + { | |
3617 | enter_break_block(&break_level,switch_blk); | |
3618 | if (++curr_case == MAXCASELOC) | |
3619 | cfatal( | |
3620 | @@ -2430,17 +2724,20 @@ | |
3621 | switch_block[switch_level].expr_index = yyvsp[-1]; | |
3622 | } | |
3623 | break; | |
3624 | -case 136: | |
3625 | -#line 1058 "bac.y" | |
3626 | -{ first_case_hdr = curr_case; case_hdr_cnt = 1; } | |
3627 | - break; | |
3628 | -case 137: | |
3629 | -#line 1060 "bac.y" | |
3630 | -{ case_hdr_cnt++; } | |
3631 | - break; | |
3632 | -case 138: | |
3633 | + | |
3634 | + case 137: | |
3635 | #line 1064 "bac.y" | |
3636 | -{ int i; | |
3637 | + { first_case_hdr = curr_case; case_hdr_cnt = 1; } | |
3638 | + break; | |
3639 | + | |
3640 | + case 138: | |
3641 | +#line 1066 "bac.y" | |
3642 | + { case_hdr_cnt++; } | |
3643 | + break; | |
3644 | + | |
3645 | + case 139: | |
3646 | +#line 1070 "bac.y" | |
3647 | + { int i; | |
3648 | i = switch_block[switch_level].expr_index; | |
3649 | if ((expr[i].typ != expr[yyvsp[-1]].typ)&&(expr[yyvsp[-1]].typ != notyp)) | |
3650 | yyerror | |
3651 | @@ -2458,18 +2755,20 @@ | |
3652 | } | |
3653 | } | |
3654 | break; | |
3655 | -case 139: | |
3656 | -#line 1084 "bac.y" | |
3657 | -{ int j; | |
3658 | + | |
3659 | + case 140: | |
3660 | +#line 1090 "bac.y" | |
3661 | + { int j; | |
3662 | j = switch_block[switch_level].first_case; | |
3663 | if (case_hdr_cnt > 0) emit(JUMP); /* for multiple case labels */ | |
3664 | if (curr_case > j) | |
3665 | code[case_loc[curr_case]].y = lc; /* prev JZER target */ | |
3666 | } | |
3667 | break; | |
3668 | -case 140: | |
3669 | -#line 1093 "bac.y" | |
3670 | -{ int i, j, k; | |
3671 | + | |
3672 | + case 141: | |
3673 | +#line 1099 "bac.y" | |
3674 | + { int i, j, k; | |
3675 | for (i = 1, j = first_case_hdr; i < case_hdr_cnt; i++, j++ ) { | |
3676 | k = case_loc[j]; | |
3677 | code[k+1].y = lc; /* k+1 == address of JMP to stmt_list */ | |
3678 | @@ -2478,36 +2777,42 @@ | |
3679 | first_case_hdr = -1; | |
3680 | } | |
3681 | break; | |
3682 | -case 141: | |
3683 | -#line 1104 "bac.y" | |
3684 | -{ yyval = lc; } | |
3685 | - break; | |
3686 | -case 143: | |
3687 | -#line 1109 "bac.y" | |
3688 | -{ yyval = lc; } | |
3689 | - break; | |
3690 | -case 144: | |
3691 | -#line 1113 "bac.y" | |
3692 | -{ if (level == 1) emit(COEND); in_cobegin = 0; } | |
3693 | + | |
3694 | + case 142: | |
3695 | +#line 1110 "bac.y" | |
3696 | + { yyval = lc; } | |
3697 | break; | |
3698 | -case 145: | |
3699 | -#line 1117 "bac.y" | |
3700 | -{ | |
3701 | + | |
3702 | + case 144: | |
3703 | +#line 1115 "bac.y" | |
3704 | + { yyval = lc; } | |
3705 | + break; | |
3706 | + | |
3707 | + case 145: | |
3708 | +#line 1119 "bac.y" | |
3709 | + { if (level == 1) emit(COEND); in_cobegin = 0; } | |
3710 | + break; | |
3711 | + | |
3712 | + case 146: | |
3713 | +#line 1123 "bac.y" | |
3714 | + { | |
3715 | yyval = yyvsp[-2]; /* continue target */ | |
3716 | emit1(JUMP,yyvsp[-2]); | |
3717 | code[yyvsp[-1]].y = lc; | |
3718 | } | |
3719 | break; | |
3720 | -case 146: | |
3721 | -#line 1123 "bac.y" | |
3722 | -{ | |
3723 | + | |
3724 | + case 147: | |
3725 | +#line 1129 "bac.y" | |
3726 | + { | |
3727 | yyval = yyvsp[-2]; /* continue target */ | |
3728 | code[yyvsp[-1]].y = yyvsp[-4]; /* point JUMP to top of DO */ | |
3729 | } | |
3730 | break; | |
3731 | -case 147: | |
3732 | -#line 1128 "bac.y" | |
3733 | -{ int i; | |
3734 | + | |
3735 | + case 148: | |
3736 | +#line 1134 "bac.y" | |
3737 | + { int i; | |
3738 | if (yyvsp[-2]) { /* iteration code was generated */ | |
3739 | yyval = for_info[curr_for].iter_loc; /* continue target */ | |
3740 | /* jump back to iteration code after stmt */ | |
3741 | @@ -2532,39 +2837,45 @@ | |
3742 | curr_for--; | |
3743 | } | |
3744 | break; | |
3745 | -case 148: | |
3746 | -#line 1155 "bac.y" | |
3747 | -{ | |
3748 | + | |
3749 | + case 149: | |
3750 | +#line 1161 "bac.y" | |
3751 | + { | |
3752 | yyval = lc; /* continue target */ | |
3753 | enter_break_block(&break_level,loop_blk); | |
3754 | } | |
3755 | break; | |
3756 | -case 149: | |
3757 | -#line 1162 "bac.y" | |
3758 | -{ | |
3759 | + | |
3760 | + case 150: | |
3761 | +#line 1168 "bac.y" | |
3762 | + { | |
3763 | gen_exprval(yyvsp[-1]); | |
3764 | free_expr(yyvsp[-1]); | |
3765 | yyval = lc; | |
3766 | emit(JZER); | |
3767 | } | |
3768 | break; | |
3769 | -case 150: | |
3770 | -#line 1171 "bac.y" | |
3771 | -{ | |
3772 | + | |
3773 | + case 151: | |
3774 | +#line 1177 "bac.y" | |
3775 | + { | |
3776 | enter_break_block(&break_level,loop_blk); | |
3777 | } | |
3778 | break; | |
3779 | -case 151: | |
3780 | -#line 1177 "bac.y" | |
3781 | -{ yyval = lc; /* location of stmt code */ } | |
3782 | + | |
3783 | + case 152: | |
3784 | +#line 1183 "bac.y" | |
3785 | + { yyval = lc; /* location of stmt code */ } | |
3786 | break; | |
3787 | -case 152: | |
3788 | -#line 1181 "bac.y" | |
3789 | -{ yyval = lc; /* continue target */ } | |
3790 | + | |
3791 | + case 153: | |
3792 | +#line 1187 "bac.y" | |
3793 | + { yyval = lc; /* continue target */ } | |
3794 | break; | |
3795 | -case 153: | |
3796 | -#line 1185 "bac.y" | |
3797 | -{ | |
3798 | + | |
3799 | + case 154: | |
3800 | +#line 1191 "bac.y" | |
3801 | + { | |
3802 | gen_exprval(yyvsp[-1]); | |
3803 | free_expr(yyvsp[-1]); | |
3804 | emit1(JZER,lc+2); | |
3805 | @@ -2572,15 +2883,17 @@ | |
3806 | emit(JUMP); | |
3807 | } | |
3808 | break; | |
3809 | -case 154: | |
3810 | -#line 1195 "bac.y" | |
3811 | -{ /* init stuff done, continuation testing code is next */ | |
3812 | + | |
3813 | + case 155: | |
3814 | +#line 1201 "bac.y" | |
3815 | + { /* init stuff done, continuation testing code is next */ | |
3816 | for_info[curr_for].cont_loc = lc; /* continuation test code */ | |
3817 | } | |
3818 | break; | |
3819 | -case 155: | |
3820 | -#line 1201 "bac.y" | |
3821 | -{ | |
3822 | + | |
3823 | + case 156: | |
3824 | +#line 1207 "bac.y" | |
3825 | + { | |
3826 | enter_break_block(&break_level,loop_blk); | |
3827 | if (++curr_for == MAXFORNEST) | |
3828 | cfatal("No more than %d 'for' statements can be nested", | |
3829 | @@ -2591,13 +2904,15 @@ | |
3830 | } | |
3831 | } | |
3832 | break; | |
3833 | -case 156: | |
3834 | -#line 1214 "bac.y" | |
3835 | -{ yyval = 0; /* no continuation code */ } | |
3836 | + | |
3837 | + case 157: | |
3838 | +#line 1220 "bac.y" | |
3839 | + { yyval = 0; /* no continuation code */ } | |
3840 | break; | |
3841 | -case 157: | |
3842 | -#line 1216 "bac.y" | |
3843 | -{ | |
3844 | + | |
3845 | + case 158: | |
3846 | +#line 1222 "bac.y" | |
3847 | + { | |
3848 | yyval = 1; /* continuation code */ | |
3849 | gen_exprval(yyvsp[0]); /* expr might not have been generated yet */ | |
3850 | free_expr(yyvsp[0]); | |
3851 | @@ -2605,32 +2920,36 @@ | |
3852 | emit(JZER); | |
3853 | } | |
3854 | break; | |
3855 | -case 158: | |
3856 | -#line 1226 "bac.y" | |
3857 | -{ | |
3858 | + | |
3859 | + case 159: | |
3860 | +#line 1232 "bac.y" | |
3861 | + { | |
3862 | emit(JUMP); /* to stmt code, backpatched later */ | |
3863 | for_info[curr_for].iter_loc = lc; /* loc of iteration code */ | |
3864 | } | |
3865 | break; | |
3866 | -case 159: | |
3867 | -#line 1233 "bac.y" | |
3868 | -{ | |
3869 | + | |
3870 | + case 160: | |
3871 | +#line 1239 "bac.y" | |
3872 | + { | |
3873 | yyval = 0; /* no iteration code */ | |
3874 | for_info[curr_for].stmt_loc = lc; /* loc of stmt code */ | |
3875 | } | |
3876 | break; | |
3877 | -case 160: | |
3878 | -#line 1238 "bac.y" | |
3879 | -{ | |
3880 | + | |
3881 | + case 161: | |
3882 | +#line 1244 "bac.y" | |
3883 | + { | |
3884 | yyval = 1; /* iteration code */ | |
3885 | if (for_info[curr_for].cont_jzer >= 0) /* there was cont code */ | |
3886 | emit(JUMP); /* to continuation code, backpatched */ | |
3887 | for_info[curr_for].stmt_loc = lc; /* loc of stmt code */ | |
3888 | } | |
3889 | break; | |
3890 | -case 161: | |
3891 | -#line 1247 "bac.y" | |
3892 | -{ | |
3893 | + | |
3894 | + case 162: | |
3895 | +#line 1253 "bac.y" | |
3896 | + { | |
3897 | if (level != 1) | |
3898 | yyerror("'cobegin' block allowed only in 'main'"); | |
3899 | else if (in_cobegin) | |
3900 | @@ -2640,9 +2959,10 @@ | |
3901 | in_cobegin = 1; | |
3902 | } | |
3903 | break; | |
3904 | -case 162: | |
3905 | -#line 1259 "bac.y" | |
3906 | -{ | |
3907 | + | |
3908 | + case 163: | |
3909 | +#line 1265 "bac.y" | |
3910 | + { | |
3911 | if ((break_level < 0)|| | |
3912 | (break_block[break_level].bb_type != loop_blk)) | |
3913 | yyerror("'continue' is inappropriate outside a loop"); | |
3914 | @@ -2660,9 +2980,10 @@ | |
3915 | } | |
3916 | } | |
3917 | break; | |
3918 | -case 163: | |
3919 | -#line 1279 "bac.y" | |
3920 | -{ | |
3921 | + | |
3922 | + case 164: | |
3923 | +#line 1285 "bac.y" | |
3924 | + { | |
3925 | if (break_level < 0) | |
3926 | yyerror("'break' is inappropriate outside a 'loop' or 'switch' statement"); | |
3927 | else { | |
3928 | @@ -2679,40 +3000,51 @@ | |
3929 | } | |
3930 | } | |
3931 | break; | |
3932 | -case 164: | |
3933 | -#line 1298 "bac.y" | |
3934 | -{ | |
3935 | + | |
3936 | + case 165: | |
3937 | +#line 1304 "bac.y" | |
3938 | + { | |
3939 | if (void_function) { | |
3940 | - if (yyvsp[-1] < 0) | |
3941 | - emit(EXIT_PROC); | |
3942 | + if (yyvsp[-1] < 0) { | |
3943 | + if (++curr_ret == MAXRETURN) | |
3944 | + cfatal( | |
3945 | + "No more thn %d 'return' statements can appear in a function",MAXRETURN); | |
3946 | + else | |
3947 | + return_loc[curr_ret] = lc; /* mark the JUMP loc */ | |
3948 | + emit(JUMP); | |
3949 | + } | |
3950 | else | |
3951 | yyerror("Cannot return a value from a 'void' function"); | |
3952 | } | |
3953 | - if (yyvsp[-1] >= 0) | |
3954 | - gen_exprval(yyvsp[-1]); | |
3955 | - else /* no expression to push */ | |
3956 | - emit1(PUSH_LIT,0); | |
3957 | - emit(STORE); | |
3958 | - if (++curr_ret == MAXRETURN) | |
3959 | - cfatal( | |
3960 | + else { // non void function | |
3961 | + if (yyvsp[-1] >= 0) | |
3962 | + gen_exprval(yyvsp[-1]); | |
3963 | + else /* no expression to push */ | |
3964 | + emit1(PUSH_LIT,0); | |
3965 | + emit(STORE); | |
3966 | + if (++curr_ret == MAXRETURN) | |
3967 | + cfatal( | |
3968 | "No more thn %d 'return' statements can appear in a function",MAXRETURN); | |
3969 | - else | |
3970 | - return_loc[curr_ret] = lc; /* mark the JUMP loc */ | |
3971 | - emit(JUMP); /* jump to fcn exit*/ | |
3972 | + else | |
3973 | + return_loc[curr_ret] = lc; /* mark the JUMP loc */ | |
3974 | + emit(JUMP); /* jump to fcn exit*/ | |
3975 | + } | |
3976 | } | |
3977 | break; | |
3978 | -case 165: | |
3979 | -#line 1320 "bac.y" | |
3980 | -{ | |
3981 | + | |
3982 | + case 166: | |
3983 | +#line 1334 "bac.y" | |
3984 | + { | |
3985 | if (!in_func_decl) | |
3986 | yyerror("'return' is inappropriate outside a function"); | |
3987 | else if (!void_function) | |
3988 | - emit2(LOAD_ADDR,tab[func_tab].lev+1,0); | |
3989 | + emit2(LOAD_ADDR,tab[prt].lev+1,0); | |
3990 | } | |
3991 | break; | |
3992 | -case 169: | |
3993 | -#line 1336 "bac.y" | |
3994 | -{ | |
3995 | + | |
3996 | + case 170: | |
3997 | +#line 1350 "bac.y" | |
3998 | + { | |
3999 | if (expr[yyvsp[0]].typ == arrays) /* presently our only struct type */ | |
4000 | yyerror("Cannot output an array"); | |
4001 | else if(expr[yyvsp[0]].typ == strings) { | |
4002 | @@ -2728,20 +3060,23 @@ | |
4003 | free_expr(yyvsp[0]); | |
4004 | } | |
4005 | break; | |
4006 | -case 170: | |
4007 | -#line 1352 "bac.y" | |
4008 | -{ emit(WRITELN); } | |
4009 | - break; | |
4010 | -case 171: | |
4011 | -#line 1354 "bac.y" | |
4012 | -{ | |
4013 | + | |
4014 | + case 171: | |
4015 | +#line 1366 "bac.y" | |
4016 | + { emit(WRITELN); } | |
4017 | + break; | |
4018 | + | |
4019 | + case 172: | |
4020 | +#line 1368 "bac.y" | |
4021 | + { | |
4022 | int tmp = store_string(laststring,&stab_size); | |
4023 | emit1(WRITE_RAWSTRING,tmp); | |
4024 | } | |
4025 | break; | |
4026 | -case 172: | |
4027 | -#line 1361 "bac.y" | |
4028 | -{ | |
4029 | + | |
4030 | + case 173: | |
4031 | +#line 1375 "bac.y" | |
4032 | + { | |
4033 | if ((expr[yyvsp[-1]].obj != variable)&& (expr[yyvsp[-1]].obj != ext_variable)) | |
4034 | yyerror("input item must be a 'variable'"); | |
4035 | else if ((expr[yyvsp[-1]].typ != ints)&&(expr[yyvsp[-1]].typ != chars)&& | |
4036 | @@ -2752,23 +3087,32 @@ | |
4037 | emit1(READ,expr[yyvsp[-1]].typ); | |
4038 | } else /* array element */ | |
4039 | emit1(READ,expr[yyvsp[-1]].typ); | |
4040 | + free_expr(yyvsp[-1]); | |
4041 | } | |
4042 | break; | |
4043 | -case 174: | |
4044 | -#line 1378 "bac.y" | |
4045 | -{ yyval = -1; } | |
4046 | - break; | |
4047 | -case 176: | |
4048 | -#line 1383 "bac.y" | |
4049 | -{ int i = expr[yyvsp[-1]].tix; | |
4050 | + | |
4051 | + case 175: | |
4052 | +#line 1393 "bac.y" | |
4053 | + { yyval = -1; } | |
4054 | + break; | |
4055 | + | |
4056 | + case 176: | |
4057 | +#line 1395 "bac.y" | |
4058 | + { free_expr(yyvsp[0]); } | |
4059 | + break; | |
4060 | + | |
4061 | + case 177: | |
4062 | +#line 1399 "bac.y" | |
4063 | + { int i = expr[yyvsp[-1]].tix; | |
4064 | if ((tab[i].obj == function) && (!expr[yyvsp[-1]].result_used)) | |
4065 | yyerror("A non-void function cannot be called as a void function"); | |
4066 | free_expr(yyvsp[-1]); | |
4067 | } | |
4068 | break; | |
4069 | -case 179: | |
4070 | -#line 1395 "bac.y" | |
4071 | -{ | |
4072 | + | |
4073 | + case 180: | |
4074 | +#line 1411 "bac.y" | |
4075 | + { | |
4076 | expr[yyvsp[0]].result_used = 1; | |
4077 | gen_exprval(yyvsp[0]); | |
4078 | if (tab[yyvsp[-1]].typ == expr[yyvsp[0]].typ) { | |
4079 | @@ -2786,19 +3130,21 @@ | |
4080 | else | |
4081 | yyerror("Type mismatch in assignment"); | |
4082 | yyval = yyvsp[0]; | |
4083 | + expr[yyval].tix = yyvsp[-1]; | |
4084 | assign_cnt--; | |
4085 | } | |
4086 | break; | |
4087 | -case 180: | |
4088 | -#line 1416 "bac.y" | |
4089 | -{ | |
4090 | + | |
4091 | + case 181: | |
4092 | +#line 1433 "bac.y" | |
4093 | + { | |
4094 | gen_exprval(yyvsp[0]); | |
4095 | if (expr[yyvsp[-1]].typ == expr[yyvsp[0]].typ) { | |
4096 | if ((expr[yyvsp[-1]].typ == sems)||(expr[yyvsp[-1]].typ == bsems)|| | |
4097 | (expr[yyvsp[-1]].typ == conds)) | |
4098 | yyerror("Cannot assign to 'semaphore' or 'condition'"); | |
4099 | else if (expr[yyvsp[-1]].typ == arrays) | |
4100 | - emit1(COPY_BLOCK,atab[tab[yyvsp[-1]].ref].size); | |
4101 | + emit1(COPY_BLOCK,atab[expr[yyvsp[-1]].ref].size); | |
4102 | else /* standard types */ | |
4103 | if (assign_cnt > 1) /* multiple assignments */ | |
4104 | emit(STORE_KEEP); | |
4105 | @@ -2807,32 +3153,33 @@ | |
4106 | } | |
4107 | else | |
4108 | yyerror("Type mismatch in assignment"); | |
4109 | + free_expr(yyvsp[0]); | |
4110 | expr[yyvsp[-1]].isval = 1; | |
4111 | yyval = yyvsp[-1]; | |
4112 | assign_cnt--; | |
4113 | } | |
4114 | break; | |
4115 | -case 181: | |
4116 | -#line 1439 "bac.y" | |
4117 | -{ | |
4118 | + | |
4119 | + case 182: | |
4120 | +#line 1457 "bac.y" | |
4121 | + { | |
4122 | assign_cnt++; | |
4123 | if ((tab[yyvsp[-1]].obj == variable)||(tab[yyvsp[-1]].obj == ext_variable)) { | |
4124 | - if ((tab[yyvsp[-1]].typ == sems)||(tab[yyvsp[-1]].typ == bsems)) | |
4125 | - yyerror("Must use `initialsem' to initialize a 'semaphore'"); | |
4126 | - else | |
4127 | emit_push_addr(tab[yyvsp[-1]]); | |
4128 | } | |
4129 | else | |
4130 | yyerror("'variable' identifier expected"); | |
4131 | } | |
4132 | break; | |
4133 | -case 182: | |
4134 | -#line 1453 "bac.y" | |
4135 | -{ assign_cnt++; } | |
4136 | + | |
4137 | + case 183: | |
4138 | +#line 1468 "bac.y" | |
4139 | + { assign_cnt++; } | |
4140 | break; | |
4141 | -case 184: | |
4142 | -#line 1458 "bac.y" | |
4143 | -{ | |
4144 | + | |
4145 | + case 185: | |
4146 | +#line 1473 "bac.y" | |
4147 | + { | |
4148 | if ((expr[yyvsp[-2]].typ == ints)&&(expr[yyvsp[0]].typ == ints)) { | |
4149 | gen_exprval(yyvsp[0]); | |
4150 | emit(DO_OR); | |
4151 | @@ -2844,13 +3191,15 @@ | |
4152 | free_expr(yyvsp[0]); | |
4153 | } | |
4154 | break; | |
4155 | -case 185: | |
4156 | -#line 1472 "bac.y" | |
4157 | -{ gen_exprval(yyvsp[0]); } | |
4158 | + | |
4159 | + case 186: | |
4160 | +#line 1487 "bac.y" | |
4161 | + { gen_exprval(yyvsp[0]); } | |
4162 | break; | |
4163 | -case 187: | |
4164 | -#line 1477 "bac.y" | |
4165 | -{ | |
4166 | + | |
4167 | + case 188: | |
4168 | +#line 1492 "bac.y" | |
4169 | + { | |
4170 | if ((expr[yyvsp[-2]].typ == ints)&&(expr[yyvsp[0]].typ == ints)) { | |
4171 | gen_exprval(yyvsp[0]); | |
4172 | emit(DO_AND); | |
4173 | @@ -2862,13 +3211,15 @@ | |
4174 | free_expr(yyvsp[0]); | |
4175 | } | |
4176 | break; | |
4177 | -case 188: | |
4178 | -#line 1491 "bac.y" | |
4179 | -{ gen_exprval(yyvsp[0]); } | |
4180 | + | |
4181 | + case 189: | |
4182 | +#line 1506 "bac.y" | |
4183 | + { gen_exprval(yyvsp[0]); } | |
4184 | break; | |
4185 | -case 190: | |
4186 | -#line 1496 "bac.y" | |
4187 | -{ | |
4188 | + | |
4189 | + case 191: | |
4190 | +#line 1511 "bac.y" | |
4191 | + { | |
4192 | gen_exprval(yyvsp[0]); | |
4193 | if (expr[yyvsp[-2]].typ == expr[yyvsp[0]].typ){ | |
4194 | if ((expr[yyvsp[-2]].typ == ints)||(expr[yyvsp[-2]].typ == chars)) | |
4195 | @@ -2883,37 +3234,45 @@ | |
4196 | free_expr(yyvsp[0]); | |
4197 | } | |
4198 | break; | |
4199 | -case 191: | |
4200 | -#line 1513 "bac.y" | |
4201 | -{ gen_exprval(yyvsp[0]); } | |
4202 | - break; | |
4203 | -case 192: | |
4204 | -#line 1516 "bac.y" | |
4205 | -{ yyval = TEST_EQ; } | |
4206 | - break; | |
4207 | -case 193: | |
4208 | -#line 1517 "bac.y" | |
4209 | -{ yyval = TEST_LT; } | |
4210 | - break; | |
4211 | -case 194: | |
4212 | -#line 1518 "bac.y" | |
4213 | -{ yyval = TEST_GT; } | |
4214 | - break; | |
4215 | -case 195: | |
4216 | -#line 1519 "bac.y" | |
4217 | -{ yyval = TEST_LE; } | |
4218 | - break; | |
4219 | -case 196: | |
4220 | -#line 1520 "bac.y" | |
4221 | -{ yyval = TEST_GE; } | |
4222 | - break; | |
4223 | -case 197: | |
4224 | -#line 1521 "bac.y" | |
4225 | -{ yyval = TEST_NE; } | |
4226 | + | |
4227 | + case 192: | |
4228 | +#line 1528 "bac.y" | |
4229 | + { gen_exprval(yyvsp[0]); } | |
4230 | break; | |
4231 | -case 199: | |
4232 | -#line 1526 "bac.y" | |
4233 | -{ | |
4234 | + | |
4235 | + case 193: | |
4236 | +#line 1531 "bac.y" | |
4237 | + { yyval = TEST_EQ; } | |
4238 | + break; | |
4239 | + | |
4240 | + case 194: | |
4241 | +#line 1532 "bac.y" | |
4242 | + { yyval = TEST_LT; } | |
4243 | + break; | |
4244 | + | |
4245 | + case 195: | |
4246 | +#line 1533 "bac.y" | |
4247 | + { yyval = TEST_GT; } | |
4248 | + break; | |
4249 | + | |
4250 | + case 196: | |
4251 | +#line 1534 "bac.y" | |
4252 | + { yyval = TEST_LE; } | |
4253 | + break; | |
4254 | + | |
4255 | + case 197: | |
4256 | +#line 1535 "bac.y" | |
4257 | + { yyval = TEST_GE; } | |
4258 | + break; | |
4259 | + | |
4260 | + case 198: | |
4261 | +#line 1536 "bac.y" | |
4262 | + { yyval = TEST_NE; } | |
4263 | + break; | |
4264 | + | |
4265 | + case 200: | |
4266 | +#line 1541 "bac.y" | |
4267 | + { | |
4268 | yyval = yyvsp[0]; | |
4269 | gen_exprval(yyval); | |
4270 | if ((expr[yyval].typ != ints)&&(expr[yyval].typ != notyp)){ | |
4271 | @@ -2922,9 +3281,10 @@ | |
4272 | } | |
4273 | } | |
4274 | break; | |
4275 | -case 200: | |
4276 | -#line 1535 "bac.y" | |
4277 | -{ | |
4278 | + | |
4279 | + case 201: | |
4280 | +#line 1550 "bac.y" | |
4281 | + { | |
4282 | yyval = yyvsp[0]; | |
4283 | gen_exprval(yyval); | |
4284 | if ((expr[yyval].typ != ints)&&(expr[yyval].typ != notyp)){ | |
4285 | @@ -2935,9 +3295,10 @@ | |
4286 | emit(NEGATE); | |
4287 | } | |
4288 | break; | |
4289 | -case 201: | |
4290 | -#line 1546 "bac.y" | |
4291 | -{ | |
4292 | + | |
4293 | + case 202: | |
4294 | +#line 1561 "bac.y" | |
4295 | + { | |
4296 | gen_exprval(yyvsp[0]); | |
4297 | switch (yyvsp[-1]) { | |
4298 | case DO_ADD: | |
4299 | @@ -2952,21 +3313,25 @@ | |
4300 | free_expr(yyvsp[0]); | |
4301 | } | |
4302 | break; | |
4303 | -case 202: | |
4304 | -#line 1563 "bac.y" | |
4305 | -{ gen_exprval(yyvsp[0]); } | |
4306 | - break; | |
4307 | -case 203: | |
4308 | -#line 1566 "bac.y" | |
4309 | -{ yyval = DO_ADD; } | |
4310 | - break; | |
4311 | -case 204: | |
4312 | -#line 1567 "bac.y" | |
4313 | -{ yyval = DO_SUB; } | |
4314 | + | |
4315 | + case 203: | |
4316 | +#line 1578 "bac.y" | |
4317 | + { gen_exprval(yyvsp[0]); } | |
4318 | break; | |
4319 | -case 206: | |
4320 | -#line 1572 "bac.y" | |
4321 | -{ | |
4322 | + | |
4323 | + case 204: | |
4324 | +#line 1581 "bac.y" | |
4325 | + { yyval = DO_ADD; } | |
4326 | + break; | |
4327 | + | |
4328 | + case 205: | |
4329 | +#line 1582 "bac.y" | |
4330 | + { yyval = DO_SUB; } | |
4331 | + break; | |
4332 | + | |
4333 | + case 207: | |
4334 | +#line 1587 "bac.y" | |
4335 | + { | |
4336 | gen_exprval(yyvsp[0]); | |
4337 | switch(yyvsp[-1]) { | |
4338 | case DO_MUL: | |
4339 | @@ -2985,25 +3350,30 @@ | |
4340 | free_expr(yyvsp[0]); | |
4341 | } | |
4342 | break; | |
4343 | -case 207: | |
4344 | -#line 1593 "bac.y" | |
4345 | -{ gen_exprval(yyvsp[0]); } | |
4346 | - break; | |
4347 | -case 208: | |
4348 | -#line 1596 "bac.y" | |
4349 | -{ yyval = DO_MUL; } | |
4350 | - break; | |
4351 | -case 209: | |
4352 | -#line 1597 "bac.y" | |
4353 | -{ yyval = DO_DIV; } | |
4354 | - break; | |
4355 | -case 210: | |
4356 | -#line 1598 "bac.y" | |
4357 | -{ yyval = DO_MOD; } | |
4358 | + | |
4359 | + case 208: | |
4360 | +#line 1608 "bac.y" | |
4361 | + { gen_exprval(yyvsp[0]); } | |
4362 | break; | |
4363 | -case 212: | |
4364 | -#line 1603 "bac.y" | |
4365 | -{ | |
4366 | + | |
4367 | + case 209: | |
4368 | +#line 1611 "bac.y" | |
4369 | + { yyval = DO_MUL; } | |
4370 | + break; | |
4371 | + | |
4372 | + case 210: | |
4373 | +#line 1612 "bac.y" | |
4374 | + { yyval = DO_DIV; } | |
4375 | + break; | |
4376 | + | |
4377 | + case 211: | |
4378 | +#line 1613 "bac.y" | |
4379 | + { yyval = DO_MOD; } | |
4380 | + break; | |
4381 | + | |
4382 | + case 213: | |
4383 | +#line 1618 "bac.y" | |
4384 | + { | |
4385 | yyval = new_expr(); | |
4386 | expr[yyval].obj = constant; | |
4387 | expr[yyval].adr = yyvsp[0]; | |
4388 | @@ -3011,9 +3381,10 @@ | |
4389 | expr[yyval].lev = level; | |
4390 | } | |
4391 | break; | |
4392 | -case 213: | |
4393 | -#line 1611 "bac.y" | |
4394 | -{ | |
4395 | + | |
4396 | + case 214: | |
4397 | +#line 1626 "bac.y" | |
4398 | + { | |
4399 | yyval = new_expr(); | |
4400 | expr[yyval].obj = constant; | |
4401 | expr[yyval].adr = laststring[0]; | |
4402 | @@ -3021,13 +3392,15 @@ | |
4403 | expr[yyval].lev = level; | |
4404 | } | |
4405 | break; | |
4406 | -case 214: | |
4407 | -#line 1619 "bac.y" | |
4408 | -{ yyval = yyvsp[-1];} | |
4409 | + | |
4410 | + case 215: | |
4411 | +#line 1634 "bac.y" | |
4412 | + { yyval = yyvsp[-1];} | |
4413 | break; | |
4414 | -case 215: | |
4415 | -#line 1621 "bac.y" | |
4416 | -{ | |
4417 | + | |
4418 | + case 216: | |
4419 | +#line 1636 "bac.y" | |
4420 | + { | |
4421 | yyval = yyvsp[0]; | |
4422 | gen_exprval(yyval); | |
4423 | if (expr[yyval].typ == ints) | |
4424 | @@ -3038,9 +3411,10 @@ | |
4425 | } | |
4426 | } | |
4427 | break; | |
4428 | -case 217: | |
4429 | -#line 1635 "bac.y" | |
4430 | -{ | |
4431 | + | |
4432 | + case 218: | |
4433 | +#line 1650 "bac.y" | |
4434 | + { | |
4435 | if ((expr[yyvsp[-1]].typ != ints)&&(expr[yyvsp[-1]].typ != chars)) | |
4436 | yyerror("'int' or 'char' expected"); | |
4437 | else { | |
4438 | @@ -3052,9 +3426,10 @@ | |
4439 | } | |
4440 | } | |
4441 | break; | |
4442 | -case 218: | |
4443 | -#line 1647 "bac.y" | |
4444 | -{ | |
4445 | + | |
4446 | + case 219: | |
4447 | +#line 1662 "bac.y" | |
4448 | + { | |
4449 | if ((expr[yyvsp[0]].typ != ints)&&(expr[yyvsp[0]].typ != chars)) | |
4450 | yyerror("'int' or 'char' expected"); | |
4451 | else { | |
4452 | @@ -3066,9 +3441,10 @@ | |
4453 | } | |
4454 | } | |
4455 | break; | |
4456 | -case 219: | |
4457 | -#line 1659 "bac.y" | |
4458 | -{ | |
4459 | + | |
4460 | + case 220: | |
4461 | +#line 1674 "bac.y" | |
4462 | + { | |
4463 | if ((expr[yyvsp[-1]].typ != ints)&&(expr[yyvsp[-1]].typ != chars)) | |
4464 | yyerror("'int' or 'char' expected"); | |
4465 | else { | |
4466 | @@ -3080,9 +3456,10 @@ | |
4467 | } | |
4468 | } | |
4469 | break; | |
4470 | -case 220: | |
4471 | -#line 1671 "bac.y" | |
4472 | -{ | |
4473 | + | |
4474 | + case 221: | |
4475 | +#line 1686 "bac.y" | |
4476 | + { | |
4477 | if ((expr[yyvsp[0]].typ != ints)&&(expr[yyvsp[0]].typ != chars)) | |
4478 | yyerror("'int' or 'char' expected"); | |
4479 | else { | |
4480 | @@ -3094,9 +3471,10 @@ | |
4481 | } | |
4482 | } | |
4483 | break; | |
4484 | -case 224: | |
4485 | -#line 1688 "bac.y" | |
4486 | -{ | |
4487 | + | |
4488 | + case 225: | |
4489 | +#line 1703 "bac.y" | |
4490 | + { | |
4491 | yyval = new_expr(); | |
4492 | expr[yyval].obj = tab[yyvsp[0]].obj; | |
4493 | expr[yyval].typ = tab[yyvsp[0]].typ; | |
4494 | @@ -3107,9 +3485,10 @@ | |
4495 | expr[yyval].tix = yyvsp[0]; | |
4496 | } | |
4497 | break; | |
4498 | -case 225: | |
4499 | -#line 1701 "bac.y" | |
4500 | -{ int k; | |
4501 | + | |
4502 | + case 226: | |
4503 | +#line 1716 "bac.y" | |
4504 | + { int k; | |
4505 | yyval = new_expr(); | |
4506 | expr[yyval].obj = tab[yyvsp[-1]].obj; | |
4507 | expr[yyval].typ = tab[yyvsp[-1]].typ; | |
4508 | @@ -3154,9 +3533,10 @@ | |
4509 | } | |
4510 | } | |
4511 | break; | |
4512 | -case 228: | |
4513 | -#line 1750 "bac.y" | |
4514 | -{ | |
4515 | + | |
4516 | + case 229: | |
4517 | +#line 1765 "bac.y" | |
4518 | + { | |
4519 | last_pf = yyvsp[0]; | |
4520 | if ((tab[yyvsp[0]].obj != function)&&(tab[yyvsp[0]].obj != procedure)&& | |
4521 | (tab[yyvsp[0]].obj != ext_function)&&(tab[yyvsp[0]].obj != ext_procedure)) | |
4522 | @@ -3167,7 +3547,7 @@ | |
4523 | else{ /* legal func call */ | |
4524 | pfstack[toppfs].tix = last_pf; | |
4525 | pfstack[toppfs].pct = parmct = 0; | |
4526 | - first_stringerr = first_parmcterr = 1; | |
4527 | + first_parmcterr = 1; | |
4528 | if (tab[yyvsp[0]].lev != -1){ /* regular proc call */ | |
4529 | if ((tab[yyvsp[0]].mon)&&(tab[prt].mon)&& | |
4530 | (tab[yyvsp[0]].mon != tab[prt].mon)) | |
4531 | @@ -3178,9 +3558,10 @@ | |
4532 | } /* if func */ | |
4533 | } | |
4534 | break; | |
4535 | -case 233: | |
4536 | -#line 1782 "bac.y" | |
4537 | -{ | |
4538 | + | |
4539 | + case 234: | |
4540 | +#line 1797 "bac.y" | |
4541 | + { | |
4542 | parmct = ++pfstack[toppfs].pct; | |
4543 | if (tab[last_pf].lev == -1) | |
4544 | stdproc_parm(last_pf,yyvsp[0],parmct); | |
4545 | @@ -3189,9 +3570,10 @@ | |
4546 | free_expr(yyvsp[0]); | |
4547 | } | |
4548 | break; | |
4549 | -case 239: | |
4550 | -#line 1800 "bac.y" | |
4551 | -{ | |
4552 | + | |
4553 | + case 240: | |
4554 | +#line 1815 "bac.y" | |
4555 | + { | |
4556 | if (expr[yyvsp[-1]].typ != strings) | |
4557 | yyerror("left parameter is not of type 'string'"); | |
4558 | yyval = NO_EXPR; /* for free_expr() call up the parse tree */ | |
4559 | @@ -3202,9 +3584,11 @@ | |
4560 | free_expr(yyvsp[-1]); free_expr(yyvsp[0]); | |
4561 | } | |
4562 | break; | |
4563 | -case 240: | |
4564 | -#line 1813 "bac.y" | |
4565 | -{ | |
4566 | + | |
4567 | + case 241: | |
4568 | +#line 1828 "bac.y" | |
4569 | + { | |
4570 | + yyval = yyvsp[-1]; | |
4571 | if (expr[yyvsp[-1]].typ != strings) { | |
4572 | yyerror("right parameter is not of type 'string'"); | |
4573 | last_eltyp = notyp; | |
4574 | @@ -3217,13 +3601,15 @@ | |
4575 | } | |
4576 | } | |
4577 | break; | |
4578 | -case 241: | |
4579 | -#line 1826 "bac.y" | |
4580 | -{ yyval = yyvsp[-1]; } | |
4581 | + | |
4582 | + case 242: | |
4583 | +#line 1842 "bac.y" | |
4584 | + { yyval = yyvsp[-1]; } | |
4585 | break; | |
4586 | -case 242: | |
4587 | -#line 1830 "bac.y" | |
4588 | -{ | |
4589 | + | |
4590 | + case 243: | |
4591 | +#line 1846 "bac.y" | |
4592 | + { | |
4593 | yyval = new_expr(); | |
4594 | expr[yyval].obj = variable; | |
4595 | expr[yyval].typ = rawstrings; | |
4596 | @@ -3233,9 +3619,10 @@ | |
4597 | expr[yyval].tix = -1; | |
4598 | } | |
4599 | break; | |
4600 | -case 243: | |
4601 | -#line 1842 "bac.y" | |
4602 | -{ | |
4603 | + | |
4604 | + case 244: | |
4605 | +#line 1858 "bac.y" | |
4606 | + { | |
4607 | if (expr[yyvsp[-1]].typ != strings) | |
4608 | yyerror("left parameter is not of type 'string'"); | |
4609 | yyval = NO_EXPR; /* for free_expr() call up the parse tree */ | |
4610 | @@ -3246,9 +3633,10 @@ | |
4611 | free_expr(yyvsp[-1]); free_expr(yyvsp[0]); | |
4612 | } | |
4613 | break; | |
4614 | -case 244: | |
4615 | -#line 1855 "bac.y" | |
4616 | -{ | |
4617 | + | |
4618 | + case 245: | |
4619 | +#line 1871 "bac.y" | |
4620 | + { | |
4621 | if (expr[yyvsp[-1]].typ != strings) | |
4622 | yyerror("left parameter is not of type 'string'"); | |
4623 | yyval = new_expr(); | |
4624 | @@ -3265,9 +3653,10 @@ | |
4625 | free_expr(yyvsp[0]); | |
4626 | } | |
4627 | break; | |
4628 | -case 245: | |
4629 | -#line 1874 "bac.y" | |
4630 | -{ | |
4631 | + | |
4632 | + case 246: | |
4633 | +#line 1890 "bac.y" | |
4634 | + { | |
4635 | yyval = new_expr(); | |
4636 | expr[yyval].obj = function; | |
4637 | expr[yyval].typ = ints; | |
4638 | @@ -3284,9 +3673,10 @@ | |
4639 | free_expr(yyvsp[0]); | |
4640 | } | |
4641 | break; | |
4642 | -case 246: | |
4643 | -#line 1893 "bac.y" | |
4644 | -{ | |
4645 | + | |
4646 | + case 247: | |
4647 | +#line 1909 "bac.y" | |
4648 | + { | |
4649 | if (expr[yyvsp[-1]].typ == strings) { | |
4650 | if (!expr[yyvsp[-1]].arelt) | |
4651 | /* addr of array ref is already on the stack */ | |
4652 | @@ -3297,9 +3687,10 @@ | |
4653 | /* parent rule will free_expr($2) */ | |
4654 | } | |
4655 | break; | |
4656 | -case 247: | |
4657 | -#line 1904 "bac.y" | |
4658 | -{ | |
4659 | + | |
4660 | + case 248: | |
4661 | +#line 1920 "bac.y" | |
4662 | + { | |
4663 | yyval = new_expr(); | |
4664 | expr[yyval].obj = variable; | |
4665 | expr[yyval].typ = rawstrings; | |
4666 | @@ -3309,9 +3700,10 @@ | |
4667 | expr[yyval].tix = -1; | |
4668 | } | |
4669 | break; | |
4670 | -case 248: | |
4671 | -#line 1916 "bac.y" | |
4672 | -{ | |
4673 | + | |
4674 | + case 249: | |
4675 | +#line 1932 "bac.y" | |
4676 | + { | |
4677 | yyval = new_expr(); | |
4678 | expr[yyval].obj = function; | |
4679 | expr[yyval].typ = ints; | |
4680 | @@ -3324,9 +3716,10 @@ | |
4681 | emit1(SSCANF_OP,yyvsp[-3]); | |
4682 | } | |
4683 | break; | |
4684 | -case 249: | |
4685 | -#line 1931 "bac.y" | |
4686 | -{ | |
4687 | + | |
4688 | + case 250: | |
4689 | +#line 1947 "bac.y" | |
4690 | + { | |
4691 | if (expr[yyvsp[-2]].typ != strings) | |
4692 | yyerror("Leftmost sscanf parameter must be of type 'string'"); | |
4693 | yyval = expr[yyvsp[0]].adr; /* pass rawstring index up the tree */ | |
4694 | @@ -3335,9 +3728,10 @@ | |
4695 | varargs_cnt = 0; | |
4696 | } | |
4697 | break; | |
4698 | -case 250: | |
4699 | -#line 1942 "bac.y" | |
4700 | -{ | |
4701 | + | |
4702 | + case 251: | |
4703 | +#line 1958 "bac.y" | |
4704 | + { | |
4705 | if ((expr[yyvsp[0]].typ != ints)&&(expr[yyvsp[0]].typ != strings)) | |
4706 | yyerror( | |
4707 | "sscanf parameter must be either of type 'int' or type 'string'"); | |
4708 | @@ -3346,9 +3740,10 @@ | |
4709 | free_expr(yyvsp[0]); | |
4710 | } | |
4711 | break; | |
4712 | -case 251: | |
4713 | -#line 1951 "bac.y" | |
4714 | -{ | |
4715 | + | |
4716 | + case 252: | |
4717 | +#line 1967 "bac.y" | |
4718 | + { | |
4719 | if ((expr[yyvsp[0]].typ != ints)&&(expr[yyvsp[0]].typ != strings)) | |
4720 | yyerror( | |
4721 | "sscanf parameter must be either of type 'int' or type 'string'"); | |
4722 | @@ -3357,9 +3752,10 @@ | |
4723 | free_expr(yyvsp[0]); | |
4724 | } | |
4725 | break; | |
4726 | -case 252: | |
4727 | -#line 1962 "bac.y" | |
4728 | -{ | |
4729 | + | |
4730 | + case 253: | |
4731 | +#line 1978 "bac.y" | |
4732 | + { | |
4733 | if (expr[yyvsp[-1]].typ != strings) | |
4734 | yyerror("Left parameter must be of type 'string'"); | |
4735 | emit(RECEIVE_OP); | |
4736 | @@ -3373,9 +3769,10 @@ | |
4737 | expr[yyval].adr = expr[yyval].lev = -1; | |
4738 | } | |
4739 | break; | |
4740 | -case 253: | |
4741 | -#line 1976 "bac.y" | |
4742 | -{ | |
4743 | + | |
4744 | + case 254: | |
4745 | +#line 1992 "bac.y" | |
4746 | + { | |
4747 | if (expr[yyvsp[-3]].typ != strings) | |
4748 | yyerror("Left parameter must be of type 'string'"); | |
4749 | /* implements receive(string,int&) call */ | |
4750 | @@ -3398,9 +3795,10 @@ | |
4751 | expr[yyval].adr = expr[yyval].lev = -1; | |
4752 | } | |
4753 | break; | |
4754 | -case 254: | |
4755 | -#line 2001 "bac.y" | |
4756 | -{ | |
4757 | + | |
4758 | + case 255: | |
4759 | +#line 2017 "bac.y" | |
4760 | + { | |
4761 | expr[yyvsp[-1]].ref = sizeof(int)*atab[last_aref].elsize; | |
4762 | expr[yyvsp[-1]].arelt = 1; | |
4763 | expr[yyvsp[-1]].typ = last_eltyp; | |
4764 | @@ -3411,9 +3809,10 @@ | |
4765 | } | |
4766 | } | |
4767 | break; | |
4768 | -case 255: | |
4769 | -#line 2014 "bac.y" | |
4770 | -{ | |
4771 | + | |
4772 | + case 256: | |
4773 | +#line 2030 "bac.y" | |
4774 | + { | |
4775 | if (tab[yyvsp[0]].typ != arrays) { | |
4776 | sprintf(pbuf,"'%s' is not of type 'array'",tab[yyvsp[0]].name); | |
4777 | yyerror(pbuf); | |
4778 | @@ -3441,9 +3840,10 @@ | |
4779 | expr[yyval].normal = tab[yyvsp[0]].normal; | |
4780 | } | |
4781 | break; | |
4782 | -case 256: | |
4783 | -#line 2044 "bac.y" | |
4784 | -{ | |
4785 | + | |
4786 | + case 257: | |
4787 | +#line 2060 "bac.y" | |
4788 | + { | |
4789 | gen_exprval(yyvsp[-1]); | |
4790 | last_aref = arstack[topars].aref; | |
4791 | last_eltyp = arstack[topars].eltyp; | |
4792 | @@ -3453,9 +3853,10 @@ | |
4793 | free_expr(yyvsp[-1]); | |
4794 | } | |
4795 | break; | |
4796 | -case 257: | |
4797 | -#line 2054 "bac.y" | |
4798 | -{ | |
4799 | + | |
4800 | + case 258: | |
4801 | +#line 2070 "bac.y" | |
4802 | + { | |
4803 | gen_exprval(yyvsp[-1]); | |
4804 | last_aref = arstack[topars].aref; | |
4805 | last_eltyp = arstack[topars].eltyp; | |
4806 | @@ -3465,47 +3866,39 @@ | |
4807 | free_expr(yyvsp[-1]); | |
4808 | } | |
4809 | break; | |
4810 | -case 258: | |
4811 | -#line 2066 "bac.y" | |
4812 | -{ | |
4813 | + | |
4814 | + case 259: | |
4815 | +#line 2082 "bac.y" | |
4816 | + { | |
4817 | expr[yyvsp[-1]].typ = ints; | |
4818 | yyval = yyvsp[-1]; | |
4819 | } | |
4820 | break; | |
4821 | -case 259: | |
4822 | -#line 2073 "bac.y" | |
4823 | -{ yyval = loc(lastident(),level); } | |
4824 | - break; | |
4825 | -case 260: | |
4826 | -#line 2077 "bac.y" | |
4827 | -{ yyval = enter(lastident(),constant,level,level); } | |
4828 | + | |
4829 | + case 260: | |
4830 | +#line 2089 "bac.y" | |
4831 | + { yyval = loc(lastident(),level); } | |
4832 | break; | |
4833 | -} | |
4834 | ||
4835 | -#line 705 "/usr/share/bison/bison.simple" | |
4836 | + case 261: | |
4837 | +#line 2093 "bac.y" | |
4838 | + { yyval = enter(lastident(),constant,level,level); } | |
4839 | + break; | |
4840 | + | |
4841 | + | |
4842 | + } | |
4843 | ||
4844 | +/* Line 991 of yacc.c. */ | |
4845 | +#line 3892 "y.tab.c" | |
4846 | \f | |
4847 | yyvsp -= yylen; | |
4848 | yyssp -= yylen; | |
4849 | -#if YYLSP_NEEDED | |
4850 | - yylsp -= yylen; | |
4851 | -#endif | |
4852 | ||
4853 | -#if YYDEBUG | |
4854 | - if (yydebug) | |
4855 | - { | |
4856 | - short *yyssp1 = yyss - 1; | |
4857 | - YYFPRINTF (stderr, "state stack now"); | |
4858 | - while (yyssp1 != yyssp) | |
4859 | - YYFPRINTF (stderr, " %d", *++yyssp1); | |
4860 | - YYFPRINTF (stderr, "\n"); | |
4861 | - } | |
4862 | -#endif | |
4863 | + | |
4864 | + YY_STACK_PRINT (yyss, yyssp); | |
4865 | ||
4866 | *++yyvsp = yyval; | |
4867 | -#if YYLSP_NEEDED | |
4868 | - *++yylsp = yyloc; | |
4869 | -#endif | |
4870 | + | |
4871 | ||
4872 | /* Now `shift' the result of the reduction. Determine what state | |
4873 | that goes to, based on the state we popped back to and the rule | |
4874 | @@ -3513,11 +3906,11 @@ | |
4875 | ||
4876 | yyn = yyr1[yyn]; | |
4877 | ||
4878 | - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; | |
4879 | - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) | |
4880 | + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; | |
4881 | + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) | |
4882 | yystate = yytable[yystate]; | |
4883 | else | |
4884 | - yystate = yydefgoto[yyn - YYNTBASE]; | |
4885 | + yystate = yydefgoto[yyn - YYNTOKENS]; | |
4886 | ||
4887 | goto yynewstate; | |
4888 | ||
4889 | @@ -3530,13 +3923,13 @@ | |
4890 | if (!yyerrstatus) | |
4891 | { | |
4892 | ++yynerrs; | |
4893 | - | |
4894 | -#ifdef YYERROR_VERBOSE | |
4895 | +#if YYERROR_VERBOSE | |
4896 | yyn = yypact[yystate]; | |
4897 | ||
4898 | - if (yyn > YYFLAG && yyn < YYLAST) | |
4899 | + if (YYPACT_NINF < yyn && yyn < YYLAST) | |
4900 | { | |
4901 | YYSIZE_T yysize = 0; | |
4902 | + int yytype = YYTRANSLATE (yychar); | |
4903 | char *yymsg; | |
4904 | int yyx, yycount; | |
4905 | ||
4906 | @@ -3545,15 +3938,15 @@ | |
4907 | YYCHECK. */ | |
4908 | for (yyx = yyn < 0 ? -yyn : 0; | |
4909 | yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) | |
4910 | - if (yycheck[yyx + yyn] == yyx) | |
4911 | + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) | |
4912 | yysize += yystrlen (yytname[yyx]) + 15, yycount++; | |
4913 | - yysize += yystrlen ("parse error, unexpected ") + 1; | |
4914 | - yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); | |
4915 | + yysize += yystrlen ("syntax error, unexpected ") + 1; | |
4916 | + yysize += yystrlen (yytname[yytype]); | |
4917 | yymsg = (char *) YYSTACK_ALLOC (yysize); | |
4918 | if (yymsg != 0) | |
4919 | { | |
4920 | - char *yyp = yystpcpy (yymsg, "parse error, unexpected "); | |
4921 | - yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); | |
4922 | + char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); | |
4923 | + yyp = yystpcpy (yyp, yytname[yytype]); | |
4924 | ||
4925 | if (yycount < 5) | |
4926 | { | |
4927 | @@ -3561,7 +3954,7 @@ | |
4928 | for (yyx = yyn < 0 ? -yyn : 0; | |
4929 | yyx < (int) (sizeof (yytname) / sizeof (char *)); | |
4930 | yyx++) | |
4931 | - if (yycheck[yyx + yyn] == yyx) | |
4932 | + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) | |
4933 | { | |
4934 | const char *yyq = ! yycount ? ", expecting " : " or "; | |
4935 | yyp = yystpcpy (yyp, yyq); | |
4936 | @@ -3573,102 +3966,93 @@ | |
4937 | YYSTACK_FREE (yymsg); | |
4938 | } | |
4939 | else | |
4940 | - yyerror ("parse error; also virtual memory exhausted"); | |
4941 | + yyerror ("syntax error; also virtual memory exhausted"); | |
4942 | } | |
4943 | else | |
4944 | -#endif /* defined (YYERROR_VERBOSE) */ | |
4945 | - yyerror ("parse error"); | |
4946 | +#endif /* YYERROR_VERBOSE */ | |
4947 | + yyerror ("syntax error"); | |
4948 | } | |
4949 | - goto yyerrlab1; | |
4950 | ||
4951 | ||
4952 | -/*--------------------------------------------------. | |
4953 | -| yyerrlab1 -- error raised explicitly by an action | | |
4954 | -`--------------------------------------------------*/ | |
4955 | -yyerrlab1: | |
4956 | + | |
4957 | if (yyerrstatus == 3) | |
4958 | { | |
4959 | /* If just tried and failed to reuse lookahead token after an | |
4960 | error, discard it. */ | |
4961 | ||
4962 | - /* return failure if at end of input */ | |
4963 | + /* Return failure if at end of input. */ | |
4964 | if (yychar == YYEOF) | |
4965 | - YYABORT; | |
4966 | - YYDPRINTF ((stderr, "Discarding token %d (%s).\n", | |
4967 | - yychar, yytname[yychar1])); | |
4968 | + { | |
4969 | + /* Pop the error token. */ | |
4970 | + YYPOPSTACK; | |
4971 | + /* Pop the rest of the stack. */ | |
4972 | + while (yyss < yyssp) | |
4973 | + { | |
4974 | + YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); | |
4975 | + yydestruct (yystos[*yyssp], yyvsp); | |
4976 | + YYPOPSTACK; | |
4977 | + } | |
4978 | + YYABORT; | |
4979 | + } | |
4980 | + | |
4981 | + YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); | |
4982 | + yydestruct (yytoken, &yylval); | |
4983 | yychar = YYEMPTY; | |
4984 | + | |
4985 | } | |
4986 | ||
4987 | /* Else will try to reuse lookahead token after shifting the error | |
4988 | token. */ | |
4989 | + goto yyerrlab2; | |
4990 | ||
4991 | - yyerrstatus = 3; /* Each real token shifted decrements this */ | |
4992 | ||
4993 | - goto yyerrhandle; | |
4994 | +/*----------------------------------------------------. | |
4995 | +| yyerrlab1 -- error raised explicitly by an action. | | |
4996 | +`----------------------------------------------------*/ | |
4997 | +yyerrlab1: | |
4998 | ||
4999 | + /* Suppress GCC warning that yyerrlab1 is unused when no action | |
5000 | + invokes YYERROR. */ | |
5001 | +#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) \ | |
5002 | + && !defined __cplusplus | |
5003 | + __attribute__ ((__unused__)) | |
5004 | +#endif | |
5005 | ||
5006 | -/*-------------------------------------------------------------------. | |
5007 | -| yyerrdefault -- current state does not do anything special for the | | |
5008 | -| error token. | | |
5009 | -`-------------------------------------------------------------------*/ | |
5010 | -yyerrdefault: | |
5011 | -#if 0 | |
5012 | - /* This is wrong; only states that explicitly want error tokens | |
5013 | - should shift them. */ | |
5014 | ||
5015 | - /* If its default is to accept any token, ok. Otherwise pop it. */ | |
5016 | - yyn = yydefact[yystate]; | |
5017 | - if (yyn) | |
5018 | - goto yydefault; | |
5019 | -#endif | |
5020 | + goto yyerrlab2; | |
5021 | ||
5022 | ||
5023 | /*---------------------------------------------------------------. | |
5024 | -| yyerrpop -- pop the current state because it cannot handle the | | |
5025 | -| error token | | |
5026 | +| yyerrlab2 -- pop states until the error token can be shifted. | | |
5027 | `---------------------------------------------------------------*/ | |
5028 | -yyerrpop: | |
5029 | - if (yyssp == yyss) | |
5030 | - YYABORT; | |
5031 | - yyvsp--; | |
5032 | - yystate = *--yyssp; | |
5033 | -#if YYLSP_NEEDED | |
5034 | - yylsp--; | |
5035 | -#endif | |
5036 | +yyerrlab2: | |
5037 | + yyerrstatus = 3; /* Each real token shifted decrements this. */ | |
5038 | ||
5039 | -#if YYDEBUG | |
5040 | - if (yydebug) | |
5041 | + for (;;) | |
5042 | { | |
5043 | - short *yyssp1 = yyss - 1; | |
5044 | - YYFPRINTF (stderr, "Error: state stack now"); | |
5045 | - while (yyssp1 != yyssp) | |
5046 | - YYFPRINTF (stderr, " %d", *++yyssp1); | |
5047 | - YYFPRINTF (stderr, "\n"); | |
5048 | - } | |
5049 | -#endif | |
5050 | + yyn = yypact[yystate]; | |
5051 | + if (yyn != YYPACT_NINF) | |
5052 | + { | |
5053 | + yyn += YYTERROR; | |
5054 | + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) | |
5055 | + { | |
5056 | + yyn = yytable[yyn]; | |
5057 | + if (0 < yyn) | |
5058 | + break; | |
5059 | + } | |
5060 | + } | |
5061 | ||
5062 | -/*--------------. | |
5063 | -| yyerrhandle. | | |
5064 | -`--------------*/ | |
5065 | -yyerrhandle: | |
5066 | - yyn = yypact[yystate]; | |
5067 | - if (yyn == YYFLAG) | |
5068 | - goto yyerrdefault; | |
5069 | + /* Pop the current state because it cannot handle the error token. */ | |
5070 | + if (yyssp == yyss) | |
5071 | + YYABORT; | |
5072 | ||
5073 | - yyn += YYTERROR; | |
5074 | - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) | |
5075 | - goto yyerrdefault; | |
5076 | + YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); | |
5077 | + yydestruct (yystos[yystate], yyvsp); | |
5078 | + yyvsp--; | |
5079 | + yystate = *--yyssp; | |
5080 | ||
5081 | - yyn = yytable[yyn]; | |
5082 | - if (yyn < 0) | |
5083 | - { | |
5084 | - if (yyn == YYFLAG) | |
5085 | - goto yyerrpop; | |
5086 | - yyn = -yyn; | |
5087 | - goto yyreduce; | |
5088 | + YY_STACK_PRINT (yyss, yyssp); | |
5089 | } | |
5090 | - else if (yyn == 0) | |
5091 | - goto yyerrpop; | |
5092 | ||
5093 | if (yyn == YYFINAL) | |
5094 | YYACCEPT; | |
5095 | @@ -3676,9 +4060,7 @@ | |
5096 | YYDPRINTF ((stderr, "Shifting error token, ")); | |
5097 | ||
5098 | *++yyvsp = yylval; | |
5099 | -#if YYLSP_NEEDED | |
5100 | - *++yylsp = yylloc; | |
5101 | -#endif | |
5102 | + | |
5103 | ||
5104 | yystate = yyn; | |
5105 | goto yynewstate; | |
5106 | @@ -3698,13 +4080,15 @@ | |
5107 | yyresult = 1; | |
5108 | goto yyreturn; | |
5109 | ||
5110 | -/*---------------------------------------------. | |
5111 | -| yyoverflowab -- parser overflow comes here. | | |
5112 | -`---------------------------------------------*/ | |
5113 | +#ifndef yyoverflow | |
5114 | +/*----------------------------------------------. | |
5115 | +| yyoverflowlab -- parser overflow comes here. | | |
5116 | +`----------------------------------------------*/ | |
5117 | yyoverflowlab: | |
5118 | yyerror ("parser stack overflow"); | |
5119 | yyresult = 2; | |
5120 | /* Fall through. */ | |
5121 | +#endif | |
5122 | ||
5123 | yyreturn: | |
5124 | #ifndef yyoverflow | |
5125 | @@ -3713,7 +4097,9 @@ | |
5126 | #endif | |
5127 | return yyresult; | |
5128 | } | |
5129 | -#line 2081 "bac.y" | |
5130 | + | |
5131 | + | |
5132 | +#line 2097 "bac.y" | |
5133 | /*start of routines*/ | |
5134 | ||
5135 | void enter_break_block(int* break_level, break_block_type bbt) | |
5136 | @@ -3810,6 +4196,9 @@ | |
5137 | /* | |
5138 | * | |
5139 | * $Log$ | |
5140 | + * Revision 2.26 2004/07/21 19:17:28 bynum | |
5141 | + * correct minor errors discovered in writing the Java version of bacc | |
5142 | + * | |
5143 | * Revision 2.25 2004/04/13 18:18:40 bynum | |
5144 | * revise grammar to handle C-style expressions | |
5145 | * | |
5146 | @@ -3963,3 +4352,4 @@ | |
5147 | * | |
5148 | * | |
5149 | */ | |
5150 | + | |
5151 | diff -ur bacisrc/ccomp/lex.c bacisrc.ok/ccomp/lex.c | |
5152 | --- bacisrc/ccomp/lex.c 2004-04-15 13:31:23.000000000 +0200 | |
5153 | +++ bacisrc.ok/ccomp/lex.c 2005-10-26 22:11:03.000000000 +0200 | |
5154 | @@ -9,9 +9,6 @@ | |
5155 | #define YY_FLEX_MINOR_VERSION 5 | |
5156 | ||
5157 | #include <stdio.h> | |
5158 | -#if !defined(DOS) | |
5159 | -#include <unistd.h> | |
5160 | -#endif | |
5161 | ||
5162 | ||
5163 | /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ | |
5164 | @@ -25,6 +22,9 @@ | |
5165 | #ifdef __cplusplus | |
5166 | ||
5167 | #include <stdlib.h> | |
5168 | +#if !defined(DOS) | |
5169 | +#include <unistd.h> | |
5170 | +#endif | |
5171 | ||
5172 | /* Use prototypes in function declarations. */ | |
5173 | #define YY_USE_PROTOS | |
5174 | @@ -696,7 +696,7 @@ | |
5175 | YY_DECL | |
5176 | { | |
5177 | register yy_state_type yy_current_state; | |
5178 | - register char *yy_cp = NULL, *yy_bp = NULL; | |
5179 | + register char *yy_cp, *yy_bp; | |
5180 | register int yy_act; | |
5181 | ||
5182 | #line 50 "bac.l" | |
5183 | @@ -1567,7 +1567,6 @@ | |
5184 | #endif /* ifndef YY_NO_UNPUT */ | |
5185 | ||
5186 | ||
5187 | -#ifndef YY_NO_INPUT | |
5188 | #ifdef __cplusplus | |
5189 | static int yyinput() | |
5190 | #else | |
5191 | @@ -1639,7 +1638,7 @@ | |
5192 | ||
5193 | return c; | |
5194 | } | |
5195 | -#endif /* YY_NO_INPUT */ | |
5196 | + | |
5197 | ||
5198 | #ifdef YY_USE_PROTOS | |
5199 | void yyrestart( FILE *input_file ) | |
5200 | @@ -1750,6 +1749,11 @@ | |
5201 | } | |
5202 | ||
5203 | ||
5204 | +#ifndef YY_ALWAYS_INTERACTIVE | |
5205 | +#ifndef YY_NEVER_INTERACTIVE | |
5206 | +extern int isatty YY_PROTO(( int )); | |
5207 | +#endif | |
5208 | +#endif | |
5209 | ||
5210 | #ifdef YY_USE_PROTOS | |
5211 | void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) | |
5212 | @@ -2216,7 +2220,7 @@ | |
5213 | } | |
5214 | } while (reading); | |
5215 | } | |
5216 | - return ((esc < 256) ? esc : 0x20); | |
5217 | + return esc; | |
5218 | } | |
5219 | ||
5220 | ||
5221 | diff -ur bacisrc/ccomp/Makefile bacisrc.ok/ccomp/Makefile | |
5222 | --- bacisrc/ccomp/Makefile 2004-04-15 13:31:24.000000000 +0200 | |
5223 | +++ bacisrc.ok/ccomp/Makefile 2005-10-26 22:11:03.000000000 +0200 | |
5224 | @@ -1,8 +1,8 @@ | |
5225 | # Makefile for BenAri Concurrent C Compiler in C | |
5226 | # adapted from the makefile for the BenAri Concurrent Pascal compiler in C | |
5227 | ||
5228 | -OBJS = baccutil.o date.o lex.o gram.o ../lib/readtab.o ../lib/globtabs.o | |
5229 | -CFLAGS = -g -Wall | |
5230 | +OBJS = baccutil.o date.o lex.o gram.o | |
5231 | +CFLAGS = -g -Wall | |
5232 | #CFLAGS = -g | |
5233 | # pick which one of the following two lines you need | |
5234 | #YACC=yacc | |
5235 | diff -ur bacisrc/ccomp/ytab.h bacisrc.ok/ccomp/ytab.h | |
5236 | --- bacisrc/ccomp/ytab.h 2004-04-15 13:31:23.000000000 +0200 | |
5237 | +++ bacisrc.ok/ccomp/ytab.h 2005-10-26 22:11:03.000000000 +0200 | |
5238 | @@ -1,64 +1,152 @@ | |
5239 | -#ifndef BISON_Y_TAB_H | |
5240 | -# define BISON_Y_TAB_H | |
5241 | +/* A Bison parser, made by GNU Bison 1.875. */ | |
5242 | ||
5243 | -# ifndef YYSTYPE | |
5244 | -# define YYSTYPE int | |
5245 | -# define YYSTYPE_IS_TRIVIAL 1 | |
5246 | -# endif | |
5247 | -# define UNSIGNED_INT 257 | |
5248 | -# define STRING 258 | |
5249 | -# define RAWSTRING 259 | |
5250 | -# define STRINGCONCAT 260 | |
5251 | -# define STRINGCOMPARE 261 | |
5252 | -# define STRINGCOPY 262 | |
5253 | -# define STRINGLENGTH 263 | |
5254 | -# define IDENTIFIER 264 | |
5255 | -# define CHARCON 265 | |
5256 | -# define INCLUDE 266 | |
5257 | -# define FNSTRING 267 | |
5258 | -# define NE 268 | |
5259 | -# define LE 269 | |
5260 | -# define GE 270 | |
5261 | -# define EQ 271 | |
5262 | -# define OR 272 | |
5263 | -# define AND 273 | |
5264 | -# define PLPL 274 | |
5265 | -# define MIMI 275 | |
5266 | -# define IF 276 | |
5267 | -# define ELSE 277 | |
5268 | -# define SWITCH 278 | |
5269 | -# define CASE 279 | |
5270 | -# define DEFAULT 280 | |
5271 | -# define WHILE 281 | |
5272 | -# define DO 282 | |
5273 | -# define FOR 283 | |
5274 | -# define CBEGIN 284 | |
5275 | -# define CONST 285 | |
5276 | -# define TYPEDEF 286 | |
5277 | -# define VOID 287 | |
5278 | -# define INT 288 | |
5279 | -# define CHAR 289 | |
5280 | -# define CONTINUE 290 | |
5281 | -# define BREAK 291 | |
5282 | -# define RETURN 292 | |
5283 | -# define COUT 293 | |
5284 | -# define LTLT 294 | |
5285 | -# define ENDL 295 | |
5286 | -# define CIN 296 | |
5287 | -# define GTGT 297 | |
5288 | -# define MAIN 298 | |
5289 | -# define MONITOR 299 | |
5290 | -# define INIT 300 | |
5291 | -# define ATOMIC 301 | |
5292 | -# define SEND 302 | |
5293 | -# define RECEIVE 303 | |
5294 | -# define BROADCAST 304 | |
5295 | -# define EXTERN 305 | |
5296 | -# define SSCANF 306 | |
5297 | -# define SPRINTF 307 | |
5298 | -# define LOWER_THAN_ELSE 308 | |
5299 | +/* Skeleton parser for Yacc-like parsing with Bison, | |
5300 | + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. | |
5301 | ||
5302 | + This program is free software; you can redistribute it and/or modify | |
5303 | + it under the terms of the GNU General Public License as published by | |
5304 | + the Free Software Foundation; either version 2, or (at your option) | |
5305 | + any later version. | |
5306 | + | |
5307 | + This program is distributed in the hope that it will be useful, | |
5308 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
5309 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
5310 | + GNU General Public License for more details. | |
5311 | + | |
5312 | + You should have received a copy of the GNU General Public License | |
5313 | + along with this program; if not, write to the Free Software | |
5314 | + Foundation, Inc., 59 Temple Place - Suite 330, | |
5315 | + Boston, MA 02111-1307, USA. */ | |
5316 | + | |
5317 | +/* As a special exception, when this file is copied by Bison into a | |
5318 | + Bison output file, you may use that output file without restriction. | |
5319 | + This special exception was added by the Free Software Foundation | |
5320 | + in version 1.24 of Bison. */ | |
5321 | + | |
5322 | +/* Tokens. */ | |
5323 | +#ifndef YYTOKENTYPE | |
5324 | +# define YYTOKENTYPE | |
5325 | + /* Put the tokens into the symbol table, so that GDB and other debuggers | |
5326 | + know about them. */ | |
5327 | + enum yytokentype { | |
5328 | + UNSIGNED_INT = 258, | |
5329 | + STRING = 259, | |
5330 | + RAWSTRING = 260, | |
5331 | + STRINGCONCAT = 261, | |
5332 | + STRINGCOMPARE = 262, | |
5333 | + STRINGCOPY = 263, | |
5334 | + STRINGLENGTH = 264, | |
5335 | + IDENTIFIER = 265, | |
5336 | + CHARCON = 266, | |
5337 | + INCLUDE = 267, | |
5338 | + FNSTRING = 268, | |
5339 | + NE = 269, | |
5340 | + LE = 270, | |
5341 | + GE = 271, | |
5342 | + EQ = 272, | |
5343 | + OR = 273, | |
5344 | + AND = 274, | |
5345 | + PLPL = 275, | |
5346 | + MIMI = 276, | |
5347 | + IF = 277, | |
5348 | + ELSE = 278, | |
5349 | + SWITCH = 279, | |
5350 | + CASE = 280, | |
5351 | + DEFAULT = 281, | |
5352 | + WHILE = 282, | |
5353 | + DO = 283, | |
5354 | + FOR = 284, | |
5355 | + CBEGIN = 285, | |
5356 | + CONST = 286, | |
5357 | + TYPEDEF = 287, | |
5358 | + VOID = 288, | |
5359 | + INT = 289, | |
5360 | + CHAR = 290, | |
5361 | + CONTINUE = 291, | |
5362 | + BREAK = 292, | |
5363 | + RETURN = 293, | |
5364 | + COUT = 294, | |
5365 | + LTLT = 295, | |
5366 | + ENDL = 296, | |
5367 | + CIN = 297, | |
5368 | + GTGT = 298, | |
5369 | + MAIN = 299, | |
5370 | + MONITOR = 300, | |
5371 | + INIT = 301, | |
5372 | + ATOMIC = 302, | |
5373 | + SEND = 303, | |
5374 | + RECEIVE = 304, | |
5375 | + BROADCAST = 305, | |
5376 | + EXTERN = 306, | |
5377 | + SSCANF = 307, | |
5378 | + SPRINTF = 308, | |
5379 | + LOWER_THAN_ELSE = 309 | |
5380 | + }; | |
5381 | +#endif | |
5382 | +#define UNSIGNED_INT 258 | |
5383 | +#define STRING 259 | |
5384 | +#define RAWSTRING 260 | |
5385 | +#define STRINGCONCAT 261 | |
5386 | +#define STRINGCOMPARE 262 | |
5387 | +#define STRINGCOPY 263 | |
5388 | +#define STRINGLENGTH 264 | |
5389 | +#define IDENTIFIER 265 | |
5390 | +#define CHARCON 266 | |
5391 | +#define INCLUDE 267 | |
5392 | +#define FNSTRING 268 | |
5393 | +#define NE 269 | |
5394 | +#define LE 270 | |
5395 | +#define GE 271 | |
5396 | +#define EQ 272 | |
5397 | +#define OR 273 | |
5398 | +#define AND 274 | |
5399 | +#define PLPL 275 | |
5400 | +#define MIMI 276 | |
5401 | +#define IF 277 | |
5402 | +#define ELSE 278 | |
5403 | +#define SWITCH 279 | |
5404 | +#define CASE 280 | |
5405 | +#define DEFAULT 281 | |
5406 | +#define WHILE 282 | |
5407 | +#define DO 283 | |
5408 | +#define FOR 284 | |
5409 | +#define CBEGIN 285 | |
5410 | +#define CONST 286 | |
5411 | +#define TYPEDEF 287 | |
5412 | +#define VOID 288 | |
5413 | +#define INT 289 | |
5414 | +#define CHAR 290 | |
5415 | +#define CONTINUE 291 | |
5416 | +#define BREAK 292 | |
5417 | +#define RETURN 293 | |
5418 | +#define COUT 294 | |
5419 | +#define LTLT 295 | |
5420 | +#define ENDL 296 | |
5421 | +#define CIN 297 | |
5422 | +#define GTGT 298 | |
5423 | +#define MAIN 299 | |
5424 | +#define MONITOR 300 | |
5425 | +#define INIT 301 | |
5426 | +#define ATOMIC 302 | |
5427 | +#define SEND 303 | |
5428 | +#define RECEIVE 304 | |
5429 | +#define BROADCAST 305 | |
5430 | +#define EXTERN 306 | |
5431 | +#define SSCANF 307 | |
5432 | +#define SPRINTF 308 | |
5433 | +#define LOWER_THAN_ELSE 309 | |
5434 | + | |
5435 | + | |
5436 | + | |
5437 | + | |
5438 | +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) | |
5439 | +typedef int YYSTYPE; | |
5440 | +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ | |
5441 | +# define YYSTYPE_IS_DECLARED 1 | |
5442 | +# define YYSTYPE_IS_TRIVIAL 1 | |
5443 | +#endif | |
5444 | ||
5445 | extern YYSTYPE yylval; | |
5446 | ||
5447 | -#endif /* not BISON_Y_TAB_H */ | |
5448 | + | |
5449 | + | |
5450 | diff -ur bacisrc/disasm/main.c bacisrc.ok/disasm/main.c | |
5451 | --- bacisrc/disasm/main.c 2004-04-15 13:31:24.000000000 +0200 | |
5452 | +++ bacisrc.ok/disasm/main.c 2005-10-26 22:11:03.000000000 +0200 | |
5453 | @@ -42,7 +42,7 @@ | |
5454 | global_init(argc,argv); | |
5455 | showing_source = source_wanted; | |
5456 | while (lc <= last_code) { | |
5457 | - if (showing_source &&(dbg[dbix].lc <= lc)) | |
5458 | + if (dbg[dbix].lc <= lc) | |
5459 | show_source(disasm,lc,&cur_ifile,&showing_source,&dbix); | |
5460 | if (lc >= nextblock_lc) { | |
5461 | cur_block++; | |
5462 | @@ -65,6 +65,9 @@ | |
5463 | ||
5464 | /* | |
5465 | * $Log$ | |
5466 | + * Revision 1.8 2004/06/10 22:05:18 bynum | |
5467 | + * remove showing_source bug at top of main | |
5468 | + * | |
5469 | * Revision 1.7 2001/07/13 19:34:36 bynum | |
5470 | * add globtabs.h include | |
5471 | * | |
5472 | diff -ur bacisrc/interp/bainterp.c bacisrc.ok/interp/bainterp.c | |
5473 | --- bacisrc/interp/bainterp.c 2004-04-15 13:31:24.000000000 +0200 | |
5474 | +++ bacisrc.ok/interp/bainterp.c 2005-10-26 22:11:03.000000000 +0200 | |
5475 | @@ -777,7 +777,7 @@ | |
5476 | /* ANY proc can have a return address of 0, since it would */ | |
5477 | /* have to be called by a MARKSTACK/CALL pair. */ | |
5478 | if (ptab[curpr].pc != 0){ | |
5479 | - /* retrieve static link from AR[3] */ | |
5480 | + /* retrieve dynamic link from AR[3] */ | |
5481 | h2 = s[ saddr_check(curpr,ptab[curpr].b + 3)]; | |
5482 | /* h2 now points to AR[caller] */ | |
5483 | assert(s[h2+1] != -1); /* does this ever happen?? */ | |
5484 | @@ -1123,6 +1123,9 @@ | |
5485 | /* | |
5486 | * | |
5487 | * $Log$ | |
5488 | + * Revision 2.17 2005/06/19 21:31:38 bynum | |
5489 | + * fix comment in CALL instruction | |
5490 | + * | |
5491 | * Revision 2.16 2004/04/13 18:21:38 bynum | |
5492 | * fix cross monitor calls | |
5493 | * | |
5494 | diff -ur bacisrc/interp/baiutils.c bacisrc.ok/interp/baiutils.c | |
5495 | --- bacisrc/interp/baiutils.c 2004-04-15 13:31:24.000000000 +0200 | |
5496 | +++ bacisrc.ok/interp/baiutils.c 2005-10-26 22:11:03.000000000 +0200 | |
5497 | @@ -86,7 +86,6 @@ | |
5498 | extern proctab ptab[]; /* the process table */ | |
5499 | extern CODEBLOCK cbtab[]; /* code block table */ | |
5500 | extern int last_cbtab; /* index of last element cbtab */ | |
5501 | -extern int main_cbix; /* cbtab index of main proc */ | |
5502 | ||
5503 | int main_dbix; /* dbg index of the first byte of the main proc */ | |
5504 | int main_b; /* bottom of stackframe of main proc */ | |
5505 | @@ -386,9 +385,19 @@ | |
5506 | int active, suspended, look, add, d; | |
5507 | if (ptab[0].active) /* proc0 becomes inactive after CODEND stmt */ | |
5508 | cpr = 0; /* until that happens, proc0 is king */ | |
5509 | + else if (ptab[cpr].atomic) { | |
5510 | + if (ptab[cpr].suspend >= 0) { // suspended + atomic ==> deadlock | |
5511 | + *pst = deadlock; | |
5512 | +#if defined(TCL) | |
5513 | + colorwindows(cpr); | |
5514 | +#endif | |
5515 | + } /* if cpr is atomic and suspended */ | |
5516 | + // if cpr is atomic and not suspended, then let it run | |
5517 | + // cpr will be returned below | |
5518 | + } | |
5519 | else if (*stepcnt == 0){ /* time quantum expired */ | |
5520 | d = PMAXP1; /* must switch contexts */ | |
5521 | - suspended = (active = 0); | |
5522 | + suspended = -1; | |
5523 | look = __random(PMAXP1); | |
5524 | add = 1 + __random(PMAXM1); /* 1 <= add < PMAXP1 */ | |
5525 | while ( ((!ptab[look].active) || (ptab[look].suspend>=0) || | |
5526 | @@ -403,7 +412,7 @@ | |
5527 | } /* while */ | |
5528 | if (d < 0) { /* no runnable process was found */ | |
5529 | /* choose most recently seen suspended proc, else m.r.seen active */ | |
5530 | - cpr = (suspended ? suspended : active ); | |
5531 | + cpr = ((suspended >= 0) ? suspended : active ); | |
5532 | *pst = deadlock; | |
5533 | #if defined(TCL) | |
5534 | colorwindows(cpr); | |
5535 | @@ -411,22 +420,10 @@ | |
5536 | } | |
5537 | else { /* we found someone to run */ | |
5538 | *stepcnt = __random(STEPMAXP1); | |
5539 | - /* if the thread we picked is atomic and suspended, the */ | |
5540 | - /* we have deadlock */ | |
5541 | - if (ptab[cpr].atomic){ | |
5542 | - if (ptab[cpr].suspend >= 0) { | |
5543 | - *pst = deadlock; | |
5544 | -#if defined(TCL) | |
5545 | - colorwindows(cpr); | |
5546 | -#endif | |
5547 | - } /* if cpr is suspended */ | |
5548 | - } | |
5549 | - else { /* cpr is not atomic, let it run */ | |
5550 | - cpr = look; | |
5551 | + cpr = look; | |
5552 | #if defined(TCL) | |
5553 | - colorwindows(cpr); | |
5554 | + colorwindows(cpr); | |
5555 | #endif | |
5556 | - } /* else cpr is not atomic */ | |
5557 | } /* else a runnable proc was found */ | |
5558 | } /* *stepcnt was 0, time for a context switch */ | |
5559 | else /* no context switch -- count down current proc's quantum */ | |
5560 | @@ -516,7 +513,7 @@ | |
5561 | sprintf(buf," %c",tmp); | |
5562 | break; | |
5563 | case strings: | |
5564 | - sprintf(buf," %s",(char *) s[tmp]); | |
5565 | + sprintf(buf," %s",(char *) &s[sta]); | |
5566 | default: ; | |
5567 | } /* switch */ | |
5568 | while (*p) p++; /* find the end */ | |
5569 | @@ -765,6 +762,7 @@ | |
5570 | { | |
5571 | int pc, dbgix; | |
5572 | time_t x; | |
5573 | + int lno; | |
5574 | int pc_to_dbgix(int); | |
5575 | #if defined(SunOS) | |
5576 | extern time_t time(time_t*); | |
5577 | @@ -773,8 +771,10 @@ | |
5578 | pc = ptab[curpr].pc; | |
5579 | dbgix = pc_to_dbgix(pc); | |
5580 | time(&x); | |
5581 | + lno = dbg[dbgix].flno; | |
5582 | + if (lno < 0) lno = -lno; | |
5583 | sprintf(out_buf,"\n%s\n Process %d, loc %d, line %d of %s\n %s",hdr,curpr, | |
5584 | - pc,dbg[dbgix].flno,inputfile[dbg[dbgix].fix].fname,ctime(&x)); | |
5585 | + pc,lno,inputfile[dbg[dbgix].fix].fname,ctime(&x)); | |
5586 | /* ctime inserts a newline '\n' */ | |
5587 | #if defined(TCL) | |
5588 | tcl_1printf(out_buf,DATAWIN); | |
5589 | @@ -823,7 +823,8 @@ | |
5590 | #else | |
5591 | fputs(out_buf,stdout); | |
5592 | #endif | |
5593 | - show_vars(0,0); | |
5594 | + /*show_vars(0,0);*/ | |
5595 | + show_vars(0,1); | |
5596 | sprintf(out_buf, | |
5597 | "\nMainproc Variables \ntype name stack loc value\n"); | |
5598 | #if defined(TCL) | |
5599 | @@ -1123,12 +1124,6 @@ | |
5600 | int ix; /* loop counter */ | |
5601 | int block0_vsize; /* size of outer block */ | |
5602 | ||
5603 | - | |
5604 | - if (btab[1].vsize > STMAX - STKINCR * PMAX) { | |
5605 | - fprintf(stderr,"Stack required is too great to run. Abort!\n"); | |
5606 | - exit(1); | |
5607 | - } | |
5608 | - | |
5609 | charl = ' '; /* lowest char ord */ | |
5610 | charh = '~'; /* highest character ordinal */ | |
5611 | ||
5612 | @@ -1144,14 +1139,12 @@ | |
5613 | exit(1); | |
5614 | } | |
5615 | /* establish stack frame for main pgm */ | |
5616 | - block0_vsize = btab[0].vsize; | |
5617 | ptab[0].b = main_b = block0_vsize; | |
5618 | s[main_b] = 0; /* main proc result */ | |
5619 | s[main_b+1] = 0; /* main proc return address */ | |
5620 | s[main_b+2] = 0; /* main proc static link */ | |
5621 | s[main_b+3] = -1; /* main proc dynamic link */ | |
5622 | s[main_b+4] = btab[0].lastpar; /* tab index of main proc temp stored here */ | |
5623 | - ptab[0].tabix = s[main_b+4]; /* need to store in ptab, too */ | |
5624 | /* set tab index of main proc */ | |
5625 | main_tix = ptab[0].tabix = s[main_b+4]; | |
5626 | /* initialize display of main proc */ | |
5627 | @@ -1167,8 +1160,6 @@ | |
5628 | ptab[0].t,STMAX); | |
5629 | exit(1); | |
5630 | } | |
5631 | - /* zero out the local variable storage of the main proc */ | |
5632 | - for (ix = main_b+5; ix <= ptab[0].t; ix++) s[ix] = 0; | |
5633 | ptab[0].pc = tab[main_tix].adr; /* set entry point */ | |
5634 | ptab[0].active = 1; /* main proc is active */ | |
5635 | ptab[0].suspend = NOT_SUSPENDED; /* main proc is not suspended */ | |
5636 | @@ -1178,7 +1169,7 @@ | |
5637 | ptab[0].first_spc = ptab[0].last_spc = -1; | |
5638 | /* main proc gets what's left over after allocating the stack to */ | |
5639 | /* the other procs */ | |
5640 | - ptab[0].stacksize = STMAX - PMAX * STKINCR; | |
5641 | + ptab[0].stacksize = STMAX - block0_vsize - PMAX * STKINCR; | |
5642 | ||
5643 | /* show main proc startup information, if necessary */ | |
5644 | if (initAR_db) { | |
5645 | @@ -1191,8 +1182,8 @@ | |
5646 | show_AR(ptab[0].b,ptab[0].t); | |
5647 | } | |
5648 | ||
5649 | - for (ix = 0; ix < last_dbg; ix++) | |
5650 | - if (dbg[ix].lc == cbtab[main_cbix].adr) { | |
5651 | + for (ix = 0; ix <= last_dbg; ix++) | |
5652 | + if (dbg[ix].lc == tab[main_tix].adr) { | |
5653 | main_dbix = ix; | |
5654 | break; | |
5655 | } | |
5656 | @@ -1421,7 +1412,6 @@ | |
5657 | inputfile[dbg[jx].fix].fname); | |
5658 | strcpy(buf,tmp_buf); | |
5659 | } | |
5660 | - strcat(buf,"\n"); | |
5661 | } /* list_breakpoint */ | |
5662 | ||
5663 | int get_breakindex(int ix) | |
5664 | @@ -1552,10 +1542,11 @@ | |
5665 | char* prompt = "(h = help)>"; | |
5666 | int i, dbgix, b, t, pc, pc2, oldpc; | |
5667 | int cbix; | |
5668 | + int tlno; | |
5669 | int count; | |
5670 | int dummy; | |
5671 | char prev_cmd, cmd; | |
5672 | - static int lno = -1; | |
5673 | + static int lno = 1; | |
5674 | ||
5675 | prev_cmd = 's'; | |
5676 | while (reading_cmds && *singlestep) { | |
5677 | @@ -1711,13 +1702,16 @@ | |
5678 | break; | |
5679 | case 'w': | |
5680 | switch (word[0][1]) { | |
5681 | + case '\0': | |
5682 | case '\n': | |
5683 | pc = ptab[curpr].pc; | |
5684 | printf("Current process # %d: %s pc = %d b = %d t = %d\n", | |
5685 | curpr,tab[ptab[curpr].tabix].name, pc, | |
5686 | ptab[curpr].b, ptab[curpr].t); | |
5687 | dbgix = pc_to_dbgix(pc); | |
5688 | - printf(" line %d of %s\n",dbg[dbgix].flno, | |
5689 | + tlno = dbg[dbgix].flno; | |
5690 | + if (tlno < 0) tlno = - tlno; | |
5691 | + printf(" line %d of %s\n",tlno, | |
5692 | inputfile[dbg[dbgix].fix].fname); | |
5693 | break; | |
5694 | case 'c': | |
5695 | @@ -1868,6 +1862,7 @@ | |
5696 | if (i == parm_cnt) return i; | |
5697 | op_addr = saddr_check(curpr,s[parm_offset]); | |
5698 | parm_offset++; | |
5699 | + tempbuf[0] = '\0'; | |
5700 | switch (*fp) { | |
5701 | case 'd': | |
5702 | if (next_word(tempbuf,&sp)< 0) return i; | |
5703 | @@ -1937,14 +1932,16 @@ | |
5704 | i = 0; | |
5705 | parm_offset = scan_strix + 1; | |
5706 | while(*fp) { | |
5707 | - while((*fp)&&(*fp != '%')) { | |
5708 | + while(*fp) { | |
5709 | /* copy non-format stuff directly into output buffer */ | |
5710 | + if (*fp == '\\') fp++; // copy escaped char directly | |
5711 | + else if (*fp == '%') break; | |
5712 | *bp = *fp; | |
5713 | fp++; bp++; | |
5714 | } | |
5715 | /* if there's format left, use it */ | |
5716 | if (*fp == '%') { | |
5717 | - if (i == parm_cnt) return; | |
5718 | + if (i > parm_cnt) break; | |
5719 | /* must check for %q -- it's a BACI special */ | |
5720 | if (*(fp+1) == 'q') { | |
5721 | if (i <= parm_cnt) { | |
5722 | @@ -2435,145 +2432,5 @@ | |
5723 | ||
5724 | ||
5725 | /* | |
5726 | - * | |
5727 | - * $Log$ | |
5728 | - * Revision 2.18 2001/07/21 19:28:59 bynum | |
5729 | - * remove atoi from SunOS extern declarations | |
5730 | - * | |
5731 | - * Revision 2.17 2001/07/20 13:17:40 bynum | |
5732 | - * surround atoi declaration with if !defined(DOS) | |
5733 | - * | |
5734 | - * Revision 2.16 2001/07/20 13:12:33 bynum | |
5735 | - * change to __randomize() | |
5736 | - * | |
5737 | - * Revision 2.15 2001/07/13 19:35:43 bynum | |
5738 | - * add stdlib.h include for exit, add globtabs.h include | |
5739 | - * | |
5740 | - * Revision 2.14 2001/03/15 17:53:36 bynum | |
5741 | - * in chooseproc, change add = 1 + __random(PMAXM1) | |
5742 | - * | |
5743 | - * Revision 2.13 2000/08/04 17:35:41 bynum | |
5744 | - * replace last_dbg_ix with last_dbg | |
5745 | - * | |
5746 | - * Revision 2.12 2000/08/03 21:11:10 bynum | |
5747 | - * change all random and urandom calls to __random and __urandom | |
5748 | - * | |
5749 | - * Revision 2.11 2000/06/14 20:40:26 bynum | |
5750 | - * To debugger, add 'r' cmd to reload pcode file and 'o' cmd to load a | |
5751 | - * new pcode file | |
5752 | - * | |
5753 | - * Revision 2.10 2000/06/07 17:48:39 bynum | |
5754 | - * incorporate the code from the BACI GUI directory | |
5755 | - * | |
5756 | - * Revision 1.21 1999/09/07 16:30:59 bynum | |
5757 | - * add case for global vbls in get_stack_addr | |
5758 | - * | |
5759 | - * Revision 1.20 1999/08/12 15:33:23 bynum | |
5760 | - * add declaration of extern time() in a #if defined(SunOS) bracket | |
5761 | - * | |
5762 | - * Revision 1.19 1999/08/12 14:45:33 bynum | |
5763 | - * In TCL verrsion, change to statically allocated infile array, add | |
5764 | - * TCLread_file_info proc to read the file info into the static array | |
5765 | - * (replacing the library read_file_info proc), fix errors in get_stac_addr | |
5766 | - * proc (thanks to Brad Taylor), add write_header timestamp proc, delete | |
5767 | - * stopcmd proc, in runinit add while (Tk_DoOneEvent(TK_NO_WAIT)); loops | |
5768 | - * to ensure that X events are taken care of (avoids SEGVs) | |
5769 | - * | |
5770 | - * Revision 1.18 1999/07/29 16:14:25 bynum | |
5771 | - * change runinit, init_interperet, global_init, global_tcl_init so that | |
5772 | - * a gui user can rerun a pcode file, add checks of calculated ptab data | |
5773 | - * in init_interpreter, allow inclusion of .pco in filename | |
5774 | - * | |
5775 | - * Revision 1.17 1999/07/28 19:19:39 bynum | |
5776 | - * add commenting, add breakpoint handling procs, fix errors in user | |
5777 | - * interface | |
5778 | - * | |
5779 | - * Revision 1.16 1998/08/18 14:08:43 bynum | |
5780 | - * remove curpr global, move into parmlist of many functions, add | |
5781 | - * functions to display arrays, add init_process_displays to fix | |
5782 | - * global scope bug | |
5783 | - * | |
5784 | - * Revision 1.15 1998/07/16 18:24:27 bynum | |
5785 | - * add code to support handling of breakpoints in the gui version | |
5786 | - * | |
5787 | - * Revision 1.14 1998/06/26 15:46:05 bynum | |
5788 | - * switch from insertFile call in runinit to loadAllFiles to implement loading | |
5789 | - * multiple files | |
5790 | - * | |
5791 | - * Revision 1.13 1998/06/26 13:15:49 bynum | |
5792 | - * add parms to chooseproc, switch from tcl_printf(*,0) to tcl_1printf(*,0) | |
5793 | - * | |
5794 | - * Revision 1.12 1998/06/05 12:25:54 bynum | |
5795 | - * get rid of tcl_writeln proc, switch from tcl_printf to tcl_1printf | |
5796 | - * for output to proc0 window, use automatically allocated buffers | |
5797 | - * in the tcl_printf, tcl_1printf, tcl_putnum, tcl_putchar procs | |
5798 | - * (too many people using tcl_buffer!!) | |
5799 | - * | |
5800 | - * Revision 1.11 1998/05/29 19:35:11 bynum | |
5801 | - * change to pc_to_dbix() call from current_dbix(), implement setting | |
5802 | - * breakpoints by source lines in debugger, implement listing source file | |
5803 | - * in debugger | |
5804 | - * | |
5805 | - * Revision 1.10 1998/05/28 16:23:01 bynum | |
5806 | - * move tcl_ procs from main.c, add if defined(TCL) code, change | |
5807 | - * debugging output to include pnn proc no, add getInfile proc | |
5808 | - * | |
5809 | - * Revision 1.9 1998/05/26 13:36:33 bynum | |
5810 | - * incorporate tcl_printf() and other tcl functions from main.c | |
5811 | - * bring Vince's code into agreement with the 5/98 BACI code so that | |
5812 | - * both gui and std interpreter can be built from the same source files | |
5813 | - * | |
5814 | - * Revision 2.7 1997/10/24 09:34:35 bynum | |
5815 | - * add semicolon to empty default case, fix off-by-one in clock_tick(xpc) | |
5816 | - * | |
5817 | - * Revision 2.6 1997/10/23 13:26:47 bynum | |
5818 | - * change breakpoint machinery to display a "logical" breakpoint index | |
5819 | - * | |
5820 | - * Revision 2.5 1997/10/19 07:06:06 bynum | |
5821 | - * make sscanf declaration acceptable to LINUX | |
5822 | - * | |
5823 | - * Revision 2.4 1997/09/05 16:39:02 bynum | |
5824 | - * fix cpfmt() proc | |
5825 | - * | |
5826 | - * Revision 2.3 1997/09/04 10:57:43 bynum | |
5827 | - * add sprintf, sscanf | |
5828 | - * | |
5829 | - * Revision 2.2 1997/07/10 17:20:14 bynum | |
5830 | - * improve write_process_table output | |
5831 | - * | |
5832 | - * Revision 2.1 1997/07/02 13:41:15 bynum | |
5833 | - * move interpreter utils from bainterp.c here, add debugger utils | |
5834 | - * | |
5835 | - * Revision 2.0 1997/06/30 06:59:21 bynum | |
5836 | - * first version with level 0 globals | |
5837 | - * | |
5838 | - * Revision 1.8 1997/03/25 14:55:59 bynum | |
5839 | - * ncorporate name changes from the include directory, add fprintf prototype | |
5840 | - * | |
5841 | - * Revision 1.7 1996/03/07 09:32:41 bynum | |
5842 | - * remove 'filename_line' declaration | |
5843 | - * | |
5844 | - * Revision 1.6 1995/11/20 16:07:26 bynum | |
5845 | - * change "magic phrase" that intepreter looks for, change interpreter | |
5846 | - * flag | |
5847 | - * | |
5848 | - * Revision 1.5 1995/09/07 14:53:40 bynum | |
5849 | - * remove baiglobs.h include, tweak pgm name flag slightly | |
5850 | - * | |
5851 | - * Revision 1.4 1995/09/07 14:42:00 bynum | |
5852 | - * move code to read the global tables to the ../lib/read_tables.c file, | |
5853 | - * change includes to conform to new structure of ../include directory | |
5854 | - * change from K&R proc headers to ANSI C headers | |
5855 | - * | |
5856 | - * Revision 1.3 1995/08/29 15:57:20 bynum | |
5857 | - * add -p option message in 'show_help', add code to create the interp | |
5858 | - * program name string automatically from the date string | |
5859 | - * | |
5860 | - * Revision 1.2 1995/07/06 14:33:15 bynum | |
5861 | - * add 'atomic' field | |
5862 | - * | |
5863 | - * Revision 1.1 1995/06/22 06:51:31 bynum | |
5864 | - * Initial revision | |
5865 | - * | |
5866 | - * | |
5867 | + * $Id$ | |
5868 | */ | |
5869 | diff -ur bacisrc/interp/main.c bacisrc.ok/interp/main.c | |
5870 | --- bacisrc/interp/main.c 2004-04-15 13:31:24.000000000 +0200 | |
5871 | +++ bacisrc.ok/interp/main.c 2005-10-26 22:11:03.000000000 +0200 | |
5872 | @@ -19,7 +19,7 @@ | |
5873 | #if defined(TCL) | |
5874 | /* GUI interpreter */ | |
5875 | #include "tcl.h" | |
5876 | -#include <tk.h> | |
5877 | +#include "tk.h" | |
5878 | #include <stdlib.h> | |
5879 | #include <string.h> | |
5880 | #include "../include/bacicnty.h" | |
5881 | @@ -107,21 +107,21 @@ | |
5882 | exit(1); | |
5883 | } | |
5884 | /* Create commands and common variables */ | |
5885 | - Tcl_CreateCommand(interp, "run", runinit, (ClientData) NULL, | |
5886 | + Tcl_CreateCommand(interp, "run", (Tcl_CmdProc *) runinit, (ClientData) NULL, | |
5887 | (Tcl_CmdDeleteProc *) NULL); | |
5888 | - Tcl_CreateCommand(interp, "getInfile", getInfile, (ClientData) NULL, | |
5889 | - (Tcl_CmdDeleteProc *) NULL); | |
5890 | - Tcl_CreateCommand(interp, "getBreakpoint", getBreakpoint, (ClientData) NULL, | |
5891 | - (Tcl_CmdDeleteProc *) NULL); | |
5892 | - Tcl_CreateCommand(interp, "setBreakpoint", setBreakpoint, (ClientData) NULL, | |
5893 | - (Tcl_CmdDeleteProc *) NULL); | |
5894 | - Tcl_CreateCommand(interp, "unsetBreakpoint", unsetBreakpoint, | |
5895 | + Tcl_CreateCommand(interp, "getInfile", (Tcl_CmdProc*) getInfile, | |
5896 | + (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); | |
5897 | + Tcl_CreateCommand(interp, "getBreakpoint", (Tcl_CmdProc *) getBreakpoint, | |
5898 | + (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); | |
5899 | + Tcl_CreateCommand(interp, "setBreakpoint", (Tcl_CmdProc *) setBreakpoint, | |
5900 | + (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); | |
5901 | + Tcl_CreateCommand(interp, "unsetBreakpoint", (Tcl_CmdProc *) unsetBreakpoint, | |
5902 | (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); | |
5903 | - Tcl_CreateCommand(interp, "LinenoToPC", LinenoToPC, | |
5904 | + Tcl_CreateCommand(interp, "LinenoToPC", (Tcl_CmdProc *) LinenoToPC, | |
5905 | (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); | |
5906 | - Tcl_CreateCommand(interp, "LineHasBreak", LineHasBreak, | |
5907 | + Tcl_CreateCommand(interp, "LineHasBreak", (Tcl_CmdProc *) LineHasBreak, | |
5908 | (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); | |
5909 | - Tcl_CreateCommand(interp, "WriteData", WriteData, | |
5910 | + Tcl_CreateCommand(interp, "WriteData", (Tcl_CmdProc *) WriteData, | |
5911 | (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); | |
5912 | ||
5913 | Tcl_LinkVar(interp, "tinitAR_db", (char *) &initAR_db, TCL_LINK_INT); | |
5914 | diff -ur bacisrc/interp/Makefile bacisrc.ok/interp/Makefile | |
5915 | --- bacisrc/interp/Makefile 2004-04-15 13:31:24.000000000 +0200 | |
5916 | +++ bacisrc.ok/interp/Makefile 2005-10-26 22:11:03.000000000 +0200 | |
5917 | @@ -1,15 +1,34 @@ | |
5918 | # makefile for BenAri Concurrent Pascal PCODE Interpreter in C | |
5919 | # | |
5920 | +## Particularize to your Tcl, Tk installation | |
5921 | +## For Suse | |
5922 | +LTCL = -ltcl8.4 | |
5923 | +LTK = -ltk8.4 | |
5924 | +TCLINCDIR = $(HOME)/tcl8.4.10/generic | |
5925 | +TKINCDIR = $(HOME)/tk8.4.10/generic | |
5926 | +## For RedHat workstation 3 | |
5927 | +#LTCL = -ltcl8.3 | |
5928 | +#LTK = -ltk8.3 | |
5929 | +#TCLINCDIR = /usr/local/tcl/generic | |
5930 | +#TKINCDIR = /usr/local/tk/generic | |
5931 | +## For Cygwin | |
5932 | +#LTCL = -ltcl8.4 | |
5933 | +#LTK = -ltk8.4 | |
5934 | +#TCLINCDIR = /usr/include/ | |
5935 | +#TKINCDIR = /usr/include | |
5936 | +# | |
5937 | +# | |
5938 | OBJS=main.o bainterp.o baiutils.o random.o date.o ../lib/globtabs.o | |
5939 | INCDIR = ../include | |
5940 | INCLS=$(INCDIR)/globdata.h $(INCDIR)/bacicnty.h \ | |
5941 | - $(INCDIR)/disutils.h $(INCDIR)/genutil.h $(INCDIR)/readtab.h random.h | |
5942 | + $(INCDIR)/disutils.h $(INCDIR)/genutil.h $(INCDIR)/readtab.h random.h | |
5943 | CC=gcc | |
5944 | +CFLAGS=-Wall -g $(DEFINES) -I$(INCDIR) | |
5945 | #CC=cc | |
5946 | -CFLAGS= -Wall -g | |
5947 | -#CFLAGS=-Wall -g $(DEFINES) -I$(INCDIR) | |
5948 | +#CFLAGS= -Wall -g | |
5949 | #CFLAGS=-g $(DEFINES) -I$(INCDIR) | |
5950 | LIBDIR= ../lib | |
5951 | +UNAMECMD=`uname -s | sed -e 's/CYGWIN_.*/CYGWIN/'` | |
5952 | ||
5953 | which: | |
5954 | @echo "What do you want to make for `uname -s`?" | |
5955 | @@ -19,32 +38,38 @@ | |
5956 | ||
5957 | gui: | |
5958 | make clean | |
5959 | - make "OS=`uname -s`" whichgui | |
5960 | + make "OS=$(UNAMECMD)" whichgui | |
5961 | ||
5962 | whichgui: | |
5963 | $(LIBDIR)/checkLastOS '*.o' | |
5964 | make $(OS)gui | |
5965 | ||
5966 | -Darwingui: | |
5967 | - make "DEFINES=-DMACOSX -DTCL" "LLIBS=-ltk -ltcl -lX11 -ldl -lm" \ | |
5968 | - "INCDIRS=-I$(INCDIR)" \ | |
5969 | +CYGWINgui: | |
5970 | + make "DEFINES=-DLinux -DTCL" "LLIBS=$(LTCL) $(LTK) -lX11 -lm" \ | |
5971 | + "INCDIRS= -I$(INCDIR) -I$(TCLINCDIR) -I$(TKINCDIR)" \ | |
5972 | "LDFLAGS= -L/usr/lib -L/usr/local/lib -L/usr/X11R6/lib" \ | |
5973 | guibainterp | |
5974 | ||
5975 | -Linuxgui: | |
5976 | - make "DEFINES=-DLinux -DTCL" "LLIBS=-ltk -ltcl -lX11 -ldl -lm" \ | |
5977 | - "INCDIRS=-I$(INCDIR)" \ | |
5978 | +Darwingui: | |
5979 | + make "DEFINES=-DMACOSX -DTCL" "LLIBS=$(LTCL) $(LTK) -lX11 -ldl -lm" \ | |
5980 | + "INCDIRS= -I$(INCDIR) -I$(TCLINCDIR) -I$(TKINCDIR)" \ | |
5981 | "LDFLAGS= -L/usr/lib -L/usr/local/lib -L/usr/X11R6/lib" \ | |
5982 | guibainterp | |
5983 | ||
5984 | -SunOSgui: | |
5985 | - make "DEFINES=-DSunOS -DTCL -DTcl7_5" "LLIBS=-ltk8.0 -ltcl8.0 -lX11 -lm" \ | |
5986 | +IRIXgui: | |
5987 | + make "DEFINES=-DIRIX -DTCL" "LLIBS=-ltkx -ltclx -lX11 -lm" \ | |
5988 | "INCDIRS=-I$(INCDIR) -I/usr/local/include" \ | |
5989 | "LDFLAGS= -L/usr/lib -L/usr/local/lib -L/usr/X11R6/lib" \ | |
5990 | guibainterp | |
5991 | ||
5992 | -IRIXgui: | |
5993 | - make "DEFINES=-DIRIX -DTCL" "LLIBS=-ltkx -ltclx -lX11 -lm" \ | |
5994 | +Linuxgui: | |
5995 | + make "DEFINES=-DLinux -DTCL" "LLIBS=$(LTCL) $(LTK) -lX11 -lm" \ | |
5996 | + "INCDIRS= -I$(INCDIR) -I$(TCLINCDIR) -I$(TKINCDIR)" \ | |
5997 | + "LDFLAGS= -L/usr/lib -L/usr/local/lib -L/usr/X11R6/lib" \ | |
5998 | + guibainterp | |
5999 | + | |
6000 | +SunOSgui: | |
6001 | + make "DEFINES=-DSunOS -DTCL -DTcl7_5" "LLIBS=-ltk8.0 -ltcl8.0 -lX11 -lm" \ | |
6002 | "INCDIRS=-I$(INCDIR) -I/usr/local/include" \ | |
6003 | "LDFLAGS= -L/usr/lib -L/usr/local/lib -L/usr/X11R6/lib" \ | |
6004 | guibainterp | |
6005 | @@ -102,29 +127,7 @@ | |
6006 | rm -f main.o bainterp.o baiutils.o random.o ../lib/makedate | |
6007 | ||
6008 | # | |
6009 | -# | |
6010 | -# $Log$ | |
6011 | -# Revision 2.0 2000/06/07 17:54:14 bynum | |
6012 | -# switch to Makefile from the BACI GUI directory | |
6013 | -# | |
6014 | -# Revision 1.1 1999/08/12 15:57:22 bynum | |
6015 | -# Initial revision | |
6016 | -# | |
6017 | -# Revision 1.5 1996/03/07 09:38:07 bynum | |
6018 | -# correct 'makedate' call | |
6019 | -# | |
6020 | -# Revision 1.4 1996/03/07 09:33:36 bynum | |
6021 | -# change file name to 'Makefile', add 'date.o' target | |
6022 | -# | |
6023 | -# Revision 1.3 1995/09/14 13:36:42 bynum | |
6024 | -# add cd to lib directory in bainterp target | |
6025 | -# | |
6026 | -# Revision 1.2 1995/09/07 14:45:03 bynum | |
6027 | -# add references to ../lib directory and add library reference in | |
6028 | -# the final compilation step, change bpcinter.c to main.c | |
6029 | -# | |
6030 | -# Revision 1.1 1995/06/22 06:49:19 bynum | |
6031 | -# Initial revision | |
6032 | -# | |
6033 | -# | |
6034 | +# $Id$ | |
6035 | # | |
6036 | + | |
6037 | + | |
6038 | diff -ur bacisrc/lib/compdata.c bacisrc.ok/lib/compdata.c | |
6039 | --- bacisrc/lib/compdata.c 2004-04-15 13:31:23.000000000 +0200 | |
6040 | +++ bacisrc.ok/lib/compdata.c 2005-10-26 22:11:03.000000000 +0200 | |
6041 | @@ -18,7 +18,6 @@ | |
6042 | ||
6043 | ||
6044 | int errcount; /* count of parsing errors */ | |
6045 | -int first_stringerr; | |
6046 | int first_parmcterr; | |
6047 | ||
6048 | /* for the expression subtrees of the parsetree */ | |
6049 | @@ -28,6 +27,9 @@ | |
6050 | /* | |
6051 | * | |
6052 | * $Log$ | |
6053 | + * Revision 1.9 2004/07/21 19:13:03 bynum | |
6054 | + * get rid of first_stringerr var | |
6055 | + * | |
6056 | * Revision 1.8 2001/07/21 17:26:12 bynum | |
6057 | * replace ../include in bacicnty.h include | |
6058 | * | |
6059 | diff -ur bacisrc/lib/computil.c bacisrc.ok/lib/computil.c | |
6060 | --- bacisrc/lib/computil.c 2004-04-15 13:31:23.000000000 +0200 | |
6061 | +++ bacisrc.ok/lib/computil.c 2005-10-26 22:11:03.000000000 +0200 | |
6062 | @@ -103,7 +103,7 @@ | |
6063 | j = btab[display[vislevel]].last; /* name is at "vislevel" static level */ | |
6064 | l = j; | |
6065 | while (strcmp(tab[j].name,tmpid)) j = tab[j].link; | |
6066 | - if ((j != 0)&&(tab[j].lev == vislevel)) { | |
6067 | + if (j != 0) { | |
6068 | sprintf(ubuf,"Duplicate identifier '%s' at level %d",tmpid,vislevel); | |
6069 | yyerror(ubuf); | |
6070 | return(0); | |
6071 | @@ -257,6 +257,7 @@ | |
6072 | if (expr[i].free){ | |
6073 | expr[i].obj = constant; | |
6074 | expr[i].typ = notyp; | |
6075 | + expr[i].tix = -1; | |
6076 | expr[i].adr = expr[i].ref = 0; | |
6077 | expr[i].lev = expr[i].normal = expr[i].result_used = 0; | |
6078 | expr[i].arelt = expr[i].isval = expr[i].free = 0; | |
6079 | @@ -713,9 +714,15 @@ | |
6080 | /* was stored */ | |
6081 | { | |
6082 | ||
6083 | + char buf[512]; | |
6084 | extern char laststring[]; | |
6085 | int t; | |
6086 | int slen, oldsx, newsx; | |
6087 | + int i; | |
6088 | + int len = strlen(str); | |
6089 | + /* first ASCII-ize the string */ | |
6090 | + for (i = 0; i< len; i++) | |
6091 | + if (!isascii(str[i])) str[i] = '?'; | |
6092 | if (*sx > 0) { | |
6093 | t = 0; | |
6094 | while (t < *sx) { | |
6095 | @@ -775,7 +782,7 @@ | |
6096 | char name[30]; | |
6097 | char what[30]; | |
6098 | name[0] = '\0'; | |
6099 | - for(ix = 0; ix < last_tab; ix++) { | |
6100 | + for(ix = 0; ix <= last_tab; ix++) { | |
6101 | switch (tab[ix].obj) { | |
6102 | case ext_procedure: | |
6103 | strcpy(name,tab[ix].name); | |
6104 | @@ -892,6 +899,23 @@ | |
6105 | fclose(pcode); | |
6106 | } /* of write_pcode */ | |
6107 | ||
6108 | +void check_expr_list() | |
6109 | +{ | |
6110 | + extern int last_predeclared; | |
6111 | + int i; | |
6112 | + printf("List of in-use exprs\n"); | |
6113 | + for (i = 0; i < EXPRSIZE; i++) | |
6114 | + if (!expr[i].free) { | |
6115 | + printf("Expression %d in use: obj %s type %s tix %d name %s\n", | |
6116 | + i,objnames[expr[i].obj],typenames[expr[i].typ], | |
6117 | + expr[i].tix-last_predeclared, | |
6118 | + tab[expr[i].tix].name); | |
6119 | + printf(" adr %x ref %d lev %d arelt %d isval %d result_used %d\n", | |
6120 | + expr[i].adr,expr[i].ref,expr[i].lev,expr[i].arelt,expr[i].isval, | |
6121 | + expr[i].result_used); | |
6122 | + } | |
6123 | +} | |
6124 | + | |
6125 | /* main pgm for the BenAri Compilers */ | |
6126 | ||
6127 | int main(int argc,char **argv) | |
6128 | @@ -920,12 +944,16 @@ | |
6129 | } | |
6130 | write_pcode(pcode_fname,comp_pname,filename_line); | |
6131 | fprintf(stderr,"Compilation listing is stored in %s\n",list_fname); | |
6132 | + /*check_expr_list(); uncomment to check for non-free expr's */ | |
6133 | return(retval); | |
6134 | } | |
6135 | ||
6136 | /* | |
6137 | * | |
6138 | * $Log$ | |
6139 | + * Revision 1.22 2004/07/21 19:10:18 bynum | |
6140 | + * correct minor errors, add check_expr_list(), ascii-ize input strings | |
6141 | + * | |
6142 | * Revision 1.21 2003/11/01 13:48:08 bynum | |
6143 | * Moti's bug fix for read(a[i]) | |
6144 | * | |
6145 | diff -ur bacisrc/lib/disutils.c bacisrc.ok/lib/disutils.c | |
6146 | --- bacisrc/lib/disutils.c 2004-04-15 13:31:23.000000000 +0200 | |
6147 | +++ bacisrc.ok/lib/disutils.c 2005-10-26 22:11:03.000000000 +0200 | |
6148 | @@ -14,7 +14,6 @@ | |
6149 | int last_cbtab; | |
6150 | ||
6151 | extern int last_tab; | |
6152 | -int main_cbix; /* index of the cbtab[] entry for main proc */ | |
6153 | ||
6154 | int build_cbtab() | |
6155 | /* | |
6156 | @@ -50,11 +49,6 @@ | |
6157 | } | |
6158 | } | |
6159 | } | |
6160 | - for (ix = 0; ix < cbix; ix++) | |
6161 | - if (tab[cbtab[ix].tix].obj == mainproc) { | |
6162 | - main_cbix = ix; | |
6163 | - break; | |
6164 | - } | |
6165 | return cbix; | |
6166 | } /* build_cbtab */ | |
6167 | ||
6168 | @@ -85,10 +79,16 @@ | |
6169 | { | |
6170 | int jx; | |
6171 | int ix; | |
6172 | + int mon; | |
6173 | if ((offset == 0)&&(level > 0)) | |
6174 | return tabix; /* function return value */ | |
6175 | ix = find_var(tabix,level,offset); | |
6176 | if (ix > 0) return ix; | |
6177 | + mon = tab[tabix].mon; | |
6178 | + if (mon > 0) { // if a mon proc, then look in the monitor next | |
6179 | + ix = find_var(mon,level,offset); | |
6180 | + if (ix > 0) return ix; | |
6181 | + } | |
6182 | for (jx = 0; jx <= last_cbtab; jx++) { | |
6183 | if ((tab[cbtab[jx].tix].lev < tab[tabix].lev) || | |
6184 | (tab[cbtab[jx].tix].obj == outerblock)) { | |
6185 | @@ -328,7 +328,7 @@ | |
6186 | strcat(dl,"WRITELN\n"); | |
6187 | break; /* 63 */ | |
6188 | case WHICH_PROC: /* 71, which_proc */ | |
6189 | - strcat(dl,"WHICHPROC, push # current process\n"); | |
6190 | + strcat(dl,"WHICH_PROC, push # current process\n"); | |
6191 | break; | |
6192 | case SUSPEND: /* 72, suspend */ | |
6193 | strcat(dl,"SUSPEND current process\n"); | |
6194 | @@ -435,6 +435,15 @@ | |
6195 | ||
6196 | /* | |
6197 | * $Log$ | |
6198 | + * Revision 1.15 2005/06/19 21:24:01 bynum | |
6199 | + * get rid of main_cbix variable | |
6200 | + * | |
6201 | + * Revision 1.14 2005/06/19 20:59:08 bynum | |
6202 | + * correct WHICH_PROC output | |
6203 | + * | |
6204 | + * Revision 1.13 2004/07/21 19:12:10 bynum | |
6205 | + * add check of enclosing monitor when required in search_var() | |
6206 | + * | |
6207 | * Revision 1.12 2003/05/07 21:54:47 bynum | |
6208 | * change disassembler output slightly | |
6209 | * | |
6210 | diff -ur bacisrc/lib/globdata.c bacisrc.ok/lib/globdata.c | |
6211 | --- bacisrc/lib/globdata.c 2004-04-15 13:31:23.000000000 +0200 | |
6212 | +++ bacisrc.ok/lib/globdata.c 2005-10-26 22:11:03.000000000 +0200 | |
6213 | @@ -15,7 +15,7 @@ | |
6214 | /* used with -c option when there is no main() proc */ | |
6215 | ||
6216 | TYPENAME typenames[] = {"notyp","int","bool","char","bsem", | |
6217 | - "sem","cond","array"}; | |
6218 | + "sem","cond","array","","","rawstr","string"}; | |
6219 | ||
6220 | OBJNAME objnames[] = {"constant","variable","type","procedure", | |
6221 | "function","monitor"}; | |
6222 | @@ -26,6 +26,12 @@ | |
6223 | /* | |
6224 | * | |
6225 | * $Log$ | |
6226 | + * Revision 1.11 2005/10/26 20:04:48 bynum | |
6227 | + * change typenames entries | |
6228 | + * | |
6229 | + * Revision 1.10 2005/06/19 21:01:37 bynum | |
6230 | + * add rawstring and string to typenames array | |
6231 | + * | |
6232 | * Revision 1.9 2001/07/21 17:28:52 bynum | |
6233 | * add ../include to bacicnty.h include | |
6234 | * |