1 | |
---|
2 | /* A Bison parser, made from gram.y |
---|
3 | by GNU Bison version 1.25 |
---|
4 | */ |
---|
5 | |
---|
6 | #define YYBISON 1 /* Identify Bison output. */ |
---|
7 | |
---|
8 | #define tSYMBOL 258 |
---|
9 | #define tREGEXP 259 |
---|
10 | #define tSTRING 260 |
---|
11 | #define tINTEGER 261 |
---|
12 | #define tREAL 262 |
---|
13 | #define tSUB 263 |
---|
14 | #define tSTATE 264 |
---|
15 | #define tSTART 265 |
---|
16 | #define tSTARTRULES 266 |
---|
17 | #define tNAMERULES 267 |
---|
18 | #define tBEGIN 268 |
---|
19 | #define tEND 269 |
---|
20 | #define tRETURN 270 |
---|
21 | #define tIF 271 |
---|
22 | #define tELSE 272 |
---|
23 | #define tLOCAL 273 |
---|
24 | #define tWHILE 274 |
---|
25 | #define tFOR 275 |
---|
26 | #define tADDASSIGN 276 |
---|
27 | #define tSUBASSIGN 277 |
---|
28 | #define tMULASSIGN 278 |
---|
29 | #define tDIVASSIGN 279 |
---|
30 | #define tOR 280 |
---|
31 | #define tAND 281 |
---|
32 | #define tEQ 282 |
---|
33 | #define tNE 283 |
---|
34 | #define tGE 284 |
---|
35 | #define tLE 285 |
---|
36 | #define tDIV 286 |
---|
37 | #define tPLUSPLUS 287 |
---|
38 | #define tMINUSMINUS 288 |
---|
39 | |
---|
40 | #line 1 "gram.y" |
---|
41 | |
---|
42 | /* -*- c -*- |
---|
43 | * Grammar for states. |
---|
44 | * Copyright (c) 1997 Markku Rossi. |
---|
45 | * |
---|
46 | * Author: Markku Rossi <mtr@iki.fi> |
---|
47 | */ |
---|
48 | |
---|
49 | /* |
---|
50 | * This file is part of GNU enscript. |
---|
51 | * |
---|
52 | * This program is free software; you can redistribute it and/or modify |
---|
53 | * it under the terms of the GNU General Public License as published by |
---|
54 | * the Free Software Foundation; either version 2, or (at your option) |
---|
55 | * any later version. |
---|
56 | * |
---|
57 | * This program is distributed in the hope that it will be useful, |
---|
58 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
59 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
60 | * GNU General Public License for more details. |
---|
61 | * |
---|
62 | * You should have received a copy of the GNU General Public License |
---|
63 | * along with this program; see the file COPYING. If not, write to |
---|
64 | * the Free Software Foundation, 59 Temple Place - Suite 330, |
---|
65 | * Boston, MA 02111-1307, USA. |
---|
66 | */ |
---|
67 | |
---|
68 | /* |
---|
69 | * $Id: gram.c,v 1.1.1.1 2002-05-29 18:21:15 ghudson Exp $ |
---|
70 | */ |
---|
71 | |
---|
72 | #include "defs.h" |
---|
73 | |
---|
74 | #line 35 "gram.y" |
---|
75 | typedef union |
---|
76 | { |
---|
77 | List *lst; |
---|
78 | Node *node; |
---|
79 | Cons *cons; |
---|
80 | Stmt *stmt; |
---|
81 | Expr *expr; |
---|
82 | } YYSTYPE; |
---|
83 | #include <stdio.h> |
---|
84 | |
---|
85 | #ifndef __cplusplus |
---|
86 | #ifndef __STDC__ |
---|
87 | #define const |
---|
88 | #endif |
---|
89 | #endif |
---|
90 | |
---|
91 | |
---|
92 | |
---|
93 | #define YYFINAL 162 |
---|
94 | #define YYFLAG -32768 |
---|
95 | #define YYNTBASE 51 |
---|
96 | |
---|
97 | #define YYTRANSLATE(x) ((unsigned)(x) <= 288 ? yytranslate[x] : 67) |
---|
98 | |
---|
99 | static const char yytranslate[] = { 0, |
---|
100 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
101 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
102 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
103 | 2, 2, 40, 2, 2, 2, 2, 2, 2, 49, |
---|
104 | 50, 38, 36, 48, 37, 2, 2, 2, 2, 2, |
---|
105 | 2, 2, 2, 2, 2, 2, 2, 27, 47, 32, |
---|
106 | 21, 33, 26, 2, 2, 2, 2, 2, 2, 2, |
---|
107 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
108 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
109 | 43, 2, 44, 2, 2, 2, 2, 2, 2, 2, |
---|
110 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
111 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
112 | 2, 2, 45, 2, 46, 2, 2, 2, 2, 2, |
---|
113 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
114 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
115 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
116 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
117 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
118 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
119 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
120 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
121 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
122 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
123 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
124 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
---|
125 | 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, |
---|
126 | 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, |
---|
127 | 16, 17, 18, 19, 20, 22, 23, 24, 25, 28, |
---|
128 | 29, 30, 31, 34, 35, 39, 41, 42 |
---|
129 | }; |
---|
130 | |
---|
131 | #if YYDEBUG != 0 |
---|
132 | static const short yyprhs[] = { 0, |
---|
133 | 0, 1, 4, 9, 14, 19, 25, 27, 28, 33, |
---|
134 | 34, 37, 42, 47, 52, 57, 58, 60, 62, 66, |
---|
135 | 67, 71, 73, 77, 79, 83, 84, 87, 90, 94, |
---|
136 | 104, 108, 114, 122, 128, 138, 141, 143, 145, 147, |
---|
137 | 149, 151, 154, 158, 162, 167, 171, 175, 179, 183, |
---|
138 | 187, 190, 193, 196, 199, 206, 210, 215, 221, 225, |
---|
139 | 229, 233, 237, 241, 245, 249, 253, 257, 261, 262, |
---|
140 | 264, 265, 267, 269 |
---|
141 | }; |
---|
142 | |
---|
143 | static const short yyrhs[] = { -1, |
---|
144 | 51, 52, 0, 10, 45, 61, 46, 0, 11, 45, |
---|
145 | 53, 46, 0, 12, 45, 53, 46, 0, 9, 3, |
---|
146 | 45, 54, 46, 0, 62, 0, 0, 53, 4, 3, |
---|
147 | 47, 0, 0, 54, 55, 0, 13, 45, 61, 46, |
---|
148 | 0, 14, 45, 61, 46, 0, 4, 45, 61, 46, |
---|
149 | 0, 3, 45, 61, 46, 0, 0, 57, 0, 3, |
---|
150 | 0, 57, 48, 3, 0, 0, 18, 59, 47, 0, |
---|
151 | 60, 0, 59, 48, 60, 0, 3, 0, 3, 21, |
---|
152 | 63, 0, 0, 61, 62, 0, 15, 47, 0, 15, |
---|
153 | 63, 47, 0, 8, 3, 49, 56, 50, 45, 58, |
---|
154 | 61, 46, 0, 45, 61, 46, 0, 16, 49, 63, |
---|
155 | 50, 62, 0, 16, 49, 63, 50, 62, 17, 62, |
---|
156 | 0, 19, 49, 63, 50, 62, 0, 20, 49, 64, |
---|
157 | 47, 63, 47, 64, 50, 62, 0, 63, 47, 0, |
---|
158 | 5, 0, 4, 0, 6, 0, 7, 0, 3, 0, |
---|
159 | 40, 63, 0, 63, 29, 63, 0, 63, 28, 63, |
---|
160 | 0, 3, 49, 65, 50, 0, 3, 21, 63, 0, |
---|
161 | 3, 22, 63, 0, 3, 23, 63, 0, 3, 24, |
---|
162 | 63, 0, 3, 25, 63, 0, 3, 41, 0, 3, |
---|
163 | 42, 0, 41, 3, 0, 42, 3, 0, 63, 43, |
---|
164 | 63, 44, 21, 63, 0, 49, 63, 50, 0, 63, |
---|
165 | 43, 63, 44, 0, 63, 26, 63, 27, 63, 0, |
---|
166 | 63, 38, 63, 0, 63, 39, 63, 0, 63, 36, |
---|
167 | 63, 0, 63, 37, 63, 0, 63, 32, 63, 0, |
---|
168 | 63, 33, 63, 0, 63, 30, 63, 0, 63, 31, |
---|
169 | 63, 0, 63, 34, 63, 0, 63, 35, 63, 0, |
---|
170 | 0, 63, 0, 0, 66, 0, 63, 0, 66, 48, |
---|
171 | 63, 0 |
---|
172 | }; |
---|
173 | |
---|
174 | #endif |
---|
175 | |
---|
176 | #if YYDEBUG != 0 |
---|
177 | static const short yyrline[] = { 0, |
---|
178 | 67, 68, 71, 72, 74, 76, 78, 81, 82, 86, |
---|
179 | 87, 89, 90, 91, 92, 95, 96, 99, 100, 103, |
---|
180 | 104, 107, 108, 111, 112, 115, 116, 119, 121, 123, |
---|
181 | 128, 130, 132, 135, 137, 140, 144, 146, 148, 150, |
---|
182 | 152, 154, 156, 157, 158, 160, 162, 164, 166, 168, |
---|
183 | 170, 172, 174, 176, 178, 180, 181, 183, 185, 186, |
---|
184 | 187, 188, 190, 191, 192, 193, 194, 195, 198, 199, |
---|
185 | 202, 203, 206, 207 |
---|
186 | }; |
---|
187 | #endif |
---|
188 | |
---|
189 | |
---|
190 | #if YYDEBUG != 0 || defined (YYERROR_VERBOSE) |
---|
191 | |
---|
192 | static const char * const yytname[] = { "$","error","$undefined.","tSYMBOL", |
---|
193 | "tREGEXP","tSTRING","tINTEGER","tREAL","tSUB","tSTATE","tSTART","tSTARTRULES", |
---|
194 | "tNAMERULES","tBEGIN","tEND","tRETURN","tIF","tELSE","tLOCAL","tWHILE","tFOR", |
---|
195 | "'='","tADDASSIGN","tSUBASSIGN","tMULASSIGN","tDIVASSIGN","'?'","':'","tOR", |
---|
196 | "tAND","tEQ","tNE","'<'","'>'","tGE","tLE","'+'","'-'","'*'","tDIV","'!'","tPLUSPLUS", |
---|
197 | "tMINUSMINUS","'['","']'","'{'","'}'","';'","','","'('","')'","file","toplevel", |
---|
198 | "regexp_sym_list","staterules","staterule","symbol_list","rest_symbol_list", |
---|
199 | "locals","locals_rest","local_def","stmt_list","stmt","expr","cond_expr","expr_list", |
---|
200 | "rest_expr_list", NULL |
---|
201 | }; |
---|
202 | #endif |
---|
203 | |
---|
204 | static const short yyr1[] = { 0, |
---|
205 | 51, 51, 52, 52, 52, 52, 52, 53, 53, 54, |
---|
206 | 54, 55, 55, 55, 55, 56, 56, 57, 57, 58, |
---|
207 | 58, 59, 59, 60, 60, 61, 61, 62, 62, 62, |
---|
208 | 62, 62, 62, 62, 62, 62, 63, 63, 63, 63, |
---|
209 | 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, |
---|
210 | 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, |
---|
211 | 63, 63, 63, 63, 63, 63, 63, 63, 64, 64, |
---|
212 | 65, 65, 66, 66 |
---|
213 | }; |
---|
214 | |
---|
215 | static const short yyr2[] = { 0, |
---|
216 | 0, 2, 4, 4, 4, 5, 1, 0, 4, 0, |
---|
217 | 2, 4, 4, 4, 4, 0, 1, 1, 3, 0, |
---|
218 | 3, 1, 3, 1, 3, 0, 2, 2, 3, 9, |
---|
219 | 3, 5, 7, 5, 9, 2, 1, 1, 1, 1, |
---|
220 | 1, 2, 3, 3, 4, 3, 3, 3, 3, 3, |
---|
221 | 2, 2, 2, 2, 6, 3, 4, 5, 3, 3, |
---|
222 | 3, 3, 3, 3, 3, 3, 3, 3, 0, 1, |
---|
223 | 0, 1, 1, 3 |
---|
224 | }; |
---|
225 | |
---|
226 | static const short yydefact[] = { 1, |
---|
227 | 0, 41, 38, 37, 39, 40, 0, 0, 0, 0, |
---|
228 | 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, |
---|
229 | 2, 7, 0, 0, 0, 0, 0, 0, 51, 52, |
---|
230 | 71, 0, 0, 26, 8, 8, 28, 0, 0, 0, |
---|
231 | 69, 42, 53, 54, 0, 0, 0, 0, 0, 0, |
---|
232 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
233 | 36, 46, 47, 48, 49, 50, 73, 0, 72, 16, |
---|
234 | 10, 0, 0, 0, 29, 0, 0, 70, 0, 31, |
---|
235 | 27, 56, 0, 44, 43, 65, 66, 63, 64, 67, |
---|
236 | 68, 61, 62, 59, 60, 0, 45, 0, 18, 0, |
---|
237 | 17, 0, 3, 0, 4, 5, 0, 0, 0, 0, |
---|
238 | 57, 74, 0, 0, 0, 0, 0, 0, 6, 11, |
---|
239 | 0, 32, 34, 0, 58, 0, 20, 19, 26, 26, |
---|
240 | 26, 26, 9, 0, 69, 55, 0, 26, 0, 0, |
---|
241 | 0, 0, 33, 0, 24, 0, 22, 0, 15, 14, |
---|
242 | 12, 13, 0, 0, 21, 0, 30, 35, 25, 23, |
---|
243 | 0, 0 |
---|
244 | }; |
---|
245 | |
---|
246 | static const short yydefgoto[] = { 1, |
---|
247 | 21, 73, 102, 120, 100, 101, 138, 146, 147, 45, |
---|
248 | 81, 23, 79, 68, 69 |
---|
249 | }; |
---|
250 | |
---|
251 | static const short yypact[] = {-32768, |
---|
252 | 51, 312,-32768,-32768,-32768,-32768, 1, 8, -33, -22, |
---|
253 | -21, 281, -24, -23, -16, 303, 24, 31,-32768, 303, |
---|
254 | -32768,-32768, 380, 303, 303, 303, 303, 303,-32768,-32768, |
---|
255 | 303, -14, 20,-32768,-32768,-32768,-32768, 400, 303, 303, |
---|
256 | 303, 10,-32768,-32768, 115, 47, 303, 303, 303, 303, |
---|
257 | 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, |
---|
258 | -32768, 475, 475, 475, 475, 475, 475, 19, 26, 65, |
---|
259 | -32768, 134, 4, 6,-32768, 334, 357, 475, 25,-32768, |
---|
260 | -32768,-32768, 459, 490, 504, 516, 516, 89, 89, 89, |
---|
261 | 89, -36, -36, 10, 10, 440,-32768, 303,-32768, 38, |
---|
262 | 41, 18,-32768, 91,-32768,-32768, 275, 275, 303, 303, |
---|
263 | 74, 475, 60, 105, 64, 66, 67, 68,-32768,-32768, |
---|
264 | 69, 97,-32768, 420, 475, 303, 99,-32768,-32768,-32768, |
---|
265 | -32768,-32768,-32768, 275, 303, 475, 126,-32768, 162, 181, |
---|
266 | 209, 228,-32768, 86, 123, -29,-32768, 256,-32768,-32768, |
---|
267 | -32768,-32768, 275, 303,-32768, 126,-32768,-32768, 475,-32768, |
---|
268 | 145,-32768 |
---|
269 | }; |
---|
270 | |
---|
271 | static const short yypgoto[] = {-32768, |
---|
272 | -32768, 110,-32768,-32768,-32768,-32768,-32768,-32768, -9, -28, |
---|
273 | -1, -11, 13,-32768,-32768 |
---|
274 | }; |
---|
275 | |
---|
276 | |
---|
277 | #define YYLAST 559 |
---|
278 | |
---|
279 | |
---|
280 | static const short yytable[] = { 22, |
---|
281 | 38, 58, 59, 32, 42, 72, 60, 104, 46, 104, |
---|
282 | 33, 34, 62, 63, 64, 65, 66, 155, 156, 67, |
---|
283 | 115, 116, 35, 36, 39, 40, 43, 76, 77, 78, |
---|
284 | 117, 118, 41, 44, 70, 83, 84, 85, 86, 87, |
---|
285 | 88, 89, 90, 91, 92, 93, 94, 95, 96, 105, |
---|
286 | 161, 106, 60, 2, 3, 4, 5, 6, 7, 8, |
---|
287 | 9, 10, 11, 119, 71, 12, 13, 99, 97, 14, |
---|
288 | 15, 109, 47, 98, 48, 49, 50, 51, 52, 53, |
---|
289 | 54, 55, 56, 57, 58, 59, 112, 113, 114, 60, |
---|
290 | 16, 17, 18, 121, 126, 19, 82, 124, 125, 20, |
---|
291 | 139, 140, 141, 142, 127, 122, 123, 128, 129, 148, |
---|
292 | 130, 131, 132, 134, 136, 133, 137, 2, 3, 4, |
---|
293 | 5, 6, 7, 78, 56, 57, 58, 59, 145, 12, |
---|
294 | 13, 60, 143, 14, 15, 153, 2, 3, 4, 5, |
---|
295 | 6, 7, 159, 154, 162, 74, 160, 144, 12, 13, |
---|
296 | 0, 158, 14, 15, 16, 17, 18, 0, 0, 19, |
---|
297 | 80, 0, 0, 20, 2, 3, 4, 5, 6, 7, |
---|
298 | 0, 0, 0, 16, 17, 18, 12, 13, 19, 103, |
---|
299 | 14, 15, 20, 2, 3, 4, 5, 6, 7, 0, |
---|
300 | 0, 0, 0, 0, 0, 12, 13, 0, 0, 14, |
---|
301 | 15, 16, 17, 18, 0, 0, 19, 149, 0, 0, |
---|
302 | 20, 2, 3, 4, 5, 6, 7, 0, 0, 0, |
---|
303 | 16, 17, 18, 12, 13, 19, 150, 14, 15, 20, |
---|
304 | 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, |
---|
305 | 0, 0, 12, 13, 0, 0, 14, 15, 16, 17, |
---|
306 | 18, 0, 0, 19, 151, 0, 0, 20, 2, 3, |
---|
307 | 4, 5, 6, 7, 0, 0, 0, 16, 17, 18, |
---|
308 | 12, 13, 19, 152, 14, 15, 20, 2, 3, 4, |
---|
309 | 5, 6, 7, 2, 3, 4, 5, 6, 0, 12, |
---|
310 | 13, 0, 0, 14, 15, 16, 17, 18, 0, 0, |
---|
311 | 19, 157, 0, 0, 20, 2, 3, 4, 5, 6, |
---|
312 | 0, 0, 0, 0, 16, 17, 18, 0, 0, 19, |
---|
313 | 16, 17, 18, 20, 0, 0, 0, 37, 0, 20, |
---|
314 | 0, 0, 24, 25, 26, 27, 28, 0, 0, 0, |
---|
315 | 0, 0, 16, 17, 18, 0, 0, 0, 0, 0, |
---|
316 | 0, 20, 29, 30, 0, 0, 0, 0, 0, 47, |
---|
317 | 31, 48, 49, 50, 51, 52, 53, 54, 55, 56, |
---|
318 | 57, 58, 59, 0, 0, 0, 60, 0, 0, 0, |
---|
319 | 0, 0, 47, 107, 48, 49, 50, 51, 52, 53, |
---|
320 | 54, 55, 56, 57, 58, 59, 0, 0, 0, 60, |
---|
321 | 0, 0, 0, 0, 0, 47, 108, 48, 49, 50, |
---|
322 | 51, 52, 53, 54, 55, 56, 57, 58, 59, 0, |
---|
323 | 0, 0, 60, 0, 0, 47, 61, 48, 49, 50, |
---|
324 | 51, 52, 53, 54, 55, 56, 57, 58, 59, 0, |
---|
325 | 0, 0, 60, 0, 0, 47, 75, 48, 49, 50, |
---|
326 | 51, 52, 53, 54, 55, 56, 57, 58, 59, 0, |
---|
327 | 0, 0, 60, 0, 0, 47, 135, 48, 49, 50, |
---|
328 | 51, 52, 53, 54, 55, 56, 57, 58, 59, 0, |
---|
329 | 0, 0, 60, 111, 47, 110, 48, 49, 50, 51, |
---|
330 | 52, 53, 54, 55, 56, 57, 58, 59, 0, 0, |
---|
331 | 47, 60, 48, 49, 50, 51, 52, 53, 54, 55, |
---|
332 | 56, 57, 58, 59, 0, 0, 0, 60, 49, 50, |
---|
333 | 51, 52, 53, 54, 55, 56, 57, 58, 59, 0, |
---|
334 | 0, 0, 60, 50, 51, 52, 53, 54, 55, 56, |
---|
335 | 57, 58, 59, 0, 0, 0, 60, 52, 53, 54, |
---|
336 | 55, 56, 57, 58, 59, 0, 0, 0, 60 |
---|
337 | }; |
---|
338 | |
---|
339 | static const short yycheck[] = { 1, |
---|
340 | 12, 38, 39, 3, 16, 34, 43, 4, 20, 4, |
---|
341 | 3, 45, 24, 25, 26, 27, 28, 47, 48, 31, |
---|
342 | 3, 4, 45, 45, 49, 49, 3, 39, 40, 41, |
---|
343 | 13, 14, 49, 3, 49, 47, 48, 49, 50, 51, |
---|
344 | 52, 53, 54, 55, 56, 57, 58, 59, 60, 46, |
---|
345 | 0, 46, 43, 3, 4, 5, 6, 7, 8, 9, |
---|
346 | 10, 11, 12, 46, 45, 15, 16, 3, 50, 19, |
---|
347 | 20, 47, 26, 48, 28, 29, 30, 31, 32, 33, |
---|
348 | 34, 35, 36, 37, 38, 39, 98, 50, 48, 43, |
---|
349 | 40, 41, 42, 3, 21, 45, 50, 109, 110, 49, |
---|
350 | 129, 130, 131, 132, 45, 107, 108, 3, 45, 138, |
---|
351 | 45, 45, 45, 17, 126, 47, 18, 3, 4, 5, |
---|
352 | 6, 7, 8, 135, 36, 37, 38, 39, 3, 15, |
---|
353 | 16, 43, 134, 19, 20, 50, 3, 4, 5, 6, |
---|
354 | 7, 8, 154, 21, 0, 36, 156, 135, 15, 16, |
---|
355 | -1, 153, 19, 20, 40, 41, 42, -1, -1, 45, |
---|
356 | 46, -1, -1, 49, 3, 4, 5, 6, 7, 8, |
---|
357 | -1, -1, -1, 40, 41, 42, 15, 16, 45, 46, |
---|
358 | 19, 20, 49, 3, 4, 5, 6, 7, 8, -1, |
---|
359 | -1, -1, -1, -1, -1, 15, 16, -1, -1, 19, |
---|
360 | 20, 40, 41, 42, -1, -1, 45, 46, -1, -1, |
---|
361 | 49, 3, 4, 5, 6, 7, 8, -1, -1, -1, |
---|
362 | 40, 41, 42, 15, 16, 45, 46, 19, 20, 49, |
---|
363 | 3, 4, 5, 6, 7, 8, -1, -1, -1, -1, |
---|
364 | -1, -1, 15, 16, -1, -1, 19, 20, 40, 41, |
---|
365 | 42, -1, -1, 45, 46, -1, -1, 49, 3, 4, |
---|
366 | 5, 6, 7, 8, -1, -1, -1, 40, 41, 42, |
---|
367 | 15, 16, 45, 46, 19, 20, 49, 3, 4, 5, |
---|
368 | 6, 7, 8, 3, 4, 5, 6, 7, -1, 15, |
---|
369 | 16, -1, -1, 19, 20, 40, 41, 42, -1, -1, |
---|
370 | 45, 46, -1, -1, 49, 3, 4, 5, 6, 7, |
---|
371 | -1, -1, -1, -1, 40, 41, 42, -1, -1, 45, |
---|
372 | 40, 41, 42, 49, -1, -1, -1, 47, -1, 49, |
---|
373 | -1, -1, 21, 22, 23, 24, 25, -1, -1, -1, |
---|
374 | -1, -1, 40, 41, 42, -1, -1, -1, -1, -1, |
---|
375 | -1, 49, 41, 42, -1, -1, -1, -1, -1, 26, |
---|
376 | 49, 28, 29, 30, 31, 32, 33, 34, 35, 36, |
---|
377 | 37, 38, 39, -1, -1, -1, 43, -1, -1, -1, |
---|
378 | -1, -1, 26, 50, 28, 29, 30, 31, 32, 33, |
---|
379 | 34, 35, 36, 37, 38, 39, -1, -1, -1, 43, |
---|
380 | -1, -1, -1, -1, -1, 26, 50, 28, 29, 30, |
---|
381 | 31, 32, 33, 34, 35, 36, 37, 38, 39, -1, |
---|
382 | -1, -1, 43, -1, -1, 26, 47, 28, 29, 30, |
---|
383 | 31, 32, 33, 34, 35, 36, 37, 38, 39, -1, |
---|
384 | -1, -1, 43, -1, -1, 26, 47, 28, 29, 30, |
---|
385 | 31, 32, 33, 34, 35, 36, 37, 38, 39, -1, |
---|
386 | -1, -1, 43, -1, -1, 26, 47, 28, 29, 30, |
---|
387 | 31, 32, 33, 34, 35, 36, 37, 38, 39, -1, |
---|
388 | -1, -1, 43, 44, 26, 27, 28, 29, 30, 31, |
---|
389 | 32, 33, 34, 35, 36, 37, 38, 39, -1, -1, |
---|
390 | 26, 43, 28, 29, 30, 31, 32, 33, 34, 35, |
---|
391 | 36, 37, 38, 39, -1, -1, -1, 43, 29, 30, |
---|
392 | 31, 32, 33, 34, 35, 36, 37, 38, 39, -1, |
---|
393 | -1, -1, 43, 30, 31, 32, 33, 34, 35, 36, |
---|
394 | 37, 38, 39, -1, -1, -1, 43, 32, 33, 34, |
---|
395 | 35, 36, 37, 38, 39, -1, -1, -1, 43 |
---|
396 | }; |
---|
397 | /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ |
---|
398 | #line 3 "/usr/local/share/bison.simple" |
---|
399 | |
---|
400 | /* Skeleton output parser for bison, |
---|
401 | Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. |
---|
402 | |
---|
403 | This program is free software; you can redistribute it and/or modify |
---|
404 | it under the terms of the GNU General Public License as published by |
---|
405 | the Free Software Foundation; either version 2, or (at your option) |
---|
406 | any later version. |
---|
407 | |
---|
408 | This program is distributed in the hope that it will be useful, |
---|
409 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
410 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
411 | GNU General Public License for more details. |
---|
412 | |
---|
413 | You should have received a copy of the GNU General Public License |
---|
414 | along with this program; if not, write to the Free Software |
---|
415 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
---|
416 | |
---|
417 | /* As a special exception, when this file is copied by Bison into a |
---|
418 | Bison output file, you may use that output file without restriction. |
---|
419 | This special exception was added by the Free Software Foundation |
---|
420 | in version 1.24 of Bison. */ |
---|
421 | |
---|
422 | #ifndef alloca |
---|
423 | #ifdef __GNUC__ |
---|
424 | #define alloca __builtin_alloca |
---|
425 | #else /* not GNU C. */ |
---|
426 | #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) |
---|
427 | #include <alloca.h> |
---|
428 | #else /* not sparc */ |
---|
429 | #if defined (MSDOS) && !defined (__TURBOC__) |
---|
430 | #include <malloc.h> |
---|
431 | #else /* not MSDOS, or __TURBOC__ */ |
---|
432 | #if defined(_AIX) |
---|
433 | #include <malloc.h> |
---|
434 | #pragma alloca |
---|
435 | #else /* not MSDOS, __TURBOC__, or _AIX */ |
---|
436 | #ifdef __hpux |
---|
437 | #ifdef __cplusplus |
---|
438 | extern "C" { |
---|
439 | void *alloca (unsigned int); |
---|
440 | }; |
---|
441 | #else /* not __cplusplus */ |
---|
442 | void *alloca (); |
---|
443 | #endif /* not __cplusplus */ |
---|
444 | #endif /* __hpux */ |
---|
445 | #endif /* not _AIX */ |
---|
446 | #endif /* not MSDOS, or __TURBOC__ */ |
---|
447 | #endif /* not sparc. */ |
---|
448 | #endif /* not GNU C. */ |
---|
449 | #endif /* alloca not defined. */ |
---|
450 | |
---|
451 | /* This is the parser code that is written into each bison parser |
---|
452 | when the %semantic_parser declaration is not specified in the grammar. |
---|
453 | It was written by Richard Stallman by simplifying the hairy parser |
---|
454 | used when %semantic_parser is specified. */ |
---|
455 | |
---|
456 | /* Note: there must be only one dollar sign in this file. |
---|
457 | It is replaced by the list of actions, each action |
---|
458 | as one case of the switch. */ |
---|
459 | |
---|
460 | #define yyerrok (yyerrstatus = 0) |
---|
461 | #define yyclearin (yychar = YYEMPTY) |
---|
462 | #define YYEMPTY -2 |
---|
463 | #define YYEOF 0 |
---|
464 | #define YYACCEPT return(0) |
---|
465 | #define YYABORT return(1) |
---|
466 | #define YYERROR goto yyerrlab1 |
---|
467 | /* Like YYERROR except do call yyerror. |
---|
468 | This remains here temporarily to ease the |
---|
469 | transition to the new meaning of YYERROR, for GCC. |
---|
470 | Once GCC version 2 has supplanted version 1, this can go. */ |
---|
471 | #define YYFAIL goto yyerrlab |
---|
472 | #define YYRECOVERING() (!!yyerrstatus) |
---|
473 | #define YYBACKUP(token, value) \ |
---|
474 | do \ |
---|
475 | if (yychar == YYEMPTY && yylen == 1) \ |
---|
476 | { yychar = (token), yylval = (value); \ |
---|
477 | yychar1 = YYTRANSLATE (yychar); \ |
---|
478 | YYPOPSTACK; \ |
---|
479 | goto yybackup; \ |
---|
480 | } \ |
---|
481 | else \ |
---|
482 | { yyerror ("syntax error: cannot back up"); YYERROR; } \ |
---|
483 | while (0) |
---|
484 | |
---|
485 | #define YYTERROR 1 |
---|
486 | #define YYERRCODE 256 |
---|
487 | |
---|
488 | #ifndef YYPURE |
---|
489 | #define YYLEX yylex() |
---|
490 | #endif |
---|
491 | |
---|
492 | #ifdef YYPURE |
---|
493 | #ifdef YYLSP_NEEDED |
---|
494 | #ifdef YYLEX_PARAM |
---|
495 | #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) |
---|
496 | #else |
---|
497 | #define YYLEX yylex(&yylval, &yylloc) |
---|
498 | #endif |
---|
499 | #else /* not YYLSP_NEEDED */ |
---|
500 | #ifdef YYLEX_PARAM |
---|
501 | #define YYLEX yylex(&yylval, YYLEX_PARAM) |
---|
502 | #else |
---|
503 | #define YYLEX yylex(&yylval) |
---|
504 | #endif |
---|
505 | #endif /* not YYLSP_NEEDED */ |
---|
506 | #endif |
---|
507 | |
---|
508 | /* If nonreentrant, generate the variables here */ |
---|
509 | |
---|
510 | #ifndef YYPURE |
---|
511 | |
---|
512 | int yychar; /* the lookahead symbol */ |
---|
513 | YYSTYPE yylval; /* the semantic value of the */ |
---|
514 | /* lookahead symbol */ |
---|
515 | |
---|
516 | #ifdef YYLSP_NEEDED |
---|
517 | YYLTYPE yylloc; /* location data for the lookahead */ |
---|
518 | /* symbol */ |
---|
519 | #endif |
---|
520 | |
---|
521 | int yynerrs; /* number of parse errors so far */ |
---|
522 | #endif /* not YYPURE */ |
---|
523 | |
---|
524 | #if YYDEBUG != 0 |
---|
525 | int yydebug; /* nonzero means print parse trace */ |
---|
526 | /* Since this is uninitialized, it does not stop multiple parsers |
---|
527 | from coexisting. */ |
---|
528 | #endif |
---|
529 | |
---|
530 | /* YYINITDEPTH indicates the initial size of the parser's stacks */ |
---|
531 | |
---|
532 | #ifndef YYINITDEPTH |
---|
533 | #define YYINITDEPTH 200 |
---|
534 | #endif |
---|
535 | |
---|
536 | /* YYMAXDEPTH is the maximum size the stacks can grow to |
---|
537 | (effective only if the built-in stack extension method is used). */ |
---|
538 | |
---|
539 | #if YYMAXDEPTH == 0 |
---|
540 | #undef YYMAXDEPTH |
---|
541 | #endif |
---|
542 | |
---|
543 | #ifndef YYMAXDEPTH |
---|
544 | #define YYMAXDEPTH 10000 |
---|
545 | #endif |
---|
546 | |
---|
547 | /* Prevent warning if -Wstrict-prototypes. */ |
---|
548 | #ifdef __GNUC__ |
---|
549 | int yyparse (void); |
---|
550 | #endif |
---|
551 | |
---|
552 | #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ |
---|
553 | #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) |
---|
554 | #else /* not GNU C or C++ */ |
---|
555 | #ifndef __cplusplus |
---|
556 | |
---|
557 | /* This is the most reliable way to avoid incompatibilities |
---|
558 | in available built-in functions on various systems. */ |
---|
559 | static void |
---|
560 | __yy_memcpy (to, from, count) |
---|
561 | char *to; |
---|
562 | char *from; |
---|
563 | int count; |
---|
564 | { |
---|
565 | register char *f = from; |
---|
566 | register char *t = to; |
---|
567 | register int i = count; |
---|
568 | |
---|
569 | while (i-- > 0) |
---|
570 | *t++ = *f++; |
---|
571 | } |
---|
572 | |
---|
573 | #else /* __cplusplus */ |
---|
574 | |
---|
575 | /* This is the most reliable way to avoid incompatibilities |
---|
576 | in available built-in functions on various systems. */ |
---|
577 | static void |
---|
578 | __yy_memcpy (char *to, char *from, int count) |
---|
579 | { |
---|
580 | register char *f = from; |
---|
581 | register char *t = to; |
---|
582 | register int i = count; |
---|
583 | |
---|
584 | while (i-- > 0) |
---|
585 | *t++ = *f++; |
---|
586 | } |
---|
587 | |
---|
588 | #endif |
---|
589 | #endif |
---|
590 | |
---|
591 | #line 196 "/usr/local/share/bison.simple" |
---|
592 | |
---|
593 | /* The user can define YYPARSE_PARAM as the name of an argument to be passed |
---|
594 | into yyparse. The argument should have type void *. |
---|
595 | It should actually point to an object. |
---|
596 | Grammar actions can access the variable by casting it |
---|
597 | to the proper pointer type. */ |
---|
598 | |
---|
599 | #ifdef YYPARSE_PARAM |
---|
600 | #ifdef __cplusplus |
---|
601 | #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM |
---|
602 | #define YYPARSE_PARAM_DECL |
---|
603 | #else /* not __cplusplus */ |
---|
604 | #define YYPARSE_PARAM_ARG YYPARSE_PARAM |
---|
605 | #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; |
---|
606 | #endif /* not __cplusplus */ |
---|
607 | #else /* not YYPARSE_PARAM */ |
---|
608 | #define YYPARSE_PARAM_ARG |
---|
609 | #define YYPARSE_PARAM_DECL |
---|
610 | #endif /* not YYPARSE_PARAM */ |
---|
611 | |
---|
612 | int |
---|
613 | yyparse(YYPARSE_PARAM_ARG) |
---|
614 | YYPARSE_PARAM_DECL |
---|
615 | { |
---|
616 | register int yystate; |
---|
617 | register int yyn; |
---|
618 | register short *yyssp; |
---|
619 | register YYSTYPE *yyvsp; |
---|
620 | int yyerrstatus; /* number of tokens to shift before error messages enabled */ |
---|
621 | int yychar1 = 0; /* lookahead token as an internal (translated) token number */ |
---|
622 | |
---|
623 | short yyssa[YYINITDEPTH]; /* the state stack */ |
---|
624 | YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ |
---|
625 | |
---|
626 | short *yyss = yyssa; /* refer to the stacks thru separate pointers */ |
---|
627 | YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ |
---|
628 | |
---|
629 | #ifdef YYLSP_NEEDED |
---|
630 | YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ |
---|
631 | YYLTYPE *yyls = yylsa; |
---|
632 | YYLTYPE *yylsp; |
---|
633 | |
---|
634 | #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) |
---|
635 | #else |
---|
636 | #define YYPOPSTACK (yyvsp--, yyssp--) |
---|
637 | #endif |
---|
638 | |
---|
639 | int yystacksize = YYINITDEPTH; |
---|
640 | |
---|
641 | #ifdef YYPURE |
---|
642 | int yychar; |
---|
643 | YYSTYPE yylval; |
---|
644 | int yynerrs; |
---|
645 | #ifdef YYLSP_NEEDED |
---|
646 | YYLTYPE yylloc; |
---|
647 | #endif |
---|
648 | #endif |
---|
649 | |
---|
650 | YYSTYPE yyval; /* the variable used to return */ |
---|
651 | /* semantic values from the action */ |
---|
652 | /* routines */ |
---|
653 | |
---|
654 | int yylen; |
---|
655 | |
---|
656 | #if YYDEBUG != 0 |
---|
657 | if (yydebug) |
---|
658 | fprintf(stderr, "Starting parse\n"); |
---|
659 | #endif |
---|
660 | |
---|
661 | yystate = 0; |
---|
662 | yyerrstatus = 0; |
---|
663 | yynerrs = 0; |
---|
664 | yychar = YYEMPTY; /* Cause a token to be read. */ |
---|
665 | |
---|
666 | /* Initialize stack pointers. |
---|
667 | Waste one element of value and location stack |
---|
668 | so that they stay on the same level as the state stack. |
---|
669 | The wasted elements are never initialized. */ |
---|
670 | |
---|
671 | yyssp = yyss - 1; |
---|
672 | yyvsp = yyvs; |
---|
673 | #ifdef YYLSP_NEEDED |
---|
674 | yylsp = yyls; |
---|
675 | #endif |
---|
676 | |
---|
677 | /* Push a new state, which is found in yystate . */ |
---|
678 | /* In all cases, when you get here, the value and location stacks |
---|
679 | have just been pushed. so pushing a state here evens the stacks. */ |
---|
680 | yynewstate: |
---|
681 | |
---|
682 | *++yyssp = yystate; |
---|
683 | |
---|
684 | if (yyssp >= yyss + yystacksize - 1) |
---|
685 | { |
---|
686 | /* Give user a chance to reallocate the stack */ |
---|
687 | /* Use copies of these so that the &'s don't force the real ones into memory. */ |
---|
688 | YYSTYPE *yyvs1 = yyvs; |
---|
689 | short *yyss1 = yyss; |
---|
690 | #ifdef YYLSP_NEEDED |
---|
691 | YYLTYPE *yyls1 = yyls; |
---|
692 | #endif |
---|
693 | |
---|
694 | /* Get the current used size of the three stacks, in elements. */ |
---|
695 | int size = yyssp - yyss + 1; |
---|
696 | |
---|
697 | #ifdef yyoverflow |
---|
698 | /* Each stack pointer address is followed by the size of |
---|
699 | the data in use in that stack, in bytes. */ |
---|
700 | #ifdef YYLSP_NEEDED |
---|
701 | /* This used to be a conditional around just the two extra args, |
---|
702 | but that might be undefined if yyoverflow is a macro. */ |
---|
703 | yyoverflow("parser stack overflow", |
---|
704 | &yyss1, size * sizeof (*yyssp), |
---|
705 | &yyvs1, size * sizeof (*yyvsp), |
---|
706 | &yyls1, size * sizeof (*yylsp), |
---|
707 | &yystacksize); |
---|
708 | #else |
---|
709 | yyoverflow("parser stack overflow", |
---|
710 | &yyss1, size * sizeof (*yyssp), |
---|
711 | &yyvs1, size * sizeof (*yyvsp), |
---|
712 | &yystacksize); |
---|
713 | #endif |
---|
714 | |
---|
715 | yyss = yyss1; yyvs = yyvs1; |
---|
716 | #ifdef YYLSP_NEEDED |
---|
717 | yyls = yyls1; |
---|
718 | #endif |
---|
719 | #else /* no yyoverflow */ |
---|
720 | /* Extend the stack our own way. */ |
---|
721 | if (yystacksize >= YYMAXDEPTH) |
---|
722 | { |
---|
723 | yyerror("parser stack overflow"); |
---|
724 | return 2; |
---|
725 | } |
---|
726 | yystacksize *= 2; |
---|
727 | if (yystacksize > YYMAXDEPTH) |
---|
728 | yystacksize = YYMAXDEPTH; |
---|
729 | yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); |
---|
730 | __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp)); |
---|
731 | yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); |
---|
732 | __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp)); |
---|
733 | #ifdef YYLSP_NEEDED |
---|
734 | yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); |
---|
735 | __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp)); |
---|
736 | #endif |
---|
737 | #endif /* no yyoverflow */ |
---|
738 | |
---|
739 | yyssp = yyss + size - 1; |
---|
740 | yyvsp = yyvs + size - 1; |
---|
741 | #ifdef YYLSP_NEEDED |
---|
742 | yylsp = yyls + size - 1; |
---|
743 | #endif |
---|
744 | |
---|
745 | #if YYDEBUG != 0 |
---|
746 | if (yydebug) |
---|
747 | fprintf(stderr, "Stack size increased to %d\n", yystacksize); |
---|
748 | #endif |
---|
749 | |
---|
750 | if (yyssp >= yyss + yystacksize - 1) |
---|
751 | YYABORT; |
---|
752 | } |
---|
753 | |
---|
754 | #if YYDEBUG != 0 |
---|
755 | if (yydebug) |
---|
756 | fprintf(stderr, "Entering state %d\n", yystate); |
---|
757 | #endif |
---|
758 | |
---|
759 | goto yybackup; |
---|
760 | yybackup: |
---|
761 | |
---|
762 | /* Do appropriate processing given the current state. */ |
---|
763 | /* Read a lookahead token if we need one and don't already have one. */ |
---|
764 | /* yyresume: */ |
---|
765 | |
---|
766 | /* First try to decide what to do without reference to lookahead token. */ |
---|
767 | |
---|
768 | yyn = yypact[yystate]; |
---|
769 | if (yyn == YYFLAG) |
---|
770 | goto yydefault; |
---|
771 | |
---|
772 | /* Not known => get a lookahead token if don't already have one. */ |
---|
773 | |
---|
774 | /* yychar is either YYEMPTY or YYEOF |
---|
775 | or a valid token in external form. */ |
---|
776 | |
---|
777 | if (yychar == YYEMPTY) |
---|
778 | { |
---|
779 | #if YYDEBUG != 0 |
---|
780 | if (yydebug) |
---|
781 | fprintf(stderr, "Reading a token: "); |
---|
782 | #endif |
---|
783 | yychar = YYLEX; |
---|
784 | } |
---|
785 | |
---|
786 | /* Convert token to internal form (in yychar1) for indexing tables with */ |
---|
787 | |
---|
788 | if (yychar <= 0) /* This means end of input. */ |
---|
789 | { |
---|
790 | yychar1 = 0; |
---|
791 | yychar = YYEOF; /* Don't call YYLEX any more */ |
---|
792 | |
---|
793 | #if YYDEBUG != 0 |
---|
794 | if (yydebug) |
---|
795 | fprintf(stderr, "Now at end of input.\n"); |
---|
796 | #endif |
---|
797 | } |
---|
798 | else |
---|
799 | { |
---|
800 | yychar1 = YYTRANSLATE(yychar); |
---|
801 | |
---|
802 | #if YYDEBUG != 0 |
---|
803 | if (yydebug) |
---|
804 | { |
---|
805 | fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); |
---|
806 | /* Give the individual parser a way to print the precise meaning |
---|
807 | of a token, for further debugging info. */ |
---|
808 | #ifdef YYPRINT |
---|
809 | YYPRINT (stderr, yychar, yylval); |
---|
810 | #endif |
---|
811 | fprintf (stderr, ")\n"); |
---|
812 | } |
---|
813 | #endif |
---|
814 | } |
---|
815 | |
---|
816 | yyn += yychar1; |
---|
817 | if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) |
---|
818 | goto yydefault; |
---|
819 | |
---|
820 | yyn = yytable[yyn]; |
---|
821 | |
---|
822 | /* yyn is what to do for this token type in this state. |
---|
823 | Negative => reduce, -yyn is rule number. |
---|
824 | Positive => shift, yyn is new state. |
---|
825 | New state is final state => don't bother to shift, |
---|
826 | just return success. |
---|
827 | 0, or most negative number => error. */ |
---|
828 | |
---|
829 | if (yyn < 0) |
---|
830 | { |
---|
831 | if (yyn == YYFLAG) |
---|
832 | goto yyerrlab; |
---|
833 | yyn = -yyn; |
---|
834 | goto yyreduce; |
---|
835 | } |
---|
836 | else if (yyn == 0) |
---|
837 | goto yyerrlab; |
---|
838 | |
---|
839 | if (yyn == YYFINAL) |
---|
840 | YYACCEPT; |
---|
841 | |
---|
842 | /* Shift the lookahead token. */ |
---|
843 | |
---|
844 | #if YYDEBUG != 0 |
---|
845 | if (yydebug) |
---|
846 | fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); |
---|
847 | #endif |
---|
848 | |
---|
849 | /* Discard the token being shifted unless it is eof. */ |
---|
850 | if (yychar != YYEOF) |
---|
851 | yychar = YYEMPTY; |
---|
852 | |
---|
853 | *++yyvsp = yylval; |
---|
854 | #ifdef YYLSP_NEEDED |
---|
855 | *++yylsp = yylloc; |
---|
856 | #endif |
---|
857 | |
---|
858 | /* count tokens shifted since error; after three, turn off error status. */ |
---|
859 | if (yyerrstatus) yyerrstatus--; |
---|
860 | |
---|
861 | yystate = yyn; |
---|
862 | goto yynewstate; |
---|
863 | |
---|
864 | /* Do the default action for the current state. */ |
---|
865 | yydefault: |
---|
866 | |
---|
867 | yyn = yydefact[yystate]; |
---|
868 | if (yyn == 0) |
---|
869 | goto yyerrlab; |
---|
870 | |
---|
871 | /* Do a reduction. yyn is the number of a rule to reduce with. */ |
---|
872 | yyreduce: |
---|
873 | yylen = yyr2[yyn]; |
---|
874 | if (yylen > 0) |
---|
875 | yyval = yyvsp[1-yylen]; /* implement default value of the action */ |
---|
876 | |
---|
877 | #if YYDEBUG != 0 |
---|
878 | if (yydebug) |
---|
879 | { |
---|
880 | int i; |
---|
881 | |
---|
882 | fprintf (stderr, "Reducing via rule %d (line %d), ", |
---|
883 | yyn, yyrline[yyn]); |
---|
884 | |
---|
885 | /* Print the symbols being reduced, and their result. */ |
---|
886 | for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) |
---|
887 | fprintf (stderr, "%s ", yytname[yyrhs[i]]); |
---|
888 | fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); |
---|
889 | } |
---|
890 | #endif |
---|
891 | |
---|
892 | |
---|
893 | switch (yyn) { |
---|
894 | |
---|
895 | case 3: |
---|
896 | #line 71 "gram.y" |
---|
897 | { start_stmts = yyvsp[-1].lst; ; |
---|
898 | break;} |
---|
899 | case 4: |
---|
900 | #line 73 "gram.y" |
---|
901 | { startrules = yyvsp[-1].lst; ; |
---|
902 | break;} |
---|
903 | case 5: |
---|
904 | #line 75 "gram.y" |
---|
905 | { namerules = yyvsp[-1].lst; ; |
---|
906 | break;} |
---|
907 | case 6: |
---|
908 | #line 77 "gram.y" |
---|
909 | { define_state (yyvsp[-3].node, yyvsp[-1].lst); ; |
---|
910 | break;} |
---|
911 | case 7: |
---|
912 | #line 78 "gram.y" |
---|
913 | { list_append (global_stmts, yyvsp[0].stmt); ; |
---|
914 | break;} |
---|
915 | case 8: |
---|
916 | #line 81 "gram.y" |
---|
917 | { yyval.lst = list (); ; |
---|
918 | break;} |
---|
919 | case 9: |
---|
920 | #line 83 "gram.y" |
---|
921 | { list_append (yyvsp[-3].lst, cons (yyvsp[-2].node, yyvsp[-1].node)); ; |
---|
922 | break;} |
---|
923 | case 10: |
---|
924 | #line 86 "gram.y" |
---|
925 | { yyval.lst = list (); ; |
---|
926 | break;} |
---|
927 | case 11: |
---|
928 | #line 87 "gram.y" |
---|
929 | { list_append (yyvsp[-1].lst, yyvsp[0].cons); ; |
---|
930 | break;} |
---|
931 | case 12: |
---|
932 | #line 89 "gram.y" |
---|
933 | { yyval.cons = cons (RULE_BEGIN, yyvsp[-1].lst); ; |
---|
934 | break;} |
---|
935 | case 13: |
---|
936 | #line 90 "gram.y" |
---|
937 | { yyval.cons = cons (RULE_END, yyvsp[-1].lst); ; |
---|
938 | break;} |
---|
939 | case 14: |
---|
940 | #line 91 "gram.y" |
---|
941 | { yyval.cons = cons (yyvsp[-3].node, yyvsp[-1].lst); ; |
---|
942 | break;} |
---|
943 | case 15: |
---|
944 | #line 92 "gram.y" |
---|
945 | { yyval.cons = cons (yyvsp[-3].node, yyvsp[-1].lst); ; |
---|
946 | break;} |
---|
947 | case 16: |
---|
948 | #line 95 "gram.y" |
---|
949 | { yyval.lst = list (); ; |
---|
950 | break;} |
---|
951 | case 17: |
---|
952 | #line 96 "gram.y" |
---|
953 | { yyval.lst = yyvsp[0].lst; ; |
---|
954 | break;} |
---|
955 | case 18: |
---|
956 | #line 99 "gram.y" |
---|
957 | { yyval.lst = list (); list_append (yyval.lst, yyvsp[0].node); ; |
---|
958 | break;} |
---|
959 | case 19: |
---|
960 | #line 100 "gram.y" |
---|
961 | { list_append (yyvsp[-2].lst, yyvsp[0].node); ; |
---|
962 | break;} |
---|
963 | case 20: |
---|
964 | #line 103 "gram.y" |
---|
965 | { yyval.lst = list (); ; |
---|
966 | break;} |
---|
967 | case 21: |
---|
968 | #line 104 "gram.y" |
---|
969 | { yyval.lst = yyvsp[-1].lst; ; |
---|
970 | break;} |
---|
971 | case 22: |
---|
972 | #line 107 "gram.y" |
---|
973 | { yyval.lst = list (); list_append (yyval.lst, yyvsp[0].cons); ; |
---|
974 | break;} |
---|
975 | case 23: |
---|
976 | #line 108 "gram.y" |
---|
977 | { list_append (yyvsp[-2].lst, yyvsp[0].cons); ; |
---|
978 | break;} |
---|
979 | case 24: |
---|
980 | #line 111 "gram.y" |
---|
981 | { yyval.cons = cons (yyvsp[0].node, NULL); ; |
---|
982 | break;} |
---|
983 | case 25: |
---|
984 | #line 112 "gram.y" |
---|
985 | { yyval.cons = cons (yyvsp[-2].node, yyvsp[0].expr); ; |
---|
986 | break;} |
---|
987 | case 26: |
---|
988 | #line 115 "gram.y" |
---|
989 | { yyval.lst = list (); ; |
---|
990 | break;} |
---|
991 | case 27: |
---|
992 | #line 116 "gram.y" |
---|
993 | { list_append (yyvsp[-1].lst, yyvsp[0].stmt); ; |
---|
994 | break;} |
---|
995 | case 28: |
---|
996 | #line 119 "gram.y" |
---|
997 | { yyval.stmt = mk_stmt (sRETURN, NULL, NULL, |
---|
998 | NULL, NULL); ; |
---|
999 | break;} |
---|
1000 | case 29: |
---|
1001 | #line 121 "gram.y" |
---|
1002 | { yyval.stmt = mk_stmt (sRETURN, yyvsp[-1].expr, NULL, |
---|
1003 | NULL, NULL); ; |
---|
1004 | break;} |
---|
1005 | case 30: |
---|
1006 | #line 124 "gram.y" |
---|
1007 | { yyval.stmt = mk_stmt (sDEFSUB, yyvsp[-7].node, |
---|
1008 | cons (cons (yyvsp[-5].lst, yyvsp[-2].lst), |
---|
1009 | yyvsp[-1].lst), |
---|
1010 | NULL, NULL); ; |
---|
1011 | break;} |
---|
1012 | case 31: |
---|
1013 | #line 128 "gram.y" |
---|
1014 | { yyval.stmt = mk_stmt (sBLOCK, yyvsp[-1].lst, NULL, |
---|
1015 | NULL, NULL); ; |
---|
1016 | break;} |
---|
1017 | case 32: |
---|
1018 | #line 130 "gram.y" |
---|
1019 | { yyval.stmt = mk_stmt (sIF, yyvsp[-2].expr, yyvsp[0].stmt, NULL, |
---|
1020 | NULL); ; |
---|
1021 | break;} |
---|
1022 | case 33: |
---|
1023 | #line 133 "gram.y" |
---|
1024 | { yyval.stmt = mk_stmt (sIF, yyvsp[-4].expr, yyvsp[-2].stmt, yyvsp[0].stmt, |
---|
1025 | NULL); ; |
---|
1026 | break;} |
---|
1027 | case 34: |
---|
1028 | #line 135 "gram.y" |
---|
1029 | { yyval.stmt = mk_stmt (sWHILE, yyvsp[-2].expr, yyvsp[0].stmt, |
---|
1030 | NULL, NULL); ; |
---|
1031 | break;} |
---|
1032 | case 35: |
---|
1033 | #line 138 "gram.y" |
---|
1034 | { yyval.stmt = mk_stmt (sFOR, yyvsp[-6].expr, yyvsp[-4].expr, yyvsp[-2].expr, |
---|
1035 | yyvsp[0].stmt); ; |
---|
1036 | break;} |
---|
1037 | case 36: |
---|
1038 | #line 140 "gram.y" |
---|
1039 | { yyval.stmt = mk_stmt (sEXPR, yyvsp[-1].expr, NULL, |
---|
1040 | NULL, NULL); ; |
---|
1041 | break;} |
---|
1042 | case 37: |
---|
1043 | #line 144 "gram.y" |
---|
1044 | { yyval.expr = mk_expr (eSTRING, yyvsp[0].node, NULL, |
---|
1045 | NULL); ; |
---|
1046 | break;} |
---|
1047 | case 38: |
---|
1048 | #line 146 "gram.y" |
---|
1049 | { yyval.expr = mk_expr (eREGEXP, yyvsp[0].node, NULL, |
---|
1050 | NULL); ; |
---|
1051 | break;} |
---|
1052 | case 39: |
---|
1053 | #line 148 "gram.y" |
---|
1054 | { yyval.expr = mk_expr (eINTEGER, yyvsp[0].node, NULL, |
---|
1055 | NULL); ; |
---|
1056 | break;} |
---|
1057 | case 40: |
---|
1058 | #line 150 "gram.y" |
---|
1059 | { yyval.expr = mk_expr (eREAL, yyvsp[0].node, NULL, |
---|
1060 | NULL); ; |
---|
1061 | break;} |
---|
1062 | case 41: |
---|
1063 | #line 152 "gram.y" |
---|
1064 | { yyval.expr = mk_expr (eSYMBOL, yyvsp[0].node, NULL, |
---|
1065 | NULL); ; |
---|
1066 | break;} |
---|
1067 | case 42: |
---|
1068 | #line 154 "gram.y" |
---|
1069 | { yyval.expr = mk_expr (eNOT, yyvsp[0].expr, NULL, |
---|
1070 | NULL); ; |
---|
1071 | break;} |
---|
1072 | case 43: |
---|
1073 | #line 156 "gram.y" |
---|
1074 | { yyval.expr = mk_expr (eAND, yyvsp[-2].expr, yyvsp[0].expr, NULL); ; |
---|
1075 | break;} |
---|
1076 | case 44: |
---|
1077 | #line 157 "gram.y" |
---|
1078 | { yyval.expr = mk_expr (eOR, yyvsp[-2].expr, yyvsp[0].expr, NULL); ; |
---|
1079 | break;} |
---|
1080 | case 45: |
---|
1081 | #line 158 "gram.y" |
---|
1082 | { yyval.expr = mk_expr (eFCALL, yyvsp[-3].node, yyvsp[-1].lst, |
---|
1083 | NULL); ; |
---|
1084 | break;} |
---|
1085 | case 46: |
---|
1086 | #line 160 "gram.y" |
---|
1087 | { yyval.expr = mk_expr (eASSIGN, yyvsp[-2].node, yyvsp[0].expr, |
---|
1088 | NULL); ; |
---|
1089 | break;} |
---|
1090 | case 47: |
---|
1091 | #line 162 "gram.y" |
---|
1092 | { yyval.expr = mk_expr (eADDASSIGN, yyvsp[-2].node, yyvsp[0].expr, |
---|
1093 | NULL); ; |
---|
1094 | break;} |
---|
1095 | case 48: |
---|
1096 | #line 164 "gram.y" |
---|
1097 | { yyval.expr = mk_expr (eSUBASSIGN, yyvsp[-2].node, yyvsp[0].expr, |
---|
1098 | NULL); ; |
---|
1099 | break;} |
---|
1100 | case 49: |
---|
1101 | #line 166 "gram.y" |
---|
1102 | { yyval.expr = mk_expr (eMULASSIGN, yyvsp[-2].node, yyvsp[0].expr, |
---|
1103 | NULL); ; |
---|
1104 | break;} |
---|
1105 | case 50: |
---|
1106 | #line 168 "gram.y" |
---|
1107 | { yyval.expr = mk_expr (eDIVASSIGN, yyvsp[-2].node, yyvsp[0].expr, |
---|
1108 | NULL); ; |
---|
1109 | break;} |
---|
1110 | case 51: |
---|
1111 | #line 170 "gram.y" |
---|
1112 | { yyval.expr = mk_expr (ePOSTFIXADD, yyvsp[-1].node, NULL, |
---|
1113 | NULL); ; |
---|
1114 | break;} |
---|
1115 | case 52: |
---|
1116 | #line 172 "gram.y" |
---|
1117 | { yyval.expr = mk_expr (ePOSTFIXSUB, yyvsp[-1].node, NULL, |
---|
1118 | NULL); ; |
---|
1119 | break;} |
---|
1120 | case 53: |
---|
1121 | #line 174 "gram.y" |
---|
1122 | { yyval.expr = mk_expr (ePREFIXADD, yyvsp[0].node, NULL, |
---|
1123 | NULL); ; |
---|
1124 | break;} |
---|
1125 | case 54: |
---|
1126 | #line 176 "gram.y" |
---|
1127 | { yyval.expr = mk_expr (ePREFIXSUB, yyvsp[0].node, NULL, |
---|
1128 | NULL); ; |
---|
1129 | break;} |
---|
1130 | case 55: |
---|
1131 | #line 178 "gram.y" |
---|
1132 | { yyval.expr = mk_expr (eARRAYASSIGN, yyvsp[-5].expr, yyvsp[-3].expr, |
---|
1133 | yyvsp[0].expr); ; |
---|
1134 | break;} |
---|
1135 | case 56: |
---|
1136 | #line 180 "gram.y" |
---|
1137 | { yyval.expr = yyvsp[-1].expr; ; |
---|
1138 | break;} |
---|
1139 | case 57: |
---|
1140 | #line 181 "gram.y" |
---|
1141 | { yyval.expr = mk_expr (eARRAYREF, yyvsp[-3].expr, yyvsp[-1].expr, |
---|
1142 | NULL); ; |
---|
1143 | break;} |
---|
1144 | case 58: |
---|
1145 | #line 183 "gram.y" |
---|
1146 | { yyval.expr = mk_expr (eQUESTCOLON, yyvsp[-4].expr, yyvsp[-2].expr, |
---|
1147 | yyvsp[0].expr); ; |
---|
1148 | break;} |
---|
1149 | case 59: |
---|
1150 | #line 185 "gram.y" |
---|
1151 | { yyval.expr = mk_expr (eMULT, yyvsp[-2].expr, yyvsp[0].expr, NULL); ; |
---|
1152 | break;} |
---|
1153 | case 60: |
---|
1154 | #line 186 "gram.y" |
---|
1155 | { yyval.expr = mk_expr (eDIV, yyvsp[-2].expr, yyvsp[0].expr, NULL); ; |
---|
1156 | break;} |
---|
1157 | case 61: |
---|
1158 | #line 187 "gram.y" |
---|
1159 | { yyval.expr = mk_expr (ePLUS, yyvsp[-2].expr, yyvsp[0].expr, NULL); ; |
---|
1160 | break;} |
---|
1161 | case 62: |
---|
1162 | #line 188 "gram.y" |
---|
1163 | { yyval.expr = mk_expr (eMINUS, yyvsp[-2].expr, yyvsp[0].expr, |
---|
1164 | NULL); ; |
---|
1165 | break;} |
---|
1166 | case 63: |
---|
1167 | #line 190 "gram.y" |
---|
1168 | { yyval.expr = mk_expr (eLT, yyvsp[-2].expr, yyvsp[0].expr, NULL); ; |
---|
1169 | break;} |
---|
1170 | case 64: |
---|
1171 | #line 191 "gram.y" |
---|
1172 | { yyval.expr = mk_expr (eGT, yyvsp[-2].expr, yyvsp[0].expr, NULL); ; |
---|
1173 | break;} |
---|
1174 | case 65: |
---|
1175 | #line 192 "gram.y" |
---|
1176 | { yyval.expr = mk_expr (eEQ, yyvsp[-2].expr, yyvsp[0].expr, NULL); ; |
---|
1177 | break;} |
---|
1178 | case 66: |
---|
1179 | #line 193 "gram.y" |
---|
1180 | { yyval.expr = mk_expr (eNE, yyvsp[-2].expr, yyvsp[0].expr, NULL); ; |
---|
1181 | break;} |
---|
1182 | case 67: |
---|
1183 | #line 194 "gram.y" |
---|
1184 | { yyval.expr = mk_expr (eGE, yyvsp[-2].expr, yyvsp[0].expr, NULL); ; |
---|
1185 | break;} |
---|
1186 | case 68: |
---|
1187 | #line 195 "gram.y" |
---|
1188 | { yyval.expr = mk_expr (eLE, yyvsp[-2].expr, yyvsp[0].expr, NULL); ; |
---|
1189 | break;} |
---|
1190 | case 69: |
---|
1191 | #line 198 "gram.y" |
---|
1192 | { yyval.expr = NULL; ; |
---|
1193 | break;} |
---|
1194 | case 70: |
---|
1195 | #line 199 "gram.y" |
---|
1196 | { yyval.expr = yyvsp[0].expr; ; |
---|
1197 | break;} |
---|
1198 | case 71: |
---|
1199 | #line 202 "gram.y" |
---|
1200 | { yyval.lst = list (); ; |
---|
1201 | break;} |
---|
1202 | case 72: |
---|
1203 | #line 203 "gram.y" |
---|
1204 | { yyval.lst = yyvsp[0].lst; ; |
---|
1205 | break;} |
---|
1206 | case 73: |
---|
1207 | #line 206 "gram.y" |
---|
1208 | { yyval.lst = list (); list_append (yyval.lst, yyvsp[0].expr); ; |
---|
1209 | break;} |
---|
1210 | case 74: |
---|
1211 | #line 207 "gram.y" |
---|
1212 | { list_append (yyvsp[-2].lst, yyvsp[0].expr); ; |
---|
1213 | break;} |
---|
1214 | } |
---|
1215 | /* the action file gets copied in in place of this dollarsign */ |
---|
1216 | #line 498 "/usr/local/share/bison.simple" |
---|
1217 | |
---|
1218 | yyvsp -= yylen; |
---|
1219 | yyssp -= yylen; |
---|
1220 | #ifdef YYLSP_NEEDED |
---|
1221 | yylsp -= yylen; |
---|
1222 | #endif |
---|
1223 | |
---|
1224 | #if YYDEBUG != 0 |
---|
1225 | if (yydebug) |
---|
1226 | { |
---|
1227 | short *ssp1 = yyss - 1; |
---|
1228 | fprintf (stderr, "state stack now"); |
---|
1229 | while (ssp1 != yyssp) |
---|
1230 | fprintf (stderr, " %d", *++ssp1); |
---|
1231 | fprintf (stderr, "\n"); |
---|
1232 | } |
---|
1233 | #endif |
---|
1234 | |
---|
1235 | *++yyvsp = yyval; |
---|
1236 | |
---|
1237 | #ifdef YYLSP_NEEDED |
---|
1238 | yylsp++; |
---|
1239 | if (yylen == 0) |
---|
1240 | { |
---|
1241 | yylsp->first_line = yylloc.first_line; |
---|
1242 | yylsp->first_column = yylloc.first_column; |
---|
1243 | yylsp->last_line = (yylsp-1)->last_line; |
---|
1244 | yylsp->last_column = (yylsp-1)->last_column; |
---|
1245 | yylsp->text = 0; |
---|
1246 | } |
---|
1247 | else |
---|
1248 | { |
---|
1249 | yylsp->last_line = (yylsp+yylen-1)->last_line; |
---|
1250 | yylsp->last_column = (yylsp+yylen-1)->last_column; |
---|
1251 | } |
---|
1252 | #endif |
---|
1253 | |
---|
1254 | /* Now "shift" the result of the reduction. |
---|
1255 | Determine what state that goes to, |
---|
1256 | based on the state we popped back to |
---|
1257 | and the rule number reduced by. */ |
---|
1258 | |
---|
1259 | yyn = yyr1[yyn]; |
---|
1260 | |
---|
1261 | yystate = yypgoto[yyn - YYNTBASE] + *yyssp; |
---|
1262 | if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
---|
1263 | yystate = yytable[yystate]; |
---|
1264 | else |
---|
1265 | yystate = yydefgoto[yyn - YYNTBASE]; |
---|
1266 | |
---|
1267 | goto yynewstate; |
---|
1268 | |
---|
1269 | yyerrlab: /* here on detecting error */ |
---|
1270 | |
---|
1271 | if (! yyerrstatus) |
---|
1272 | /* If not already recovering from an error, report this error. */ |
---|
1273 | { |
---|
1274 | ++yynerrs; |
---|
1275 | |
---|
1276 | #ifdef YYERROR_VERBOSE |
---|
1277 | yyn = yypact[yystate]; |
---|
1278 | |
---|
1279 | if (yyn > YYFLAG && yyn < YYLAST) |
---|
1280 | { |
---|
1281 | int size = 0; |
---|
1282 | char *msg; |
---|
1283 | int x, count; |
---|
1284 | |
---|
1285 | count = 0; |
---|
1286 | /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ |
---|
1287 | for (x = (yyn < 0 ? -yyn : 0); |
---|
1288 | x < (sizeof(yytname) / sizeof(char *)); x++) |
---|
1289 | if (yycheck[x + yyn] == x) |
---|
1290 | size += strlen(yytname[x]) + 15, count++; |
---|
1291 | msg = (char *) malloc(size + 15); |
---|
1292 | if (msg != 0) |
---|
1293 | { |
---|
1294 | strcpy(msg, "parse error"); |
---|
1295 | |
---|
1296 | if (count < 5) |
---|
1297 | { |
---|
1298 | count = 0; |
---|
1299 | for (x = (yyn < 0 ? -yyn : 0); |
---|
1300 | x < (sizeof(yytname) / sizeof(char *)); x++) |
---|
1301 | if (yycheck[x + yyn] == x) |
---|
1302 | { |
---|
1303 | strcat(msg, count == 0 ? ", expecting `" : " or `"); |
---|
1304 | strcat(msg, yytname[x]); |
---|
1305 | strcat(msg, "'"); |
---|
1306 | count++; |
---|
1307 | } |
---|
1308 | } |
---|
1309 | yyerror(msg); |
---|
1310 | free(msg); |
---|
1311 | } |
---|
1312 | else |
---|
1313 | yyerror ("parse error; also virtual memory exceeded"); |
---|
1314 | } |
---|
1315 | else |
---|
1316 | #endif /* YYERROR_VERBOSE */ |
---|
1317 | yyerror("parse error"); |
---|
1318 | } |
---|
1319 | |
---|
1320 | goto yyerrlab1; |
---|
1321 | yyerrlab1: /* here on error raised explicitly by an action */ |
---|
1322 | |
---|
1323 | if (yyerrstatus == 3) |
---|
1324 | { |
---|
1325 | /* if just tried and failed to reuse lookahead token after an error, discard it. */ |
---|
1326 | |
---|
1327 | /* return failure if at end of input */ |
---|
1328 | if (yychar == YYEOF) |
---|
1329 | YYABORT; |
---|
1330 | |
---|
1331 | #if YYDEBUG != 0 |
---|
1332 | if (yydebug) |
---|
1333 | fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); |
---|
1334 | #endif |
---|
1335 | |
---|
1336 | yychar = YYEMPTY; |
---|
1337 | } |
---|
1338 | |
---|
1339 | /* Else will try to reuse lookahead token |
---|
1340 | after shifting the error token. */ |
---|
1341 | |
---|
1342 | yyerrstatus = 3; /* Each real token shifted decrements this */ |
---|
1343 | |
---|
1344 | goto yyerrhandle; |
---|
1345 | |
---|
1346 | yyerrdefault: /* current state does not do anything special for the error token. */ |
---|
1347 | |
---|
1348 | #if 0 |
---|
1349 | /* This is wrong; only states that explicitly want error tokens |
---|
1350 | should shift them. */ |
---|
1351 | yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ |
---|
1352 | if (yyn) goto yydefault; |
---|
1353 | #endif |
---|
1354 | |
---|
1355 | yyerrpop: /* pop the current state because it cannot handle the error token */ |
---|
1356 | |
---|
1357 | if (yyssp == yyss) YYABORT; |
---|
1358 | yyvsp--; |
---|
1359 | yystate = *--yyssp; |
---|
1360 | #ifdef YYLSP_NEEDED |
---|
1361 | yylsp--; |
---|
1362 | #endif |
---|
1363 | |
---|
1364 | #if YYDEBUG != 0 |
---|
1365 | if (yydebug) |
---|
1366 | { |
---|
1367 | short *ssp1 = yyss - 1; |
---|
1368 | fprintf (stderr, "Error: state stack now"); |
---|
1369 | while (ssp1 != yyssp) |
---|
1370 | fprintf (stderr, " %d", *++ssp1); |
---|
1371 | fprintf (stderr, "\n"); |
---|
1372 | } |
---|
1373 | #endif |
---|
1374 | |
---|
1375 | yyerrhandle: |
---|
1376 | |
---|
1377 | yyn = yypact[yystate]; |
---|
1378 | if (yyn == YYFLAG) |
---|
1379 | goto yyerrdefault; |
---|
1380 | |
---|
1381 | yyn += YYTERROR; |
---|
1382 | if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) |
---|
1383 | goto yyerrdefault; |
---|
1384 | |
---|
1385 | yyn = yytable[yyn]; |
---|
1386 | if (yyn < 0) |
---|
1387 | { |
---|
1388 | if (yyn == YYFLAG) |
---|
1389 | goto yyerrpop; |
---|
1390 | yyn = -yyn; |
---|
1391 | goto yyreduce; |
---|
1392 | } |
---|
1393 | else if (yyn == 0) |
---|
1394 | goto yyerrpop; |
---|
1395 | |
---|
1396 | if (yyn == YYFINAL) |
---|
1397 | YYACCEPT; |
---|
1398 | |
---|
1399 | #if YYDEBUG != 0 |
---|
1400 | if (yydebug) |
---|
1401 | fprintf(stderr, "Shifting error token, "); |
---|
1402 | #endif |
---|
1403 | |
---|
1404 | *++yyvsp = yylval; |
---|
1405 | #ifdef YYLSP_NEEDED |
---|
1406 | *++yylsp = yylloc; |
---|
1407 | #endif |
---|
1408 | |
---|
1409 | yystate = yyn; |
---|
1410 | goto yynewstate; |
---|
1411 | } |
---|
1412 | #line 210 "gram.y" |
---|
1413 | |
---|
1414 | |
---|
1415 | void |
---|
1416 | yyerror (msg) |
---|
1417 | char *msg; |
---|
1418 | { |
---|
1419 | fprintf (stderr, "%s:%d: %s\n", defs_file, linenum, msg); |
---|
1420 | } |
---|