2
* Picviz - Parallel coordinates ploter
3
* Copyright (C) 2008 Sebastien Tricaud <toady@gscore.org>
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation version 3.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21
#include "filter-parser.h"
23
static char *escape_str(char *str)
28
for ( i = 1; str[i]; i++ ) {
30
if ( ! escape_next && str[i] == '\\' ) {
45
%option 8bit prefix="pcvfilter"
47
/* [show|hide] [only|except] [value|plot|plotmin|plotmax|color] [>|<|=|] ["red"|"foobar"|123] [on axis N] */
48
/* plot = exact value as plotted by picviz
49
* plotmin = number of plots min to display */
50
/* ie.: show only plot > 100 on axis 3 */
51
/* ie.: show only plotmin 5 on axes */
53
FILTERDISPLAY (show|hide)
54
FILTERSELECT (only|except)
55
FILTERTYPE (value|plot|color|freq)
60
SQSTRING \'([^\\\']|\\.)*\'
61
DQSTRING \"([^\\\"]|\\.)*\"
64
OPERATOR_AND (\&\&|\&|and|AND)
65
OPERATOR_OR (\|\||\||or|OR)
67
OPERATOR_AND_WORD (and)
71
RELATION (\=|\!\=|\>|\<|\<\=|\>\=|is|not)
74
RELATION_NOTEQUAL \!\=
77
RELATION_LESS_OR_EQUAL \<\=
78
RELATION_GREATER_OR_EQUAL \>\=
88
pcvfilterlval.string = strdup(pcvfiltertext);
93
pcvfilterlval.string = strdup(pcvfiltertext);
98
pcvfilterlval.string = strdup(pcvfiltertext);
99
return TOK_FILTERTYPE;
103
pcvfilterlval.string = strdup(pcvfiltertext);
104
return TOK_SELECTAXIS;
108
pcvfilterlval.string = strdup(pcvfiltertext);
109
return TOK_SELECTAXES;
117
pcvfilterlval.string = strdup(escape_str(pcvfiltertext));
121
pcvfilterlval.string = strdup(escape_str(pcvfiltertext));
126
pcvfilterlval.string = strdup(pcvfiltertext);
131
pcvfilterlval.string = strdup(pcvfiltertext);
136
pcvfilterlval.string = strdup(pcvfiltertext);
140
{OPERATOR_AND} { return TOK_OPERATOR_AND; };
141
{OPERATOR_OR} { return TOK_OPERATOR_OR; };
145
/* remove unused functions */
146
typedef void (*dummy_function) ();
147
dummy_function picvizfilter_unused[] =
149
(dummy_function) input, (dummy_function) yyunput