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

   1 karl  1.16 //%2006////////////////////////////////////////////////////////////////////////
   2            //
   3            // 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            // IBM Corp.; EMC Corporation, The Open Group.
   7            // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   8            // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
   9            // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
  10            // EMC Corporation; VERITAS Software Corporation; The Open Group.
  11            // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
  12            // EMC Corporation; Symantec Corporation; The Open Group.
  13            //
  14            // Permission is hereby granted, free of charge, to any person obtaining a copy
  15            // of this software and associated documentation files (the "Software"), to
  16            // deal in the Software without restriction, including without limitation the
  17            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  18            // sell copies of the Software, and to permit persons to whom the Software is
  19            // furnished to do so, subject to the following conditions:
  20            // 
  21            // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
  22 karl  1.16 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
  23            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
  24            // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  25            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  26            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  27            // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  28            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  29            //
  30            //==============================================================================
  31 karl  1.15 /* A Bison parser, made by GNU Bison 1.875c.  */
  32 karl  1.12 
  33 karl  1.15 /* Skeleton parser for Yacc-like parsing with Bison,
  34               Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
  35 karl  1.12 
  36 karl  1.15    This program is free software; you can redistribute it and/or modify
  37               it under the terms of the GNU General Public License as published by
  38               the Free Software Foundation; either version 2, or (at your option)
  39               any later version.
  40 karl  1.13 
  41 karl  1.15    This program is distributed in the hope that it will be useful,
  42               but WITHOUT ANY WARRANTY; without even the implied warranty of
  43               MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  44               GNU General Public License for more details.
  45            
  46               You should have received a copy of the GNU General Public License
  47               along with this program; if not, write to the Free Software
  48               Foundation, Inc., 59 Temple Place - Suite 330,
  49               Boston, MA 02111-1307, USA.  */
  50            
  51            /* As a special exception, when this file is copied by Bison into a
  52               Bison output file, you may use that output file without restriction.
  53               This special exception was added by the Free Software Foundation
  54               in version 1.24 of Bison.  */
  55            
  56            /* Written by Richard Stallman by simplifying the original so called
  57               ``semantic'' parser.  */
  58            
  59            /* All symbols defined below should begin with yy or YY, to avoid
  60               infringing on user name space.  This should be done even for local
  61               variables, as they might otherwise be expanded by user macros.
  62 karl  1.15    There are some unavoidable exceptions within include files to
  63               define necessary library symbols; they are noted "INFRINGES ON
  64               USER NAME SPACE" below.  */
  65            
  66            /* Identify Bison output.  */
  67            #define YYBISON 1
  68            
  69            /* Skeleton name.  */
  70            #define YYSKELETON_NAME "yacc.c"
  71            
  72            /* Pure parsers.  */
  73            #define YYPURE 0
  74            
  75            /* Using locations.  */
  76            #define YYLSP_NEEDED 0
  77            
  78            /* If NAME_PREFIX is specified substitute the variables and functions
  79               names.  */
  80 mike  1.2  #define yyparse WQL_parse
  81 karl  1.15 #define yylex   WQL_lex
  82 mike  1.2  #define yyerror WQL_error
  83 karl  1.15 #define yylval  WQL_lval
  84            #define yychar  WQL_char
  85 mike  1.2  #define yydebug WQL_debug
  86            #define yynerrs WQL_nerrs
  87 karl  1.12 
  88 karl  1.15 
  89            /* Tokens.  */
  90            #ifndef YYTOKENTYPE
  91            # define YYTOKENTYPE
  92               /* Put the tokens into the symbol table, so that GDB and other debuggers
  93                  know about them.  */
  94               enum yytokentype {
  95                 TOK_INTEGER = 258,
  96                 TOK_DOUBLE = 259,
  97                 TOK_STRING = 260,
  98                 TOK_TRUE = 261,
  99                 TOK_FALSE = 262,
 100                 TOK_NULL = 263,
 101                 TOK_ISA = 264,
 102                 TOK_DOT = 265,
 103                 TOK_EQ = 266,
 104                 TOK_NE = 267,
 105                 TOK_LT = 268,
 106                 TOK_LE = 269,
 107                 TOK_GT = 270,
 108                 TOK_GE = 271,
 109 karl  1.15      TOK_NOT = 272,
 110                 TOK_OR = 273,
 111                 TOK_AND = 274,
 112                 TOK_IS = 275,
 113                 TOK_IDENTIFIER = 276,
 114                 TOK_SELECT = 277,
 115                 TOK_WHERE = 278,
 116                 TOK_FROM = 279,
 117                 TOK_UNEXPECTED_CHAR = 280
 118               };
 119            #endif
 120            #define TOK_INTEGER 258
 121            #define TOK_DOUBLE 259
 122            #define TOK_STRING 260
 123            #define TOK_TRUE 261
 124            #define TOK_FALSE 262
 125            #define TOK_NULL 263
 126            #define TOK_ISA 264
 127            #define TOK_DOT 265
 128            #define TOK_EQ 266
 129            #define TOK_NE 267
 130 karl  1.15 #define TOK_LT 268
 131            #define TOK_LE 269
 132            #define TOK_GT 270
 133            #define TOK_GE 271
 134            #define TOK_NOT 272
 135            #define TOK_OR 273
 136            #define TOK_AND 274
 137            #define TOK_IS 275
 138            #define TOK_IDENTIFIER 276
 139            #define TOK_SELECT 277
 140            #define TOK_WHERE 278
 141            #define TOK_FROM 279
 142            #define TOK_UNEXPECTED_CHAR 280
 143            
 144            
 145            
 146            
 147            /* Copy the first part of user declarations.  */
 148            #line 37 "WQL.y"
 149 karl  1.12 
 150 mike  1.2  
 151            #include <Pegasus/Common/Config.h>
 152            #include <Pegasus/WQL/WQLOperation.h>
 153            #include <Pegasus/WQL/WQLOperand.h>
 154            #include <Pegasus/WQL/WQLParserState.h>
 155            #include <Pegasus/WQL/WQLSelectStatement.h>
 156            #include <string.h>
 157            #include <stdlib.h>
 158            
 159            #ifdef PEGASUS_OS_TYPE_WINDOWS
 160            # include <malloc.h>
 161            #endif
 162            
 163            #if defined(PEGASUS_COMPILER_ACC) && defined(PEGASUS_OS_HPUX)
 164            # include <alloca.h>
 165            #endif
 166            
 167            #if 0
 168            # define WQL_TRACE(X) printf X
 169            #else
 170            # define WQL_TRACE(X)
 171 mike  1.2  #endif
 172            
 173            extern int WQL_lex();
 174 kumpf 1.3  extern int WQL_error(const char*);
 175 mike  1.2  
 176 karl  1.12 //
 177            // Define the global parser state object:
 178            //
 179 mike  1.2  
 180            PEGASUS_USING_PEGASUS;
 181            
 182            PEGASUS_NAMESPACE_BEGIN
 183            
 184 karl  1.9  extern WQLParserState* globalParserState;
 185 mike  1.2  
 186            PEGASUS_NAMESPACE_END
 187            
 188 karl  1.12 
 189 karl  1.15 
 190            /* Enabling traces.  */
 191            #ifndef YYDEBUG
 192            # define YYDEBUG 0
 193            #endif
 194            
 195            /* Enabling verbose error messages.  */
 196            #ifdef YYERROR_VERBOSE
 197            # undef YYERROR_VERBOSE
 198            # define YYERROR_VERBOSE 1
 199            #else
 200            # define YYERROR_VERBOSE 0
 201            #endif
 202            
 203            #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
 204            #line 87 "WQL.y"
 205            typedef union YYSTYPE {
 206 mike  1.2     int intValue;
 207               double doubleValue;
 208               char* strValue;
 209               void* nodeValue;
 210            } YYSTYPE;
 211 karl  1.15 /* Line 191 of yacc.c.  */
 212            #line 183 "WQLtemp"
 213            # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 214            # define YYSTYPE_IS_DECLARED 1
 215            # define YYSTYPE_IS_TRIVIAL 1
 216            #endif
 217            
 218            
 219            
 220            /* Copy the second part of user declarations.  */
 221            
 222            
 223            /* Line 214 of yacc.c.  */
 224            #line 195 "WQLtemp"
 225            
 226            #if ! defined (yyoverflow) || YYERROR_VERBOSE
 227            
 228            # ifndef YYFREE
 229            #  define YYFREE free
 230            # endif
 231            # ifndef YYMALLOC
 232 karl  1.15 #  define YYMALLOC malloc
 233            # endif
 234            
 235            /* The parser invokes alloca or malloc; define the necessary symbols.  */
 236            
 237            # ifdef YYSTACK_USE_ALLOCA
 238            #  if YYSTACK_USE_ALLOCA
 239            #   define YYSTACK_ALLOC alloca
 240            #  endif
 241            # else
 242            #  if defined (alloca) || defined (_ALLOCA_H)
 243            #   define YYSTACK_ALLOC alloca
 244            #  else
 245            #   ifdef __GNUC__
 246            #    define YYSTACK_ALLOC __builtin_alloca
 247            #   endif
 248            #  endif
 249            # endif
 250            
 251            # ifdef YYSTACK_ALLOC
 252               /* Pacify GCC's `empty if-body' warning. */
 253 karl  1.15 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
 254            # else
 255            #  if defined (__STDC__) || defined (__cplusplus)
 256            #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 257            #   define YYSIZE_T size_t
 258            #  endif
 259            #  define YYSTACK_ALLOC YYMALLOC
 260            #  define YYSTACK_FREE YYFREE
 261            # endif
 262            #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
 263            
 264            
 265            #if (! defined (yyoverflow) \
 266                 && (! defined (__cplusplus) \
 267            	 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
 268            
 269            /* A type that is properly aligned for any stack member.  */
 270            union yyalloc
 271            {
 272              short yyss;
 273              YYSTYPE yyvs;
 274 karl  1.15   };
 275            
 276            /* The size of the maximum gap between one aligned stack and the next.  */
 277            # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
 278            
 279            /* The size of an array large to enough to hold all stacks, each with
 280               N elements.  */
 281            # define YYSTACK_BYTES(N) \
 282                 ((N) * (sizeof (short) + sizeof (YYSTYPE))				\
 283                  + YYSTACK_GAP_MAXIMUM)
 284            
 285            /* Copy COUNT objects from FROM to TO.  The source and destination do
 286               not overlap.  */
 287            # ifndef YYCOPY
 288            #  if defined (__GNUC__) && 1 < __GNUC__
 289            #   define YYCOPY(To, From, Count) \
 290                  __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
 291            #  else
 292            #   define YYCOPY(To, From, Count)		\
 293                  do					\
 294            	{					\
 295 karl  1.15 	  register YYSIZE_T yyi;		\
 296            	  for (yyi = 0; yyi < (Count); yyi++)	\
 297            	    (To)[yyi] = (From)[yyi];		\
 298            	}					\
 299                  while (0)
 300            #  endif
 301            # endif
 302            
 303            /* Relocate STACK from its old location to the new one.  The
 304               local variables YYSIZE and YYSTACKSIZE give the old and new number of
 305               elements in the stack, and YYPTR gives the new location of the
 306               stack.  Advance YYPTR to a properly aligned location for the next
 307               stack.  */
 308            # define YYSTACK_RELOCATE(Stack)					\
 309                do									\
 310                  {									\
 311            	YYSIZE_T yynewbytes;						\
 312            	YYCOPY (&yyptr->Stack, Stack, yysize);				\
 313            	Stack = &yyptr->Stack;						\
 314            	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
 315            	yyptr += yynewbytes / sizeof (*yyptr);				\
 316 karl  1.15       }									\
 317                while (0)
 318 karl  1.12 
 319 karl  1.14 #endif
 320 karl  1.15 
 321            #if defined (__STDC__) || defined (__cplusplus)
 322               typedef signed char yysigned_char;
 323            #else
 324               typedef short yysigned_char;
 325 karl  1.12 #endif
 326 karl  1.13 
 327 karl  1.15 /* YYFINAL -- State number of the termination state. */
 328            #define YYFINAL  9
 329            /* YYLAST -- Last index in YYTABLE.  */
 330            #define YYLAST   69
 331            
 332            /* YYNTOKENS -- Number of terminals. */
 333            #define YYNTOKENS  30
 334            /* YYNNTS -- Number of nonterminals. */
 335            #define YYNNTS  16
 336            /* YYNRULES -- Number of rules. */
 337            #define YYNRULES  39
 338            /* YYNRULES -- Number of states. */
 339            #define YYNSTATES  65
 340            
 341            /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 342            #define YYUNDEFTOK  2
 343            #define YYMAXUTOK   280
 344            
 345            #define YYTRANSLATE(YYX) 						\
 346              ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 347            
 348 karl  1.15 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
 349            static const unsigned char yytranslate[] =
 350            {
 351                   0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 352                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 353                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 354                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 355                  28,    29,    26,     2,    27,     2,     2,     2,     2,     2,
 356                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 357                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 358                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 359                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 360                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 361                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 362                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 363                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 364                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 365                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 366                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 367                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 368                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 369 karl  1.15        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 370                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 371                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 372                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 373                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 374                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 375                   2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 376                   2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
 377                   5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
 378                  15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
 379                  25
 380            };
 381 karl  1.12 
 382 karl  1.15 #if YYDEBUG
 383            /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
 384               YYRHS.  */
 385            static const unsigned char yyprhs[] =
 386            {
 387                   0,     0,     3,     5,     9,    11,    13,    15,    19,    22,
 388                  24,    27,    30,    34,    38,    41,    45,    47,    51,    56,
 389                  58,    60,    64,    68,    72,    76,    80,    84,    88,    92,
 390                  97,    99,   101,   103,   107,   109,   111,   113,   115,   117
 391 karl  1.13 };
 392 karl  1.12 
 393 karl  1.15 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
 394            static const yysigned_char yyrhs[] =
 395            {
 396                  31,     0,    -1,    32,    -1,    22,    33,    35,    -1,    26,
 397                  -1,    34,    -1,    43,    -1,    34,    27,    43,    -1,    36,
 398                  37,    -1,    36,    -1,    24,    44,    -1,    23,    38,    -1,
 399                  38,    18,    38,    -1,    38,    19,    38,    -1,    17,    38,
 400                  -1,    28,    38,    29,    -1,    39,    -1,    39,    20,    42,
 401                  -1,    39,    20,    17,    42,    -1,    40,    -1,    41,    -1,
 402                  45,    13,    45,    -1,    45,    15,    45,    -1,    45,    14,
 403                  45,    -1,    45,    16,    45,    -1,    45,    11,    45,    -1,
 404                  45,    12,    45,    -1,    43,     9,    44,    -1,    45,    20,
 405                   8,    -1,    45,    20,    17,     8,    -1,     6,    -1,     7,
 406                  -1,    21,    -1,    21,    10,    21,    -1,    21,    -1,    43,
 407                  -1,     3,    -1,     4,    -1,     5,    -1,    42,    -1
 408 karl  1.12 };
 409            
 410 karl  1.15 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 411            static const unsigned short yyrline[] =
 412            {
 413                   0,   160,   160,   166,   172,   176,   182,   186,   192,   196,
 414                 202,   209,   215,   220,   225,   231,   235,   239,   244,   253,
 415                 257,   263,   268,   273,   278,   283,   288,   293,   303,   308,
 416                 315,   319,   332,   337,   349,   356,   362,   367,   372,   377
 417 karl  1.12 };
 418 karl  1.14 #endif
 419            
 420 karl  1.15 #if YYDEBUG || YYERROR_VERBOSE
 421            /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
 422               First, the terminals, then, starting at YYNTOKENS, nonterminals. */
 423            static const char *const yytname[] =
 424            {
 425              "$end", "error", "$undefined", "TOK_INTEGER", "TOK_DOUBLE",
 426              "TOK_STRING", "TOK_TRUE", "TOK_FALSE", "TOK_NULL", "TOK_ISA", "TOK_DOT",
 427              "TOK_EQ", "TOK_NE", "TOK_LT", "TOK_LE", "TOK_GT", "TOK_GE", "TOK_NOT",
 428              "TOK_OR", "TOK_AND", "TOK_IS", "TOK_IDENTIFIER", "TOK_SELECT",
 429              "TOK_WHERE", "TOK_FROM", "TOK_UNEXPECTED_CHAR", "'*'", "','", "'('",
 430              "')'", "$accept", "start", "selectStatement", "selectList",
 431              "propertyList", "selectExpression", "fromClause", "whereClause",
 432              "searchCondition", "predicate", "comparisonPredicate", "nullPredicate",
 433              "truthValue", "propertyName", "className", "comparisonTerm", 0
 434 karl  1.12 };
 435            #endif
 436            
 437 karl  1.15 # ifdef YYPRINT
 438            /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
 439               token YYLEX-NUM.  */
 440            static const unsigned short yytoknum[] =
 441            {
 442                   0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
 443                 265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
 444                 275,   276,   277,   278,   279,   280,    42,    44,    40,    41
 445            };
 446            # endif
 447 karl  1.14 
 448 karl  1.15 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 449            static const unsigned char yyr1[] =
 450            {
 451                   0,    30,    31,    32,    33,    33,    34,    34,    35,    35,
 452                  36,    37,    38,    38,    38,    38,    38,    38,    38,    39,
 453                  39,    40,    40,    40,    40,    40,    40,    40,    41,    41,
 454                  42,    42,    43,    43,    44,    45,    45,    45,    45,    45
 455 karl  1.12 };
 456            
 457 karl  1.15 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
 458            static const unsigned char yyr2[] =
 459            {
 460                   0,     2,     1,     3,     1,     1,     1,     3,     2,     1,
 461                   2,     2,     3,     3,     2,     3,     1,     3,     4,     1,
 462                   1,     3,     3,     3,     3,     3,     3,     3,     3,     4,
 463                   1,     1,     1,     3,     1,     1,     1,     1,     1,     1
 464 karl  1.13 };
 465 karl  1.12 
 466 karl  1.15 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
 467               STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
 468               means the default is an error.  */
 469            static const unsigned char yydefact[] =
 470            {
 471                   0,     0,     0,     2,    32,     4,     0,     5,     6,     1,
 472                   0,     0,     3,     9,     0,    33,    34,    10,     0,     8,
 473                   7,    36,    37,    38,    30,    31,     0,     0,    11,    16,
 474                  19,    20,    39,    35,     0,    14,     0,     0,     0,     0,
 475                   0,     0,     0,     0,     0,     0,     0,     0,    15,    12,
 476                  13,     0,    17,    27,    35,    25,    26,    21,    23,    22,
 477                  24,    28,     0,    18,    29
 478 mike  1.2  };
 479 karl  1.12 
 480 karl  1.15 /* YYDEFGOTO[NTERM-NUM]. */
 481            static const yysigned_char yydefgoto[] =
 482            {
 483                  -1,     2,     3,     6,     7,    12,    13,    19,    28,    29,
 484                  30,    31,    32,    54,    17,    34
 485 karl  1.12 };
 486            
 487 karl  1.15 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
 488               STATE-NUM.  */
 489            #define YYPACT_NINF -38
 490            static const yysigned_char yypact[] =
 491            {
 492                 -21,   -10,    15,   -38,    25,   -38,    17,    -8,   -38,   -38,
 493                  28,    39,   -38,    38,    41,   -38,   -38,   -38,     1,   -38,
 494                 -38,   -38,   -38,   -38,   -38,   -38,     1,     1,     5,    43,
 495                 -38,   -38,   -38,    55,    31,   -38,     9,     1,     1,    33,
 496                  39,    27,    27,    27,    27,    27,    27,    -5,   -38,    46,
 497                 -38,    52,   -38,   -38,   -38,   -38,   -38,   -38,   -38,   -38,
 498                 -38,   -38,    58,   -38,   -38
 499 karl  1.12 };
 500            
 501 karl  1.15 /* YYPGOTO[NTERM-NUM].  */
 502            static const yysigned_char yypgoto[] =
 503            {
 504                 -38,   -38,   -38,   -38,   -38,   -38,   -38,   -38,   -17,   -38,
 505                 -38,   -38,   -37,    -1,    29,    11
 506 karl  1.12 };
 507            
 508 karl  1.15 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
 509               positive, shift that token.  If negative, reduce the rule which
 510               number is the opposite.  If zero, do what YYDEFACT says.
 511               If YYTABLE_NINF, syntax error.  */
 512            #define YYTABLE_NINF -1
 513            static const unsigned char yytable[] =
 514            {
 515                   8,     1,    52,    61,    21,    22,    23,    24,    25,    35,
 516                  36,     4,    62,    20,    63,     9,     5,    33,    26,    14,
 517                  49,    50,     4,    37,    38,    33,    33,    37,    38,    27,
 518                  21,    22,    23,    24,    25,    10,    33,    33,    48,    24,
 519                  25,    11,    41,    42,    43,    44,    45,    46,     4,    15,
 520                  51,    47,    55,    56,    57,    58,    59,    60,    24,    25,
 521                  16,    18,     4,    39,    40,    38,    64,     0,     0,    53
 522 karl  1.12 };
 523            
 524 karl  1.15 static const yysigned_char yycheck[] =
 525            {
 526                   1,    22,    39,     8,     3,     4,     5,     6,     7,    26,
 527                  27,    21,    17,    14,    51,     0,    26,    18,    17,    27,
 528                  37,    38,    21,    18,    19,    26,    27,    18,    19,    28,
 529                   3,     4,     5,     6,     7,    10,    37,    38,    29,     6,
 530                   7,    24,    11,    12,    13,    14,    15,    16,    21,    21,
 531                  17,    20,    41,    42,    43,    44,    45,    46,     6,     7,
 532                  21,    23,    21,    20,     9,    19,     8,    -1,    -1,    40
 533 karl  1.12 };
 534            
 535 karl  1.15 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
 536               symbol of state STATE-NUM.  */
 537            static const unsigned char yystos[] =
 538            {
 539                   0,    22,    31,    32,    21,    26,    33,    34,    43,     0,
 540                  10,    24,    35,    36,    27,    21,    21,    44,    23,    37,
 541                  43,     3,     4,     5,     6,     7,    17,    28,    38,    39,
 542                  40,    41,    42,    43,    45,    38,    38,    18,    19,    20,
 543                   9,    11,    12,    13,    14,    15,    16,    20,    29,    38,
 544                  38,    17,    42,    44,    43,    45,    45,    45,    45,    45,
 545                  45,     8,    17,    42,     8
 546 karl  1.12 };
 547 karl  1.14 
 548 karl  1.15 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
 549            # define YYSIZE_T __SIZE_TYPE__
 550            #endif
 551            #if ! defined (YYSIZE_T) && defined (size_t)
 552            # define YYSIZE_T size_t
 553            #endif
 554            #if ! defined (YYSIZE_T)
 555            # if defined (__STDC__) || defined (__cplusplus)
 556            #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 557            #  define YYSIZE_T size_t
 558            # endif
 559            #endif
 560            #if ! defined (YYSIZE_T)
 561            # define YYSIZE_T unsigned int
 562 mike  1.2  #endif
 563 karl  1.14 
 564 karl  1.12 #define yyerrok		(yyerrstatus = 0)
 565            #define yyclearin	(yychar = YYEMPTY)
 566 karl  1.15 #define YYEMPTY		(-2)
 567 karl  1.12 #define YYEOF		0
 568 karl  1.15 
 569 karl  1.12 #define YYACCEPT	goto yyacceptlab
 570 karl  1.15 #define YYABORT		goto yyabortlab
 571            #define YYERROR		goto yyerrorlab
 572            
 573            
 574            /* Like YYERROR except do call yyerror.  This remains here temporarily
 575               to ease the transition to the new meaning of YYERROR, for GCC.
 576 karl  1.12    Once GCC version 2 has supplanted version 1, this can go.  */
 577 karl  1.15 
 578 karl  1.12 #define YYFAIL		goto yyerrlab
 579 karl  1.15 
 580 karl  1.12 #define YYRECOVERING()  (!!yyerrstatus)
 581 karl  1.15 
 582            #define YYBACKUP(Token, Value)					\
 583 karl  1.12 do								\
 584              if (yychar == YYEMPTY && yylen == 1)				\
 585 karl  1.15     {								\
 586                  yychar = (Token);						\
 587                  yylval = (Value);						\
 588                  yytoken = YYTRANSLATE (yychar);				\
 589 karl  1.12       YYPOPSTACK;						\
 590                  goto yybackup;						\
 591                }								\
 592              else								\
 593 karl  1.15     { 								\
 594                  yyerror ("syntax error: cannot back up");\
 595                  YYERROR;							\
 596                }								\
 597 karl  1.12 while (0)
 598            
 599            #define YYTERROR	1
 600            #define YYERRCODE	256
 601            
 602 karl  1.15 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
 603               are run).  */
 604            
 605            #ifndef YYLLOC_DEFAULT
 606            # define YYLLOC_DEFAULT(Current, Rhs, N)		\
 607               ((Current).first_line   = (Rhs)[1].first_line,	\
 608                (Current).first_column = (Rhs)[1].first_column,	\
 609                (Current).last_line    = (Rhs)[N].last_line,	\
 610                (Current).last_column  = (Rhs)[N].last_column)
 611 karl  1.14 #endif
 612 karl  1.13 
 613 karl  1.15 /* YYLEX -- calling `yylex' with the right arguments.  */
 614            
 615 karl  1.14 #ifdef YYLEX_PARAM
 616 karl  1.15 # define YYLEX yylex (YYLEX_PARAM)
 617 karl  1.14 #else
 618 karl  1.15 # define YYLEX yylex ()
 619 karl  1.12 #endif
 620 karl  1.15 
 621            /* Enable debugging if requested.  */
 622            #if YYDEBUG
 623            
 624            # ifndef YYFPRINTF
 625            #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
 626            #  define YYFPRINTF fprintf
 627            # endif
 628            
 629            # define YYDPRINTF(Args)			\
 630            do {						\
 631              if (yydebug)					\
 632                YYFPRINTF Args;				\
 633            } while (0)
 634            
 635            # define YYDSYMPRINT(Args)			\
 636            do {						\
 637              if (yydebug)					\
 638                yysymprint Args;				\
 639            } while (0)
 640            
 641 karl  1.15 # define YYDSYMPRINTF(Title, Token, Value, Location)		\
 642            do {								\
 643              if (yydebug)							\
 644                {								\
 645                  YYFPRINTF (stderr, "%s ", Title);				\
 646                  yysymprint (stderr, 					\
 647                              Token, Value);	\
 648                  YYFPRINTF (stderr, "\n");					\
 649                }								\
 650            } while (0)
 651            
 652            /*------------------------------------------------------------------.
 653            | yy_stack_print -- Print the state stack from its BOTTOM up to its |
 654            | TOP (included).                                                   |
 655            `------------------------------------------------------------------*/
 656            
 657            #if defined (__STDC__) || defined (__cplusplus)
 658            static void
 659            yy_stack_print (short *bottom, short *top)
 660 mike  1.2  #else
 661 karl  1.15 static void
 662            yy_stack_print (bottom, top)
 663                short *bottom;
 664                short *top;
 665 karl  1.12 #endif
 666 karl  1.15 {
 667              YYFPRINTF (stderr, "Stack now");
 668              for (/* Nothing. */; bottom <= top; ++bottom)
 669                YYFPRINTF (stderr, " %d", *bottom);
 670              YYFPRINTF (stderr, "\n");
 671            }
 672 karl  1.13 
 673 karl  1.15 # define YY_STACK_PRINT(Bottom, Top)				\
 674            do {								\
 675              if (yydebug)							\
 676                yy_stack_print ((Bottom), (Top));				\
 677            } while (0)
 678 karl  1.13 
 679            
 680 karl  1.15 /*------------------------------------------------.
 681            | Report that the YYRULE is going to be reduced.  |
 682            `------------------------------------------------*/
 683 karl  1.13 
 684 karl  1.15 #if defined (__STDC__) || defined (__cplusplus)
 685            static void
 686            yy_reduce_print (int yyrule)
 687            #else
 688            static void
 689            yy_reduce_print (yyrule)
 690                int yyrule;
 691 karl  1.12 #endif
 692 karl  1.15 {
 693              int yyi;
 694              unsigned int yylno = yyrline[yyrule];
 695              YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
 696                         yyrule - 1, yylno);
 697              /* Print the symbols being reduced, and their result.  */
 698              for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
 699                YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
 700              YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
 701            }
 702 karl  1.12 
 703 karl  1.15 # define YY_REDUCE_PRINT(Rule)		\
 704            do {					\
 705              if (yydebug)				\
 706                yy_reduce_print (Rule);		\
 707            } while (0)
 708            
 709            /* Nonzero means print parse trace.  It is left uninitialized so that
 710               multiple parsers can coexist.  */
 711            int yydebug;
 712            #else /* !YYDEBUG */
 713            # define YYDPRINTF(Args)
 714            # define YYDSYMPRINT(Args)
 715            # define YYDSYMPRINTF(Title, Token, Value, Location)
 716            # define YY_STACK_PRINT(Bottom, Top)
 717            # define YY_REDUCE_PRINT(Rule)
 718            #endif /* !YYDEBUG */
 719 karl  1.12 
 720            
 721 karl  1.15 /* YYINITDEPTH -- initial size of the parser's stacks.  */
 722 karl  1.12 #ifndef	YYINITDEPTH
 723 karl  1.15 # define YYINITDEPTH 200
 724 karl  1.12 #endif
 725            
 726 karl  1.15 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
 727               if the built-in stack extension method is used).
 728            
 729               Do not make this value too large; the results are undefined if
 730               SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
 731               evaluated with infinite-precision integer arithmetic.  */
 732 karl  1.12 
 733 karl  1.15 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
 734            # undef YYMAXDEPTH
 735 karl  1.12 #endif
 736            
 737            #ifndef YYMAXDEPTH
 738 karl  1.15 # define YYMAXDEPTH 10000
 739 mike  1.2  #endif
 740 karl  1.15 
 741 karl  1.12 
 742            
 743 karl  1.15 #if YYERROR_VERBOSE
 744            
 745            # ifndef yystrlen
 746            #  if defined (__GLIBC__) && defined (_STRING_H)
 747            #   define yystrlen strlen
 748            #  else
 749            /* Return the length of YYSTR.  */
 750            static YYSIZE_T
 751            #   if defined (__STDC__) || defined (__cplusplus)
 752            yystrlen (const char *yystr)
 753            #   else
 754            yystrlen (yystr)
 755                 const char *yystr;
 756            #   endif
 757            {
 758              register const char *yys = yystr;
 759            
 760              while (*yys++ != '\0')
 761                continue;
 762            
 763              return yys - yystr - 1;
 764 karl  1.15 }
 765            #  endif
 766            # endif
 767            
 768            # ifndef yystpcpy
 769            #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
 770            #   define yystpcpy stpcpy
 771            #  else
 772            /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
 773               YYDEST.  */
 774            static char *
 775            #   if defined (__STDC__) || defined (__cplusplus)
 776            yystpcpy (char *yydest, const char *yysrc)
 777            #   else
 778            yystpcpy (yydest, yysrc)
 779                 char *yydest;
 780                 const char *yysrc;
 781            #   endif
 782            {
 783              register char *yyd = yydest;
 784              register const char *yys = yysrc;
 785 karl  1.15 
 786              while ((*yyd++ = *yys++) != '\0')
 787                continue;
 788 karl  1.12 
 789 karl  1.15   return yyd - 1;
 790 karl  1.12 }
 791 karl  1.15 #  endif
 792            # endif
 793 karl  1.13 
 794 karl  1.15 #endif /* !YYERROR_VERBOSE */
 795 karl  1.13 
 796 karl  1.15 
 797            
 798            #if YYDEBUG
 799            /*--------------------------------.
 800            | Print this symbol on YYOUTPUT.  |
 801            `--------------------------------*/
 802            
 803            #if defined (__STDC__) || defined (__cplusplus)
 804 karl  1.13 static void
 805 karl  1.15 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
 806            #else
 807            static void
 808            yysymprint (yyoutput, yytype, yyvaluep)
 809                FILE *yyoutput;
 810                int yytype;
 811                YYSTYPE *yyvaluep;
 812            #endif
 813 karl  1.12 {
 814 karl  1.15   /* Pacify ``unused variable'' warnings.  */
 815              (void) yyvaluep;
 816 karl  1.13 
 817 karl  1.15   if (yytype < YYNTOKENS)
 818                {
 819                  YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
 820            # ifdef YYPRINT
 821                  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
 822            # endif
 823                }
 824              else
 825                YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
 826            
 827              switch (yytype)
 828                {
 829                  default:
 830                    break;
 831                }
 832              YYFPRINTF (yyoutput, ")");
 833 karl  1.12 }
 834            
 835 karl  1.15 #endif /* ! YYDEBUG */
 836            /*-----------------------------------------------.
 837            | Release the memory associated to this symbol.  |
 838            `-----------------------------------------------*/
 839            
 840            #if defined (__STDC__) || defined (__cplusplus)
 841            static void
 842            yydestruct (int yytype, YYSTYPE *yyvaluep)
 843            #else
 844            static void
 845            yydestruct (yytype, yyvaluep)
 846                int yytype;
 847                YYSTYPE *yyvaluep;
 848 mike  1.2  #endif
 849 karl  1.15 {
 850              /* Pacify ``unused variable'' warnings.  */
 851              (void) yyvaluep;
 852            
 853              switch (yytype)
 854                {
 855            
 856                  default:
 857                    break;
 858                }
 859            }
 860 karl  1.12 
 861 mike  1.2  
 862 karl  1.15 /* Prevent warnings from -Wmissing-prototypes.  */
 863 karl  1.12 
 864            #ifdef YYPARSE_PARAM
 865 karl  1.15 # if defined (__STDC__) || defined (__cplusplus)
 866            int yyparse (void *YYPARSE_PARAM);
 867            # else
 868            int yyparse ();
 869            # endif
 870            #else /* ! YYPARSE_PARAM */
 871            #if defined (__STDC__) || defined (__cplusplus)
 872            int yyparse (void);
 873            #else
 874            int yyparse ();
 875            #endif
 876            #endif /* ! YYPARSE_PARAM */
 877            
 878            
 879            
 880            /* The lookahead symbol.  */
 881            int yychar;
 882            
 883            /* The semantic value of the lookahead symbol.  */
 884            YYSTYPE yylval;
 885            
 886 karl  1.15 /* Number of syntax errors so far.  */
 887            int yynerrs;
 888            
 889            
 890            
 891            /*----------.
 892            | yyparse.  |
 893            `----------*/
 894 karl  1.12 
 895            #ifdef YYPARSE_PARAM
 896 karl  1.15 # if defined (__STDC__) || defined (__cplusplus)
 897            int yyparse (void *YYPARSE_PARAM)
 898            # else
 899            int yyparse (YYPARSE_PARAM)
 900              void *YYPARSE_PARAM;
 901            # endif
 902            #else /* ! YYPARSE_PARAM */
 903            #if defined (__STDC__) || defined (__cplusplus)
 904            int
 905            yyparse (void)
 906 karl  1.12 #else
 907 karl  1.15 int
 908            yyparse ()
 909            
 910 karl  1.12 #endif
 911 mike  1.2  #endif
 912            {
 913 karl  1.15   
 914 karl  1.12   register int yystate;
 915              register int yyn;
 916 karl  1.15   int yyresult;
 917              /* Number of tokens to shift before error messages enabled.  */
 918              int yyerrstatus;
 919              /* Lookahead token as an internal (translated) token number.  */
 920              int yytoken = 0;
 921            
 922              /* Three stacks and their tools:
 923                 `yyss': related to states,
 924                 `yyvs': related to semantic values,
 925                 `yyls': related to locations.
 926            
 927                 Refer to the stacks thru separate pointers, to allow yyoverflow
 928                 to reallocate them elsewhere.  */
 929            
 930              /* The state stack.  */
 931              short	yyssa[YYINITDEPTH];
 932              short *yyss = yyssa;
 933 karl  1.12   register short *yyssp;
 934 karl  1.15 
 935              /* The semantic value stack.  */
 936              YYSTYPE yyvsa[YYINITDEPTH];
 937              YYSTYPE *yyvs = yyvsa;
 938 karl  1.14   register YYSTYPE *yyvsp;
 939 karl  1.13 
 940 karl  1.12 
 941            
 942            #define YYPOPSTACK   (yyvsp--, yyssp--)
 943            
 944 karl  1.15   YYSIZE_T yystacksize = YYINITDEPTH;
 945 karl  1.12 
 946 karl  1.15   /* The variables used to return semantic value and location from the
 947                 action routines.  */
 948              YYSTYPE yyval;
 949 karl  1.12 
 950            
 951 karl  1.15   /* When reducing, the number of symbols on the RHS of the reduced
 952                 rule.  */
 953 karl  1.12   int yylen;
 954            
 955 karl  1.15   YYDPRINTF ((stderr, "Starting parse\n"));
 956 karl  1.12 
 957              yystate = 0;
 958              yyerrstatus = 0;
 959              yynerrs = 0;
 960              yychar = YYEMPTY;		/* Cause a token to be read.  */
 961            
 962              /* Initialize stack pointers.
 963                 Waste one element of value and location stack
 964                 so that they stay on the same level as the state stack.
 965                 The wasted elements are never initialized.  */
 966            
 967 karl  1.15   yyssp = yyss;
 968 karl  1.12   yyvsp = yyvs;
 969            
 970 karl  1.15   goto yysetstate;
 971            
 972            /*------------------------------------------------------------.
 973            | yynewstate -- Push a new state, which is found in yystate.  |
 974            `------------------------------------------------------------*/
 975             yynewstate:
 976              /* In all cases, when you get here, the value and location stacks
 977                 have just been pushed. so pushing a state here evens the stacks.
 978                 */
 979              yyssp++;
 980 karl  1.13 
 981 karl  1.15  yysetstate:
 982              *yyssp = yystate;
 983 karl  1.12 
 984 karl  1.15   if (yyss + yystacksize - 1 <= yyssp)
 985 karl  1.14     {
 986 karl  1.12       /* Get the current used size of the three stacks, in elements.  */
 987 karl  1.15       YYSIZE_T yysize = yyssp - yyss + 1;
 988 karl  1.12 
 989            #ifdef yyoverflow
 990 karl  1.15       {
 991            	/* Give user a chance to reallocate the stack. Use copies of
 992            	   these so that the &'s don't force the real ones into
 993            	   memory.  */
 994            	YYSTYPE *yyvs1 = yyvs;
 995            	short *yyss1 = yyss;
 996            
 997            
 998            	/* Each stack pointer address is followed by the size of the
 999            	   data in use in that stack, in bytes.  This used to be a
1000            	   conditional around just the two extra args, but that might
1001            	   be undefined if yyoverflow is a macro.  */
1002            	yyoverflow ("parser stack overflow",
1003            		    &yyss1, yysize * sizeof (*yyssp),
1004            		    &yyvs1, yysize * sizeof (*yyvsp),
1005            
1006            		    &yystacksize);
1007            
1008            	yyss = yyss1;
1009            	yyvs = yyvs1;
1010                  }
1011 karl  1.12 #else /* no yyoverflow */
1012 karl  1.15 # ifndef YYSTACK_RELOCATE
1013                  goto yyoverflowlab;
1014            # else
1015 karl  1.12       /* Extend the stack our own way.  */
1016 karl  1.15       if (YYMAXDEPTH <= yystacksize)
1017            	goto yyoverflowlab;
1018 karl  1.12       yystacksize *= 2;
1019 karl  1.15       if (YYMAXDEPTH < yystacksize)
1020 karl  1.12 	yystacksize = YYMAXDEPTH;
1021 karl  1.15 
1022                  {
1023            	short *yyss1 = yyss;
1024            	union yyalloc *yyptr =
1025            	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1026            	if (! yyptr)
1027            	  goto yyoverflowlab;
1028            	YYSTACK_RELOCATE (yyss);
1029            	YYSTACK_RELOCATE (yyvs);
1030            
1031            #  undef YYSTACK_RELOCATE
1032            	if (yyss1 != yyssa)
1033            	  YYSTACK_FREE (yyss1);
1034                  }
1035            # endif
1036 karl  1.12 #endif /* no yyoverflow */
1037            
1038 karl  1.15       yyssp = yyss + yysize - 1;
1039                  yyvsp = yyvs + yysize - 1;
1040            
1041 karl  1.13 
1042 karl  1.15       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1043            		  (unsigned long int) yystacksize));
1044 karl  1.12 
1045 karl  1.15       if (yyss + yystacksize - 1 <= yyssp)
1046 karl  1.12 	YYABORT;
1047                }
1048            
1049 karl  1.15   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1050 karl  1.12 
1051              goto yybackup;
1052 karl  1.15 
1053            /*-----------.
1054            | yybackup.  |
1055            `-----------*/
1056            yybackup:
1057 karl  1.12 
1058            /* Do appropriate processing given the current state.  */
1059            /* Read a lookahead token if we need one and don't already have one.  */
1060            /* yyresume: */
1061            
1062              /* First try to decide what to do without reference to lookahead token.  */
1063            
1064              yyn = yypact[yystate];
1065 karl  1.15   if (yyn == YYPACT_NINF)
1066 karl  1.12     goto yydefault;
1067            
1068              /* Not known => get a lookahead token if don't already have one.  */
1069            
1070 karl  1.15   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1071 karl  1.12   if (yychar == YYEMPTY)
1072                {
1073 karl  1.15       YYDPRINTF ((stderr, "Reading a token: "));
1074 karl  1.12       yychar = YYLEX;
1075                }
1076            
1077 karl  1.15   if (yychar <= YYEOF)
1078 karl  1.12     {
1079 karl  1.15       yychar = yytoken = YYEOF;
1080                  YYDPRINTF ((stderr, "Now at end of input.\n"));
1081 karl  1.12     }
1082              else
1083                {
1084 karl  1.15       yytoken = YYTRANSLATE (yychar);
1085                  YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1086 karl  1.12     }
1087            
1088 karl  1.15   /* If the proper action on seeing token YYTOKEN is to reduce or to
1089                 detect an error, take that action.  */
1090              yyn += yytoken;
1091              if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1092 karl  1.12     goto yydefault;
1093              yyn = yytable[yyn];
1094 karl  1.15   if (yyn <= 0)
1095 karl  1.12     {
1096 karl  1.15       if (yyn == 0 || yyn == YYTABLE_NINF)
1097 karl  1.12 	goto yyerrlab;
1098                  yyn = -yyn;
1099                  goto yyreduce;
1100                }
1101            
1102              if (yyn == YYFINAL)
1103                YYACCEPT;
1104            
1105              /* Shift the lookahead token.  */
1106 karl  1.15   YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1107 karl  1.12 
1108              /* Discard the token being shifted unless it is eof.  */
1109              if (yychar != YYEOF)
1110                yychar = YYEMPTY;
1111            
1112              *++yyvsp = yylval;
1113            
1114 karl  1.15 
1115              /* Count tokens shifted since error; after three, turn off error
1116                 status.  */
1117              if (yyerrstatus)
1118                yyerrstatus--;
1119 karl  1.12 
1120              yystate = yyn;
1121              goto yynewstate;
1122            
1123 karl  1.15 
1124            /*-----------------------------------------------------------.
1125            | yydefault -- do the default action for the current state.  |
1126            `-----------------------------------------------------------*/
1127 karl  1.14 yydefault:
1128 karl  1.12   yyn = yydefact[yystate];
1129              if (yyn == 0)
1130                goto yyerrlab;
1131 karl  1.15   goto yyreduce;
1132            
1133 karl  1.12 
1134 karl  1.15 /*-----------------------------.
1135            | yyreduce -- Do a reduction.  |
1136            `-----------------------------*/
1137 mike  1.2  yyreduce:
1138 karl  1.15   /* yyn is the number of a rule to reduce with.  */
1139 karl  1.12   yylen = yyr2[yyn];
1140            
1141 karl  1.15   /* If YYLEN is nonzero, implement the default value of the action:
1142                 `$$ = $1'.
1143 karl  1.12 
1144 karl  1.15      Otherwise, the following line sets YYVAL to garbage.
1145                 This behavior is undocumented and Bison
1146                 users should not rely upon it.  Assigning to YYVAL
1147                 unconditionally makes the parser a bit smaller, and it avoids a
1148                 GCC warning that YYVAL may be used uninitialized.  */
1149              yyval = yyvsp[1-yylen];
1150 karl  1.12 
1151            
1152 karl  1.15   YY_REDUCE_PRINT (yyn);
1153              switch (yyn)
1154                {
1155                    case 2:
1156            #line 161 "WQL.y"
1157                {
1158            	WQL_TRACE(("YACC: start\n"));
1159                ;}
1160                break;
1161 karl  1.12 
1162 karl  1.15   case 3:
1163            #line 167 "WQL.y"
1164                {
1165 karl  1.12 
1166 karl  1.15     ;}
1167                break;
1168 mike  1.2  
1169 karl  1.15   case 4:
1170            #line 173 "WQL.y"
1171                {
1172 kumpf 1.4  	globalParserState->statement->setAllProperties(true);
1173 karl  1.15     ;}
1174                break;
1175            
1176              case 5:
1177            #line 177 "WQL.y"
1178                {
1179            
1180                ;}
1181                break;
1182 karl  1.13 
1183 karl  1.15   case 6:
1184            #line 183 "WQL.y"
1185                {
1186 kumpf 1.4  	globalParserState->statement->appendSelectPropertyName(CIMName(yyvsp[0].strValue));
1187 karl  1.15     ;}
1188                break;
1189            
1190              case 7:
1191            #line 187 "WQL.y"
1192                {
1193 kumpf 1.4  	globalParserState->statement->appendSelectPropertyName(CIMName(yyvsp[0].strValue));
1194 karl  1.15     ;}
1195                break;
1196            
1197              case 8:
1198            #line 193 "WQL.y"
1199                {
1200            
1201                ;}
1202                break;
1203            
1204              case 9:
1205            #line 197 "WQL.y"
1206                {
1207            
1208                ;}
1209                break;
1210            
1211              case 10:
1212            #line 203 "WQL.y"
1213                {
1214 mike  1.2  	WQL_TRACE(("YACC: fromClause: TOK_FROM className(%s)\n", yyvsp[0].strValue));
1215 kumpf 1.4  	globalParserState->statement->setClassName(CIMName(yyvsp[0].strValue));
1216 karl  1.15     ;}
1217                break;
1218            
1219              case 11:
1220            #line 210 "WQL.y"
1221                {
1222            
1223                ;}
1224                break;
1225 karl  1.13 
1226 karl  1.15   case 12:
1227            #line 216 "WQL.y"
1228                {
1229 mike  1.2  	WQL_TRACE(("YACC: TOK_OR\n"));
1230            	globalParserState->statement->appendOperation(WQL_OR);
1231 karl  1.15     ;}
1232                break;
1233            
1234              case 13:
1235            #line 221 "WQL.y"
1236                {
1237 mike  1.2  	WQL_TRACE(("YACC: TOK_AND\n"));
1238            	globalParserState->statement->appendOperation(WQL_AND);
1239 karl  1.15     ;}
1240                break;
1241            
1242              case 14:
1243            #line 226 "WQL.y"
1244                {
1245 mike  1.2  	WQL_TRACE(("YACC: TOK_NOT\n"));
1246            
1247            	globalParserState->statement->appendOperation(WQL_NOT);
1248 karl  1.15     ;}
1249                break;
1250            
1251              case 15:
1252            #line 232 "WQL.y"
1253                {
1254            
1255                ;}
1256                break;
1257            
1258              case 16:
1259            #line 236 "WQL.y"
1260                {
1261            
1262                ;}
1263                break;
1264            
1265              case 17:
1266            #line 240 "WQL.y"
1267                {
1268 mike  1.2  	WQLOperation op = yyvsp[0].intValue ? WQL_IS_TRUE : WQL_IS_FALSE;
1269            	globalParserState->statement->appendOperation(op);
1270 karl  1.15     ;}
1271                break;
1272            
1273              case 18:
1274            #line 245 "WQL.y"
1275                {
1276 mike  1.2  	WQLOperation op = yyvsp[0].intValue ? WQL_IS_NOT_TRUE : WQL_IS_NOT_FALSE;
1277            	globalParserState->statement->appendOperation(op);
1278 karl  1.15     ;}
1279                break;
1280            
1281              case 19:
1282            #line 254 "WQL.y"
1283                {
1284            
1285                ;}
1286                break;
1287            
1288              case 20:
1289            #line 258 "WQL.y"
1290                {
1291            
1292                ;}
1293                break;
1294            
1295              case 21:
1296            #line 264 "WQL.y"
1297                {
1298 mike  1.2  	WQL_TRACE(("YACC: TOK_LT\n"));
1299            	globalParserState->statement->appendOperation(WQL_LT);
1300 karl  1.15     ;}
1301                break;
1302            
1303              case 22:
1304            #line 269 "WQL.y"
1305                {
1306 mike  1.2  	WQL_TRACE(("YACC: TOK_GT\n"));
1307            	globalParserState->statement->appendOperation(WQL_GT);
1308 karl  1.15     ;}
1309                break;
1310            
1311              case 23:
1312            #line 274 "WQL.y"
1313                {
1314 mike  1.2  	WQL_TRACE(("YACC: TOK_LE\n"));
1315            	globalParserState->statement->appendOperation(WQL_LE);
1316 karl  1.15     ;}
1317                break;
1318            
1319              case 24:
1320            #line 279 "WQL.y"
1321                {
1322 mike  1.2  	WQL_TRACE(("YACC: TOK_GE\n"));
1323            	globalParserState->statement->appendOperation(WQL_GE);
1324 karl  1.15     ;}
1325                break;
1326            
1327              case 25:
1328            #line 284 "WQL.y"
1329                {
1330 mike  1.2  	WQL_TRACE(("YACC: TOK_EQ\n"));
1331            	globalParserState->statement->appendOperation(WQL_EQ);
1332 karl  1.15     ;}
1333                break;
1334            
1335              case 26:
1336            #line 289 "WQL.y"
1337                {
1338 mike  1.2  	WQL_TRACE(("YACC: TOK_NE\n"));
1339            	globalParserState->statement->appendOperation(WQL_NE);
1340 karl  1.15     ;}
1341                break;
1342            
1343              case 27:
1344            #line 294 "WQL.y"
1345                {
1346 karl  1.13     WQL_TRACE(("YACC: TOK_ISA\n"));
1347 karl  1.14 #ifndef PEGASUS_SNIA_EXTENSIONS
1348                    // If SNIA tests, allow the ISA but do not pass className
1349 karl  1.13         yyerror("ISA Token Not Supported");
1350 karl  1.14 #endif
1351 karl  1.15     ;}
1352                break;
1353            
1354              case 28:
1355            #line 304 "WQL.y"
1356                {
1357 mike  1.2  	WQL_TRACE(("YACC: nullPredicate : comparisonTerm IS NULL\n"));
1358            	globalParserState->statement->appendOperation(WQL_IS_NULL);
1359 karl  1.15     ;}
1360                break;
1361            
1362              case 29:
1363            #line 309 "WQL.y"
1364                {
1365 mike  1.2  	WQL_TRACE(("YACC: nullPredicate : comparisonTerm IS NOT NULL\n"));
1366            	globalParserState->statement->appendOperation(WQL_IS_NOT_NULL);
1367 karl  1.15     ;}
1368                break;
1369            
1370              case 30:
1371            #line 316 "WQL.y"
1372                {
1373 mike  1.2  	yyval.intValue = 1;
1374 karl  1.15     ;}
1375                break;
1376            
1377              case 31:
1378            #line 320 "WQL.y"
1379                {
1380 mike  1.2  	yyval.intValue = 0;
1381 karl  1.15     ;}
1382                break;
1383            
1384              case 32:
1385            #line 333 "WQL.y"
1386                {
1387 karl  1.14         WQL_TRACE(("YACC: propertyName : TOK_IDENTIFIER(%s)\n", yyvsp[0].strValue));
1388                    yyval.strValue = yyvsp[0].strValue;
1389 karl  1.15     ;}
1390                break;
1391            
1392              case 33:
1393            #line 338 "WQL.y"
1394                {
1395 karl  1.14         WQL_TRACE(("YACC: propertyName : TOK_IDENTIFIER(%s.%s)\n", yyvsp[-2].strValue, yyvsp[0].strValue));
1396            #ifdef PEGASUS_SNIA_EXTENSIONS
1397                    // Pass anything as a property name to fool parser for SNIA testing
1398                    yyval.strValue = strdup("dummy");
1399            #else
1400                    yyerror("Scoped (dotted) property names not supported");
1401            #endif
1402 karl  1.15     ;}
1403                break;
1404            
1405              case 34:
1406            #line 350 "WQL.y"
1407                {
1408 mike  1.2  	WQL_TRACE(("YACC: TOK_IDENTIFIER %s\n", yyvsp[0].strValue));
1409            	yyval.strValue = yyvsp[0].strValue;
1410 karl  1.15     ;}
1411                break;
1412            
1413              case 35:
1414            #line 357 "WQL.y"
1415                {
1416 mike  1.2  	globalParserState->statement->appendOperand(
1417            	    WQLOperand(yyvsp[0].strValue, WQL_PROPERTY_NAME_TAG));
1418 kumpf 1.4  	globalParserState->statement->appendWherePropertyName(CIMName(yyvsp[0].strValue));
1419 karl  1.15     ;}
1420                break;
1421            
1422              case 36:
1423            #line 363 "WQL.y"
1424                {
1425 mike  1.2  	globalParserState->statement->appendOperand(
1426            	    WQLOperand(yyvsp[0].intValue, WQL_INTEGER_VALUE_TAG));
1427 karl  1.15     ;}
1428                break;
1429            
1430              case 37:
1431            #line 368 "WQL.y"
1432                {
1433 mike  1.2  	globalParserState->statement->appendOperand(
1434            	    WQLOperand(yyvsp[0].doubleValue, WQL_DOUBLE_VALUE_TAG));
1435 karl  1.15     ;}
1436                break;
1437            
1438              case 38:
1439            #line 373 "WQL.y"
1440                {
1441 mike  1.2  	globalParserState->statement->appendOperand(
1442            	    WQLOperand(yyvsp[0].strValue, WQL_STRING_VALUE_TAG));
1443 karl  1.15     ;}
1444                break;
1445            
1446              case 39:
1447            #line 378 "WQL.y"
1448                {
1449 mike  1.2  	globalParserState->statement->appendOperand(
1450            	    WQLOperand(yyvsp[0].intValue != 0, WQL_BOOLEAN_VALUE_TAG));
1451 karl  1.15     ;}
1452                break;
1453            
1454            
1455                }
1456            
1457            /* Line 1000 of yacc.c.  */
1458            #line 1429 "WQLtemp"
1459 karl  1.12 
1460              yyvsp -= yylen;
1461              yyssp -= yylen;
1462            
1463 karl  1.15 
1464              YY_STACK_PRINT (yyss, yyssp);
1465 karl  1.12 
1466              *++yyvsp = yyval;
1467            
1468            
1469 karl  1.15   /* Now `shift' the result of the reduction.  Determine what state
1470                 that goes to, based on the state we popped back to and the rule
1471                 number reduced by.  */
1472 karl  1.12 
1473              yyn = yyr1[yyn];
1474            
1475 karl  1.15   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1476              if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1477 karl  1.12     yystate = yytable[yystate];
1478              else
1479 karl  1.15     yystate = yydefgoto[yyn - YYNTOKENS];
1480 karl  1.12 
1481              goto yynewstate;
1482            
1483            
1484 karl  1.15 /*------------------------------------.
1485            | yyerrlab -- here on detecting error |
1486            `------------------------------------*/
1487            yyerrlab:
1488              /* If not already recovering from an error, report this error.  */
1489              if (!yyerrstatus)
1490 karl  1.12     {
1491                  ++yynerrs;
1492 karl  1.15 #if YYERROR_VERBOSE
1493 karl  1.12       yyn = yypact[yystate];
1494            
1495 karl  1.15       if (YYPACT_NINF < yyn && yyn < YYLAST)
1496 karl  1.12 	{
1497 karl  1.15 	  YYSIZE_T yysize = 0;
1498            	  int yytype = YYTRANSLATE (yychar);
1499            	  const char* yyprefix;
1500            	  char *yymsg;
1501            	  int yyx;
1502            
1503            	  /* Start YYX at -YYN if negative to avoid negative indexes in
1504            	     YYCHECK.  */
1505            	  int yyxbegin = yyn < 0 ? -yyn : 0;
1506            
1507            	  /* Stay within bounds of both yycheck and yytname.  */
1508            	  int yychecklim = YYLAST - yyn;
1509            	  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1510            	  int yycount = 0;
1511            
1512            	  yyprefix = ", expecting ";
1513            	  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1514            	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1515            	      {
1516            		yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
1517            		yycount += 1;
1518 karl  1.15 		if (yycount == 5)
1519            		  {
1520            		    yysize = 0;
1521            		    break;
1522            		  }
1523            	      }
1524            	  yysize += (sizeof ("syntax error, unexpected ")
1525            		     + yystrlen (yytname[yytype]));
1526            	  yymsg = (char *) YYSTACK_ALLOC (yysize);
1527            	  if (yymsg != 0)
1528 karl  1.12 	    {
1529 karl  1.15 	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1530            	      yyp = yystpcpy (yyp, yytname[yytype]);
1531 karl  1.12 
1532 karl  1.15 	      if (yycount < 5)
1533 karl  1.12 		{
1534 karl  1.15 		  yyprefix = ", expecting ";
1535            		  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1536            		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1537 karl  1.12 		      {
1538 karl  1.15 			yyp = yystpcpy (yyp, yyprefix);
1539            			yyp = yystpcpy (yyp, yytname[yyx]);
1540            			yyprefix = " or ";
1541 karl  1.12 		      }
1542            		}
1543 karl  1.15 	      yyerror (yymsg);
1544            	      YYSTACK_FREE (yymsg);
1545 karl  1.12 	    }
1546            	  else
1547 karl  1.15 	    yyerror ("syntax error; also virtual memory exhausted");
1548 karl  1.12 	}
1549                  else
1550            #endif /* YYERROR_VERBOSE */
1551 karl  1.15 	yyerror ("syntax error");
1552 mike  1.2      }
1553 karl  1.12 
1554 karl  1.15 
1555 karl  1.12 
1556              if (yyerrstatus == 3)
1557                {
1558 karl  1.15       /* If just tried and failed to reuse lookahead token after an
1559            	 error, discard it.  */
1560 karl  1.12 
1561 karl  1.15       if (yychar <= YYEOF)
1562                    {
1563                      /* If at end of input, pop the error token,
1564            	     then the rest of the stack, then return failure.  */
1565            	  if (yychar == YYEOF)
1566            	     for (;;)
1567            	       {
1568            		 YYPOPSTACK;
1569            		 if (yyssp == yyss)
1570            		   YYABORT;
1571            		 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1572            		 yydestruct (yystos[*yyssp], yyvsp);
1573            	       }
1574                    }
1575                  else
1576            	{
1577            	  YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1578            	  yydestruct (yytoken, &yylval);
1579            	  yychar = YYEMPTY;
1580 karl  1.14 
1581 karl  1.15 	}
1582 mike  1.2      }
1583 karl  1.12 
1584 karl  1.15   /* Else will try to reuse lookahead token after shifting the error
1585                 token.  */
1586              goto yyerrlab1;
1587 karl  1.14 
1588 karl  1.12 
1589 karl  1.15 /*---------------------------------------------------.
1590            | yyerrorlab -- error raised explicitly by YYERROR.  |
1591            `---------------------------------------------------*/
1592            yyerrorlab:
1593 karl  1.12 
1594 karl  1.15 #ifdef __GNUC__
1595              /* Pacify GCC when the user code never invokes YYERROR and the label
1596                 yyerrorlab therefore never appears in user code.  */
1597              if (0)
1598                 goto yyerrorlab;
1599            #endif
1600 karl  1.12 
1601 karl  1.15   yyvsp -= yylen;
1602              yyssp -= yylen;
1603              yystate = *yyssp;
1604              goto yyerrlab1;
1605 karl  1.12 
1606 karl  1.14 
1607 karl  1.15 /*-------------------------------------------------------------.
1608            | yyerrlab1 -- common code for both syntax error and YYERROR.  |
1609            `-------------------------------------------------------------*/
1610            yyerrlab1:
1611              yyerrstatus = 3;	/* Each real token shifted decrements this.  */
1612 karl  1.12 
1613 karl  1.15   for (;;)
1614 karl  1.14     {
1615 karl  1.15       yyn = yypact[yystate];
1616                  if (yyn != YYPACT_NINF)
1617            	{
1618            	  yyn += YYTERROR;
1619            	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1620            	    {
1621            	      yyn = yytable[yyn];
1622            	      if (0 < yyn)
1623            		break;
1624            	    }
1625            	}
1626 karl  1.12 
1627 karl  1.15       /* Pop the current state because it cannot handle the error token.  */
1628                  if (yyssp == yyss)
1629            	YYABORT;
1630 karl  1.12 
1631 karl  1.15       YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1632                  yydestruct (yystos[yystate], yyvsp);
1633                  YYPOPSTACK;
1634                  yystate = *yyssp;
1635                  YY_STACK_PRINT (yyss, yyssp);
1636 karl  1.12     }
1637            
1638              if (yyn == YYFINAL)
1639                YYACCEPT;
1640            
1641 karl  1.15   YYDPRINTF ((stderr, "Shifting error token, "));
1642 karl  1.12 
1643              *++yyvsp = yylval;
1644 karl  1.15 
1645 karl  1.12 
1646              yystate = yyn;
1647              goto yynewstate;
1648            
1649            
1650 karl  1.15 /*-------------------------------------.
1651            | yyacceptlab -- YYACCEPT comes here.  |
1652            `-------------------------------------*/
1653            yyacceptlab:
1654              yyresult = 0;
1655              goto yyreturn;
1656            
1657            /*-----------------------------------.
1658            | yyabortlab -- YYABORT comes here.  |
1659            `-----------------------------------*/
1660            yyabortlab:
1661              yyresult = 1;
1662              goto yyreturn;
1663            
1664            #ifndef yyoverflow
1665            /*----------------------------------------------.
1666            | yyoverflowlab -- parser overflow comes here.  |
1667            `----------------------------------------------*/
1668            yyoverflowlab:
1669              yyerror ("parser stack overflow");
1670              yyresult = 2;
1671 karl  1.15   /* Fall through.  */
1672            #endif
1673            
1674            yyreturn:
1675            #ifndef yyoverflow
1676              if (yyss != yyssa)
1677                YYSTACK_FREE (yyss);
1678 karl  1.12 #endif
1679 karl  1.15   return yyresult;
1680 mike  1.2  }
1681 karl  1.15 
1682            
1683            #line 383 "WQL.y"
1684            
1685 karl  1.12 

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2