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