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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2