blob: ab954cfef7b0054b4c93bf84ab33e3c9506a668d (
plain) (
blame)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
%{
/* Lex analyzer for bison grammar */
#include "commands.tab.h"
/*#define DEBUG*/
#include "macro.h"
#include <string.h>
%}
OWNER "<"[a-zA-Z0-9_.+-]+@[a-zA-Z0-9._-]+">"
VAL ['`"][a-zA-Z0-9@_+.<>() -]+['`"]
VAR [a-zA-Z0-9_<>-]+[:]?
%option noyywrap
%%
{OWNER} {
DBG("OWNER %s\n",yytext);
yylval.text=yytext;
return(OWNERID);
}
{VAL} {
DBG("VAL %s\n",yytext);
yylval.text=yytext;
return(VALID);
}
{VAR} {
DBG("VAR %s\n",yytext);
yylval.text=yytext;
return(VARID);
}
"{" |
"}" |
"=" {
yylval.text=yytext;
return(*yytext);
}
"#"[^\n]* |
"\n" |
[[:space:]] ; /* comments 'til EOL and strip all spaces and \n */
"." {
DBG("NOTSTR %s\n",yytext);
yylval.text=yytext;
return(ERROR);
}
%%
#include "structs.h"
extern struct wlp_list_t *list;
int parse(FILE *file)
{
struct wlp_node_t *tmp;
int count;
yyin=file;
DBG("go!\n");
yyparse();
DBG("EOF found\n");
}
|