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

Diff for /pegasus/src/Pegasus/WQL/WQLYACC.cpp between version 1.1.2.7 and 1.2

version 1.1.2.7, 2001/12/02 22:03:23 version 1.2, 2001/12/13 14:54:45
Line 1 
Line 1 
  
 /*  A Bison parser, made from wql.y  /*  A Bison parser, made from wql.y with Bison version GNU Bison version 1.24
     by GNU Bison version 1.28  */    */
  
 #define YYBISON 1  /* Identify Bison output.  */ #define YYBISON 1  /* Identify Bison output.  */
  
Line 11 
Line 11 
 #define yychar WQL_char #define yychar WQL_char
 #define yydebug WQL_debug #define yydebug WQL_debug
 #define yynerrs WQL_nerrs #define yynerrs WQL_nerrs
 #define TOK_INTEGER     257  #define TOK_INTEGER     258
 #define TOK_DOUBLE      258  #define TOK_DOUBLE      259
 #define TOK_STRING      259  #define TOK_STRING      260
 #define TOK_TRUE        260  #define TOK_TRUE        261
 #define TOK_FALSE       261  #define TOK_FALSE       262
 #define TOK_NULL        262  #define TOK_NULL        263
 #define TOK_EQ  263  #define TOK_EQ  264
 #define TOK_NE  264  #define TOK_NE  265
 #define TOK_LT  265  #define TOK_LT  266
 #define TOK_LE  266  #define TOK_LE  267
 #define TOK_GT  267  #define TOK_GT  268
 #define TOK_GE  268  #define TOK_GE  269
 #define TOK_NOT 269  #define TOK_NOT 270
 #define TOK_OR  270  #define TOK_OR  271
 #define TOK_AND 271  #define TOK_AND 272
 #define TOK_IS  272  #define TOK_IS  273
 #define TOK_IDENTIFIER  273  #define TOK_IDENTIFIER  274
 #define TOK_SELECT      274  #define TOK_SELECT      275
 #define TOK_WHERE       275  #define TOK_WHERE       276
 #define TOK_FROM        276  #define TOK_FROM        277
 #define TOK_UNEXPECTED_CHAR     277  #define TOK_UNEXPECTED_CHAR     278
  
 #line 9 "wql.y" #line 9 "wql.y"
  
Line 52 
Line 52 
 # include <alloca.h> # include <alloca.h>
 #endif #endif
  
 #if 1  #if 0
 # define WQL_TRACE(X) printf X # define WQL_TRACE(X) printf X
 #else #else
 # define WQL_TRACE(X) # define WQL_TRACE(X)
Line 61 
Line 61 
 extern int WQL_lex(); extern int WQL_lex();
 extern int WQL_error(char*); extern int WQL_error(char*);
  
   //
   // Define the global parser state object:
   //
   
 PEGASUS_USING_PEGASUS; PEGASUS_USING_PEGASUS;
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
Line 70 
Line 74 
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
  
  
 #line 54 "wql.y"  #line 58 "wql.y"
 typedef union typedef union
 { {
    int intValue;    int intValue;
Line 78 
Line 82 
    char* strValue;    char* strValue;
    void* nodeValue;    void* nodeValue;
 } YYSTYPE; } YYSTYPE;
   
   #ifndef YYLTYPE
   typedef
     struct yyltype
       {
         int timestamp;
         int first_line;
         int first_column;
         int last_line;
         int last_column;
         char *text;
      }
     yyltype;
   
   #define YYLTYPE yyltype
   #endif
   
 #include <stdio.h> #include <stdio.h>
  
 #ifndef __cplusplus #ifndef __cplusplus
Line 92 
Line 113 
 #define YYFLAG          -32768 #define YYFLAG          -32768
 #define YYNTBASE        28 #define YYNTBASE        28
  
 #define YYTRANSLATE(x) ((unsigned)(x) <= 277 ? yytranslate[x] : 43)  #define YYTRANSLATE(x) ((unsigned)(x) <= 278 ? yytranslate[x] : 43)
  
 static const char yytranslate[] = {     0, static const char yytranslate[] = {     0,
      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
Line 120 
Line 141 
      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      2,     2,     2,     2,     2,     1,     3,     4,     5,     6,       2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
      7,     8,     9,    10,    11,    12,    13,    14,    15,    16,       6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
     17,    18,    19,    20,    21,    22,    23      16,    17,    18,    19,    20,    21,    22,    23
 }; };
  
 #if YYDEBUG != 0 #if YYDEBUG != 0
