summaryrefslogtreecommitdiffstats
path: root/src/dotscan.lpp
blob: c472038435a2af80abaf1a9b561b386947b5f70d (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 <tqstring.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 TQString(yytext); return NAME; }
{string}		{
					TQString str = &yytext[1];
					yylval.pText = new TQString(str.left(yyleng - 2));
					return STRING;
				}
{number}		{ yylval.pText = new TQString(yytext); return NUMBER; }
{float}			{ yylval.pText = new TQString(yytext); return NUMBER; }
{space}			;
.				return yytext[0];

%%