(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.5 and 1.1.2.10

version 1.1.2.5, 2001/12/02 07:52:38 version 1.1.2.10, 2001/12/07 00:37:56
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"
  
  
   #include <Pegasus/Common/Config.h>
   #include <Pegasus/WQL/WQLOperation.h>
   #include <Pegasus/WQL/WQLOperand.h>
   #include <Pegasus/WQL/WQLParserState.h>
   #include <Pegasus/WQL/WQLSelectStatement.h>
 #include <string.h> #include <string.h>
 #include <stdlib.h> #include <stdlib.h>
  
Line 48 
Line 53 
 #endif #endif
  
 #if 0 #if 0
 # define WQL_TRACE(X) printf(X)  # define WQL_TRACE(X) printf X
 #else #else
 # define WQL_TRACE(X) # define WQL_TRACE(X)
 #endif #endif
Line 56 
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:
   //
  
 #line 41 "wql.y"  PEGASUS_USING_PEGASUS;
   
   PEGASUS_NAMESPACE_BEGIN
   
   extern WQLParserState* globalParserState;
   
   PEGASUS_NAMESPACE_END
   
   
   #line 58 "wql.y"
 typedef union typedef union
 { {
    int intValue;    int intValue;
Line 65 
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 79 
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 107 
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 138 
Line 172 
  
 #if YYDEBUG != 0 #if YYDEBUG != 0
 static const short yyrline[] = { 0, static const short yyrline[] = { 0,
    112,   118,   124,   128,   134,   138,   144,   148,   154,   160,     130,   136,   142,   146,   152,   156,   162,   166,   172,   179,
    166,   170,   174,   178,   182,   186,   190,   196,   200,   206,     185,   190,   195,   201,   205,   209,   214,   223,   227,   233,
    210,   214,   218,   222,   226,   232,   236,   242,   246,   252,     238,   243,   248,   253,   258,   265,   270,   277,   281,   287,
    257,   263,   267,   271,   275,   279     293,   300,   305,   310,   315,   320
 }; };
 #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 154 
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 765 
Line 795 
   switch (yyn) {   switch (yyn) {
  
 case 1: case 1:
 #line 113 "wql.y"  #line 131 "wql.y"
 { {
         printf("YACC: start\n");          WQL_TRACE(("YACC: start\n"));
     ;     ;
     break;}     break;}
 case 2: case 2:
 #line 119 "wql.y"  #line 137 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 3: case 3:
 #line 125 "wql.y"  #line 143 "wql.y"
 { {
           globalParserState->statement->appendPropertyName("*");
     ;     ;
     break;}     break;}
 case 4: case 4:
 #line 129 "wql.y"  #line 147 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 5: case 5:
 #line 135 "wql.y"  #line 153 "wql.y"
 { {
           globalParserState->statement->appendPropertyName(yyvsp[0].strValue);
     ;     ;
     break;}     break;}
 case 6: case 6:
 #line 139 "wql.y"  #line 157 "wql.y"
 { {
           globalParserState->statement->appendPropertyName(yyvsp[0].strValue);
     ;     ;
     break;}     break;}
 case 7: case 7:
 #line 145 "wql.y"  #line 163 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 8: case 8:
 #line 149 "wql.y"  #line 167 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 9: case 9:
 #line 155 "wql.y"  #line 173 "wql.y"
 { {
           WQL_TRACE(("YACC: fromClause: TOK_FROM className(%s)\n", yyvsp[0].strValue));
           globalParserState->statement->setClassName(yyvsp[0].strValue);
     ;     ;
     break;}     break;}
 case 10: case 10:
 #line 161 "wql.y"  #line 180 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 11: case 11:
 #line 167 "wql.y"  #line 186 "wql.y"
 { {
           WQL_TRACE(("YACC: TOK_OR\n"));
           globalParserState->statement->appendOperation(WQL_OR);
     ;     ;
     break;}     break;}
 case 12: case 12:
 #line 171 "wql.y"  #line 191 "wql.y"
 { {
           WQL_TRACE(("YACC: TOK_AND\n"));
           globalParserState->statement->appendOperation(WQL_AND);
     ;     ;
     break;}     break;}
 case 13: case 13:
 #line 175 "wql.y"  #line 196 "wql.y"
 { {
           WQL_TRACE(("YACC: TOK_NOT\n"));
  
           globalParserState->statement->appendOperation(WQL_NOT);
     ;     ;
     break;}     break;}
 case 14: case 14:
 #line 179 "wql.y"  #line 202 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 15: case 15:
 #line 183 "wql.y"  #line 206 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 16: case 16:
 #line 187 "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 191 "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 197 "wql.y"  #line 224 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 19: case 19:
 #line 201 "wql.y"  #line 228 "wql.y"
 { {
  
     ;     ;
     break;}     break;}
 case 20: case 20:
 #line 207 "wql.y"  #line 234 "wql.y"
 { {
           WQL_TRACE(("YACC: TOK_LT\n"));
           globalParserState->statement->appendOperation(WQL_LT);
     ;     ;
     break;}     break;}
 case 21: case 21:
 #line 211 "wql.y"  #line 239 "wql.y"
 { {
           WQL_TRACE(("YACC: TOK_GT\n"));
           globalParserState->statement->appendOperation(WQL_GT);
     ;     ;
     break;}     break;}
 case 22: case 22:
 #line 215 "wql.y"  #line 244 "wql.y"
 { {
           WQL_TRACE(("YACC: TOK_LE\n"));
           globalParserState->statement->appendOperation(WQL_LE);
     ;     ;
     break;}     break;}
 case 23: case 23:
 #line 219 "wql.y"  #line 249 "wql.y"
 { {
           WQL_TRACE(("YACC: TOK_GE\n"));
           globalParserState->statement->appendOperation(WQL_GE);
     ;     ;
     break;}     break;}
 case 24: case 24:
 #line 223 "wql.y"  #line 254 "wql.y"
 { {
           WQL_TRACE(("YACC: TOK_EQ\n"));
           globalParserState->statement->appendOperation(WQL_EQ);
     ;     ;
     break;}     break;}
 case 25: case 25:
 #line 227 "wql.y"  #line 259 "wql.y"
 { {
           WQL_TRACE(("YACC: TOK_NE\n"));
           globalParserState->statement->appendOperation(WQL_NE);
     ;     ;
     break;}     break;}
 case 26: case 26:
 #line 233 "wql.y"  #line 266 "wql.y"
 { {
           WQL_TRACE(("YACC: nullPredicate : comparisonTerm IS NULL\n"));
           globalParserState->statement->appendOperation(WQL_IS_NULL);
     ;     ;
     break;}     break;}
 case 27: case 27:
 #line 237 "wql.y"  #line 271 "wql.y"
 { {
           WQL_TRACE(("YACC: nullPredicate : comparisonTerm IS NOT NULL\n"));
           globalParserState->statement->appendOperation(WQL_IS_NOT_NULL);
     ;     ;
     break;}     break;}
 case 28: case 28:
 #line 243 "wql.y"  #line 278 "wql.y"
 { {
           yyval.intValue = 1;
     ;     ;
     break;}     break;}
 case 29: case 29:
 #line 247 "wql.y"  #line 282 "wql.y"
 { {
           yyval.intValue = 0;
     ;     ;
     break;}     break;}
 case 30: case 30:
 #line 253 "wql.y"  #line 288 "wql.y"
 { {
           WQL_TRACE(("YACC: propertyName : TOK_IDENTIFIER(%s)\n", yyvsp[0].strValue));
           yyval.strValue = yyvsp[0].strValue;
     ;     ;
     break;}     break;}
 case 31: case 31:
 #line 258 "wql.y"  #line 294 "wql.y"
 { {
           WQL_TRACE(("YACC: TOK_IDENTIFIER %s\n", yyvsp[0].strValue));
           yyval.strValue = yyvsp[0].strValue;
     ;     ;
     break;}     break;}
 case 32: case 32:
 #line 264 "wql.y"  #line 301 "wql.y"
 { {
           globalParserState->statement->appendOperand(
               WQLOperand(yyvsp[0].strValue, WQLOperand::PROPERTY_NAME_TAG));
     ;     ;
     break;}     break;}
 case 33: case 33:
 #line 268 "wql.y"  #line 306 "wql.y"
 { {
           globalParserState->statement->appendOperand(
               WQLOperand(yyvsp[0].intValue, WQLOperand::INTEGER_VALUE_TAG));
     ;     ;
     break;}     break;}
 case 34: case 34:
 #line 272 "wql.y"  #line 311 "wql.y"
 { {
           globalParserState->statement->appendOperand(
               WQLOperand(yyvsp[0].doubleValue, WQLOperand::DOUBLE_VALUE_TAG));
     ;     ;
     break;}     break;}
 case 35: case 35:
 #line 276 "wql.y"  #line 316 "wql.y"
 { {
           globalParserState->statement->appendOperand(
               WQLOperand(yyvsp[0].strValue, WQLOperand::STRING_VALUE_TAG));
     ;     ;
     break;}     break;}
 case 36: case 36:
 #line 280 "wql.y"  #line 321 "wql.y"
 { {
           globalParserState->statement->appendOperand(
               WQLOperand(yyvsp[0].intValue != 0, WQLOperand::BOOLEAN_VALUE_TAG));
     ;     ;
     break;}     break;}
 } }
Line 1201 
Line 1254 
     }     }
   return 1;   return 1;
 } }
 #line 283 "wql.y"  #line 326 "wql.y"
   
  
 int WQL_error(char* errorMessage)  
 {  
     fprintf(stderr, "WQL_error: %s\n", errorMessage);  
     return -1;  
 }  


Legend:
Removed from v.1.1.2.5  
changed lines
  Added in v.1.1.2.10

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2