Line 151 
Line 172 
  
 #if YYDEBUG != 0 #if YYDEBUG != 0
 static const short yyrline[] = { 0, static const short yyrline[] = { 0,
    125,   131,   137,   141,   147,   151,   157,   161,   167,   175,     130,   136,   142,   146,   152,   156,   162,   166,   172,   179,
    181,   185,   189,   193,   197,   201,   205,   211,   215,   221,     185,   190,   195,   201,   205,   209,   214,   223,   227,   233,
    225,   229,   233,   237,   241,   247,   251,   257,   261,   267,     238,   243,   248,   253,   258,   265,   270,   277,   281,   287,
    273,   280,   284,   288,   292,   296     293,   300,   306,   311,   316,   321
 }; };
 #endif  
   
   
 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)  
  
 static const char * const yytname[] = {   "$","error","$undefined.","TOK_INTEGER", static const char * const yytname[] = {   "$","error","$undefined.","TOK_INTEGER",
 "TOK_DOUBLE","TOK_STRING","TOK_TRUE","TOK_FALSE","TOK_NULL","TOK_EQ","TOK_NE", "TOK_DOUBLE","TOK_STRING","TOK_TRUE","TOK_FALSE","TOK_NULL","TOK_EQ","TOK_NE",
Line 167 
Line 184 
 "TOK_SELECT","TOK_WHERE","TOK_FROM","TOK_UNEXPECTED_CHAR","'*'","','","'('", "TOK_SELECT","TOK_WHERE","TOK_FROM","TOK_UNEXPECTED_CHAR","'*'","','","'('",
 "')'","start","selectStatement","selectList","propertyList","selectExpression", "')'","start","selectStatement","selectList","propertyList","selectExpression",
 "fromClause","whereClause","searchCondition","predicate","comparisonPredicate", "fromClause","whereClause","searchCondition","predicate","comparisonPredicate",
 "nullPredicate","truthValue","propertyName","className","comparisonTerm", NULL  "nullPredicate","truthValue","propertyName","className","comparisonTerm",""
 }; };
 #endif #endif
  
