blob: 809d1e1687310515b4f91cbb06b8a2dbe9017eb7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
%{
#include <string.h>
#include "aliases_parse.h"
#define YY_NO_INPUT
int yylex(void);
%}
%option yylineno
%option nounput
%%
[^:,#[:space:][:cntrl:]]+ {yylval.ident = strdup(yytext); return T_IDENT;}
^([[:blank:]]*(#.*)?\n)+ ;/* ignore empty lines */
[:,\n] return yytext[0];
(\n?[[:blank:]]+|#.*)+ ;/* ignore whitespace and continuation */
\\\n ;/* ignore continuation. not allowed in comments */
. return T_ERROR;
<<EOF>> return T_EOF;
%%
|