-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrl.l
23 lines (21 loc) · 957 Bytes
/
grl.l
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
%{
#include <stdio.h>
#include "y.tab.h"
%}
%%
"#".* ;
" " ;
";" return ENDLINE;
DEFAULT_SHAPE yylval.str = strdup(yytext); return DEFAULTNODESHAPE;
DEFAULT_STYLE yylval.str = strdup(yytext); return DEFAULTNODESTYLE;
BEGIN_GRAPH return BEGINGRAPH;
BEGIN_DIGRAPH return BEGINDIGRAPH;
NODE return NODE;
EDGE return EDGE;
END_GRAPH return ENDGRAPH;
"->" return DIRECTED;
"--" return NONDIRECTED;
STYLE= return STYLE;
SHAPE= return SHAPE;
\"([a-z]|[A-Z]|[0-9]|" "|\n)*\" yylval.str = strdup(yytext); return STRINGNAME;
([a-z]|[A-Z]|[0-9])+ yylval.str = strdup(yytext); return ID;