00001
00002
00003
00004
00005 #define YYBISON 1
00006
00007 #define yyparse lslparse
00008 #define yylex lsllex
00009 #define yyerror lslerror
00010 #define yylval lsllval
00011 #define yychar lslchar
00012 #define yydebug lsldebug
00013 #define yynerrs lslnerrs
00014 #define LST_SIMPLEID 257
00015 #define LST_LOGICALOP 258
00016 #define LST_EQOP 259
00017 #define LST_SIMPLEOP 260
00018 #define LST_MAPSYM 261
00019 #define LST_FIELDMAPSYM 262
00020 #define LST_MARKERSYM 263
00021 #define LST_ifTOKEN 264
00022 #define LST_thenTOKEN 265
00023 #define LST_elseTOKEN 266
00024 #define LST_LBRACKET 267
00025 #define LST_RBRACKET 268
00026 #define LST_SELECTSYM 269
00027 #define LST_SEPSYM 270
00028 #define LST_OPENSYM 271
00029 #define LST_CLOSESYM 272
00030 #define LST_COLON 273
00031 #define LST_COMMA 274
00032 #define LST_EOL 275
00033 #define LST_COMMENTSYM 276
00034 #define LST_WHITESPACE 277
00035 #define LST_QUANTIFIERSYM 278
00036 #define LST_EQUATIONSYM 279
00037 #define LST_EQSEPSYM 280
00038 #define LST_COMPOSESYM 281
00039 #define LST_LPAR 282
00040 #define LST_RPAR 283
00041 #define LST_assertsTOKEN 284
00042 #define LST_assumesTOKEN 285
00043 #define LST_byTOKEN 286
00044 #define LST_convertsTOKEN 287
00045 #define LST_enumerationTOKEN 288
00046 #define LST_equationsTOKEN 289
00047 #define LST_exemptingTOKEN 290
00048 #define LST_forTOKEN 291
00049 #define LST_generatedTOKEN 292
00050 #define LST_impliesTOKEN 293
00051 #define LST_includesTOKEN 294
00052 #define LST_introducesTOKEN 295
00053 #define LST_ofTOKEN 296
00054 #define LST_partitionedTOKEN 297
00055 #define LST_traitTOKEN 298
00056 #define LST_tupleTOKEN 299
00057 #define LST_unionTOKEN 300
00058 #define LST_BADTOKEN 301
00059
00060 #line 36 "signature.y"
00061
00062
00063 # include "bison.reset"
00064
00065 # include <stdio.h>
00066 # include "lclintMacros.nf"
00067 # include "llbasic.h"
00068 # include "lslparse.h"
00069 # include "signature.h"
00070
00071 void lslerror (char *);
00072 lslOp importedlslOp;
00073
00074
00075 static void yyprint ();
00076
00077
00078 # define YYPRINT(file, type, value) yyprint (file, type, value)
00079
00080 # define YYDEBUG 1
00081
00082 # include "bison.head"
00083
00084
00085 #line 73 "signature.y"
00086 typedef union {
00087 ltoken ltok;
00088 unsigned int count;
00089 ltokenList ltokenList;
00090 opFormNode opform;
00091 sigNode signature;
00092 nameNode name;
00093 lslOp operator;
00094 lslOpList operators;
00095 } YYSTYPE;
00096 #ifndef YYDEBUG
00097 #define YYDEBUG 1
00098 #endif
00099
00100 #include <stdio.h>
00101
00102 #ifndef __cplusplus
00103 #ifndef __STDC__
00104 #define const
00105 #endif
00106 #endif
00107
00108
00109
00110 #define YYFINAL 62
00111 #define YYFLAG -32768
00112 #define YYNTBASE 48
00113
00114 #define YYTRANSLATE(x) ((unsigned)(x) <= 301 ? yytranslate[x] : 62)
00115
00116 static const char yytranslate[] = { 0,
00117 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00118 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00119 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00120 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00121 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00122 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00123 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00124 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00125 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00126 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00127 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00128 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00129 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00130 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00131 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00132 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00133 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00134 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00135 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00136 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00137 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00138 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00139 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00140 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00141 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00142 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
00143 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
00144 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
00145 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
00146 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
00147 47
00148 };
00149
00150 #if YYDEBUG != 0
00151 static const short yyprhs[] = { 0,
00152 0, 2, 4, 7, 11, 13, 15, 22, 24, 27,
00153 30, 34, 38, 43, 48, 54, 58, 63, 68, 74,
00154 77, 81, 85, 87, 89, 91, 92, 94, 96, 100,
00155 102, 104, 108, 109, 111, 113, 117, 119
00156 };
00157
00158 static const short yyrhs[] = { 49,
00159 0, 50, 0, 49, 50, 0, 51, 19, 57, 0,
00160 61, 0, 52, 0, 10, 9, 11, 9, 12, 9,
00161 0, 53, 0, 9, 53, 0, 53, 9, 0, 9,
00162 53, 9, 0, 17, 54, 18, 0, 9, 17, 54,
00163 18, 0, 17, 54, 18, 9, 0, 9, 17, 54,
00164 18, 9, 0, 13, 54, 14, 0, 9, 13, 54,
00165 14, 0, 13, 54, 14, 9, 0, 9, 13, 54,
00166 14, 9, 0, 15, 3, 0, 9, 15, 3, 0,
00167 9, 8, 3, 0, 6, 0, 4, 0, 5, 0,
00168 0, 55, 0, 9, 0, 55, 56, 9, 0, 20,
00169 0, 16, 0, 58, 7, 60, 0, 0, 59, 0,
00170 60, 0, 59, 20, 60, 0, 3, 0, 3, 0
00171 };
00172
00173 #endif
00174
00175 #if YYDEBUG != 0
00176 static const short yyrline[] = { 0,
00177 139, 141, 146, 150, 156, 158, 162, 164, 166, 168,
00178 170, 172, 174, 176, 178, 181, 184, 187, 190, 193,
00179 196, 201, 206, 208, 210, 213, 215, 218, 220, 223,
00180 225, 228, 231, 233, 236, 238, 241, 247
00181 };
00182 #endif
00183
00184
00185 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
00186
00187 static const char * const yytname[] = { "$","error","$undefined.","LST_SIMPLEID",
00188 "LST_LOGICALOP","LST_EQOP","LST_SIMPLEOP","LST_MAPSYM","LST_FIELDMAPSYM","LST_MARKERSYM",
00189 "LST_ifTOKEN","LST_thenTOKEN","LST_elseTOKEN","LST_LBRACKET","LST_RBRACKET",
00190 "LST_SELECTSYM","LST_SEPSYM","LST_OPENSYM","LST_CLOSESYM","LST_COLON","LST_COMMA",
00191 "LST_EOL","LST_COMMENTSYM","LST_WHITESPACE","LST_QUANTIFIERSYM","LST_EQUATIONSYM",
00192 "LST_EQSEPSYM","LST_COMPOSESYM","LST_LPAR","LST_RPAR","LST_assertsTOKEN","LST_assumesTOKEN",
00193 "LST_byTOKEN","LST_convertsTOKEN","LST_enumerationTOKEN","LST_equationsTOKEN",
00194 "LST_exemptingTOKEN","LST_forTOKEN","LST_generatedTOKEN","LST_impliesTOKEN",
00195 "LST_includesTOKEN","LST_introducesTOKEN","LST_ofTOKEN","LST_partitionedTOKEN",
00196 "LST_traitTOKEN","LST_tupleTOKEN","LST_unionTOKEN","LST_BADTOKEN","top","operatorList",
00197 "operator","name","opForm","anyOp","middle","placeList","separator","signature",
00198 "domain","sortList","sortId","opId", NULL
00199 };
00200 #endif
00201
00202 static const short yyr1[] = { 0,
00203 48, 49, 49, 50, 51, 51, 52, 52, 52, 52,
00204 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
00205 52, 52, 53, 53, 53, 54, 54, 55, 55, 56,
00206 56, 57, 58, 58, 59, 59, 60, 61
00207 };
00208
00209 static const short yyr2[] = { 0,
00210 1, 1, 2, 3, 1, 1, 6, 1, 2, 2,
00211 3, 3, 4, 4, 5, 3, 4, 4, 5, 2,
00212 3, 3, 1, 1, 1, 0, 1, 1, 3, 1,
00213 1, 3, 0, 1, 1, 3, 1, 1
00214 };
00215
00216 static const short yydefact[] = { 0,
00217 38, 24, 25, 23, 0, 0, 26, 0, 26, 1,
00218 2, 0, 6, 8, 5, 0, 26, 0, 26, 9,
00219 0, 28, 0, 27, 20, 0, 3, 33, 10, 22,
00220 0, 21, 0, 11, 0, 16, 31, 30, 0, 12,
00221 37, 4, 0, 34, 35, 17, 13, 0, 18, 29,
00222 14, 0, 0, 19, 15, 0, 32, 36, 7, 0,
00223 0, 0
00224 };
00225
00226 static const short yydefgoto[] = { 60,
00227 10, 11, 12, 13, 14, 23, 24, 39, 42, 43,
00228 44, 45, 15
00229 };
00230
00231 static const short yypact[] = { -3,
00232 -32768,-32768,-32768,-32768, 11, -4, 0, 8, 0, -3,
00233 -32768, -1,-32768, 13,-32768, 17, 0, 22, 0, 18,
00234 20,-32768, 19, -12,-32768, 14,-32768, 31,-32768,-32768,
00235 21,-32768, 23,-32768, 27, 28,-32768,-32768, 29, 30,
00236 -32768,-32768, 33, 24,-32768, 34, 36, 35,-32768,-32768,
00237 -32768, 31, 31,-32768,-32768, 37,-32768,-32768,-32768, 42,
00238 48,-32768
00239 };
00240
00241 static const short yypgoto[] = {-32768,
00242 -32768, 39,-32768,-32768, 45, 4,-32768,-32768,-32768,-32768,
00243 -32768, -23,-32768
00244 };
00245
00246
00247 #define YYLAST 50
00248
00249
00250 static const short yytable[] = { 1,
00251 2, 3, 4, 37, 21, 5, 6, 38, 22, 7,
00252 25, 8, 26, 9, 2, 3, 4, 28, 16, 30,
00253 31, 29, 33, 17, 32, 18, 34, 19, 57, 58,
00254 35, 40, 36, 41, 46, 48, 49, 50, 51, 52,
00255 47, 61, 54, 53, 55, 59, 56, 62, 27, 20
00256 };
00257
00258 static const short yycheck[] = { 3,
00259 4, 5, 6, 16, 9, 9, 10, 20, 9, 13,
00260 3, 15, 9, 17, 4, 5, 6, 19, 8, 3,
00261 17, 9, 19, 13, 3, 15, 9, 17, 52, 53,
00262 11, 18, 14, 3, 14, 9, 9, 9, 9, 7,
00263 18, 0, 9, 20, 9, 9, 12, 0, 10, 5
00264 };
00265 #define YYPURE 1
00266
00267
00268 #line 3 "/af10/evans/bison-1.28/share/bison.simple"
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299 #ifndef YYSTACK_USE_ALLOCA
00300 #ifdef alloca
00301 #define YYSTACK_USE_ALLOCA
00302 #else
00303 #ifdef __GNUC__
00304 #define YYSTACK_USE_ALLOCA
00305 #define alloca __builtin_alloca
00306 #else
00307 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
00308 #define YYSTACK_USE_ALLOCA
00309 #include <alloca.h>
00310 #else
00311
00312
00313
00314 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
00315 #if 0
00316
00317 #include <malloc.h>
00318 #endif
00319 #else
00320 #if defined(_AIX)
00321
00322
00323
00324 #pragma alloca
00325 #define YYSTACK_USE_ALLOCA
00326 #else
00327 #if 0
00328 #ifdef __hpux
00329
00330 #define YYSTACK_USE_ALLOCA
00331 #define alloca __builtin_alloca
00332 #endif
00333 #endif
00334 #endif
00335 #endif
00336 #endif
00337 #endif
00338 #endif
00339 #endif
00340
00341 #ifdef YYSTACK_USE_ALLOCA
00342 #define YYSTACK_ALLOC alloca
00343 #else
00344 #define YYSTACK_ALLOC malloc
00345 #endif
00346
00347
00348
00349
00350
00351 #define yyerrok (yyerrstatus = 0)
00352 #define yyclearin (yychar = YYEMPTY)
00353 #define YYEMPTY -2
00354 #define YYEOF 0
00355 #define YYACCEPT goto yyacceptlab
00356 #define YYABORT goto yyabortlab
00357 #define YYERROR goto yyerrlab1
00358
00359
00360
00361
00362 #define YYFAIL goto yyerrlab
00363 #define YYRECOVERING() (!!yyerrstatus)
00364 #define YYBACKUP(token, value) \
00365 do \
00366 if (yychar == YYEMPTY && yylen == 1) \
00367 { yychar = (token), yylval = (value); \
00368 yychar1 = YYTRANSLATE (yychar); \
00369 YYPOPSTACK; \
00370 goto yybackup; \
00371 } \
00372 else \
00373 { yyerror ("syntax error: cannot back up"); YYERROR; } \
00374 while (0)
00375
00376 #define YYTERROR 1
00377 #define YYERRCODE 256
00378
00379 #ifndef YYPURE
00380 #define YYLEX yylex()
00381 #endif
00382
00383 #ifdef YYPURE
00384 #ifdef YYLSP_NEEDED
00385 #ifdef YYLEX_PARAM
00386 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
00387 #else
00388 #define YYLEX yylex(&yylval, &yylloc)
00389 #endif
00390 #else
00391 #ifdef YYLEX_PARAM
00392 #define YYLEX yylex(&yylval, YYLEX_PARAM)
00393 #else
00394 #define YYLEX yylex(&yylval)
00395 #endif
00396 #endif
00397 #endif
00398
00399
00400
00401 #ifndef YYPURE
00402
00403 int yychar;
00404 YYSTYPE yylval;
00405
00406
00407 #ifdef YYLSP_NEEDED
00408 YYLTYPE yylloc;
00409
00410 #endif
00411
00412 int yynerrs;
00413 #endif
00414
00415 #if YYDEBUG != 0
00416 int yydebug;
00417
00418
00419 #endif
00420
00421
00422
00423 #ifndef YYINITDEPTH
00424 #define YYINITDEPTH 200
00425 #endif
00426
00427
00428
00429
00430 #if YYMAXDEPTH == 0
00431 #undef YYMAXDEPTH
00432 #endif
00433
00434 #ifndef YYMAXDEPTH
00435 #define YYMAXDEPTH 10000
00436 #endif
00437
00438
00439
00440
00441
00442
00443 #if __GNUC__ > 1
00444 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
00445 #else
00446 #ifndef __cplusplus
00447
00448
00449
00450 static void
00451 __yy_memcpy (to, from, count)
00452 char *to;
00453 char *from;
00454 unsigned int count;
00455 {
00456 register char *f = from;
00457 register char *t = to;
00458 register int i = count;
00459
00460 while (i-- > 0)
00461 *t++ = *f++;
00462 }
00463
00464 #else
00465
00466
00467
00468 static void
00469 __yy_memcpy (char *to, char *from, unsigned int count)
00470 {
00471 register char *t = to;
00472 register char *f = from;
00473 register int i = count;
00474
00475 while (i-- > 0)
00476 *t++ = *f++;
00477 }
00478
00479 #endif
00480 #endif
00481
00482 #line 217 "/af10/evans/bison-1.28/share/bison.simple"
00483
00484
00485
00486
00487
00488
00489
00490 #ifdef YYPARSE_PARAM
00491 #ifdef __cplusplus
00492 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
00493 #define YYPARSE_PARAM_DECL
00494 #else
00495 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
00496 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
00497 #endif
00498 #else
00499 #define YYPARSE_PARAM_ARG
00500 #define YYPARSE_PARAM_DECL
00501 #endif
00502
00503
00504 #ifdef __GNUC__
00505 #ifdef YYPARSE_PARAM
00506 int yyparse (void *);
00507 #else
00508 int yyparse (void);
00509 #endif
00510 #endif
00511
00512 int
00513 yyparse(YYPARSE_PARAM_ARG)
00514 YYPARSE_PARAM_DECL
00515 {
00516 register int yystate;
00517 register int yyn;
00518 register short *yyssp;
00519 register YYSTYPE *yyvsp;
00520 int yyerrstatus;
00521 int yychar1 = 0;
00522
00523 short yyssa[YYINITDEPTH];
00524 YYSTYPE yyvsa[YYINITDEPTH];
00525
00526 short *yyss = yyssa;
00527 YYSTYPE *yyvs = yyvsa;
00528
00529 #ifdef YYLSP_NEEDED
00530 YYLTYPE yylsa[YYINITDEPTH];
00531 YYLTYPE *yyls = yylsa;
00532 YYLTYPE *yylsp;
00533
00534 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
00535 #else
00536 #define YYPOPSTACK (yyvsp--, yyssp--)
00537 #endif
00538
00539 int yystacksize = YYINITDEPTH;
00540 int yyfree_stacks = 0;
00541
00542 #ifdef YYPURE
00543 int yychar;
00544 YYSTYPE yylval;
00545 int yynerrs;
00546 #ifdef YYLSP_NEEDED
00547 YYLTYPE yylloc;
00548 #endif
00549 #endif
00550
00551 YYSTYPE yyval;
00552
00553
00554
00555 int yylen;
00556
00557 #if YYDEBUG != 0
00558 if (yydebug)
00559 fprintf(stderr, "Starting parse\n");
00560 #endif
00561
00562 yystate = 0;
00563 yyerrstatus = 0;
00564 yynerrs = 0;
00565 yychar = YYEMPTY;
00566
00567
00568
00569
00570
00571
00572 yyssp = yyss - 1;
00573 yyvsp = yyvs;
00574 #ifdef YYLSP_NEEDED
00575 yylsp = yyls;
00576 #endif
00577
00578
00579
00580
00581 yynewstate:
00582
00583 *++yyssp = yystate;
00584
00585 if (yyssp >= yyss + yystacksize - 1)
00586 {
00587
00588
00589 YYSTYPE *yyvs1 = yyvs;
00590 short *yyss1 = yyss;
00591 #ifdef YYLSP_NEEDED
00592 YYLTYPE *yyls1 = yyls;
00593 #endif
00594
00595
00596 int size = yyssp - yyss + 1;
00597
00598 #ifdef yyoverflow
00599
00600
00601 #ifdef YYLSP_NEEDED
00602
00603
00604 yyoverflow("parser stack overflow",
00605 &yyss1, size * sizeof (*yyssp),
00606 &yyvs1, size * sizeof (*yyvsp),
00607 &yyls1, size * sizeof (*yylsp),
00608 &yystacksize);
00609 #else
00610 yyoverflow("parser stack overflow",
00611 &yyss1, size * sizeof (*yyssp),
00612 &yyvs1, size * sizeof (*yyvsp),
00613 &yystacksize);
00614 #endif
00615
00616 yyss = yyss1; yyvs = yyvs1;
00617 #ifdef YYLSP_NEEDED
00618 yyls = yyls1;
00619 #endif
00620 #else
00621
00622 if (yystacksize >= YYMAXDEPTH)
00623 {
00624 yyerror("parser stack overflow");
00625 if (yyfree_stacks)
00626 {
00627 free (yyss);
00628 free (yyvs);
00629 #ifdef YYLSP_NEEDED
00630 free (yyls);
00631 #endif
00632 }
00633 return 2;
00634 }
00635 yystacksize *= 2;
00636 if (yystacksize > YYMAXDEPTH)
00637 yystacksize = YYMAXDEPTH;
00638 #ifndef YYSTACK_USE_ALLOCA
00639 yyfree_stacks = 1;
00640 #endif
00641 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
00642 __yy_memcpy ((char *)yyss, (char *)yyss1,
00643 size * (unsigned int) sizeof (*yyssp));
00644 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
00645 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
00646 size * (unsigned int) sizeof (*yyvsp));
00647 #ifdef YYLSP_NEEDED
00648 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
00649 __yy_memcpy ((char *)yyls, (char *)yyls1,
00650 size * (unsigned int) sizeof (*yylsp));
00651 #endif
00652 #endif
00653
00654 yyssp = yyss + size - 1;
00655 yyvsp = yyvs + size - 1;
00656 #ifdef YYLSP_NEEDED
00657 yylsp = yyls + size - 1;
00658 #endif
00659
00660 #if YYDEBUG != 0
00661 if (yydebug)
00662 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
00663 #endif
00664
00665 if (yyssp >= yyss + yystacksize - 1)
00666 YYABORT;
00667 }
00668
00669 #if YYDEBUG != 0
00670 if (yydebug)
00671 fprintf(stderr, "Entering state %d\n", yystate);
00672 #endif
00673
00674 goto yybackup;
00675 yybackup:
00676
00677
00678
00679
00680
00681
00682
00683 yyn = yypact[yystate];
00684 if (yyn == YYFLAG)
00685 goto yydefault;
00686
00687
00688
00689
00690
00691
00692 if (yychar == YYEMPTY)
00693 {
00694 #if YYDEBUG != 0
00695 if (yydebug)
00696 fprintf(stderr, "Reading a token: ");
00697 #endif
00698 yychar = YYLEX;
00699 }
00700
00701
00702
00703 if (yychar <= 0)
00704 {
00705 yychar1 = 0;
00706 yychar = YYEOF;
00707
00708 #if YYDEBUG != 0
00709 if (yydebug)
00710 fprintf(stderr, "Now at end of input.\n");
00711 #endif
00712 }
00713 else
00714 {
00715 yychar1 = YYTRANSLATE(yychar);
00716
00717 #if YYDEBUG != 0
00718 if (yydebug)
00719 {
00720 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
00721
00722
00723 #ifdef YYPRINT
00724 YYPRINT (stderr, yychar, yylval);
00725 #endif
00726 fprintf (stderr, ")\n");
00727 }
00728 #endif
00729 }
00730
00731 yyn += yychar1;
00732 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
00733 goto yydefault;
00734
00735 yyn = yytable[yyn];
00736
00737
00738
00739
00740
00741
00742
00743
00744 if (yyn < 0)
00745 {
00746 if (yyn == YYFLAG)
00747 goto yyerrlab;
00748 yyn = -yyn;
00749 goto yyreduce;
00750 }
00751 else if (yyn == 0)
00752 goto yyerrlab;
00753
00754 if (yyn == YYFINAL)
00755 YYACCEPT;
00756
00757
00758
00759 #if YYDEBUG != 0
00760 if (yydebug)
00761 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
00762 #endif
00763
00764
00765 if (yychar != YYEOF)
00766 yychar = YYEMPTY;
00767
00768 *++yyvsp = yylval;
00769 #ifdef YYLSP_NEEDED
00770 *++yylsp = yylloc;
00771 #endif
00772
00773
00774 if (yyerrstatus) yyerrstatus--;
00775
00776 yystate = yyn;
00777 goto yynewstate;
00778
00779
00780 yydefault:
00781
00782 yyn = yydefact[yystate];
00783 if (yyn == 0)
00784 goto yyerrlab;
00785
00786
00787 yyreduce:
00788 yylen = yyr2[yyn];
00789 if (yylen > 0)
00790 yyval = yyvsp[1-yylen];
00791
00792 #if YYDEBUG != 0
00793 if (yydebug)
00794 {
00795 int i;
00796
00797 fprintf (stderr, "Reducing via rule %d (line %d), ",
00798 yyn, yyrline[yyn]);
00799
00800
00801 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
00802 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
00803 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
00804 }
00805 #endif
00806
00807
00808 switch (yyn) {
00809
00810 case 1:
00811 #line 139 "signature.y"
00812 { lslOpList_free (yyvsp[0].operators); ;
00813 break;}
00814 case 2:
00815 #line 142 "signature.y"
00816 { lslOpList x = lslOpList_new ();
00817 g_importedlslOp = yyvsp[0].operator;
00818 lslOpList_add (x, yyvsp[0].operator);
00819 yyval.operators = x; ;
00820 break;}
00821 case 3:
00822 #line 147 "signature.y"
00823 { lslOpList_add (yyvsp[-1].operators, yyvsp[0].operator);
00824 yyval.operators = yyvsp[-1].operators; ;
00825 break;}
00826 case 4:
00827 #line 151 "signature.y"
00828 { yyval.operator = makelslOpNode (yyvsp[-2].name, yyvsp[0].signature); ;
00829 break;}
00830 case 5:
00831 #line 157 "signature.y"
00832 { yyval.name = makeNameNodeId (yyvsp[0].ltok); ;
00833 break;}
00834 case 6:
00835 #line 159 "signature.y"
00836 { yyval.name = makeNameNodeForm (yyvsp[0].opform); ;
00837 break;}
00838 case 7:
00839 #line 163 "signature.y"
00840 { yyval.opform = makeOpFormNode (yyvsp[-5].ltok, OPF_IF, opFormUnion_createMiddle (0), ltoken_undefined); ;
00841 break;}
00842 case 8:
00843 #line 165 "signature.y"
00844 { yyval.opform = makeOpFormNode (yyvsp[0].ltok, OPF_ANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
00845 break;}
00846 case 9:
00847 #line 167 "signature.y"
00848 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_MANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
00849 break;}
00850 case 10:
00851 #line 169 "signature.y"
00852 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_ANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
00853 break;}
00854 case 11:
00855 #line 171 "signature.y"
00856 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
00857 break;}
00858 case 12:
00859 #line 173 "signature.y"
00860 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
00861 break;}
00862 case 13:
00863 #line 175 "signature.y"
00864 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
00865 break;}
00866 case 14:
00867 #line 177 "signature.y"
00868 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
00869 break;}
00870 case 15:
00871 #line 179 "signature.y"
00872 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MMIDDLEM,
00873 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
00874 break;}
00875 case 16:
00876 #line 182 "signature.y"
00877 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMIDDLE,
00878 opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
00879 break;}
00880 case 17:
00881 #line 185 "signature.y"
00882 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMMIDDLE,
00883 opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
00884 break;}
00885 case 18:
00886 #line 188 "signature.y"
00887 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMIDDLEM,
00888 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
00889 break;}
00890 case 19:
00891 #line 191 "signature.y"
00892 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMMIDDLEM,
00893 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
00894 break;}
00895 case 20:
00896 #line 194 "signature.y"
00897 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_SELECT,
00898 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
00899 break;}
00900 case 21:
00901 #line 197 "signature.y"
00902 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MSELECT,
00903 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
00904 break;}
00905 case 22:
00906 #line 202 "signature.y"
00907 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMAP,
00908 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
00909 break;}
00910 case 23:
00911 #line 207 "signature.y"
00912 { yyval.ltok = yyvsp[0].ltok; ;
00913 break;}
00914 case 24:
00915 #line 209 "signature.y"
00916 { yyval.ltok = yyvsp[0].ltok; ;
00917 break;}
00918 case 25:
00919 #line 211 "signature.y"
00920 { yyval.ltok = yyvsp[0].ltok; ;
00921 break;}
00922 case 26:
00923 #line 214 "signature.y"
00924 { yyval.count = 0; ;
00925 break;}
00926 case 27:
00927 #line 216 "signature.y"
00928 { yyval.count = yyvsp[0].count; ;
00929 break;}
00930 case 28:
00931 #line 219 "signature.y"
00932 { yyval.count = 1; ;
00933 break;}
00934 case 29:
00935 #line 221 "signature.y"
00936 { yyval.count = yyvsp[-2].count + 1; ;
00937 break;}
00938 case 30:
00939 #line 224 "signature.y"
00940 { yyval.ltok = yyvsp[0].ltok; ;
00941 break;}
00942 case 31:
00943 #line 226 "signature.y"
00944 { yyval.ltok = yyvsp[0].ltok; ;
00945 break;}
00946 case 32:
00947 #line 229 "signature.y"
00948 { yyval.signature = makesigNode (yyvsp[-1].ltok, yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
00949 break;}
00950 case 33:
00951 #line 232 "signature.y"
00952 { yyval.ltokenList = ltokenList_new (); ;
00953 break;}
00954 case 34:
00955 #line 234 "signature.y"
00956 { yyval.ltokenList = yyvsp[0].ltokenList; ;
00957 break;}
00958 case 35:
00959 #line 237 "signature.y"
00960 { yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
00961 break;}
00962 case 36:
00963 #line 239 "signature.y"
00964 { yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
00965 break;}
00966 case 37:
00967 #line 242 "signature.y"
00968 {
00969 yyval.ltok = yyvsp[0].ltok;
00970 ltoken_setText (yyval.ltok, processTraitSortId (ltoken_getText (yyvsp[0].ltok)));
00971 ;
00972 break;}
00973 case 38:
00974 #line 248 "signature.y"
00975 { yyval.ltok = yyvsp[0].ltok; ;
00976 break;}
00977 }
00978
00979 #line 543 "/af10/evans/bison-1.28/share/bison.simple"
00980
00981 yyvsp -= yylen;
00982 yyssp -= yylen;
00983 #ifdef YYLSP_NEEDED
00984 yylsp -= yylen;
00985 #endif
00986
00987 #if YYDEBUG != 0
00988 if (yydebug)
00989 {
00990 short *ssp1 = yyss - 1;
00991 fprintf (stderr, "state stack now");
00992 while (ssp1 != yyssp)
00993 fprintf (stderr, " %d", *++ssp1);
00994 fprintf (stderr, "\n");
00995 }
00996 #endif
00997
00998 *++yyvsp = yyval;
00999
01000 #ifdef YYLSP_NEEDED
01001 yylsp++;
01002 if (yylen == 0)
01003 {
01004 yylsp->first_line = yylloc.first_line;
01005 yylsp->first_column = yylloc.first_column;
01006 yylsp->last_line = (yylsp-1)->last_line;
01007 yylsp->last_column = (yylsp-1)->last_column;
01008 yylsp->text = 0;
01009 }
01010 else
01011 {
01012 yylsp->last_line = (yylsp+yylen-1)->last_line;
01013 yylsp->last_column = (yylsp+yylen-1)->last_column;
01014 }
01015 #endif
01016
01017
01018
01019
01020
01021
01022 yyn = yyr1[yyn];
01023
01024 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
01025 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
01026 yystate = yytable[yystate];
01027 else
01028 yystate = yydefgoto[yyn - YYNTBASE];
01029
01030 goto yynewstate;
01031
01032 yyerrlab:
01033
01034 if (! yyerrstatus)
01035
01036 {
01037 ++yynerrs;
01038
01039 #ifdef YYERROR_VERBOSE
01040 yyn = yypact[yystate];
01041
01042 if (yyn > YYFLAG && yyn < YYLAST)
01043 {
01044 int size = 0;
01045 char *msg;
01046 int x, count;
01047
01048 count = 0;
01049
01050 for (x = (yyn < 0 ? -yyn : 0);
01051 x < (sizeof(yytname) / sizeof(char *)); x++)
01052 if (yycheck[x + yyn] == x)
01053 size += strlen(yytname[x]) + 15, count++;
01054 msg = (char *) malloc(size + 15);
01055 if (msg != 0)
01056 {
01057 strcpy(msg, "parse error");
01058
01059 if (count < 5)
01060 {
01061 count = 0;
01062 for (x = (yyn < 0 ? -yyn : 0);
01063 x < (sizeof(yytname) / sizeof(char *)); x++)
01064 if (yycheck[x + yyn] == x)
01065 {
01066 strcat(msg, count == 0 ? ", expecting `" : " or `");
01067 strcat(msg, yytname[x]);
01068 strcat(msg, "'");
01069 count++;
01070 }
01071 }
01072 yyerror(msg);
01073 free(msg);
01074 }
01075 else
01076 yyerror ("parse error; also virtual memory exceeded");
01077 }
01078 else
01079 #endif
01080 yyerror("parse error");
01081 }
01082
01083 goto yyerrlab1;
01084 yyerrlab1:
01085
01086 if (yyerrstatus == 3)
01087 {
01088
01089
01090
01091 if (yychar == YYEOF)
01092 YYABORT;
01093
01094 #if YYDEBUG != 0
01095 if (yydebug)
01096 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
01097 #endif
01098
01099 yychar = YYEMPTY;
01100 }
01101
01102
01103
01104
01105 yyerrstatus = 3;
01106
01107 goto yyerrhandle;
01108
01109 yyerrdefault:
01110
01111 #if 0
01112
01113
01114 yyn = yydefact[yystate];
01115 if (yyn) goto yydefault;
01116 #endif
01117
01118 yyerrpop:
01119
01120 if (yyssp == yyss) YYABORT;
01121 yyvsp--;
01122 yystate = *--yyssp;
01123 #ifdef YYLSP_NEEDED
01124 yylsp--;
01125 #endif
01126
01127 #if YYDEBUG != 0
01128 if (yydebug)
01129 {
01130 short *ssp1 = yyss - 1;
01131 fprintf (stderr, "Error: state stack now");
01132 while (ssp1 != yyssp)
01133 fprintf (stderr, " %d", *++ssp1);
01134 fprintf (stderr, "\n");
01135 }
01136 #endif
01137
01138 yyerrhandle:
01139
01140 yyn = yypact[yystate];
01141 if (yyn == YYFLAG)
01142 goto yyerrdefault;
01143
01144 yyn += YYTERROR;
01145 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
01146 goto yyerrdefault;
01147
01148 yyn = yytable[yyn];
01149 if (yyn < 0)
01150 {
01151 if (yyn == YYFLAG)
01152 goto yyerrpop;
01153 yyn = -yyn;
01154 goto yyreduce;
01155 }
01156 else if (yyn == 0)
01157 goto yyerrpop;
01158
01159 if (yyn == YYFINAL)
01160 YYACCEPT;
01161
01162 #if YYDEBUG != 0
01163 if (yydebug)
01164 fprintf(stderr, "Shifting error token, ");
01165 #endif
01166
01167 *++yyvsp = yylval;
01168 #ifdef YYLSP_NEEDED
01169 *++yylsp = yylloc;
01170 #endif
01171
01172 yystate = yyn;
01173 goto yynewstate;
01174
01175 yyacceptlab:
01176
01177 if (yyfree_stacks)
01178 {
01179 free (yyss);
01180 free (yyvs);
01181 #ifdef YYLSP_NEEDED
01182 free (yyls);
01183 #endif
01184 }
01185 return 0;
01186
01187 yyabortlab:
01188
01189 if (yyfree_stacks)
01190 {
01191 free (yyss);
01192 free (yyvs);
01193 #ifdef YYLSP_NEEDED
01194 free (yyls);
01195 #endif
01196 }
01197 return 1;
01198 }
01199 #line 249 "signature.y"
01200
01201
01202 # include "bison.reset"
01203
01204 extern char *yytext;
01205
01206 void lslerror (char *s)
01207 {
01208 llfatalbug
01209 (cstring_makeLiteral
01210 ("There has been a problem parsing an LSL signature. This is believed to "
01211 "result from a problem with gcc version 2.95 optimizations, "
01212 "but it has not been confirmed. Please try rebuidling LCLint "
01213 "without the -O<n> option."));
01214
01215 }
01216
01217 static void yyprint (FILE *file, int type, YYSTYPE value)
01218 {
01219 fprintf (file, " (%u:%u type: %d; text: %s) ",
01220 ltoken_getLine (value.ltok),
01221 ltoken_getCol (value.ltok),
01222 type,
01223 ltoken_getRawTextChars (value.ltok));
01224 }
01225
01226 extern void PrintToken (ltoken tok) {
01227 char *codStr;
01228
01229 switch (ltoken_getCode (tok))
01230 {
01231 case NOTTOKEN: codStr = "*** NOTTOKEN ***"; break;
01232 case LST_QUANTIFIERSYM: codStr = "QUANTIFIERSYM"; break;
01233 case LST_LOGICALOP: codStr = "LOGICALOP: "; break;
01234 case LST_SELECTSYM: codStr = "LST_SELECTSYM"; break;
01235 case LST_OPENSYM: codStr = "LST_OPENSYM"; break;
01236 case LST_SEPSYM: codStr = "SEPSYM"; break;
01237 case LST_CLOSESYM: codStr = "LST_CLOSESYM"; break;
01238 case LST_SIMPLEID: codStr = "LST_SIMPLEID"; break;
01239 case LST_MAPSYM: codStr = "MAPSYM"; break;
01240 case LST_MARKERSYM: codStr = "LST_MARKERSYM"; break;
01241 case LST_COMMENTSYM: codStr = "COMMENTSYM"; break;
01242 case LST_SIMPLEOP: codStr = "SIMPLEOP"; break;
01243 case LST_COLON: codStr = "LST_COLON"; break;
01244 case LST_COMMA: codStr = "COMMA"; break;
01245 case LST_LBRACKET: codStr = "LST_LBRACKET"; break;
01246 case LST_LPAR: codStr = "LST_LPAR"; break;
01247 case LST_RBRACKET: codStr = "LST_RBRACKET"; break;
01248 case LST_RPAR: codStr = "LST_RPAR"; break;
01249 case LST_EQOP: codStr = "LST_EQOP"; break;
01250 case LST_WHITESPACE: codStr = "WHITESPACE,"; break;
01251 case LST_EOL: codStr = "LST_EOL"; break;
01252 case LST_elseTOKEN: codStr = "elseTOKEN"; break;
01253 case LST_ifTOKEN: codStr = "ifTOKEN"; break;
01254 case LST_thenTOKEN: codStr = "thenTOKEN"; break;
01255 case LST_BADTOKEN: codStr = "*** BADTOKEN ***"; break;
01256 case LEOFTOKEN:
01257 codStr = "LEOFTOKEN"; break;
01258 default:
01259 codStr = "*** invalid token code ***";
01260 break;
01261 }
01262
01263
01264 printf ("%u:%u: Token Code (%u): %s",
01265 ltoken_getLine (tok), ltoken_getCol (tok),
01266 ltoken_getCode (tok), codStr);
01267 if (ltoken_getRawText (tok) != 0)
01268 {
01269 printf (", Token String (%lu): %s\n",
01270 ltoken_getRawText (tok), ltoken_getRawTextChars (tok));
01271 }
01272 else printf ("\n");
01273 }
01274
01275
01276
01277