summaryrefslogtreecommitdiffstats
path: root/src/dotscan.lpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotscan.lpp')
-rw-r--r--src/dotscan.lpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/dotscan.lpp b/src/dotscan.lpp
new file mode 100644
index 0000000..0667d33
--- /dev/null
+++ b/src/dotscan.lpp
@@ -0,0 +1,36 @@
+/* dot.l */
+
+%{
+#include <qstring.h>
+#include "dotparse.h"
+%}
+
+%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];
+
+%%