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