-
Notifications
You must be signed in to change notification settings - Fork 0
/
prp.l
53 lines (47 loc) · 1.18 KB
/
prp.l
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
%{
/* Definitions */
#include <stdio.h>
/*#include "y.tab.h"*/
#include "p1.cc.h"
#define DBG(X) X
%}
ws [ \t\r]+
%%
{ws} ;
\/\*.*\*\/ { }
SERVICE { DBG(printf("Service\n");)
return SERVICE;}
ENDSERVICE { return ENDSERVICE;}
START { return START;}
STATE { return STATE;}
ENDSTATE { return ENDSTATE;}
NEXTSTATE { return NEXTSTATE;}
INPUT { return INPUT;}
CALL { return CALL;}
COMMENT { return COMMENT;}
ALTERNATIVE { return ALTERNATIVE;}
ENDALTERNATIVE { return ENDALTERNATIVE;}
TASK { return TASK;}
JOIN { return JOIN;}
DECISION { return DECISION;}
ENDDECISION { return ENDDECISION;}
CONNECTION { return CONNECTION;}
ENDCONNECTION { return ENDCONNECTION;}
ELSE { return ELSE;}
STOP { return STOP;}
[(),;@:-] { printf("Here");printf("%c\n",yytext[0]); return yytext[0];}
[a-zA-Z0-9_-]+ { DBG(printf("VAR: %s here\n",yytext);)
strcpy(yylval.str,yytext);
return VAR;}
\'([^\']|\\.)*\' { DBG(printf("MQ: %s\n",yytext);)
strcpy(yylval.str,yytext);
return MULTIQUOTE;}
%%
#include <stdio.h>
/* User code */
/*
\(\ *[a-zA-Z_-]+\ *\) { DBG(printf("Case\n");)
return CASE;}
[a-zA-Z_]+\(([a-zA-Z]+,)*[a-zA-Z]\) { DBG(printf("Functioncall\n");)
return FUNCTIONCALL;}
*/