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