Update of /cvsroot/ipac-ng/ipac-ng/access/files
In directory vz-cvs-4.sog:/tmp/cvs-serv7764/ipac-ng/access/files
Modified Files:
rules.l
Log Message:
fixed eth+ notation in rules file
Index: rules.l
===================================================================
RCS file: /cvsroot/ipac-ng/ipac-ng/access/files/rules.l,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- rules.l 27 Jun 2004 19:15:45 -0000 1.2
+++ rules.l 13 Nov 2011 01:30:24 -0000 1.3
@@ -1,6 +1,12 @@
%option stack
%option noyywrap
%option caseless 8bit
+%option nodefault
+%option yylineno
+%option nounput
+%option noinput
+%option noyy_top_state
+
%x chain intf sou des ext proto iplist
%{
@@ -20,7 +26,7 @@
%%
<*>#[^\n]*[\n]? /* eat comments */
-<INITIAL,chain,sou,des,intf>[ \t]+ ;
+<INITIAL,chain,sou,des>[ \t]+ ;
<INITIAL>{ACHAR}+ {
ruleslval.s = (char *) xstrdup(yytext);
return RNAME;
@@ -53,11 +59,15 @@
yy_switch_to_buffer(old_st);
yy_pop_state();
}
-<ext>[[:alnum:]\.\-\_\/\~:\!\,]+ {
+<ext>[[:alnum:]\.\-\_\/\~:\!\,]+ {
ruleslval.s = (char *) xstrdup(yytext);
return WORD;
}
-<proto,intf,sou,des>[[:alnum:]\.\-\_\/\~]+ {
+<proto,sou,des>[[:alnum:]\.\-\_\/\~]+ {
+ ruleslval.s = (char *) xstrdup(yytext);
+ return WORD;
+ }
+<intf>([[:graph:]]{-}[\|\/])+ {
ruleslval.s = (char *) xstrdup(yytext);
return WORD;
}
@@ -73,4 +83,12 @@
<INITIAL>\| BEGIN(chain); return SEP;
<INITIAL>[\n]+ ;
<<EOF>> yyterminate();
+<*>. {
+ printf("Invalid character '%s' at line %d in rules file.\n", yytext, yylineno);
+ exit(1);
+ }
+<*>\n {
+ printf("Unexpected end-of-line at line %d in rules file.\n", yylineno);
+ exit(1);
+ }
%%
|