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