Line 778 
Line 795 
   switch (yyn) {   switch (yyn) {
  
 case 1: case 1:
 #line 126 "wql.y"  #line 131 "wql.y"
 { {
         printf("YACC: start\n");          WQL_TRACE(("YACC: start\n"));
     ;     ;
     break;}     break;}
 case 2: case 2:
 #line 132 "wql.y"  #line 137 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 3: case 3:
 #line 138 "wql.y"  #line 143 "wql.y"
 { {
         globalParserState->statement->appendPropertyName("*");          globalParserState->statement->appendSelectPropertyName("*");
     ;     ;
     break;}     break;}
 case 4: case 4:
 #line 142 "wql.y"  #line 147 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 5: case 5:
 #line 148 "wql.y"  #line 153 "wql.y"
 { {
         globalParserState->statement->appendPropertyName(yyvsp[0].strValue);          globalParserState->statement->appendSelectPropertyName(yyvsp[0].strValue);
     ;     ;
     break;}     break;}
 case 6: case 6:
 #line 152 "wql.y"  #line 157 "wql.y"
 { {
         globalParserState->statement->appendPropertyName(yyvsp[0].strValue);          globalParserState->statement->appendSelectPropertyName(yyvsp[0].strValue);
     ;     ;
     break;}     break;}
 case 7: case 7:
 #line 158 "wql.y"  #line 163 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 8: case 8:
 #line 162 "wql.y"  #line 167 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 9: case 9:
 #line 168 "wql.y"  #line 173 "wql.y"
 { {
         WQL_TRACE(("YACC: fromClause: TOK_FROM className(%s)\n", yyvsp[0].strValue));         WQL_TRACE(("YACC: fromClause: TOK_FROM className(%s)\n", yyvsp[0].strValue));
         globalParserState->statement->setClassName(yyvsp[0].strValue);         globalParserState->statement->setClassName(yyvsp[0].strValue);
         delete [] yyvsp[0].strValue;  
     ;     ;
     break;}     break;}
 case 10: case 10:
 #line 176 "wql.y"  #line 180 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 11: case 11:
 #line 182 "wql.y"  #line 186 "wql.y"
 { {
         WQL_TRACE(("YACC: TOK_OR\n"));         WQL_TRACE(("YACC: TOK_OR\n"));
           globalParserState->statement->appendOperation(WQL_OR);
     ;     ;
     break;}     break;}
 case 12: case 12:
 #line 186 "wql.y"  #line 191 "wql.y"
 { {
         WQL_TRACE(("YACC: TOK_AND\n"));         WQL_TRACE(("YACC: TOK_AND\n"));
           globalParserState->statement->appendOperation(WQL_AND);
     ;     ;
     break;}     break;}
 case 13: case 13:
 #line 190 "wql.y"  #line 196 "wql.y"
 { {
           WQL_TRACE(("YACC: TOK_NOT\n"));
  
           globalParserState->statement->appendOperation(WQL_NOT);
     ;     ;
     break;}     break;}
 case 14: case 14:
 #line 194 "wql.y"  #line 202 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 15: case 15:
 #line 198 "wql.y"  #line 206 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 16: case 16:
 #line 202 "wql.y"  #line 210 "wql.y"
 { {
           WQLOperation op = yyvsp[0].intValue ? WQL_IS_TRUE : WQL_IS_FALSE;
           globalParserState->statement->appendOperation(op);
     ;     ;
     break;}     break;}
 case 17: case 17:
 #line 206 "wql.y"  #line 215 "wql.y"
 { {
           WQLOperation op = yyvsp[0].intValue ? WQL_IS_NOT_TRUE : WQL_IS_NOT_FALSE;
           globalParserState->statement->appendOperation(op);
     ;     ;
     break;}     break;}
 case 18: case 18:
 #line 212 "wql.y"  #line 224 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 19: case 19:
 #line 216 "wql.y"  #line 228 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 20: case 20:
 #line 222 "wql.y"  #line 234 "wql.y"
 { {
         WQL_TRACE(("YACC: TOK_LT\n"));         WQL_TRACE(("YACC: TOK_LT\n"));
           globalParserState->statement->appendOperation(WQL_LT);
     ;     ;
     break;}     break;}
 case 21: case 21:
 #line 226 "wql.y"  #line 239 "wql.y"
 { {
         WQL_TRACE(("YACC: TOK_GT\n"));         WQL_TRACE(("YACC: TOK_GT\n"));
           globalParserState->statement->appendOperation(WQL_GT);
     ;     ;
     break;}     break;}
 case 22: case 22:
 #line 230 "wql.y"  #line 244 "wql.y"
 { {
         WQL_TRACE(("YACC: TOK_LE\n"));         WQL_TRACE(("YACC: TOK_LE\n"));
           globalParserState->statement->appendOperation(WQL_LE);
     ;     ;
     break;}     break;}
 case 23: case 23:
 #line 234 "wql.y"  #line 249 "wql.y"
 { {
         WQL_TRACE(("YACC: TOK_GE\n"));         WQL_TRACE(("YACC: TOK_GE\n"));
           globalParserState->statement->appendOperation(WQL_GE);
     ;     ;
     break;}     break;}
 case 24: case 24:
 #line 238 "wql.y"  #line 254 "wql.y"
 { {
         WQL_TRACE(("YACC: TOK_EQ\n"));         WQL_TRACE(("YACC: TOK_EQ\n"));
           globalParserState->statement->appendOperation(WQL_EQ);
     ;     ;
     break;}     break;}
 case 25: case 25:
 #line 242 "wql.y"  #line 259 "wql.y"
 { {
         WQL_TRACE(("YACC: TOK_NE\n"));         WQL_TRACE(("YACC: TOK_NE\n"));
           globalParserState->statement->appendOperation(WQL_NE);
     ;     ;
     break;}     break;}
 case 26: case 26:
 #line 248 "wql.y"  #line 266 "wql.y"
 { {
         WQL_TRACE(("YACC: TOK_IS TOK_NULL\n"));          WQL_TRACE(("YACC: nullPredicate : comparisonTerm IS NULL\n"));
           globalParserState->statement->appendOperation(WQL_IS_NULL);
     ;     ;
     break;}     break;}
 case 27: case 27:
 #line 252 "wql.y"  #line 271 "wql.y"
 { {
         WQL_TRACE(("YACC: TOK_NOT TOK_NULL\n"));          WQL_TRACE(("YACC: nullPredicate : comparisonTerm IS NOT NULL\n"));
           globalParserState->statement->appendOperation(WQL_IS_NOT_NULL);
     ;     ;
     break;}     break;}
 case 28: case 28:
 #line 258 "wql.y"  #line 278 "wql.y"
 { {
           yyval.intValue = 1;
     ;     ;
     break;}     break;}
 case 29: case 29:
 #line 262 "wql.y"  #line 282 "wql.y"
 { {
           yyval.intValue = 0;
     ;     ;
     break;}     break;}
 case 30: case 30:
 #line 268 "wql.y"  #line 288 "wql.y"
 { {
         WQL_TRACE(("YACC: propertyName : TOK_IDENTIFIER(%s)\n", yyvsp[0].strValue));         WQL_TRACE(("YACC: propertyName : TOK_IDENTIFIER(%s)\n", yyvsp[0].strValue));
         yyval.strValue = yyvsp[0].strValue;         yyval.strValue = yyvsp[0].strValue;
     ;     ;
     break;}     break;}
 case 31: case 31:
 #line 274 "wql.y"  #line 294 "wql.y"
 { {
         WQL_TRACE(("YACC: TOK_IDENTIFIER %s\n", yyvsp[0].strValue));         WQL_TRACE(("YACC: TOK_IDENTIFIER %s\n", yyvsp[0].strValue));
         yyval.strValue = yyvsp[0].strValue;         yyval.strValue = yyvsp[0].strValue;
     ;     ;
     break;}     break;}
 case 32: case 32:
 #line 281 "wql.y"  #line 301 "wql.y"
 { {
           globalParserState->statement->appendOperand(
               WQLOperand(yyvsp[0].strValue, WQL_PROPERTY_NAME_TAG));
           globalParserState->statement->appendWherePropertyName(yyvsp[0].strValue);
     ;     ;
     break;}     break;}
 case 33: case 33:
 #line 285 "wql.y"  #line 307 "wql.y"
 { {
           globalParserState->statement->appendOperand(
               WQLOperand(yyvsp[0].intValue, WQL_INTEGER_VALUE_TAG));
     ;     ;
     break;}     break;}
 case 34: case 34:
 #line 289 "wql.y"  #line 312 "wql.y"
 { {
           globalParserState->statement->appendOperand(
               WQLOperand(yyvsp[0].doubleValue, WQL_DOUBLE_VALUE_TAG));
     ;     ;
     break;}     break;}
 case 35: case 35:
 #line 293 "wql.y"  #line 317 "wql.y"
 { {
           globalParserState->statement->appendOperand(
               WQLOperand(yyvsp[0].strValue, WQL_STRING_VALUE_TAG));
     ;     ;
     break;}     break;}
 case 36: case 36:
 #line 297 "wql.y"  #line 322 "wql.y"
 { {
           globalParserState->statement->appendOperand(
               WQLOperand(yyvsp[0].intValue != 0, WQL_BOOLEAN_VALUE_TAG));
     ;     ;
     break;}     break;}
 } }
Line 1219 
Line 1255 
     }     }
   return 1;   return 1;
 } }
 #line 301 "wql.y"  #line 327 "wql.y"
  


Legend:
Removed from v.1.1.2.7  
changed lines
  Added in v.1.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2