1 |
%{ |
2 |
#include <stdio.h> |
3 |
|
4 |
#include "y.tab.h" |
5 |
|
6 |
%} |
7 |
|
8 |
|
9 |
DIGIT [0-9] |
10 |
|
11 |
|
12 |
%% |
13 |
|
14 |
\[.*\] ; |
15 |
\"[^\"]*\" { yylval.string = strndup (yytext + 1, yyleng - 2); return STRING; } |
16 |
[-+]?{DIGIT}+"."{DIGIT}* { yylval.num = atof ( yytext ); return NUMBER; } |
17 |
|
18 |
|
19 |
\/\/.* ; |
20 |
|
21 |
[\040\t\r,] ; |
22 |
\n yylineno++; |
23 |
|
24 |
[\;\{\}()] return yytext[0]; |
25 |
|
26 |
. printf ("unexpected character '%c' in config file line %d, skipping", yytext[0], yylineno); |
27 |
|
28 |
%% |
29 |
|
30 |
int yywrap () |
31 |
{ |
32 |
return 1; |
33 |
} |
34 |
|
35 |
|