/* dot.l */ %{ #include #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]; %%