%{
#include <stdio.h>
#include "tokens.h"

int line_number;

#define yywrap() 1
%}
%%

from				{ return t_FROM; }
to				{ return t_TO; }
allow				{ return t_ALLOW; }
deny				{ return t_DENY; }
port				{ return t_PORT; }
all				{ return t_ALL; }
any				{ return t_ALL; }
"*"				{ return t_ALL; }
	
#[^\n]*				;
\\\n				{ line_number++; }
\n				{ line_number++; return t_NEWLINE; }
[ \t]+				;
"/"				{ return t_SLASH; }
[0-9]+[^-A-Za-z_]		{ yyless(yyleng-1);return t_NUMBER; }
[0-9][0-9.]+[^-A-Za-z_]		{ yyless(yyleng-1);return t_QUAD; }
[-a-zA-Z0-0_.]+			{ return t_WORD; }
.				;
