Small tweaks in lexer.

Added flex+bison generated files under version control.
(this allows that users don't have to install flex+bison for QGIS compilation)


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5004 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
wonder 2006-03-11 16:14:56 +00:00
parent 1013d15859
commit 071a826d45
4 changed files with 3383 additions and 16 deletions

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,7 @@
%}
white [ \t\n]+
white [ \t\r\n]+
col_first [A-Za-z_]
col_next [A-Za-z0-9_]
@ -43,22 +43,11 @@ number {num1}|{num2}
str_char ('')|(\\.)|[^'\\]
string "'"{str_char}*"'"
comparison (">="|"<="|"<"|">"|"="|"!="|"<>"|"~"|"LIKE")
arithmetic [+-/*]
%%
{white} /* skip blanks and tabs */
[()] { return yytext[0]; }
{number} { yylval.number = atof(yytext); return NUMBER; }
"NOT " { return NOT; }
" AND " { return AND; }
" OR " { return OR; }
"NOT" { return NOT; }
"AND" { return AND; }
"OR" { return OR; }
"=" { yylval.op = QgsSearchTreeNode::opEQ; return COMPARISON; }
"!=" { yylval.op = QgsSearchTreeNode::opNE; return COMPARISON; }
@ -70,12 +59,18 @@ arithmetic [+-/*]
"~" { yylval.op = QgsSearchTreeNode::opRegexp; return COMPARISON; }
"LIKE" { yylval.op = QgsSearchTreeNode::opLike; return COMPARISON; }
{arithmetic} { return yytext[0]; }
[+-/*] { return yytext[0]; }
[()] { return yytext[0]; }
{number} { yylval.number = atof(yytext); return NUMBER; }
{string} { return STRING; }
{column_ref} { return COLUMN_REF; }
{white} /* skip blanks and tabs */
. { return UNKNOWN_CHARACTER; }
%%

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,69 @@
/* A Bison parser, made by GNU Bison 1.875d. */
/* Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
NUMBER = 258,
COMPARISON = 259,
STRING = 260,
COLUMN_REF = 261,
UNKNOWN_CHARACTER = 262,
NOT = 263,
AND = 264,
OR = 265,
UMINUS = 266
};
#endif
#define NUMBER 258
#define COMPARISON 259
#define STRING 260
#define COLUMN_REF 261
#define UNKNOWN_CHARACTER 262
#define NOT 263
#define AND 264
#define OR 265
#define UMINUS 266
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 60 "qgssearchstringparser.yy"
typedef union YYSTYPE { QgsSearchTreeNode* node; double number; QgsSearchTreeNode::Operator op; } YYSTYPE;
/* Line 1285 of yacc.c. */
#line 61 "qgssearchstringparser.h"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
extern YYSTYPE yylval;