]>
Commit | Line | Data |
---|---|---|
885824d3 | 1 | /* |
2 | ** Inserted at beginning of c files generated by bison | |
3 | ** REMEMBER: Change bison.reset too. | |
4 | */ | |
5 | ||
6 | /*@-allmacros@*/ | |
7 | /*@+boolint@*/ | |
8 | /*@+charint@*/ | |
9 | /*@-macroparams@*/ | |
10 | /*@-macroundef@*/ | |
11 | /*@-unreachable@*/ | |
12 | /*@-macrospec@*/ | |
13 | /*@-varuse@*/ | |
14 | /*@+ignorequals@*/ | |
15 | /*@-macrostmt@*/ | |
16 | /*@-noeffect@*/ | |
17 | /*@-shadow@*/ | |
18 | /*@-exitarg@*/ | |
19 | /*@-macroredef@*/ | |
20 | /*@-uniondef@*/ | |
21 | /*@-compdef@*/ | |
22 | /*@-matchfields@*/ | |
23 | /*@-exportlocal@*/ | |
24 | /*@-evalorderuncon@*/ | |
25 | /*@-exportheader@*/ | |
26 | /*@-typeuse@*/ | |
27 | /*@-redecl@*/ | |
28 | /*@-redef@*/ | |
29 | /*@-noparams@*/ | |
30 | /*@-ansireserved@*/ | |
31 | /*@-fielduse@*/ | |
32 | /*@-ifblock@*/ | |
33 | /*@-elseifcomplete@*/ | |
34 | /*@-whileblock@*/ | |
35 | /*@-forblock@*/ | |
36 | /*@-branchstate@*/ | |
37 | /*@-readonlytrans@*/ | |
38 | /*@-namechecks@*/ | |
39 | /*@-usedef@*/ | |
40 | /*@-systemunrecog@*/ | |
41 | /*@-dependenttrans@*/ | |
42 | /*@-unqualifiedtrans@*/ | |
43 | /*@-nullassign@*/ | |
bb7c2085 | 44 | /*@-nullpass@*/ |
45 | /*@-nullptrarith*/ | |
46 | /*@-usereleased@*/ | |
bbed3d50 | 47 | /*@-declundef@*/ |
885824d3 | 48 | |
bbed3d50 | 49 | /*drl added 11/27/2001*/ |
bb7c2085 | 50 | /*@-bounds@*/ |
e015e087 | 51 | |
52 | /*drl added 12/11/2002*/ | |
53 | /*@-type@*/ | |
54 | ||
885824d3 | 55 | /* < end of bison.head > */ |
56 | ||
d0b80d80 | 57 | /* A Bison parser, made from signature.y |
58 | by GNU bison 1.35. */ | |
885824d3 | 59 | |
60 | #define YYBISON 1 /* Identify Bison output. */ | |
61 | ||
62 | #define yyparse lslparse | |
63 | #define yylex lsllex | |
64 | #define yyerror lslerror | |
65 | #define yylval lsllval | |
66 | #define yychar lslchar | |
67 | #define yydebug lsldebug | |
68 | #define yynerrs lslnerrs | |
d0b80d80 | 69 | # define LST_SIMPLEID 257 |
70 | # define LST_LOGICALOP 258 | |
71 | # define LST_EQOP 259 | |
72 | # define LST_SIMPLEOP 260 | |
73 | # define LST_MAPSYM 261 | |
74 | # define LST_FIELDMAPSYM 262 | |
75 | # define LST_MARKERSYM 263 | |
76 | # define LST_ifTOKEN 264 | |
77 | # define LST_thenTOKEN 265 | |
78 | # define LST_elseTOKEN 266 | |
79 | # define LST_LBRACKET 267 | |
80 | # define LST_RBRACKET 268 | |
81 | # define LST_SELECTSYM 269 | |
82 | # define LST_SEPSYM 270 | |
83 | # define LST_OPENSYM 271 | |
84 | # define LST_CLOSESYM 272 | |
85 | # define LST_COLON 273 | |
86 | # define LST_COMMA 274 | |
87 | # define LST_EOL 275 | |
88 | # define LST_COMMENTSYM 276 | |
89 | # define LST_WHITESPACE 277 | |
90 | # define LST_QUANTIFIERSYM 278 | |
91 | # define LST_EQUATIONSYM 279 | |
92 | # define LST_EQSEPSYM 280 | |
93 | # define LST_COMPOSESYM 281 | |
94 | # define LST_LPAR 282 | |
95 | # define LST_RPAR 283 | |
96 | # define LST_assertsTOKEN 284 | |
97 | # define LST_assumesTOKEN 285 | |
98 | # define LST_byTOKEN 286 | |
99 | # define LST_convertsTOKEN 287 | |
100 | # define LST_enumerationTOKEN 288 | |
101 | # define LST_equationsTOKEN 289 | |
102 | # define LST_exemptingTOKEN 290 | |
103 | # define LST_forTOKEN 291 | |
104 | # define LST_generatedTOKEN 292 | |
105 | # define LST_impliesTOKEN 293 | |
106 | # define LST_includesTOKEN 294 | |
107 | # define LST_introducesTOKEN 295 | |
108 | # define LST_ofTOKEN 296 | |
109 | # define LST_partitionedTOKEN 297 | |
110 | # define LST_traitTOKEN 298 | |
111 | # define LST_tupleTOKEN 299 | |
112 | # define LST_unionTOKEN 300 | |
113 | # define LST_BADTOKEN 301 | |
885824d3 | 114 | |
885824d3 | 115 | |
116 | ||
885824d3 | 117 | # include <stdio.h> |
1b8ae690 | 118 | # include "splintMacros.nf" |
885824d3 | 119 | # include "llbasic.h" |
120 | # include "lslparse.h" | |
121 | # include "signature.h" | |
122 | ||
4dd72714 | 123 | static void lslerror (char *); |
124 | extern int lsllex (); | |
125 | ||
885824d3 | 126 | /*@dependent@*/ /*@null@*/ lslOp importedlslOp; |
127 | ||
128 | /*@-noparams@*/ /* Can't list params since YYSTYPE isn't defined yet. */ | |
129 | static void yyprint (/*FILE *p_file, int p_type, YYSTYPE p_value */); | |
130 | /*@=noparams@*/ | |
131 | ||
132 | # define YYPRINT(file, type, value) yyprint (file, type, value) | |
133 | ||
134 | # define YYDEBUG 1 | |
135 | ||
bbed3d50 | 136 | /*@-redef@*/ |
137 | /*@-readonlytrans@*/ | |
138 | /*@-nullassign@*/ | |
885824d3 | 139 | |
140 | ||
d0b80d80 | 141 | #ifndef YYSTYPE |
885824d3 | 142 | typedef union { |
143 | ltoken ltok; /* a leaf is also an ltoken */ | |
144 | unsigned int count; | |
145 | /*@only@*/ ltokenList ltokenList; | |
146 | /*@only@*/ opFormNode opform; | |
147 | /*@owned@*/ sigNode signature; | |
148 | /*@only@*/ nameNode name; | |
149 | /*@owned@*/ lslOp operator; | |
150 | /*@only@*/ lslOpList operators; | |
bbed3d50 | 151 | /*@-redef@*/ /*@-matchfields@*/ |
d0b80d80 | 152 | } yystype; |
153 | # define YYSTYPE yystype | |
154 | # define YYSTYPE_IS_TRIVIAL 1 | |
a889b5ee | 155 | #endif |
d0b80d80 | 156 | #ifndef YYDEBUG |
157 | # define YYDEBUG 1 | |
a889b5ee | 158 | #endif |
159 | ||
885824d3 | 160 | |
161 | ||
162 | #define YYFINAL 62 | |
163 | #define YYFLAG -32768 | |
164 | #define YYNTBASE 48 | |
165 | ||
d0b80d80 | 166 | /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ |
bbed3d50 | 167 | #define YYTRANSLATE(x) ((unsigned)(x) <= 301 ? yytranslate[x] : 62) |
885824d3 | 168 | |
d0b80d80 | 169 | /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ |
170 | static const char yytranslate[] = | |
171 | { | |
172 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
173 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
174 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
175 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
176 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
177 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
178 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
179 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
180 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
181 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
182 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
183 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
184 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
185 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
186 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
187 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
188 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
189 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
190 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
191 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
192 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
193 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
194 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
195 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
196 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
197 | 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, | |
198 | 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, | |
199 | 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, | |
200 | 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, | |
201 | 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, | |
202 | 46, 47 | |
885824d3 | 203 | }; |
204 | ||
d0b80d80 | 205 | #if YYDEBUG |
206 | static const short yyprhs[] = | |
207 | { | |
208 | 0, 0, 2, 4, 7, 11, 13, 15, 22, 24, | |
209 | 27, 30, 34, 38, 43, 48, 54, 58, 63, 68, | |
210 | 74, 77, 81, 85, 87, 89, 91, 92, 94, 96, | |
211 | 100, 102, 104, 108, 109, 111, 113, 117, 119 | |
885824d3 | 212 | }; |
d0b80d80 | 213 | static const short yyrhs[] = |
214 | { | |
215 | 49, 0, 50, 0, 49, 50, 0, 51, 19, 57, | |
216 | 0, 61, 0, 52, 0, 10, 9, 11, 9, 12, | |
217 | 9, 0, 53, 0, 9, 53, 0, 53, 9, 0, | |
218 | 9, 53, 9, 0, 17, 54, 18, 0, 9, 17, | |
219 | 54, 18, 0, 17, 54, 18, 9, 0, 9, 17, | |
220 | 54, 18, 9, 0, 13, 54, 14, 0, 9, 13, | |
221 | 54, 14, 0, 13, 54, 14, 9, 0, 9, 13, | |
222 | 54, 14, 9, 0, 15, 3, 0, 9, 15, 3, | |
223 | 0, 9, 8, 3, 0, 6, 0, 4, 0, 5, | |
224 | 0, 0, 55, 0, 9, 0, 55, 56, 9, 0, | |
225 | 20, 0, 16, 0, 58, 7, 60, 0, 0, 59, | |
226 | 0, 60, 0, 59, 20, 60, 0, 3, 0, 3, | |
227 | 0 | |
885824d3 | 228 | }; |
229 | ||
230 | #endif | |
231 | ||
d0b80d80 | 232 | #if YYDEBUG |
233 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ | |
234 | static const short yyrline[] = | |
235 | { | |
2f2892c2 | 236 | 0, 139, 142, 147, 152, 159, 161, 166, 168, 170, |
237 | 172, 174, 176, 178, 180, 182, 185, 188, 191, 194, | |
238 | 197, 200, 205, 210, 212, 214, 218, 220, 224, 226, | |
239 | 230, 232, 236, 240, 242, 246, 248, 252, 259 | |
885824d3 | 240 | }; |
241 | #endif | |
242 | ||
243 | ||
d0b80d80 | 244 | #if (YYDEBUG) || defined YYERROR_VERBOSE |
245 | ||
246 | /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ | |
247 | static const char *const yytname[] = | |
248 | { | |
249 | "$", "error", "$undefined.", "LST_SIMPLEID", "LST_LOGICALOP", "LST_EQOP", | |
250 | "LST_SIMPLEOP", "LST_MAPSYM", "LST_FIELDMAPSYM", "LST_MARKERSYM", | |
251 | "LST_ifTOKEN", "LST_thenTOKEN", "LST_elseTOKEN", "LST_LBRACKET", | |
252 | "LST_RBRACKET", "LST_SELECTSYM", "LST_SEPSYM", "LST_OPENSYM", | |
253 | "LST_CLOSESYM", "LST_COLON", "LST_COMMA", "LST_EOL", "LST_COMMENTSYM", | |
254 | "LST_WHITESPACE", "LST_QUANTIFIERSYM", "LST_EQUATIONSYM", | |
255 | "LST_EQSEPSYM", "LST_COMPOSESYM", "LST_LPAR", "LST_RPAR", | |
256 | "LST_assertsTOKEN", "LST_assumesTOKEN", "LST_byTOKEN", | |
257 | "LST_convertsTOKEN", "LST_enumerationTOKEN", "LST_equationsTOKEN", | |
258 | "LST_exemptingTOKEN", "LST_forTOKEN", "LST_generatedTOKEN", | |
259 | "LST_impliesTOKEN", "LST_includesTOKEN", "LST_introducesTOKEN", | |
260 | "LST_ofTOKEN", "LST_partitionedTOKEN", "LST_traitTOKEN", | |
261 | "LST_tupleTOKEN", "LST_unionTOKEN", "LST_BADTOKEN", "top", | |
262 | "operatorList", "operator", "name", "opForm", "anyOp", "middle", | |
263 | "placeList", "separator", "signature", "domain", "sortList", "sortId", | |
264 | "opId", 0 | |
885824d3 | 265 | }; |
266 | #endif | |
267 | ||
d0b80d80 | 268 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
269 | static const short yyr1[] = | |
270 | { | |
271 | 0, 48, 49, 49, 50, 51, 51, 52, 52, 52, | |
272 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, | |
273 | 52, 52, 52, 53, 53, 53, 54, 54, 55, 55, | |
274 | 56, 56, 57, 58, 58, 59, 59, 60, 61 | |
885824d3 | 275 | }; |
276 | ||
d0b80d80 | 277 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
278 | static const short yyr2[] = | |
279 | { | |
280 | 0, 1, 1, 2, 3, 1, 1, 6, 1, 2, | |
281 | 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, | |
282 | 2, 3, 3, 1, 1, 1, 0, 1, 1, 3, | |
283 | 1, 1, 3, 0, 1, 1, 3, 1, 1 | |
885824d3 | 284 | }; |
285 | ||
d0b80d80 | 286 | /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE |
287 | doesn't specify something else to do. Zero means the default is an | |
288 | error. */ | |
289 | static const short yydefact[] = | |
290 | { | |
291 | 0, 38, 24, 25, 23, 0, 0, 26, 0, 26, | |
292 | 1, 2, 0, 6, 8, 5, 0, 26, 0, 26, | |
293 | 9, 0, 28, 0, 27, 20, 0, 3, 33, 10, | |
294 | 22, 0, 21, 0, 11, 0, 16, 31, 30, 0, | |
295 | 12, 37, 4, 0, 34, 35, 17, 13, 0, 18, | |
296 | 29, 14, 0, 0, 19, 15, 0, 32, 36, 7, | |
297 | 0, 0, 0 | |
885824d3 | 298 | }; |
299 | ||
d0b80d80 | 300 | static const short yydefgoto[] = |
301 | { | |
302 | 60, 10, 11, 12, 13, 14, 23, 24, 39, 42, | |
303 | 43, 44, 45, 15 | |
885824d3 | 304 | }; |
305 | ||
d0b80d80 | 306 | static const short yypact[] = |
307 | { | |
308 | -3,-32768,-32768,-32768,-32768, 11, -4, 0, 8, 0, | |
309 | -3,-32768, -1,-32768, 13,-32768, 17, 0, 22, 0, | |
310 | 18, 20,-32768, 19, -12,-32768, 14,-32768, 31,-32768, | |
311 | -32768, 21,-32768, 23,-32768, 27, 28,-32768,-32768, 29, | |
312 | 30,-32768,-32768, 33, 24,-32768, 34, 36, 35,-32768, | |
313 | -32768,-32768, 31, 31,-32768,-32768, 37,-32768,-32768,-32768, | |
314 | 42, 48,-32768 | |
885824d3 | 315 | }; |
316 | ||
d0b80d80 | 317 | static const short yypgoto[] = |
318 | { | |
319 | -32768,-32768, 39,-32768,-32768, 45, 4,-32768,-32768,-32768, | |
320 | -32768,-32768, -23,-32768 | |
885824d3 | 321 | }; |
322 | ||
323 | ||
324 | #define YYLAST 50 | |
325 | ||
326 | ||
d0b80d80 | 327 | static const short yytable[] = |
328 | { | |
329 | 1, 2, 3, 4, 37, 21, 5, 6, 38, 22, | |
330 | 7, 25, 8, 26, 9, 2, 3, 4, 28, 16, | |
331 | 30, 31, 29, 33, 17, 32, 18, 34, 19, 57, | |
332 | 58, 35, 40, 36, 41, 46, 48, 49, 50, 51, | |
333 | 52, 47, 61, 54, 53, 55, 59, 56, 62, 27, | |
334 | 20 | |
885824d3 | 335 | }; |
336 | ||
d0b80d80 | 337 | static const short yycheck[] = |
338 | { | |
339 | 3, 4, 5, 6, 16, 9, 9, 10, 20, 9, | |
340 | 13, 3, 15, 9, 17, 4, 5, 6, 19, 8, | |
341 | 3, 17, 9, 19, 13, 3, 15, 9, 17, 52, | |
342 | 53, 11, 18, 14, 3, 14, 9, 9, 9, 9, | |
343 | 7, 18, 0, 9, 20, 9, 9, 12, 0, 10, | |
344 | 5 | |
885824d3 | 345 | }; |
346 | #define YYPURE 1 | |
347 | ||
348 | /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ | |
3e3ec469 | 349 | |
885824d3 | 350 | /* Skeleton output parser for bison, |
d0b80d80 | 351 | |
352 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software | |
353 | Foundation, Inc. | |
885824d3 | 354 | |
355 | This program is free software; you can redistribute it and/or modify | |
356 | it under the terms of the GNU General Public License as published by | |
357 | the Free Software Foundation; either version 2, or (at your option) | |
358 | any later version. | |
359 | ||
360 | This program is distributed in the hope that it will be useful, | |
361 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
362 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
363 | GNU General Public License for more details. | |
364 | ||
365 | You should have received a copy of the GNU General Public License | |
366 | along with this program; if not, write to the Free Software | |
bbed3d50 | 367 | Foundation, Inc., 59 Temple Place - Suite 330, |
368 | Boston, MA 02111-1307, USA. */ | |
885824d3 | 369 | |
370 | /* As a special exception, when this file is copied by Bison into a | |
371 | Bison output file, you may use that output file without restriction. | |
372 | This special exception was added by the Free Software Foundation | |
373 | in version 1.24 of Bison. */ | |
374 | ||
d0b80d80 | 375 | /* This is the parser code that is written into each bison parser when |
376 | the %semantic_parser declaration is not specified in the grammar. | |
377 | It was written by Richard Stallman by simplifying the hairy parser | |
378 | used when %semantic_parser is specified. */ | |
379 | ||
380 | /* All symbols defined below should begin with yy or YY, to avoid | |
381 | infringing on user name space. This should be done even for local | |
382 | variables, as they might otherwise be expanded by user macros. | |
383 | There are some unavoidable exceptions within include files to | |
384 | define necessary library symbols; they are noted "INFRINGES ON | |
385 | USER NAME SPACE" below. */ | |
386 | ||
387 | #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) | |
388 | ||
389 | /* The parser invokes alloca or malloc; define the necessary symbols. */ | |
390 | ||
391 | # if YYSTACK_USE_ALLOCA | |
392 | # define YYSTACK_ALLOC alloca | |
393 | # else | |
394 | # ifndef YYSTACK_USE_ALLOCA | |
395 | # if defined (alloca) || defined (_ALLOCA_H) | |
396 | # define YYSTACK_ALLOC alloca | |
397 | # else | |
398 | # ifdef __GNUC__ | |
399 | # define YYSTACK_ALLOC __builtin_alloca | |
400 | # endif | |
401 | # endif | |
402 | # endif | |
403 | # endif | |
404 | ||
405 | # ifdef YYSTACK_ALLOC | |
406 | /* Pacify GCC's `empty if-body' warning. */ | |
407 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) | |
408 | # else | |
409 | # if defined (__STDC__) || defined (__cplusplus) | |
410 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | |
411 | # define YYSIZE_T size_t | |
412 | # endif | |
413 | # define YYSTACK_ALLOC malloc | |
414 | # define YYSTACK_FREE free | |
415 | # endif | |
416 | #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ | |
417 | ||
418 | ||
419 | #if (! defined (yyoverflow) \ | |
420 | && (! defined (__cplusplus) \ | |
421 | || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) | |
422 | ||
423 | /* A type that is properly aligned for any stack member. */ | |
424 | union yyalloc | |
425 | { | |
426 | short yyss; | |
427 | YYSTYPE yyvs; | |
428 | # if YYLSP_NEEDED | |
429 | YYLTYPE yyls; | |
430 | # endif | |
431 | }; | |
432 | ||
433 | /* The size of the maximum gap between one aligned stack and the next. */ | |
434 | # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) | |
435 | ||
436 | /* The size of an array large to enough to hold all stacks, each with | |
437 | N elements. */ | |
438 | # if YYLSP_NEEDED | |
439 | # define YYSTACK_BYTES(N) \ | |
440 | ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ | |
441 | + 2 * YYSTACK_GAP_MAX) | |
442 | # else | |
443 | # define YYSTACK_BYTES(N) \ | |
444 | ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ | |
445 | + YYSTACK_GAP_MAX) | |
446 | # endif | |
447 | ||
448 | /* Copy COUNT objects from FROM to TO. The source and destination do | |
449 | not overlap. */ | |
450 | # ifndef YYCOPY | |
451 | # if 1 < __GNUC__ | |
452 | # define YYCOPY(To, From, Count) \ | |
453 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) | |
454 | # else | |
455 | # define YYCOPY(To, From, Count) \ | |
456 | do \ | |
457 | { \ | |
458 | register YYSIZE_T yyi; \ | |
459 | for (yyi = 0; yyi < (Count); yyi++) \ | |
460 | (To)[yyi] = (From)[yyi]; \ | |
461 | } \ | |
462 | while (0) | |
463 | # endif | |
464 | # endif | |
465 | ||
466 | /* Relocate STACK from its old location to the new one. The | |
467 | local variables YYSIZE and YYSTACKSIZE give the old and new number of | |
468 | elements in the stack, and YYPTR gives the new location of the | |
469 | stack. Advance YYPTR to a properly aligned location for the next | |
470 | stack. */ | |
471 | # define YYSTACK_RELOCATE(Stack) \ | |
472 | do \ | |
473 | { \ | |
474 | YYSIZE_T yynewbytes; \ | |
475 | YYCOPY (&yyptr->Stack, Stack, yysize); \ | |
476 | Stack = &yyptr->Stack; \ | |
477 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ | |
478 | yyptr += yynewbytes / sizeof (*yyptr); \ | |
479 | } \ | |
480 | while (0) | |
bbed3d50 | 481 | |
a889b5ee | 482 | #endif |
d0b80d80 | 483 | |
484 | ||
485 | #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) | |
486 | # define YYSIZE_T __SIZE_TYPE__ | |
bbed3d50 | 487 | #endif |
d0b80d80 | 488 | #if ! defined (YYSIZE_T) && defined (size_t) |
489 | # define YYSIZE_T size_t | |
490 | #endif | |
491 | #if ! defined (YYSIZE_T) | |
492 | # if defined (__STDC__) || defined (__cplusplus) | |
493 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ | |
494 | # define YYSIZE_T size_t | |
495 | # endif | |
496 | #endif | |
497 | #if ! defined (YYSIZE_T) | |
498 | # define YYSIZE_T unsigned int | |
e55c0c6d | 499 | #endif |
a889b5ee | 500 | |
885824d3 | 501 | #define yyerrok (yyerrstatus = 0) |
502 | #define yyclearin (yychar = YYEMPTY) | |
503 | #define YYEMPTY -2 | |
504 | #define YYEOF 0 | |
bbed3d50 | 505 | #define YYACCEPT goto yyacceptlab |
506 | #define YYABORT goto yyabortlab | |
885824d3 | 507 | #define YYERROR goto yyerrlab1 |
d0b80d80 | 508 | /* Like YYERROR except do call yyerror. This remains here temporarily |
509 | to ease the transition to the new meaning of YYERROR, for GCC. | |
885824d3 | 510 | Once GCC version 2 has supplanted version 1, this can go. */ |
511 | #define YYFAIL goto yyerrlab | |
512 | #define YYRECOVERING() (!!yyerrstatus) | |
d0b80d80 | 513 | #define YYBACKUP(Token, Value) \ |
885824d3 | 514 | do \ |
515 | if (yychar == YYEMPTY && yylen == 1) \ | |
d0b80d80 | 516 | { \ |
517 | yychar = (Token); \ | |
518 | yylval = (Value); \ | |
885824d3 | 519 | yychar1 = YYTRANSLATE (yychar); \ |
520 | YYPOPSTACK; \ | |
521 | goto yybackup; \ | |
522 | } \ | |
523 | else \ | |
d0b80d80 | 524 | { \ |
525 | yyerror ("syntax error: cannot back up"); \ | |
526 | YYERROR; \ | |
527 | } \ | |
885824d3 | 528 | while (0) |
529 | ||
530 | #define YYTERROR 1 | |
531 | #define YYERRCODE 256 | |
532 | ||
a889b5ee | 533 | |
d0b80d80 | 534 | /* YYLLOC_DEFAULT -- Compute the default location (before the actions |
535 | are run). | |
a889b5ee | 536 | |
d0b80d80 | 537 | When YYLLOC_DEFAULT is run, CURRENT is set the location of the |
538 | first token. By default, to implement support for ranges, extend | |
539 | its range to the last symbol. */ | |
885824d3 | 540 | |
d0b80d80 | 541 | #ifndef YYLLOC_DEFAULT |
542 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ | |
543 | Current.last_line = Rhs[N].last_line; \ | |
544 | Current.last_column = Rhs[N].last_column; | |
a889b5ee | 545 | #endif |
546 | ||
885824d3 | 547 | |
d0b80d80 | 548 | /* YYLEX -- calling `yylex' with the right arguments. */ |
549 | ||
550 | #if YYPURE | |
551 | # if YYLSP_NEEDED | |
552 | # ifdef YYLEX_PARAM | |
553 | # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) | |
554 | # else | |
555 | # define YYLEX yylex (&yylval, &yylloc) | |
556 | # endif | |
557 | # else /* !YYLSP_NEEDED */ | |
558 | # ifdef YYLEX_PARAM | |
559 | # define YYLEX yylex (&yylval, YYLEX_PARAM) | |
560 | # else | |
561 | # define YYLEX yylex (&yylval) | |
562 | # endif | |
563 | # endif /* !YYLSP_NEEDED */ | |
564 | #else /* !YYPURE */ | |
565 | # define YYLEX yylex () | |
566 | #endif /* !YYPURE */ | |
567 | ||
568 | ||
569 | /* Enable debugging if requested. */ | |
570 | #if YYDEBUG | |
571 | ||
572 | # ifndef YYFPRINTF | |
573 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ | |
574 | # define YYFPRINTF fprintf | |
575 | # endif | |
576 | ||
577 | # define YYDPRINTF(Args) \ | |
578 | do { \ | |
579 | if (yydebug) \ | |
580 | YYFPRINTF Args; \ | |
581 | } while (0) | |
582 | /* Nonzero means print parse trace. It is left uninitialized so that | |
583 | multiple parsers can coexist. */ | |
584 | int yydebug; | |
585 | #else /* !YYDEBUG */ | |
586 | # define YYDPRINTF(Args) | |
587 | #endif /* !YYDEBUG */ | |
588 | ||
589 | /* YYINITDEPTH -- initial size of the parser's stacks. */ | |
885824d3 | 590 | #ifndef YYINITDEPTH |
d0b80d80 | 591 | # define YYINITDEPTH 200 |
885824d3 | 592 | #endif |
593 | ||
d0b80d80 | 594 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
595 | if the built-in stack extension method is used). | |
596 | ||
597 | Do not make this value too large; the results are undefined if | |
598 | SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) | |
599 | evaluated with infinite-precision integer arithmetic. */ | |
a889b5ee | 600 | |
885824d3 | 601 | #if YYMAXDEPTH == 0 |
d0b80d80 | 602 | # undef YYMAXDEPTH |
885824d3 | 603 | #endif |
604 | ||
605 | #ifndef YYMAXDEPTH | |
d0b80d80 | 606 | # define YYMAXDEPTH 10000 |
885824d3 | 607 | #endif |
1ac6313d | 608 | \f |
d0b80d80 | 609 | #ifdef YYERROR_VERBOSE |
885824d3 | 610 | |
d0b80d80 | 611 | # ifndef yystrlen |
612 | # if defined (__GLIBC__) && defined (_STRING_H) | |
613 | # define yystrlen strlen | |
614 | # else | |
615 | /* Return the length of YYSTR. */ | |
616 | static YYSIZE_T | |
617 | # if defined (__STDC__) || defined (__cplusplus) | |
618 | yystrlen (const char *yystr) | |
619 | # else | |
620 | yystrlen (yystr) | |
621 | const char *yystr; | |
622 | # endif | |
623 | { | |
624 | register const char *yys = yystr; | |
885824d3 | 625 | |
d0b80d80 | 626 | while (*yys++ != '\0') |
627 | continue; | |
a889b5ee | 628 | |
d0b80d80 | 629 | return yys - yystr - 1; |
630 | } | |
631 | # endif | |
632 | # endif | |
633 | ||
634 | # ifndef yystpcpy | |
635 | # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) | |
636 | # define yystpcpy stpcpy | |
637 | # else | |
638 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in | |
639 | YYDEST. */ | |
640 | static char * | |
641 | # if defined (__STDC__) || defined (__cplusplus) | |
642 | yystpcpy (char *yydest, const char *yysrc) | |
643 | # else | |
644 | yystpcpy (yydest, yysrc) | |
645 | char *yydest; | |
646 | const char *yysrc; | |
647 | # endif | |
a889b5ee | 648 | { |
d0b80d80 | 649 | register char *yyd = yydest; |
650 | register const char *yys = yysrc; | |
a889b5ee | 651 | |
d0b80d80 | 652 | while ((*yyd++ = *yys++) != '\0') |
653 | continue; | |
a889b5ee | 654 | |
d0b80d80 | 655 | return yyd - 1; |
656 | } | |
657 | # endif | |
658 | # endif | |
885824d3 | 659 | #endif |
660 | \f | |
3e3ec469 | 661 | |
885824d3 | 662 | |
663 | /* The user can define YYPARSE_PARAM as the name of an argument to be passed | |
664 | into yyparse. The argument should have type void *. | |
665 | It should actually point to an object. | |
666 | Grammar actions can access the variable by casting it | |
667 | to the proper pointer type. */ | |
668 | ||
669 | #ifdef YYPARSE_PARAM | |
d0b80d80 | 670 | # if defined (__STDC__) || defined (__cplusplus) |
671 | # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM | |
672 | # define YYPARSE_PARAM_DECL | |
673 | # else | |
674 | # define YYPARSE_PARAM_ARG YYPARSE_PARAM | |
675 | # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; | |
676 | # endif | |
677 | #else /* !YYPARSE_PARAM */ | |
678 | # define YYPARSE_PARAM_ARG | |
679 | # define YYPARSE_PARAM_DECL | |
680 | #endif /* !YYPARSE_PARAM */ | |
885824d3 | 681 | |
bbed3d50 | 682 | /* Prevent warning if -Wstrict-prototypes. */ |
683 | #ifdef __GNUC__ | |
d0b80d80 | 684 | # ifdef YYPARSE_PARAM |
bbed3d50 | 685 | int yyparse (void *); |
d0b80d80 | 686 | # else |
bbed3d50 | 687 | int yyparse (void); |
d0b80d80 | 688 | # endif |
bbed3d50 | 689 | #endif |
d0b80d80 | 690 | |
691 | /* YY_DECL_VARIABLES -- depending whether we use a pure parser, | |
692 | variables are global, or local to YYPARSE. */ | |
693 | ||
694 | #define YY_DECL_NON_LSP_VARIABLES \ | |
695 | /* The lookahead symbol. */ \ | |
696 | int yychar; \ | |
697 | \ | |
698 | /* The semantic value of the lookahead symbol. */ \ | |
699 | YYSTYPE yylval; \ | |
700 | \ | |
701 | /* Number of parse errors so far. */ \ | |
702 | int yynerrs; | |
703 | ||
704 | #if YYLSP_NEEDED | |
705 | # define YY_DECL_VARIABLES \ | |
706 | YY_DECL_NON_LSP_VARIABLES \ | |
707 | \ | |
708 | /* Location data for the lookahead symbol. */ \ | |
709 | YYLTYPE yylloc; | |
710 | #else | |
711 | # define YY_DECL_VARIABLES \ | |
712 | YY_DECL_NON_LSP_VARIABLES | |
bbed3d50 | 713 | #endif |
714 | ||
d0b80d80 | 715 | |
716 | /* If nonreentrant, generate the variables here. */ | |
717 | ||
718 | #if !YYPURE | |
719 | YY_DECL_VARIABLES | |
720 | #endif /* !YYPURE */ | |
721 | ||
885824d3 | 722 | int |
d0b80d80 | 723 | yyparse (YYPARSE_PARAM_ARG) |
885824d3 | 724 | YYPARSE_PARAM_DECL |
725 | { | |
d0b80d80 | 726 | /* If reentrant, generate the variables here. */ |
727 | #if YYPURE | |
728 | YY_DECL_VARIABLES | |
729 | #endif /* !YYPURE */ | |
730 | ||
885824d3 | 731 | register int yystate; |
732 | register int yyn; | |
d0b80d80 | 733 | int yyresult; |
734 | /* Number of tokens to shift before error messages enabled. */ | |
735 | int yyerrstatus; | |
736 | /* Lookahead token as an internal (translated) token number. */ | |
737 | int yychar1 = 0; | |
738 | ||
739 | /* Three stacks and their tools: | |
740 | `yyss': related to states, | |
741 | `yyvs': related to semantic values, | |
742 | `yyls': related to locations. | |
743 | ||
744 | Refer to the stacks thru separate pointers, to allow yyoverflow | |
745 | to reallocate them elsewhere. */ | |
746 | ||
747 | /* The state stack. */ | |
748 | short yyssa[YYINITDEPTH]; | |
749 | short *yyss = yyssa; | |
885824d3 | 750 | register short *yyssp; |
a889b5ee | 751 | |
d0b80d80 | 752 | /* The semantic value stack. */ |
753 | YYSTYPE yyvsa[YYINITDEPTH]; | |
754 | YYSTYPE *yyvs = yyvsa; | |
755 | register YYSTYPE *yyvsp; | |
885824d3 | 756 | |
d0b80d80 | 757 | #if YYLSP_NEEDED |
758 | /* The location stack. */ | |
759 | YYLTYPE yylsa[YYINITDEPTH]; | |
885824d3 | 760 | YYLTYPE *yyls = yylsa; |
761 | YYLTYPE *yylsp; | |
d0b80d80 | 762 | #endif |
885824d3 | 763 | |
d0b80d80 | 764 | #if YYLSP_NEEDED |
765 | # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) | |
885824d3 | 766 | #else |
d0b80d80 | 767 | # define YYPOPSTACK (yyvsp--, yyssp--) |
885824d3 | 768 | #endif |
769 | ||
d0b80d80 | 770 | YYSIZE_T yystacksize = YYINITDEPTH; |
885824d3 | 771 | |
885824d3 | 772 | |
d0b80d80 | 773 | /* The variables used to return semantic value and location from the |
774 | action routines. */ | |
775 | YYSTYPE yyval; | |
776 | #if YYLSP_NEEDED | |
777 | YYLTYPE yyloc; | |
778 | #endif | |
885824d3 | 779 | |
d0b80d80 | 780 | /* When reducing, the number of symbols on the RHS of the reduced |
781 | rule. */ | |
885824d3 | 782 | int yylen; |
783 | ||
d0b80d80 | 784 | YYDPRINTF ((stderr, "Starting parse\n")); |
885824d3 | 785 | |
786 | yystate = 0; | |
787 | yyerrstatus = 0; | |
788 | yynerrs = 0; | |
789 | yychar = YYEMPTY; /* Cause a token to be read. */ | |
790 | ||
791 | /* Initialize stack pointers. | |
792 | Waste one element of value and location stack | |
793 | so that they stay on the same level as the state stack. | |
794 | The wasted elements are never initialized. */ | |
795 | ||
d0b80d80 | 796 | yyssp = yyss; |
885824d3 | 797 | yyvsp = yyvs; |
d0b80d80 | 798 | #if YYLSP_NEEDED |
885824d3 | 799 | yylsp = yyls; |
800 | #endif | |
d0b80d80 | 801 | goto yysetstate; |
885824d3 | 802 | |
d0b80d80 | 803 | /*------------------------------------------------------------. |
804 | | yynewstate -- Push a new state, which is found in yystate. | | |
805 | `------------------------------------------------------------*/ | |
806 | yynewstate: | |
807 | /* In all cases, when you get here, the value and location stacks | |
808 | have just been pushed. so pushing a state here evens the stacks. | |
809 | */ | |
810 | yyssp++; | |
885824d3 | 811 | |
d0b80d80 | 812 | yysetstate: |
813 | *yyssp = yystate; | |
885824d3 | 814 | |
815 | if (yyssp >= yyss + yystacksize - 1) | |
816 | { | |
885824d3 | 817 | /* Get the current used size of the three stacks, in elements. */ |
d0b80d80 | 818 | YYSIZE_T yysize = yyssp - yyss + 1; |
885824d3 | 819 | |
820 | #ifdef yyoverflow | |
d0b80d80 | 821 | { |
822 | /* Give user a chance to reallocate the stack. Use copies of | |
823 | these so that the &'s don't force the real ones into | |
824 | memory. */ | |
825 | YYSTYPE *yyvs1 = yyvs; | |
826 | short *yyss1 = yyss; | |
827 | ||
828 | /* Each stack pointer address is followed by the size of the | |
829 | data in use in that stack, in bytes. */ | |
830 | # if YYLSP_NEEDED | |
831 | YYLTYPE *yyls1 = yyls; | |
832 | /* This used to be a conditional around just the two extra args, | |
833 | but that might be undefined if yyoverflow is a macro. */ | |
834 | yyoverflow ("parser stack overflow", | |
835 | &yyss1, yysize * sizeof (*yyssp), | |
836 | &yyvs1, yysize * sizeof (*yyvsp), | |
837 | &yyls1, yysize * sizeof (*yylsp), | |
838 | &yystacksize); | |
839 | yyls = yyls1; | |
840 | # else | |
841 | yyoverflow ("parser stack overflow", | |
842 | &yyss1, yysize * sizeof (*yyssp), | |
843 | &yyvs1, yysize * sizeof (*yyvsp), | |
844 | &yystacksize); | |
845 | # endif | |
846 | yyss = yyss1; | |
847 | yyvs = yyvs1; | |
848 | } | |
885824d3 | 849 | #else /* no yyoverflow */ |
d0b80d80 | 850 | # ifndef YYSTACK_RELOCATE |
851 | goto yyoverflowlab; | |
852 | # else | |
885824d3 | 853 | /* Extend the stack our own way. */ |
854 | if (yystacksize >= YYMAXDEPTH) | |
d0b80d80 | 855 | goto yyoverflowlab; |
885824d3 | 856 | yystacksize *= 2; |
857 | if (yystacksize > YYMAXDEPTH) | |
858 | yystacksize = YYMAXDEPTH; | |
d0b80d80 | 859 | |
860 | { | |
861 | short *yyss1 = yyss; | |
862 | union yyalloc *yyptr = | |
863 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); | |
864 | if (! yyptr) | |
865 | goto yyoverflowlab; | |
866 | YYSTACK_RELOCATE (yyss); | |
867 | YYSTACK_RELOCATE (yyvs); | |
868 | # if YYLSP_NEEDED | |
869 | YYSTACK_RELOCATE (yyls); | |
870 | # endif | |
871 | # undef YYSTACK_RELOCATE | |
872 | if (yyss1 != yyssa) | |
873 | YYSTACK_FREE (yyss1); | |
874 | } | |
875 | # endif | |
885824d3 | 876 | #endif /* no yyoverflow */ |
877 | ||
d0b80d80 | 878 | yyssp = yyss + yysize - 1; |
879 | yyvsp = yyvs + yysize - 1; | |
880 | #if YYLSP_NEEDED | |
881 | yylsp = yyls + yysize - 1; | |
885824d3 | 882 | #endif |
883 | ||
d0b80d80 | 884 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
885 | (unsigned long int) yystacksize)); | |
885824d3 | 886 | |
887 | if (yyssp >= yyss + yystacksize - 1) | |
888 | YYABORT; | |
889 | } | |
890 | ||
d0b80d80 | 891 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
885824d3 | 892 | |
893 | goto yybackup; | |
d0b80d80 | 894 | |
895 | ||
896 | /*-----------. | |
897 | | yybackup. | | |
898 | `-----------*/ | |
899 | yybackup: | |
885824d3 | 900 | |
901 | /* Do appropriate processing given the current state. */ | |
902 | /* Read a lookahead token if we need one and don't already have one. */ | |
903 | /* yyresume: */ | |
904 | ||
905 | /* First try to decide what to do without reference to lookahead token. */ | |
906 | ||
907 | yyn = yypact[yystate]; | |
908 | if (yyn == YYFLAG) | |
909 | goto yydefault; | |
910 | ||
911 | /* Not known => get a lookahead token if don't already have one. */ | |
912 | ||
913 | /* yychar is either YYEMPTY or YYEOF | |
914 | or a valid token in external form. */ | |
915 | ||
916 | if (yychar == YYEMPTY) | |
917 | { | |
d0b80d80 | 918 | YYDPRINTF ((stderr, "Reading a token: ")); |
885824d3 | 919 | yychar = YYLEX; |
920 | } | |
921 | ||
922 | /* Convert token to internal form (in yychar1) for indexing tables with */ | |
923 | ||
924 | if (yychar <= 0) /* This means end of input. */ | |
925 | { | |
926 | yychar1 = 0; | |
927 | yychar = YYEOF; /* Don't call YYLEX any more */ | |
928 | ||
d0b80d80 | 929 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
885824d3 | 930 | } |
931 | else | |
932 | { | |
d0b80d80 | 933 | yychar1 = YYTRANSLATE (yychar); |
885824d3 | 934 | |
d0b80d80 | 935 | #if YYDEBUG |
936 | /* We have to keep this `#if YYDEBUG', since we use variables | |
937 | which are defined only if `YYDEBUG' is set. */ | |
885824d3 | 938 | if (yydebug) |
939 | { | |
d0b80d80 | 940 | YYFPRINTF (stderr, "Next token is %d (%s", |
941 | yychar, yytname[yychar1]); | |
942 | /* Give the individual parser a way to print the precise | |
943 | meaning of a token, for further debugging info. */ | |
944 | # ifdef YYPRINT | |
885824d3 | 945 | YYPRINT (stderr, yychar, yylval); |
d0b80d80 | 946 | # endif |
947 | YYFPRINTF (stderr, ")\n"); | |
885824d3 | 948 | } |
949 | #endif | |
950 | } | |
951 | ||
952 | yyn += yychar1; | |
953 | if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) | |
954 | goto yydefault; | |
955 | ||
956 | yyn = yytable[yyn]; | |
957 | ||
958 | /* yyn is what to do for this token type in this state. | |
959 | Negative => reduce, -yyn is rule number. | |
960 | Positive => shift, yyn is new state. | |
961 | New state is final state => don't bother to shift, | |
962 | just return success. | |
963 | 0, or most negative number => error. */ | |
964 | ||
965 | if (yyn < 0) | |
966 | { | |
967 | if (yyn == YYFLAG) | |
968 | goto yyerrlab; | |
969 | yyn = -yyn; | |
970 | goto yyreduce; | |
971 | } | |
972 | else if (yyn == 0) | |
973 | goto yyerrlab; | |
974 | ||
975 | if (yyn == YYFINAL) | |
976 | YYACCEPT; | |
977 | ||
978 | /* Shift the lookahead token. */ | |
d0b80d80 | 979 | YYDPRINTF ((stderr, "Shifting token %d (%s), ", |
980 | yychar, yytname[yychar1])); | |
885824d3 | 981 | |
982 | /* Discard the token being shifted unless it is eof. */ | |
983 | if (yychar != YYEOF) | |
984 | yychar = YYEMPTY; | |
985 | ||
986 | *++yyvsp = yylval; | |
d0b80d80 | 987 | #if YYLSP_NEEDED |
885824d3 | 988 | *++yylsp = yylloc; |
989 | #endif | |
990 | ||
d0b80d80 | 991 | /* Count tokens shifted since error; after three, turn off error |
992 | status. */ | |
993 | if (yyerrstatus) | |
994 | yyerrstatus--; | |
885824d3 | 995 | |
996 | yystate = yyn; | |
997 | goto yynewstate; | |
998 | ||
a889b5ee | 999 | |
d0b80d80 | 1000 | /*-----------------------------------------------------------. |
1001 | | yydefault -- do the default action for the current state. | | |
1002 | `-----------------------------------------------------------*/ | |
1003 | yydefault: | |
885824d3 | 1004 | yyn = yydefact[yystate]; |
1005 | if (yyn == 0) | |
1006 | goto yyerrlab; | |
d0b80d80 | 1007 | goto yyreduce; |
885824d3 | 1008 | |
d0b80d80 | 1009 | |
1010 | /*-----------------------------. | |
1011 | | yyreduce -- Do a reduction. | | |
1012 | `-----------------------------*/ | |
885824d3 | 1013 | yyreduce: |
d0b80d80 | 1014 | /* yyn is the number of a rule to reduce with. */ |
885824d3 | 1015 | yylen = yyr2[yyn]; |
885824d3 | 1016 | |
d0b80d80 | 1017 | /* If YYLEN is nonzero, implement the default value of the action: |
1018 | `$$ = $1'. | |
1019 | ||
1020 | Otherwise, the following line sets YYVAL to the semantic value of | |
1021 | the lookahead token. This behavior is undocumented and Bison | |
1022 | users should not rely upon it. Assigning to YYVAL | |
1023 | unconditionally makes the parser a bit smaller, and it avoids a | |
1024 | GCC warning that YYVAL may be used uninitialized. */ | |
1025 | yyval = yyvsp[1-yylen]; | |
1026 | ||
1027 | #if YYLSP_NEEDED | |
1028 | /* Similarly for the default location. Let the user run additional | |
1029 | commands if for instance locations are ranges. */ | |
1030 | yyloc = yylsp[1-yylen]; | |
1031 | YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); | |
1032 | #endif | |
1033 | ||
1034 | #if YYDEBUG | |
1035 | /* We have to keep this `#if YYDEBUG', since we use variables which | |
1036 | are defined only if `YYDEBUG' is set. */ | |
885824d3 | 1037 | if (yydebug) |
1038 | { | |
d0b80d80 | 1039 | int yyi; |
885824d3 | 1040 | |
d0b80d80 | 1041 | YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", |
1042 | yyn, yyrline[yyn]); | |
885824d3 | 1043 | |
1044 | /* Print the symbols being reduced, and their result. */ | |
d0b80d80 | 1045 | for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) |
1046 | YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); | |
1047 | YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); | |
885824d3 | 1048 | } |
1049 | #endif | |
1050 | ||
885824d3 | 1051 | switch (yyn) { |
1052 | ||
1053 | case 1: | |
885824d3 | 1054 | { lslOpList_free (yyvsp[0].operators); ; |
1055 | break;} | |
1056 | case 2: | |
885824d3 | 1057 | { lslOpList x = lslOpList_new (); |
1058 | g_importedlslOp = yyvsp[0].operator; | |
1059 | lslOpList_add (x, yyvsp[0].operator); | |
1060 | yyval.operators = x; ; | |
1061 | break;} | |
1062 | case 3: | |
885824d3 | 1063 | { lslOpList_add (yyvsp[-1].operators, yyvsp[0].operator); |
1064 | yyval.operators = yyvsp[-1].operators; ; | |
1065 | break;} | |
1066 | case 4: | |
885824d3 | 1067 | { yyval.operator = makelslOpNode (yyvsp[-2].name, yyvsp[0].signature); ; |
1068 | break;} | |
1069 | case 5: | |
885824d3 | 1070 | { yyval.name = makeNameNodeId (yyvsp[0].ltok); ; |
1071 | break;} | |
1072 | case 6: | |
885824d3 | 1073 | { yyval.name = makeNameNodeForm (yyvsp[0].opform); ; |
1074 | break;} | |
1075 | case 7: | |
885824d3 | 1076 | { yyval.opform = makeOpFormNode (yyvsp[-5].ltok, OPF_IF, opFormUnion_createMiddle (0), ltoken_undefined); ; |
1077 | break;} | |
1078 | case 8: | |
885824d3 | 1079 | { yyval.opform = makeOpFormNode (yyvsp[0].ltok, OPF_ANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ; |
1080 | break;} | |
1081 | case 9: | |
885824d3 | 1082 | { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_MANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ; |
1083 | break;} | |
1084 | case 10: | |
885824d3 | 1085 | { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_ANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ; |
1086 | break;} | |
1087 | case 11: | |
885824d3 | 1088 | { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ; |
1089 | break;} | |
1090 | case 12: | |
885824d3 | 1091 | { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ; |
1092 | break;} | |
1093 | case 13: | |
885824d3 | 1094 | { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ; |
1095 | break;} | |
1096 | case 14: | |
885824d3 | 1097 | { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ; |
1098 | break;} | |
1099 | case 15: | |
885824d3 | 1100 | { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MMIDDLEM, |
1101 | opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ; | |
1102 | break;} | |
1103 | case 16: | |
885824d3 | 1104 | { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMIDDLE, |
1105 | opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ; | |
1106 | break;} | |
1107 | case 17: | |
885824d3 | 1108 | { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMMIDDLE, |
1109 | opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ; | |
1110 | break;} | |
1111 | case 18: | |
885824d3 | 1112 | { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMIDDLEM, |
1113 | opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ; | |
1114 | break;} | |
1115 | case 19: | |
885824d3 | 1116 | { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMMIDDLEM, |
1117 | opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ; | |
1118 | break;} | |
1119 | case 20: | |
885824d3 | 1120 | { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_SELECT, |
1121 | opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ; | |
1122 | break;} | |
1123 | case 21: | |
885824d3 | 1124 | { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MSELECT, |
1125 | opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ; | |
1126 | break;} | |
1127 | case 22: | |
885824d3 | 1128 | { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMAP, |
1129 | opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ; | |
1130 | break;} | |
1131 | case 23: | |
885824d3 | 1132 | { yyval.ltok = yyvsp[0].ltok; ; |
1133 | break;} | |
1134 | case 24: | |
885824d3 | 1135 | { yyval.ltok = yyvsp[0].ltok; ; |
1136 | break;} | |
1137 | case 25: | |
885824d3 | 1138 | { yyval.ltok = yyvsp[0].ltok; ; |
1139 | break;} | |
1140 | case 26: | |
885824d3 | 1141 | { yyval.count = 0; ; |
1142 | break;} | |
1143 | case 27: | |
885824d3 | 1144 | { yyval.count = yyvsp[0].count; ; |
1145 | break;} | |
1146 | case 28: | |
885824d3 | 1147 | { yyval.count = 1; ; |
1148 | break;} | |
1149 | case 29: | |
885824d3 | 1150 | { yyval.count = yyvsp[-2].count + 1; ; |
1151 | break;} | |
1152 | case 30: | |
885824d3 | 1153 | { yyval.ltok = yyvsp[0].ltok; ; |
1154 | break;} | |
1155 | case 31: | |
885824d3 | 1156 | { yyval.ltok = yyvsp[0].ltok; ; |
1157 | break;} | |
1158 | case 32: | |
885824d3 | 1159 | { yyval.signature = makesigNode (yyvsp[-1].ltok, yyvsp[-2].ltokenList, yyvsp[0].ltok); ; |
1160 | break;} | |
1161 | case 33: | |
885824d3 | 1162 | { yyval.ltokenList = ltokenList_new (); ; |
1163 | break;} | |
1164 | case 34: | |
885824d3 | 1165 | { yyval.ltokenList = yyvsp[0].ltokenList; ; |
1166 | break;} | |
1167 | case 35: | |
885824d3 | 1168 | { yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ; |
1169 | break;} | |
1170 | case 36: | |
885824d3 | 1171 | { yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ; |
1172 | break;} | |
1173 | case 37: | |
885824d3 | 1174 | { |
1175 | yyval.ltok = yyvsp[0].ltok; | |
1176 | ltoken_setText (yyval.ltok, processTraitSortId (ltoken_getText (yyvsp[0].ltok))); | |
1177 | ; | |
1178 | break;} | |
1179 | case 38: | |
885824d3 | 1180 | { yyval.ltok = yyvsp[0].ltok; ; |
1181 | break;} | |
1182 | } | |
d0b80d80 | 1183 | |
3e3ec469 | 1184 | |
885824d3 | 1185 | \f |
1186 | yyvsp -= yylen; | |
1187 | yyssp -= yylen; | |
d0b80d80 | 1188 | #if YYLSP_NEEDED |
885824d3 | 1189 | yylsp -= yylen; |
1190 | #endif | |
1191 | ||
d0b80d80 | 1192 | #if YYDEBUG |
885824d3 | 1193 | if (yydebug) |
1194 | { | |
d0b80d80 | 1195 | short *yyssp1 = yyss - 1; |
1196 | YYFPRINTF (stderr, "state stack now"); | |
1197 | while (yyssp1 != yyssp) | |
1198 | YYFPRINTF (stderr, " %d", *++yyssp1); | |
1199 | YYFPRINTF (stderr, "\n"); | |
885824d3 | 1200 | } |
1201 | #endif | |
1202 | ||
1203 | *++yyvsp = yyval; | |
d0b80d80 | 1204 | #if YYLSP_NEEDED |
1205 | *++yylsp = yyloc; | |
885824d3 | 1206 | #endif |
1207 | ||
d0b80d80 | 1208 | /* Now `shift' the result of the reduction. Determine what state |
1209 | that goes to, based on the state we popped back to and the rule | |
1210 | number reduced by. */ | |
885824d3 | 1211 | |
1212 | yyn = yyr1[yyn]; | |
1213 | ||
1214 | yystate = yypgoto[yyn - YYNTBASE] + *yyssp; | |
1215 | if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) | |
1216 | yystate = yytable[yystate]; | |
1217 | else | |
1218 | yystate = yydefgoto[yyn - YYNTBASE]; | |
1219 | ||
1220 | goto yynewstate; | |
1221 | ||
885824d3 | 1222 | |
d0b80d80 | 1223 | /*------------------------------------. |
1224 | | yyerrlab -- here on detecting error | | |
1225 | `------------------------------------*/ | |
1226 | yyerrlab: | |
1227 | /* If not already recovering from an error, report this error. */ | |
1228 | if (!yyerrstatus) | |
885824d3 | 1229 | { |
1230 | ++yynerrs; | |
1231 | ||
1232 | #ifdef YYERROR_VERBOSE | |
1233 | yyn = yypact[yystate]; | |
1234 | ||
1235 | if (yyn > YYFLAG && yyn < YYLAST) | |
1236 | { | |
d0b80d80 | 1237 | YYSIZE_T yysize = 0; |
1238 | char *yymsg; | |
1239 | int yyx, yycount; | |
1240 | ||
1241 | yycount = 0; | |
1242 | /* Start YYX at -YYN if negative to avoid negative indexes in | |
1243 | YYCHECK. */ | |
1244 | for (yyx = yyn < 0 ? -yyn : 0; | |
1245 | yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) | |
1246 | if (yycheck[yyx + yyn] == yyx) | |
1247 | yysize += yystrlen (yytname[yyx]) + 15, yycount++; | |
1248 | yysize += yystrlen ("parse error, unexpected ") + 1; | |
1249 | yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); | |
1250 | yymsg = (char *) YYSTACK_ALLOC (yysize); | |
1251 | if (yymsg != 0) | |
885824d3 | 1252 | { |
d0b80d80 | 1253 | char *yyp = yystpcpy (yymsg, "parse error, unexpected "); |
1254 | yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); | |
885824d3 | 1255 | |
d0b80d80 | 1256 | if (yycount < 5) |
885824d3 | 1257 | { |
d0b80d80 | 1258 | yycount = 0; |
1259 | for (yyx = yyn < 0 ? -yyn : 0; | |
1260 | yyx < (int) (sizeof (yytname) / sizeof (char *)); | |
1261 | yyx++) | |
1262 | if (yycheck[yyx + yyn] == yyx) | |
885824d3 | 1263 | { |
d0b80d80 | 1264 | const char *yyq = ! yycount ? ", expecting " : " or "; |
1265 | yyp = yystpcpy (yyp, yyq); | |
1266 | yyp = yystpcpy (yyp, yytname[yyx]); | |
1267 | yycount++; | |
885824d3 | 1268 | } |
1269 | } | |
d0b80d80 | 1270 | yyerror (yymsg); |
1271 | YYSTACK_FREE (yymsg); | |
885824d3 | 1272 | } |
1273 | else | |
d0b80d80 | 1274 | yyerror ("parse error; also virtual memory exhausted"); |
885824d3 | 1275 | } |
1276 | else | |
d0b80d80 | 1277 | #endif /* defined (YYERROR_VERBOSE) */ |
1278 | yyerror ("parse error"); | |
885824d3 | 1279 | } |
a889b5ee | 1280 | goto yyerrlab1; |
e55c0c6d | 1281 | |
d0b80d80 | 1282 | |
1283 | /*--------------------------------------------------. | |
1284 | | yyerrlab1 -- error raised explicitly by an action | | |
1285 | `--------------------------------------------------*/ | |
1286 | yyerrlab1: | |
885824d3 | 1287 | if (yyerrstatus == 3) |
1288 | { | |
d0b80d80 | 1289 | /* If just tried and failed to reuse lookahead token after an |
1290 | error, discard it. */ | |
885824d3 | 1291 | |
1292 | /* return failure if at end of input */ | |
1293 | if (yychar == YYEOF) | |
1294 | YYABORT; | |
d0b80d80 | 1295 | YYDPRINTF ((stderr, "Discarding token %d (%s).\n", |
1296 | yychar, yytname[yychar1])); | |
885824d3 | 1297 | yychar = YYEMPTY; |
1298 | } | |
1299 | ||
d0b80d80 | 1300 | /* Else will try to reuse lookahead token after shifting the error |
1301 | token. */ | |
885824d3 | 1302 | |
1303 | yyerrstatus = 3; /* Each real token shifted decrements this */ | |
1304 | ||
1305 | goto yyerrhandle; | |
1306 | ||
885824d3 | 1307 | |
d0b80d80 | 1308 | /*-------------------------------------------------------------------. |
1309 | | yyerrdefault -- current state does not do anything special for the | | |
1310 | | error token. | | |
1311 | `-------------------------------------------------------------------*/ | |
1312 | yyerrdefault: | |
885824d3 | 1313 | #if 0 |
1314 | /* This is wrong; only states that explicitly want error tokens | |
1315 | should shift them. */ | |
d0b80d80 | 1316 | |
1317 | /* If its default is to accept any token, ok. Otherwise pop it. */ | |
1318 | yyn = yydefact[yystate]; | |
1319 | if (yyn) | |
1320 | goto yydefault; | |
885824d3 | 1321 | #endif |
1322 | ||
885824d3 | 1323 | |
d0b80d80 | 1324 | /*---------------------------------------------------------------. |
1325 | | yyerrpop -- pop the current state because it cannot handle the | | |
1326 | | error token | | |
1327 | `---------------------------------------------------------------*/ | |
1328 | yyerrpop: | |
1329 | if (yyssp == yyss) | |
1330 | YYABORT; | |
885824d3 | 1331 | yyvsp--; |
1332 | yystate = *--yyssp; | |
d0b80d80 | 1333 | #if YYLSP_NEEDED |
885824d3 | 1334 | yylsp--; |
1335 | #endif | |
1336 | ||
d0b80d80 | 1337 | #if YYDEBUG |
885824d3 | 1338 | if (yydebug) |
1339 | { | |
d0b80d80 | 1340 | short *yyssp1 = yyss - 1; |
1341 | YYFPRINTF (stderr, "Error: state stack now"); | |
1342 | while (yyssp1 != yyssp) | |
1343 | YYFPRINTF (stderr, " %d", *++yyssp1); | |
1344 | YYFPRINTF (stderr, "\n"); | |
885824d3 | 1345 | } |
1346 | #endif | |
1347 | ||
d0b80d80 | 1348 | /*--------------. |
1349 | | yyerrhandle. | | |
1350 | `--------------*/ | |
885824d3 | 1351 | yyerrhandle: |
885824d3 | 1352 | yyn = yypact[yystate]; |
1353 | if (yyn == YYFLAG) | |
1354 | goto yyerrdefault; | |
1355 | ||
1356 | yyn += YYTERROR; | |
1357 | if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) | |
1358 | goto yyerrdefault; | |
1359 | ||
1360 | yyn = yytable[yyn]; | |
1361 | if (yyn < 0) | |
1362 | { | |
1363 | if (yyn == YYFLAG) | |
1364 | goto yyerrpop; | |
1365 | yyn = -yyn; | |
1366 | goto yyreduce; | |
1367 | } | |
1368 | else if (yyn == 0) | |
1369 | goto yyerrpop; | |
1370 | ||
1371 | if (yyn == YYFINAL) | |
1372 | YYACCEPT; | |
1373 | ||
d0b80d80 | 1374 | YYDPRINTF ((stderr, "Shifting error token, ")); |
885824d3 | 1375 | |
1376 | *++yyvsp = yylval; | |
d0b80d80 | 1377 | #if YYLSP_NEEDED |
885824d3 | 1378 | *++yylsp = yylloc; |
1379 | #endif | |
1380 | ||
1381 | yystate = yyn; | |
1382 | goto yynewstate; | |
bbed3d50 | 1383 | |
bbed3d50 | 1384 | |
d0b80d80 | 1385 | /*-------------------------------------. |
1386 | | yyacceptlab -- YYACCEPT comes here. | | |
1387 | `-------------------------------------*/ | |
1388 | yyacceptlab: | |
1389 | yyresult = 0; | |
1390 | goto yyreturn; | |
1391 | ||
1392 | /*-----------------------------------. | |
1393 | | yyabortlab -- YYABORT comes here. | | |
1394 | `-----------------------------------*/ | |
1395 | yyabortlab: | |
1396 | yyresult = 1; | |
1397 | goto yyreturn; | |
1398 | ||
1399 | /*---------------------------------------------. | |
1400 | | yyoverflowab -- parser overflow comes here. | | |
1401 | `---------------------------------------------*/ | |
1402 | yyoverflowlab: | |
1403 | yyerror ("parser stack overflow"); | |
1404 | yyresult = 2; | |
1405 | /* Fall through. */ | |
1406 | ||
1407 | yyreturn: | |
1408 | #ifndef yyoverflow | |
1409 | if (yyss != yyssa) | |
1410 | YYSTACK_FREE (yyss); | |
bbed3d50 | 1411 | #endif |
d0b80d80 | 1412 | return yyresult; |
885824d3 | 1413 | } |
885824d3 | 1414 | |
1415 | ||
1416 | # include "bison.reset" | |
1417 | ||
1418 | extern char *yytext; | |
1419 | ||
1420 | void lslerror (char *s) | |
1421 | { | |
bbed3d50 | 1422 | llfatalbug |
1423 | (cstring_makeLiteral | |
1424 | ("There has been a problem in the parser with LSL signatures. This is believed to result " | |
1b8ae690 | 1425 | "from a problem with bison v. 1.25. Please try rebuidling Splint " |
bbed3d50 | 1426 | "using the pre-compiled grammar files by commenting out the " |
1427 | "BISON= line in the top-level Makefile.")); | |
885824d3 | 1428 | } |
1429 | ||
1430 | static void yyprint (FILE *file, int type, YYSTYPE value) | |
1431 | { | |
1432 | fprintf (file, " (%u:%u type: %d; text: %s) ", | |
1433 | ltoken_getLine (value.ltok), | |
1434 | ltoken_getCol (value.ltok), | |
1435 | type, | |
1436 | ltoken_getRawTextChars (value.ltok)); | |
1437 | } | |
1438 | ||
1439 | extern void PrintToken (ltoken tok) { | |
1440 | char *codStr; | |
1441 | ||
1442 | switch (ltoken_getCode (tok)) | |
1443 | { | |
1444 | case NOTTOKEN: codStr = "*** NOTTOKEN ***"; break; | |
1445 | case LST_QUANTIFIERSYM: codStr = "QUANTIFIERSYM"; break; | |
1446 | case LST_LOGICALOP: codStr = "LOGICALOP: "; break; | |
1447 | case LST_SELECTSYM: codStr = "LST_SELECTSYM"; break; | |
1448 | case LST_OPENSYM: codStr = "LST_OPENSYM"; break; | |
1449 | case LST_SEPSYM: codStr = "SEPSYM"; break; | |
1450 | case LST_CLOSESYM: codStr = "LST_CLOSESYM"; break; | |
1451 | case LST_SIMPLEID: codStr = "LST_SIMPLEID"; break; | |
1452 | case LST_MAPSYM: codStr = "MAPSYM"; break; | |
1453 | case LST_MARKERSYM: codStr = "LST_MARKERSYM"; break; | |
1454 | case LST_COMMENTSYM: codStr = "COMMENTSYM"; break; | |
1455 | case LST_SIMPLEOP: codStr = "SIMPLEOP"; break; | |
1456 | case LST_COLON: codStr = "LST_COLON"; break; | |
1457 | case LST_COMMA: codStr = "COMMA"; break; | |
1458 | case LST_LBRACKET: codStr = "LST_LBRACKET"; break; | |
1459 | case LST_LPAR: codStr = "LST_LPAR"; break; | |
1460 | case LST_RBRACKET: codStr = "LST_RBRACKET"; break; | |
1461 | case LST_RPAR: codStr = "LST_RPAR"; break; | |
1462 | case LST_EQOP: codStr = "LST_EQOP"; break; | |
1463 | case LST_WHITESPACE: codStr = "WHITESPACE,"; break; | |
1464 | case LST_EOL: codStr = "LST_EOL"; break; | |
1465 | case LST_elseTOKEN: codStr = "elseTOKEN"; break; | |
1466 | case LST_ifTOKEN: codStr = "ifTOKEN"; break; | |
1467 | case LST_thenTOKEN: codStr = "thenTOKEN"; break; | |
1468 | case LST_BADTOKEN: codStr = "*** BADTOKEN ***"; break; | |
1469 | case LEOFTOKEN: /* can't reach LEOFTOKEN easily */ | |
1470 | codStr = "LEOFTOKEN"; break; | |
1471 | default: | |
1472 | codStr = "*** invalid token code ***"; | |
1473 | break; | |
1474 | } /* end switch */ | |
1475 | ||
1476 | /* only used for debugging */ | |
1477 | printf ("%u:%u: Token Code (%u): %s", | |
1478 | ltoken_getLine (tok), ltoken_getCol (tok), | |
1479 | ltoken_getCode (tok), codStr); | |
1480 | if (ltoken_getRawText (tok) != 0) | |
1481 | { | |
1482 | printf (", Token String (%lu): %s\n", | |
1483 | ltoken_getRawText (tok), ltoken_getRawTextChars (tok)); | |
1484 | } | |
1485 | else printf ("\n"); | |
1486 | } | |
1487 | ||
1488 | ||
1489 | ||
1490 | ||
bbed3d50 | 1491 | /* |
1492 | ** Resets all flags in bison.head | |
1493 | */ | |
1494 | ||
1495 | ||
1496 | /*@=allmacros@*/ | |
1497 | /*@=boolint@*/ | |
1498 | /*@=charint@*/ | |
1499 | /*@=macroparams@*/ | |
1500 | /*@=macroundef@*/ | |
1501 | /*@=unreachable@*/ | |
1502 | /*@=macrospec@*/ | |
1503 | /*@=varuse@*/ | |
1504 | /*@=ignorequals@*/ | |
1505 | /*@=macrostmt@*/ | |
1506 | /*@=noeffect@*/ | |
1507 | /*@=shadow@*/ | |
1508 | /*@=exitarg@*/ | |
1509 | /*@=macroredef@*/ | |
1510 | /*@=uniondef@*/ | |
1511 | /*@=compdef@*/ | |
1512 | /*@=matchfields@*/ | |
1513 | /*@=exportlocal@*/ | |
1514 | /*@=evalorderuncon@*/ | |
1515 | /*@=exportheader@*/ | |
1516 | /*@=typeuse@*/ | |
1517 | /*@=redecl@*/ | |
1518 | /*@=redef@*/ | |
1519 | /*@=noparams@*/ | |
1520 | /*@=ansireserved@*/ | |
1521 | /*@=fielduse@*/ | |
1522 | /*@=ifblock@*/ | |
1523 | /*@=elseifcomplete@*/ | |
1524 | /*@=whileblock@*/ | |
1525 | /*@=forblock@*/ | |
1526 | /*@=branchstate@*/ | |
1527 | /*@=readonlytrans@*/ | |
1528 | /*@=namechecks@*/ | |
1529 | /*@=usedef@*/ | |
1530 | /*@=systemunrecog@*/ | |
1531 | /*@=dependenttrans@*/ | |
1532 | /*@=unqualifiedtrans@*/ | |
1533 | /*@=declundef@*/ | |
1534 | ||
1535 | ||
1536 | /*drl added 11/27/2001*/ | |
bb7c2085 | 1537 | /*@=bounds@*/ |
e015e087 | 1538 | |
1539 | /*drl added 12/11/2002*/ | |
1540 | /*@=type@*/ |