mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 16:39:57 +00:00
79 lines
3.1 KiB
Plaintext
79 lines
3.1 KiB
Plaintext
%{
|
|
/*
|
|
* Copyright (c) 2010 Mark Liversedge (liversedge@gmail.com)
|
|
*
|
|
* 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 of the License, 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., 51
|
|
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
#include "DataFilter.h"
|
|
|
|
// need to get rid of this and use a string...
|
|
#include <stdio.h>
|
|
|
|
// tokens
|
|
#include "DataFilter_yacc.h"/* generated by the scanner */
|
|
|
|
%}
|
|
%option noyywrap
|
|
%option nounput
|
|
%option noinput
|
|
%%
|
|
|
|
"=" DataFilterlval.op = EQ; return EQ;
|
|
"<>" DataFilterlval.op = NEQ; return NEQ;
|
|
"<" DataFilterlval.op = LT; return LT;
|
|
"<=" DataFilterlval.op = LTE; return LTE;
|
|
">" DataFilterlval.op = GT; return GT;
|
|
">=" DataFilterlval.op = GTE; return GTE;
|
|
|
|
[Mm][Aa][Tt][Cc][Hh][Ee][Ss] DataFilterlval.op = MATCHES; return MATCHES;
|
|
[Bb][Ee][Gg][Ii][Nn][Ss][Ww][Ii][Tt][Hh] DataFilterlval.op = BEGINSWITH; return BEGINSWITH;
|
|
[Ee][Nn][Dd][Ss][Ww][Ii][Tt][Hh] DataFilterlval.op = ENDSWITH; return ENDSWITH;
|
|
[Cc][Oo][Nn][Tt][Aa][Ii][Nn][Ss] DataFilterlval.op = CONTAINS; return CONTAINS;
|
|
|
|
"&&" DataFilterlval.op = AND; return AND;
|
|
[Aa][nN][Dd] DataFilterlval.op = AND; return AND;
|
|
"||" DataFilterlval.op = OR; return OR;
|
|
[Oo][Rr] DataFilterlval.op = OR; return OR;
|
|
|
|
|
|
[-+]?[0-9]+ return INTEGER;
|
|
[-+]?[0-9]+e-[0-9]+ return FLOAT;
|
|
[-+]?[0-9]+\.[-e0-9]* return FLOAT;
|
|
\"([^\"]|\\\")*\" return STRING; /* contains non-quotes or escaped-quotes */
|
|
|
|
[a-zA-Z0-9][a-zA-Z0-9_]+ return SYMBOL; /* symbols can start with 0-9 */
|
|
|
|
[ \n\t\r] ; /* we just ignore whitespace */
|
|
|
|
%%
|
|
|
|
// Older versions of flex (prior to 2.5.9) do not have the destroy function
|
|
// Or We're not using GNU flex then we also won't have a destroy function
|
|
#if !defined(FLEX_SCANNER) || (YY_FLEX_SUBMINOR_VERSION < 9)
|
|
int DataFilterlex_destroy(void) { return 0; }
|
|
#endif
|
|
|
|
void DataFilter_setString(QString p)
|
|
{
|
|
DataFilter_scan_string(p.toLatin1().data());
|
|
}
|
|
|
|
void DataFilter_clearString()
|
|
{
|
|
DataFilterlex_destroy();
|
|
}
|
|
|