-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmenu.l
More file actions
34 lines (31 loc) · 726 Bytes
/
menu.l
File metadata and controls
34 lines (31 loc) · 726 Bytes
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
%{
#include "client.h"
#include "y.tab.h"
char *get_yytext() { return yytext ; }
extern int line_num ;
%}
%%
[Ee]nvironment |
ENVIRONMENT {return ENVIRONMENT;}
[Mm]enu |
MENU {return MENU;}
[Rr]eadmenu |
READMENU {return READMENU;}
\, {return COMMA;}
\{ {return OBRACE;}
\} {return CBRACE;}
\( {return OPAREN;}
\) {return CPAREN;}
\"[^"\n]*\" {return STRING;}
\'[a-zA-Z]' {return KEY;}
\'^[a-zA-Z]' {return KEY;}
\$[a-zA-Z.]+ {return COMMAND;}
\$$[MP] {return OPENFLAG;}
[a-zA-Z_]+ {return ID_NAME;}
[0-9]+ {return INTEGER;}
[ \t] ;
\n {line_num++; }
\/\/.* ;
\#.* ;
. {return ERROR ; }
%%