hconfig

Link to this paste: http://bugs.dragonflybsd.org/pastes/439

Added by tuxillo 11 months ago.
Syntax: Plain Text

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
%{
#include <stdio.h>
#include "y.tab.h"

extern int yylval;
//#define YYSTYPE int
%}

%option noinput
%option nounput

/* common section */
nl              \n
ws              [ \t]+
blanks          ^([[:blank:]]*(#.*)?\n)+
comments        \#.*
digit           [0-9]
timeval         {digit}{0,2}
days            {timeval}d
hours           {timeval}h
minutes         {timeval}m
seconds         {timeval}s

%%

snapshots       return CMD_SNAPSHOTS;
rebalance       return CMD_REBALANCE;
prune           return CMD_PRUNE;
reblock         return CMD_REBLOCK;
dedup           return CMD_DEDUP;
recopy          return CMD_RECOPY;
any             return T_ANY_PARAM;
{days}          yylval = atoi(yytext); return TV_DAYS;
{hours}         yylval = atoi(yytext); return TV_HOURS;
{minutes}       yylval = atoi(yytext); return TV_MINUTES;
{seconds}       yylval = atoi(yytext); return TV_SECONDS;
.               return T_BADTOK;

%%

Download