00001
00002
00003
00004
00005 #ifndef IBIS_PREDICATE_H
00006 #define IBIS_PREDICATE_H
00020 #include "qExpr.h"
00021
00022 #include <stdio.h>
00023 #include <stack>
00024 #include <deque>
00025 #include <vector>
00026
00027 int yylex();
00028 int yyparse();
00029 void yyerror(const char *s);
00030 void yyparse_cleanup();
00031 namespace ibis {
00033 qExpr* parseQuery(const char* str);
00034 }
00035
00036 extern std::vector<char*> parse_str_vec;
00037 extern char *parse_string;
00038 extern int parse_length, parse_offset;
00039
00040 #if defined(YYBISON) || defined(FLEX_SCANNER)
00041
00042 extern char *yytext;
00043 #define YY_INPUT(buf,result,max_size) {\
00044 if (parse_offset <= parse_length) {\
00045 buf[0] = parse_string[parse_offset++];\
00046 result = 1;}\
00047 else {result = YY_NULL;}}
00048
00049 #else
00050
00051 # define YYLMAX BUFSIZ
00052 extern char yytext[YYLMAX];
00053 int yywrap();
00054
00055
00056
00057 inline int lex_input() {
00058 if (parse_offset <= parse_length) {
00059 return parse_string[parse_offset++];
00060 }
00061 else {
00062 yyerror("attempt to move beyond EOS");
00063 return 0;
00064 }
00065 }
00066
00067 inline void unput(int){
00068 if (parse_offset > 0) --parse_offset;
00069 else yyerror("attempt to move before BOS");
00070 }
00071 #endif
00072 #endif // IBIS_PREDICATE_H