(file) Return to WQLYACC.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / WQL

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2