~ubuntu-branches/ubuntu/trusty/qgis/trusty

« back to all changes in this revision

Viewing changes to src/core/qgssearchstringlexer.ll

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 *   (at your option) any later version.                                   *
16
16
 *                                                                         *
17
17
 ***************************************************************************/
18
 
 /* $Id: qgssearchstringlexer.ll 5939 2006-10-12 16:24:55Z wonder $ */
 
18
 /* $Id$ */
19
19
 
20
20
%option noyywrap
21
21
%option case-insensitive
28
28
#include <stdlib.h>  // atof()
29
29
  
30
30
#include "qgssearchtreenode.h"
31
 
#include "qgssearchstringparser.h"
 
31
#include "qgssearchstringparser.hpp"
 
32
 
 
33
// if not defined, searches for isatty()
 
34
// which doesn't in MSVC compiler
 
35
#define YY_NEVER_INTERACTIVE 1
32
36
 
33
37
%}
34
38
 
48
52
str_char    ('')|(\\.)|[^'\\]
49
53
string      "'"{str_char}*"'"
50
54
 
 
55
 
51
56
%%
52
57
 
53
58
"NOT"    { return NOT; }
64
69
"~"   {  yylval.op = QgsSearchTreeNode::opRegexp; return COMPARISON; }
65
70
"LIKE" { yylval.op = QgsSearchTreeNode::opLike; return COMPARISON; }
66
71
 
67
 
[+-/*]    { return yytext[0]; }
 
72
"sqrt" { yylval.op = QgsSearchTreeNode::opSQRT; return FUNCTION;}
 
73
"sin"  { yylval.op = QgsSearchTreeNode::opSIN; return FUNCTION;}
 
74
"cos"  { yylval.op = QgsSearchTreeNode::opCOS; return FUNCTION;}
 
75
"tan"  { yylval.op = QgsSearchTreeNode::opTAN; return FUNCTION;}
 
76
"asin" { yylval.op = QgsSearchTreeNode::opASIN; return FUNCTION;}
 
77
"acos" { yylval.op = QgsSearchTreeNode::opACOS; return FUNCTION;}
 
78
"atan" { yylval.op = QgsSearchTreeNode::opATAN; return FUNCTION;}
 
79
"to int" { yylval.op = QgsSearchTreeNode::opTOINT; return FUNCTION;}
 
80
"to real" { yylval.op = QgsSearchTreeNode::opTOREAL; return FUNCTION;}
 
81
"to string" { yylval.op = QgsSearchTreeNode::opTOSTRING; return FUNCTION;}
 
82
 
 
83
[+-/*^]    { return yytext[0]; }
68
84
 
69
85
[()]      { return yytext[0]; }
70
86
 
72
88
 
73
89
{string}  { return STRING; }
74
90
 
 
91
"$area" { return AREA; }
 
92
"$length" { return LENGTH; }
 
93
 
75
94
{column_ref}   { return COLUMN_REF; }
76
95
 
77
96
{white}    /* skip blanks and tabs */
78
97
 
79
 
.       { return UNKNOWN_CHARACTER; }
 
98
.       { return Unknown_CHARACTER; }
80
99
 
81
100
%%
82
101