| 1 |
root |
1.1 |
%{ |
| 2 |
|
|
#include <stdio.h> |
| 3 |
|
|
|
| 4 |
|
|
#include "y.tab.h" |
| 5 |
|
|
|
| 6 |
|
|
%} |
| 7 |
|
|
|
| 8 |
root |
1.2 |
|
| 9 |
|
|
DIGIT [0-9] |
| 10 |
|
|
|
| 11 |
|
|
|
| 12 |
root |
1.1 |
%% |
| 13 |
|
|
|
| 14 |
|
|
\[.*\] ; |
| 15 |
|
|
\"[^\"]*\" { yylval.string = strndup (yytext + 1, yyleng - 2); return STRING; } |
| 16 |
root |
1.2 |
[-+]?{DIGIT}+"."{DIGIT}* { yylval.num = atof ( yytext ); return NUMBER; } |
| 17 |
|
|
|
| 18 |
root |
1.1 |
|
| 19 |
root |
1.2 |
\/\/.* ; |
| 20 |
root |
1.1 |
|
| 21 |
|
|
[\040\t\r,] ; |
| 22 |
|
|
\n yylineno++; |
| 23 |
|
|
|
| 24 |
root |
1.2 |
[\;\{\}()] return yytext[0]; |
| 25 |
root |
1.1 |
|
| 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 |
|
|
|