blob: 68887b3a520a6c5c9d5b3ec0d373180e1d2bebce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
/* dot.l */
%{
#include <qstring.h>
#include "dotparse.hpp"
%}
%option noyywrap
name [a-zA-Z_][a-zA-Z0-9_]*
string \"(\\.|[^\"])*\"
space [ \t\n]+
number [1-9][0-9]*
float [0-9]*\.[0-9]+
%%
"graph" return GRAPH;
"digraph" return DIGRAPH;
"calltree" return CALL_TREE;
"callingtree" return CALLING_TREE;
"node" return NODE;
"->" return DIR_EDGE;
"--" return UNDIR_EDGE;
{name} { yylval.pText = new QString(yytext); return NAME; }
{string} {
QString str = &yytext[1];
yylval.pText = new QString(str.left(yyleng - 2));
return STRING;
}
{number} { yylval.pText = new QString(yytext); return NUMBER; }
{float} { yylval.pText = new QString(yytext); return NUMBER; }
{space} ;
. return yytext[0];
%%
|