40 #define YYSKELETON_NAME "yacc.c"
46 #define YYLSP_NEEDED 0
87 #line 37 "bdb_query_bison.y"
90 #define YYSTYPE CBDB_Query::TQueryClause*
91 #define YYPARSE_PARAM parm
92 #define YYLEX_PARAM parm
93 #define YYINITDEPTH 50
94 #define YYMAXDEPTH 1000
108 env->AttachQueryClause(res);
109 env->AddNodeToPool(res);
121 #ifdef YYERROR_VERBOSE
122 # undef YYERROR_VERBOSE
123 # define YYERROR_VERBOSE 1
125 # define YYERROR_VERBOSE 0
128 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
130 # define yystype YYSTYPE
131 # define YYSTYPE_IS_DECLARED 1
132 # define YYSTYPE_IS_TRIVIAL 1
141 #line 142 "bdb_query_bison.tab.c"
143 #if ! defined (yyoverflow) || YYERROR_VERBOSE
147 # if YYSTACK_USE_ALLOCA
148 # define YYSTACK_ALLOC alloca
150 # ifndef YYSTACK_USE_ALLOCA
151 # if defined (alloca) || defined (_ALLOCA_H)
152 # define YYSTACK_ALLOC alloca
155 # define YYSTACK_ALLOC __builtin_alloca
161 # ifdef YYSTACK_ALLOC
163 # define YYSTACK_FREE(Ptr) do { ; } while (0)
165 # if defined (__STDC__) || defined (__cplusplus)
167 # define YYSIZE_T size_t
169 # define YYSTACK_ALLOC malloc
170 # define YYSTACK_FREE free
175 #if (! defined (yyoverflow) \
176 && (! defined (__cplusplus) \
177 || (YYSTYPE_IS_TRIVIAL)))
187 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
191 # define YYSTACK_BYTES(N) \
192 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
193 + YYSTACK_GAP_MAXIMUM)
199 # define YYCOPY(To, From, Count) \
200 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
202 # define YYCOPY(To, From, Count) \
206 for (yyi = 0; yyi < (Count); yyi++) \
207 (To)[yyi] = (From)[yyi]; \
218 # define YYSTACK_RELOCATE(Stack) \
221 YYSIZE_T yynewbytes; \
222 YYCOPY (&yyptr->Stack, Stack, yysize); \
223 Stack = &yyptr->Stack; \
224 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
225 yyptr += yynewbytes / sizeof (*yyptr); \
231 #if defined (__STDC__) || defined (__cplusplus)
253 #define YYMAXUTOK 269
255 #define YYTRANSLATE(YYX) \
256 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
261 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
262 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
263 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
264 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
265 15, 16, 2, 2, 2, 2, 2, 2, 2, 2,
266 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
267 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
268 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
269 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
270 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
271 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
272 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
273 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
274 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
275 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
276 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
277 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
278 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
279 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
280 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
281 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
282 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
283 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
284 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
285 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
286 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
287 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
295 0, 0, 3, 5, 7, 9, 11, 15, 19, 23,
296 27, 31, 35, 39, 43, 47
302 18, 0, -1, 19, -1, 5, -1, 4, -1, 3,
303 -1, 19, 7, 19, -1, 19, 8, 19, -1, 19,
304 9, 19, -1, 19, 10, 19, -1, 19, 11, 19,
305 -1, 19, 12, 19, -1, 19, 13, 19, -1, 19,
306 14, 19, -1, 15, 19, 16, -1, 6, 19, -1
312 0, 89, 89, 102, 106, 110, 114, 119, 124, 129,
313 135, 140, 145, 150, 155, 159
317 #if YYDEBUG || YYERROR_VERBOSE
322 "$end",
"error",
"$undefined",
"NAME",
"STRING",
"NUM",
"NOT",
"AND",
323 "OR",
"EQ",
"NOTEQ",
"GT",
"GE",
"LT",
"LE",
"'('",
"')'",
"$accept",
331 static const unsigned short yytoknum[] =
333 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
334 265, 266, 267, 268, 269, 40, 41
339 static const unsigned char yyr1[] =
341 0, 17, 18, 19, 19, 19, 19, 19, 19, 19,
342 19, 19, 19, 19, 19, 19
346 static const unsigned char yyr2[] =
348 0, 2, 1, 1, 1, 1, 3, 3, 3, 3,
357 0, 5, 4, 3, 0, 0, 0, 2, 15, 0,
358 1, 0, 0, 0, 0, 0, 0, 0, 0, 14,
359 6, 7, 8, 9, 10, 11, 12, 13
370 #define YYPACT_NINF -5
373 0, -5, -5, -5, 0, 0, 2, 19, 19, 9,
374 -5, 0, 0, 0, 0, 0, 0, 0, 0, -5,
375 26, 32, 37, 41, 44, 46, 10, -5
388 #define YYTABLE_NINF -1
391 8, 9, 10, 1, 2, 3, 4, 20, 21, 22,
392 23, 24, 25, 26, 27, 5, 11, 12, 13, 14,
393 15, 16, 17, 18, 18, 19, 11, 12, 13, 14,
394 15, 16, 17, 18, 12, 13, 14, 15, 16, 17,
395 18, 13, 14, 15, 16, 17, 18, 14, 15, 16,
396 17, 18, 15, 16, 17, 18, 16, 17, 18, 17,
402 4, 5, 0, 3, 4, 5, 6, 11, 12, 13,
403 14, 15, 16, 17, 18, 15, 7, 8, 9, 10,
404 11, 12, 13, 14, 14, 16, 7, 8, 9, 10,
405 11, 12, 13, 14, 8, 9, 10, 11, 12, 13,
406 14, 9, 10, 11, 12, 13, 14, 10, 11, 12,
407 13, 14, 11, 12, 13, 14, 12, 13, 14, 13,
415 0, 3, 4, 5, 6, 15, 18, 19, 19, 19,
416 0, 7, 8, 9, 10, 11, 12, 13, 14, 16,
417 19, 19, 19, 19, 19, 19, 19, 19
420 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
421 # define YYSIZE_T __SIZE_TYPE__
423 #if ! defined (YYSIZE_T) && defined (size_t)
424 # define YYSIZE_T size_t
426 #if ! defined (YYSIZE_T)
427 # if defined (__STDC__) || defined (__cplusplus)
429 # define YYSIZE_T size_t
432 #if ! defined (YYSIZE_T)
433 # define YYSIZE_T unsigned int
436 #define yyerrok (yyerrstatus = 0)
437 #define yyclearin (yychar = YYEMPTY)
441 #define YYACCEPT goto yyacceptlab
442 #define YYABORT goto yyabortlab
443 #define YYERROR goto yyerrlab1
450 #define YYFAIL goto yyerrlab
452 #define YYRECOVERING() (!!yyerrstatus)
454 #define YYBACKUP(Token, Value) \
456 if (yychar == YYEMPTY && yylen == 1) \
460 yytoken = YYTRANSLATE (yychar); \
466 yyerror ("syntax error: cannot back up");\
472 #define YYERRCODE 256
477 #ifndef YYLLOC_DEFAULT
478 # define YYLLOC_DEFAULT(Current, Rhs, N) \
479 Current.first_line = Rhs[1].first_line; \
480 Current.first_column = Rhs[1].first_column; \
481 Current.last_line = Rhs[N].last_line; \
482 Current.last_column = Rhs[N].last_column;
488 # define YYLEX yylex (&yylval, YYLEX_PARAM)
490 # define YYLEX yylex (&yylval)
498 # define YYFPRINTF fprintf
501 # define YYDPRINTF(Args) \
507 # define YYDSYMPRINT(Args) \
513 # define YYDSYMPRINTF(Title, Token, Value, Location) \
517 YYFPRINTF (stderr, "%s ", Title); \
518 yysymprint (stderr, \
520 YYFPRINTF (stderr, "\n"); \
529 #if defined (__STDC__) || defined (__cplusplus)
540 for (; bottom <= top; ++bottom)
545 # define YY_STACK_PRINT(Bottom, Top) \
548 yy_stack_print ((Bottom), (Top)); \
556 #if defined (__STDC__) || defined (__cplusplus)
566 unsigned int yylno =
yyrline[yyrule];
567 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %u), ",
575 # define YY_REDUCE_PRINT(Rule) \
578 yy_reduce_print (Rule); \
585 # define YYDPRINTF(Args)
586 # define YYDSYMPRINT(Args)
587 # define YYDSYMPRINTF(Title, Token, Value, Location)
588 # define YY_STACK_PRINT(Bottom, Top)
589 # define YY_REDUCE_PRINT(Rule)
595 # define YYINITDEPTH 200
610 # define YYMAXDEPTH 10000
618 # if defined (__GLIBC__) && defined (_STRING_H)
619 # define yystrlen strlen
623 # if defined (__STDC__) || defined (__cplusplus)
630 const char *yys = yystr;
632 while (*yys++ !=
'\0')
635 return yys - yystr - 1;
641 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
642 # define yystpcpy stpcpy
647 # if defined (__STDC__) || defined (__cplusplus)
648 yystpcpy (
char *yydest,
const char *yysrc)
656 const char *yys = yysrc;
658 while ((*yyd++ = *yys++) !=
'\0')
675 #if defined (__STDC__) || defined (__cplusplus)
693 YYPRINT (yyoutput, yytoknum[yytype], *
yyvaluep);
712 #if defined (__STDC__) || defined (__cplusplus)
737 # if defined (__STDC__) || defined (__cplusplus)
743 #if defined (__STDC__) || defined (__cplusplus)
760 # if defined (__STDC__) || defined (__cplusplus)
767 #if defined (__STDC__) || defined (__cplusplus)
814 #define YYPOPSTACK (yyvsp--, yyssp--)
827 YYDPRINTF ((stderr,
"Starting parse\n"));
854 *yyssp = (short)yystate;
856 if (yyss + yystacksize - 1 <= yyssp)
874 yyoverflow (
"parser stack overflow",
875 &yyss1, yysize *
sizeof (*yyssp),
876 &yyvs1, yysize *
sizeof (*yyvsp),
884 # ifndef YYSTACK_RELOCATE
903 # undef YYSTACK_RELOCATE
910 yyssp =
yyss + yysize - 1;
911 yyvsp =
yyvs + yysize - 1;
914 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
915 (
unsigned long int) yystacksize));
917 if (
yyss + yystacksize - 1 <= yyssp)
921 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
945 YYDPRINTF ((stderr,
"Reading a token: "));
952 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1021 yyval = yyvsp[1-yylen];
1028 #line 103 "bdb_query_bison.y"
1035 #line 107 "bdb_query_bison.y"
1042 #line 111 "bdb_query_bison.y"
1049 #line 115 "bdb_query_bison.y"
1057 #line 120 "bdb_query_bison.y"
1065 #line 125 "bdb_query_bison.y"
1073 #line 130 "bdb_query_bison.y"
1076 yyval->GetValue().SetNot();
1082 #line 136 "bdb_query_bison.y"
1090 #line 141 "bdb_query_bison.y"
1098 #line 146 "bdb_query_bison.y"
1106 #line 151 "bdb_query_bison.y"
1114 #line 156 "bdb_query_bison.y"
1121 #line 160 "bdb_query_bison.y"
1132 #line 1133 "bdb_query_bison.tab.c"
1150 if (0 <= yystate && yystate <=
YYLAST &&
yycheck[yystate] == *yyssp)
1173 const char* yyprefix;
1179 int yyxbegin = yyn < 0 ? -yyn : 0;
1182 int yychecklim =
YYLAST - yyn;
1186 yyprefix =
", expecting ";
1187 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1198 yysize += (
sizeof (
"syntax error, unexpected ")
1203 char *yyp =
yystpcpy (yymsg,
"syntax error, unexpected ");
1208 yyprefix =
", expecting ";
1209 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1221 yyerror (
"syntax error; also virtual memory exhausted");
1230 if (yyerrstatus == 3)
1241 while (
yyss < yyssp)
1296 YYDPRINTF ((stderr,
"Shifting error token, "));
1324 yyerror (
"parser stack overflow");
1338 #line 166 "bdb_query_bison.y"
static void BisonSaveStageResult(CBDB_Query::TQueryClause *res, void *parm)
#define YYDSYMPRINTF(Title, Token, Value, Location)
static const unsigned char yytable[]
static void yy_reduce_print(int yyrule)
static void yysymprint(FILE *yyoutput, int yytype, CBDB_Query::TQueryClause **yyvaluep)
static const unsigned char yydefact[]
#define YY_REDUCE_PRINT(Rule)
static const yysigned_char yypact[]
static const unsigned char yyrline[]
#define YY_STACK_PRINT(Bottom, Top)
static const unsigned char yyr2[]
static void yy_stack_print(short *bottom, short *top)
static const unsigned char yytranslate[]
static void yydestruct(int yytype, CBDB_Query::TQueryClause **yyvaluep)
static const yysigned_char yypgoto[]
static const yysigned_char yyrhs[]
static const yysigned_char yydefgoto[]
static const char *const yytname[]
static const unsigned char yystos[]
#define YYSTACK_RELOCATE(Stack)
static const unsigned char yyprhs[]
static const unsigned char yycheck[]
static const unsigned char yyr1[]
Class passed to Lex/Bison (yylex/yyparse) functions.
static TQueryClause * NewLogicalNode(CBDB_QueryNode::ELogicalType otype, TQueryClause *arg1, TQueryClause *arg2)
Creates new logical node of the query.
static TQueryClause * NewOperatorNode(CBDB_QueryNode::EOperatorType otype, const string &arg1, const string &arg2)
Creates new operator node of the query Caller is responsible for destruction (in most cases the resul...
static char * yystpcpy(char *yydest, const char *yysrc)
static unsigned int yystrlen(char *yystr) const
CBDB_Query::TQueryClause * yyvs