2 /* A Bison parser, made from signature.y
3 by GNU Bison version 1.25
6 #define YYBISON 1 /* Identify Bison output. */
8 #define yyparse lslparse
10 #define yyerror lslerror
11 #define yylval lsllval
12 #define yychar lslchar
13 #define yydebug lsldebug
14 #define yynerrs lslnerrs
15 #define LST_SIMPLEID 258
16 #define LST_LOGICALOP 259
18 #define LST_SIMPLEOP 261
19 #define LST_MAPSYM 262
20 #define LST_FIELDMAPSYM 263
21 #define LST_MARKERSYM 264
22 #define LST_ifTOKEN 265
23 #define LST_thenTOKEN 266
24 #define LST_elseTOKEN 267
25 #define LST_LBRACKET 268
26 #define LST_RBRACKET 269
27 #define LST_SELECTSYM 270
28 #define LST_SEPSYM 271
29 #define LST_OPENSYM 272
30 #define LST_CLOSESYM 273
34 #define LST_COMMENTSYM 277
35 #define LST_WHITESPACE 278
36 #define LST_QUANTIFIERSYM 279
37 #define LST_EQUATIONSYM 280
38 #define LST_EQSEPSYM 281
39 #define LST_COMPOSESYM 282
42 #define LST_assertsTOKEN 285
43 #define LST_assumesTOKEN 286
44 #define LST_byTOKEN 287
45 #define LST_convertsTOKEN 288
46 #define LST_enumerationTOKEN 289
47 #define LST_equationsTOKEN 290
48 #define LST_exemptingTOKEN 291
49 #define LST_forTOKEN 292
50 #define LST_generatedTOKEN 293
51 #define LST_impliesTOKEN 294
52 #define LST_includesTOKEN 295
53 #define LST_introducesTOKEN 296
54 #define LST_ofTOKEN 297
55 #define LST_partitionedTOKEN 298
56 #define LST_traitTOKEN 299
57 #define LST_tupleTOKEN 300
58 #define LST_unionTOKEN 301
59 #define LST_BADTOKEN 302
61 #line 36 "signature.y"
64 # include "bison.reset"
67 # include "lclintMacros.nf"
69 # include "lslparse.h"
70 # include "signature.h"
72 void lslerror (char *);
73 /*@dependent@*/ /*@null@*/ lslOp importedlslOp;
75 /*@-noparams@*/ /* Can't list params since YYSTYPE isn't defined yet. */
76 static void yyprint (/*FILE *p_file, int p_type, YYSTYPE p_value */);
79 # define YYPRINT(file, type, value) yyprint (file, type, value)
83 # include "bison.head"
86 #line 73 "signature.y"
88 ltoken ltok; /* a leaf is also an ltoken */
90 /*@only@*/ ltokenList ltokenList;
91 /*@only@*/ opFormNode opform;
92 /*@owned@*/ sigNode signature;
93 /*@only@*/ nameNode name;
94 /*@owned@*/ lslOp operator;
95 /*@only@*/ lslOpList operators;
112 #define YYFLAG -32768
115 #define YYTRANSLATE(x) ((unsigned)(x) <= 302 ? yytranslate[x] : 62)
117 static const char yytranslate[] = { 0,
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, 2, 2, 2, 2, 2,
143 2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
144 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
145 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
146 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
147 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
152 static const short yyprhs[] = { 0,
153 0, 2, 4, 7, 11, 13, 15, 22, 24, 27,
154 30, 34, 38, 43, 48, 54, 58, 63, 68, 74,
155 77, 81, 85, 87, 89, 91, 92, 94, 96, 100,
156 102, 104, 108, 109, 111, 113, 117, 119
159 static const short yyrhs[] = { 49,
160 0, 50, 0, 49, 50, 0, 51, 19, 57, 0,
161 61, 0, 52, 0, 10, 9, 11, 9, 12, 9,
162 0, 53, 0, 9, 53, 0, 53, 9, 0, 9,
163 53, 9, 0, 17, 54, 18, 0, 9, 17, 54,
164 18, 0, 17, 54, 18, 9, 0, 9, 17, 54,
165 18, 9, 0, 13, 54, 14, 0, 9, 13, 54,
166 14, 0, 13, 54, 14, 9, 0, 9, 13, 54,
167 14, 9, 0, 15, 3, 0, 9, 15, 3, 0,
168 9, 8, 3, 0, 6, 0, 4, 0, 5, 0,
169 0, 55, 0, 9, 0, 55, 56, 9, 0, 20,
170 0, 16, 0, 58, 7, 60, 0, 0, 59, 0,
171 60, 0, 59, 20, 60, 0, 3, 0, 3, 0
177 static const short yyrline[] = { 0,
178 139, 141, 146, 150, 156, 158, 162, 164, 166, 168,
179 170, 172, 174, 176, 178, 181, 184, 187, 190, 193,
180 196, 201, 206, 208, 210, 213, 215, 218, 220, 223,
181 225, 228, 231, 233, 236, 238, 241, 247
186 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
188 static const char * const yytname[] = { "$","error","$undefined.","LST_SIMPLEID",
189 "LST_LOGICALOP","LST_EQOP","LST_SIMPLEOP","LST_MAPSYM","LST_FIELDMAPSYM","LST_MARKERSYM",
190 "LST_ifTOKEN","LST_thenTOKEN","LST_elseTOKEN","LST_LBRACKET","LST_RBRACKET",
191 "LST_SELECTSYM","LST_SEPSYM","LST_OPENSYM","LST_CLOSESYM","LST_COLON","LST_COMMA",
192 "LST_EOL","LST_COMMENTSYM","LST_WHITESPACE","LST_QUANTIFIERSYM","LST_EQUATIONSYM",
193 "LST_EQSEPSYM","LST_COMPOSESYM","LST_LPAR","LST_RPAR","LST_assertsTOKEN","LST_assumesTOKEN",
194 "LST_byTOKEN","LST_convertsTOKEN","LST_enumerationTOKEN","LST_equationsTOKEN",
195 "LST_exemptingTOKEN","LST_forTOKEN","LST_generatedTOKEN","LST_impliesTOKEN",
196 "LST_includesTOKEN","LST_introducesTOKEN","LST_ofTOKEN","LST_partitionedTOKEN",
197 "LST_traitTOKEN","LST_tupleTOKEN","LST_unionTOKEN","LST_BADTOKEN","top","operatorList",
198 "operator","name","opForm","anyOp","middle","placeList","separator","signature",
199 "domain","sortList","sortId","opId", NULL
203 static const short yyr1[] = { 0,
204 48, 49, 49, 50, 51, 51, 52, 52, 52, 52,
205 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
206 52, 52, 53, 53, 53, 54, 54, 55, 55, 56,
207 56, 57, 58, 58, 59, 59, 60, 61
210 static const short yyr2[] = { 0,
211 1, 1, 2, 3, 1, 1, 6, 1, 2, 2,
212 3, 3, 4, 4, 5, 3, 4, 4, 5, 2,
213 3, 3, 1, 1, 1, 0, 1, 1, 3, 1,
214 1, 3, 0, 1, 1, 3, 1, 1
217 static const short yydefact[] = { 0,
218 38, 24, 25, 23, 0, 0, 26, 0, 26, 1,
219 2, 0, 6, 8, 5, 0, 26, 0, 26, 9,
220 0, 28, 0, 27, 20, 0, 3, 33, 10, 22,
221 0, 21, 0, 11, 0, 16, 31, 30, 0, 12,
222 37, 4, 0, 34, 35, 17, 13, 0, 18, 29,
223 14, 0, 0, 19, 15, 0, 32, 36, 7, 0,
227 static const short yydefgoto[] = { 60,
228 10, 11, 12, 13, 14, 23, 24, 39, 42, 43,
232 static const short yypact[] = { -3,
233 -32768,-32768,-32768,-32768, 11, -4, 0, 8, 0, -3,
234 -32768, -1,-32768, 13,-32768, 17, 0, 22, 0, 18,
235 20,-32768, 19, -12,-32768, 14,-32768, 31,-32768,-32768,
236 21,-32768, 23,-32768, 27, 28,-32768,-32768, 29, 30,
237 -32768,-32768, 33, 24,-32768, 34, 36, 35,-32768,-32768,
238 -32768, 31, 31,-32768,-32768, 37,-32768,-32768,-32768, 42,
242 static const short yypgoto[] = {-32768,
243 -32768, 39,-32768,-32768, 45, 4,-32768,-32768,-32768,-32768,
251 static const short yytable[] = { 1,
252 2, 3, 4, 37, 21, 5, 6, 38, 22, 7,
253 25, 8, 26, 9, 2, 3, 4, 28, 16, 30,
254 31, 29, 33, 17, 32, 18, 34, 19, 57, 58,
255 35, 40, 36, 41, 46, 48, 49, 50, 51, 52,
256 47, 61, 54, 53, 55, 59, 56, 62, 27, 20
259 static const short yycheck[] = { 3,
260 4, 5, 6, 16, 9, 9, 10, 20, 9, 13,
261 3, 15, 9, 17, 4, 5, 6, 19, 8, 3,
262 17, 9, 19, 13, 3, 15, 9, 17, 52, 53,
263 11, 18, 14, 3, 14, 9, 9, 9, 9, 7,
264 18, 0, 9, 20, 9, 9, 12, 0, 10, 5
268 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
269 #line 3 "/usr/lib/bison.simple"
271 /* Skeleton output parser for bison,
272 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
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)
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.
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
288 /* As a special exception, when this file is copied by Bison into a
289 Bison output file, you may use that output file without restriction.
290 This special exception was added by the Free Software Foundation
291 in version 1.24 of Bison. */
295 #define alloca __builtin_alloca
296 #else /* not GNU C. */
297 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
299 #else /* not sparc */
300 #if defined (MSDOS) && !defined (__TURBOC__)
302 #else /* not MSDOS, or __TURBOC__ */
306 #else /* not MSDOS, __TURBOC__, or _AIX */
310 void *alloca (unsigned int);
312 #else /* not __cplusplus */
314 #endif /* not __cplusplus */
316 #endif /* not _AIX */
317 #endif /* not MSDOS, or __TURBOC__ */
318 #endif /* not sparc. */
319 #endif /* not GNU C. */
320 #endif /* alloca not defined. */
322 /* This is the parser code that is written into each bison parser
323 when the %semantic_parser declaration is not specified in the grammar.
324 It was written by Richard Stallman by simplifying the hairy parser
325 used when %semantic_parser is specified. */
327 /* Note: there must be only one dollar sign in this file.
328 It is replaced by the list of actions, each action
329 as one case of the switch. */
331 #define yyerrok (yyerrstatus = 0)
332 #define yyclearin (yychar = YYEMPTY)
335 #define YYACCEPT return(0)
336 #define YYABORT return(1)
337 #define YYERROR goto yyerrlab1
338 /* Like YYERROR except do call yyerror.
339 This remains here temporarily to ease the
340 transition to the new meaning of YYERROR, for GCC.
341 Once GCC version 2 has supplanted version 1, this can go. */
342 #define YYFAIL goto yyerrlab
343 #define YYRECOVERING() (!!yyerrstatus)
344 #define YYBACKUP(token, value) \
346 if (yychar == YYEMPTY && yylen == 1) \
347 { yychar = (token), yylval = (value); \
348 yychar1 = YYTRANSLATE (yychar); \
353 { yyerror ("syntax error: cannot back up"); YYERROR; } \
357 #define YYERRCODE 256
360 #define YYLEX yylex()
366 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
368 #define YYLEX yylex(&yylval, &yylloc)
370 #else /* not YYLSP_NEEDED */
372 #define YYLEX yylex(&yylval, YYLEX_PARAM)
374 #define YYLEX yylex(&yylval)
376 #endif /* not YYLSP_NEEDED */
379 /* If nonreentrant, generate the variables here */
383 int yychar; /* the lookahead symbol */
384 YYSTYPE yylval; /* the semantic value of the */
385 /* lookahead symbol */
388 YYLTYPE yylloc; /* location data for the lookahead */
392 int yynerrs; /* number of parse errors so far */
393 #endif /* not YYPURE */
396 int yydebug; /* nonzero means print parse trace */
397 /* Since this is uninitialized, it does not stop multiple parsers
401 /* YYINITDEPTH indicates the initial size of the parser's stacks */
404 #define YYINITDEPTH 200
407 /* YYMAXDEPTH is the maximum size the stacks can grow to
408 (effective only if the built-in stack extension method is used). */
415 #define YYMAXDEPTH 10000
418 /* Prevent warning if -Wstrict-prototypes. */
423 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
424 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
425 #else /* not GNU C or C++ */
428 /* This is the most reliable way to avoid incompatibilities
429 in available built-in functions on various systems. */
431 __yy_memcpy (to, from, count)
436 register char *f = from;
437 register char *t = to;
438 register int i = count;
444 #else /* __cplusplus */
446 /* This is the most reliable way to avoid incompatibilities
447 in available built-in functions on various systems. */
449 __yy_memcpy (char *to, char *from, int count)
451 register char *f = from;
452 register char *t = to;
453 register int i = count;
462 #line 196 "/usr/lib/bison.simple"
464 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
465 into yyparse. The argument should have type void *.
466 It should actually point to an object.
467 Grammar actions can access the variable by casting it
468 to the proper pointer type. */
472 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
473 #define YYPARSE_PARAM_DECL
474 #else /* not __cplusplus */
475 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
476 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
477 #endif /* not __cplusplus */
478 #else /* not YYPARSE_PARAM */
479 #define YYPARSE_PARAM_ARG
480 #define YYPARSE_PARAM_DECL
481 #endif /* not YYPARSE_PARAM */
484 yyparse(YYPARSE_PARAM_ARG)
487 register int yystate;
489 register short *yyssp;
490 register YYSTYPE *yyvsp;
491 int yyerrstatus; /* number of tokens to shift before error messages enabled */
492 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
494 short yyssa[YYINITDEPTH]; /* the state stack */
495 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
497 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
498 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
501 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
502 YYLTYPE *yyls = yylsa;
505 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
507 #define YYPOPSTACK (yyvsp--, yyssp--)
510 int yystacksize = YYINITDEPTH;
521 YYSTYPE yyval; /* the variable used to return */
522 /* semantic values from the action */
529 fprintf(stderr, "Starting parse\n");
535 yychar = YYEMPTY; /* Cause a token to be read. */
537 /* Initialize stack pointers.
538 Waste one element of value and location stack
539 so that they stay on the same level as the state stack.
540 The wasted elements are never initialized. */
548 /* Push a new state, which is found in yystate . */
549 /* In all cases, when you get here, the value and location stacks
550 have just been pushed. so pushing a state here evens the stacks. */
555 if (yyssp >= yyss + yystacksize - 1)
557 /* Give user a chance to reallocate the stack */
558 /* Use copies of these so that the &'s don't force the real ones into memory. */
559 YYSTYPE *yyvs1 = yyvs;
562 YYLTYPE *yyls1 = yyls;
565 /* Get the current used size of the three stacks, in elements. */
566 int size = yyssp - yyss + 1;
569 /* Each stack pointer address is followed by the size of
570 the data in use in that stack, in bytes. */
572 /* This used to be a conditional around just the two extra args,
573 but that might be undefined if yyoverflow is a macro. */
574 yyoverflow("parser stack overflow",
575 &yyss1, size * sizeof (*yyssp),
576 &yyvs1, size * sizeof (*yyvsp),
577 &yyls1, size * sizeof (*yylsp),
580 yyoverflow("parser stack overflow",
581 &yyss1, size * sizeof (*yyssp),
582 &yyvs1, size * sizeof (*yyvsp),
586 yyss = yyss1; yyvs = yyvs1;
590 #else /* no yyoverflow */
591 /* Extend the stack our own way. */
592 if (yystacksize >= YYMAXDEPTH)
594 yyerror("parser stack overflow");
598 if (yystacksize > YYMAXDEPTH)
599 yystacksize = YYMAXDEPTH;
600 yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
601 __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
602 yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
603 __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
605 yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
606 __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
608 #endif /* no yyoverflow */
610 yyssp = yyss + size - 1;
611 yyvsp = yyvs + size - 1;
613 yylsp = yyls + size - 1;
618 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
621 if (yyssp >= yyss + yystacksize - 1)
627 fprintf(stderr, "Entering state %d\n", yystate);
633 /* Do appropriate processing given the current state. */
634 /* Read a lookahead token if we need one and don't already have one. */
637 /* First try to decide what to do without reference to lookahead token. */
639 yyn = yypact[yystate];
643 /* Not known => get a lookahead token if don't already have one. */
645 /* yychar is either YYEMPTY or YYEOF
646 or a valid token in external form. */
648 if (yychar == YYEMPTY)
652 fprintf(stderr, "Reading a token: ");
657 /* Convert token to internal form (in yychar1) for indexing tables with */
659 if (yychar <= 0) /* This means end of input. */
662 yychar = YYEOF; /* Don't call YYLEX any more */
666 fprintf(stderr, "Now at end of input.\n");
671 yychar1 = YYTRANSLATE(yychar);
676 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
677 /* Give the individual parser a way to print the precise meaning
678 of a token, for further debugging info. */
680 YYPRINT (stderr, yychar, yylval);
682 fprintf (stderr, ")\n");
688 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
693 /* yyn is what to do for this token type in this state.
694 Negative => reduce, -yyn is rule number.
695 Positive => shift, yyn is new state.
696 New state is final state => don't bother to shift,
698 0, or most negative number => error. */
713 /* Shift the lookahead token. */
717 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
720 /* Discard the token being shifted unless it is eof. */
729 /* count tokens shifted since error; after three, turn off error status. */
730 if (yyerrstatus) yyerrstatus--;
735 /* Do the default action for the current state. */
738 yyn = yydefact[yystate];
742 /* Do a reduction. yyn is the number of a rule to reduce with. */
746 yyval = yyvsp[1-yylen]; /* implement default value of the action */
753 fprintf (stderr, "Reducing via rule %d (line %d), ",
756 /* Print the symbols being reduced, and their result. */
757 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
758 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
759 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
767 #line 139 "signature.y"
768 { lslOpList_free (yyvsp[0].operators); ;
771 #line 142 "signature.y"
772 { lslOpList x = lslOpList_new ();
773 g_importedlslOp = yyvsp[0].operator;
774 lslOpList_add (x, yyvsp[0].operator);
775 yyval.operators = x; ;
778 #line 147 "signature.y"
779 { lslOpList_add (yyvsp[-1].operators, yyvsp[0].operator);
780 yyval.operators = yyvsp[-1].operators; ;
783 #line 151 "signature.y"
784 { yyval.operator = makelslOpNode (yyvsp[-2].name, yyvsp[0].signature); ;
787 #line 157 "signature.y"
788 { yyval.name = makeNameNodeId (yyvsp[0].ltok); ;
791 #line 159 "signature.y"
792 { yyval.name = makeNameNodeForm (yyvsp[0].opform); ;
795 #line 163 "signature.y"
796 { yyval.opform = makeOpFormNode (yyvsp[-5].ltok, OPF_IF, opFormUnion_createMiddle (0), ltoken_undefined); ;
799 #line 165 "signature.y"
800 { yyval.opform = makeOpFormNode (yyvsp[0].ltok, OPF_ANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
803 #line 167 "signature.y"
804 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_MANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
807 #line 169 "signature.y"
808 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_ANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
811 #line 171 "signature.y"
812 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
815 #line 173 "signature.y"
816 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
819 #line 175 "signature.y"
820 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
823 #line 177 "signature.y"
824 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
827 #line 179 "signature.y"
828 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MMIDDLEM,
829 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
832 #line 182 "signature.y"
833 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMIDDLE,
834 opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
837 #line 185 "signature.y"
838 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMMIDDLE,
839 opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
842 #line 188 "signature.y"
843 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMIDDLEM,
844 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
847 #line 191 "signature.y"
848 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMMIDDLEM,
849 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
852 #line 194 "signature.y"
853 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_SELECT,
854 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
857 #line 197 "signature.y"
858 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MSELECT,
859 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
862 #line 202 "signature.y"
863 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMAP,
864 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
867 #line 207 "signature.y"
868 { yyval.ltok = yyvsp[0].ltok; ;
871 #line 209 "signature.y"
872 { yyval.ltok = yyvsp[0].ltok; ;
875 #line 211 "signature.y"
876 { yyval.ltok = yyvsp[0].ltok; ;
879 #line 214 "signature.y"
883 #line 216 "signature.y"
884 { yyval.count = yyvsp[0].count; ;
887 #line 219 "signature.y"
891 #line 221 "signature.y"
892 { yyval.count = yyvsp[-2].count + 1; ;
895 #line 224 "signature.y"
896 { yyval.ltok = yyvsp[0].ltok; ;
899 #line 226 "signature.y"
900 { yyval.ltok = yyvsp[0].ltok; ;
903 #line 229 "signature.y"
904 { yyval.signature = makesigNode (yyvsp[-1].ltok, yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
907 #line 232 "signature.y"
908 { yyval.ltokenList = ltokenList_new (); ;
911 #line 234 "signature.y"
912 { yyval.ltokenList = yyvsp[0].ltokenList; ;
915 #line 237 "signature.y"
916 { yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
919 #line 239 "signature.y"
920 { yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
923 #line 242 "signature.y"
925 yyval.ltok = yyvsp[0].ltok;
926 ltoken_setText (yyval.ltok, processTraitSortId (ltoken_getText (yyvsp[0].ltok)));
930 #line 248 "signature.y"
931 { yyval.ltok = yyvsp[0].ltok; ;
934 /* the action file gets copied in in place of this dollarsign */
935 #line 498 "/usr/lib/bison.simple"
946 short *ssp1 = yyss - 1;
947 fprintf (stderr, "state stack now");
948 while (ssp1 != yyssp)
949 fprintf (stderr, " %d", *++ssp1);
950 fprintf (stderr, "\n");
960 yylsp->first_line = yylloc.first_line;
961 yylsp->first_column = yylloc.first_column;
962 yylsp->last_line = (yylsp-1)->last_line;
963 yylsp->last_column = (yylsp-1)->last_column;
968 yylsp->last_line = (yylsp+yylen-1)->last_line;
969 yylsp->last_column = (yylsp+yylen-1)->last_column;
973 /* Now "shift" the result of the reduction.
974 Determine what state that goes to,
975 based on the state we popped back to
976 and the rule number reduced by. */
980 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
981 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
982 yystate = yytable[yystate];
984 yystate = yydefgoto[yyn - YYNTBASE];
988 yyerrlab: /* here on detecting error */
991 /* If not already recovering from an error, report this error. */
995 #ifdef YYERROR_VERBOSE
996 yyn = yypact[yystate];
998 if (yyn > YYFLAG && yyn < YYLAST)
1005 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
1006 for (x = (yyn < 0 ? -yyn : 0);
1007 x < (sizeof(yytname) / sizeof(char *)); x++)
1008 if (yycheck[x + yyn] == x)
1009 size += strlen(yytname[x]) + 15, count++;
1010 msg = (char *) malloc(size + 15);
1013 strcpy(msg, "parse error");
1018 for (x = (yyn < 0 ? -yyn : 0);
1019 x < (sizeof(yytname) / sizeof(char *)); x++)
1020 if (yycheck[x + yyn] == x)
1022 strcat(msg, count == 0 ? ", expecting `" : " or `");
1023 strcat(msg, yytname[x]);
1032 yyerror ("parse error; also virtual memory exceeded");
1035 #endif /* YYERROR_VERBOSE */
1036 yyerror("parse error");
1040 yyerrlab1: /* here on error raised explicitly by an action */
1042 if (yyerrstatus == 3)
1044 /* if just tried and failed to reuse lookahead token after an error, discard it. */
1046 /* return failure if at end of input */
1047 if (yychar == YYEOF)
1052 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1058 /* Else will try to reuse lookahead token
1059 after shifting the error token. */
1061 yyerrstatus = 3; /* Each real token shifted decrements this */
1065 yyerrdefault: /* current state does not do anything special for the error token. */
1068 /* This is wrong; only states that explicitly want error tokens
1069 should shift them. */
1070 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
1071 if (yyn) goto yydefault;
1074 yyerrpop: /* pop the current state because it cannot handle the error token */
1076 if (yyssp == yyss) YYABORT;
1086 short *ssp1 = yyss - 1;
1087 fprintf (stderr, "Error: state stack now");
1088 while (ssp1 != yyssp)
1089 fprintf (stderr, " %d", *++ssp1);
1090 fprintf (stderr, "\n");
1096 yyn = yypact[yystate];
1101 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1120 fprintf(stderr, "Shifting error token, ");
1131 #line 249 "signature.y"
1134 # include "bison.reset"
1136 extern char *yytext;
1138 void lslerror (char *s)
1140 lclplainerror (message ("An error has occurred in parsing LSL signature: %s",
1141 cstring_fromChars (s)));
1144 static void yyprint (FILE *file, int type, YYSTYPE value)
1146 fprintf (file, " (%u:%u type: %d; text: %s) ",
1147 ltoken_getLine (value.ltok),
1148 ltoken_getCol (value.ltok),
1150 ltoken_getRawTextChars (value.ltok));
1153 extern void PrintToken (ltoken tok) {
1156 switch (ltoken_getCode (tok))
1158 case NOTTOKEN: codStr = "*** NOTTOKEN ***"; break;
1159 case LST_QUANTIFIERSYM: codStr = "QUANTIFIERSYM"; break;
1160 case LST_LOGICALOP: codStr = "LOGICALOP: "; break;
1161 case LST_SELECTSYM: codStr = "LST_SELECTSYM"; break;
1162 case LST_OPENSYM: codStr = "LST_OPENSYM"; break;
1163 case LST_SEPSYM: codStr = "SEPSYM"; break;
1164 case LST_CLOSESYM: codStr = "LST_CLOSESYM"; break;
1165 case LST_SIMPLEID: codStr = "LST_SIMPLEID"; break;
1166 case LST_MAPSYM: codStr = "MAPSYM"; break;
1167 case LST_MARKERSYM: codStr = "LST_MARKERSYM"; break;
1168 case LST_COMMENTSYM: codStr = "COMMENTSYM"; break;
1169 case LST_SIMPLEOP: codStr = "SIMPLEOP"; break;
1170 case LST_COLON: codStr = "LST_COLON"; break;
1171 case LST_COMMA: codStr = "COMMA"; break;
1172 case LST_LBRACKET: codStr = "LST_LBRACKET"; break;
1173 case LST_LPAR: codStr = "LST_LPAR"; break;
1174 case LST_RBRACKET: codStr = "LST_RBRACKET"; break;
1175 case LST_RPAR: codStr = "LST_RPAR"; break;
1176 case LST_EQOP: codStr = "LST_EQOP"; break;
1177 case LST_WHITESPACE: codStr = "WHITESPACE,"; break;
1178 case LST_EOL: codStr = "LST_EOL"; break;
1179 case LST_elseTOKEN: codStr = "elseTOKEN"; break;
1180 case LST_ifTOKEN: codStr = "ifTOKEN"; break;
1181 case LST_thenTOKEN: codStr = "thenTOKEN"; break;
1182 case LST_BADTOKEN: codStr = "*** BADTOKEN ***"; break;
1183 case LEOFTOKEN: /* can't reach LEOFTOKEN easily */
1184 codStr = "LEOFTOKEN"; break;
1186 codStr = "*** invalid token code ***";
1190 /* only used for debugging */
1191 printf ("%u:%u: Token Code (%u): %s",
1192 ltoken_getLine (tok), ltoken_getCol (tok),
1193 ltoken_getCode (tok), codStr);
1194 if (ltoken_getRawText (tok) != 0)
1196 printf (", Token String (%lu): %s\n",
1197 ltoken_getRawText (tok), ltoken_getRawTextChars (tok));