well, you know what i mean (. matches anything not yet matched).
However, this means that there is input still queued up so we need
to do a YY_NEW_FILE; in yywrap. So, yywrap has moved into parse.lex
and it calls parser_cleanup() which is most of the old yywrap()
sigh.
#include "options.h"
#include "y.tab.h"
+#undef yywrap /* guard against a yywrap macro */
+
extern YYSTYPE yylval;
int sudolineno = 1;
static int fill __P((void));
+extern void parser_cleanup __P((void));
#ifdef TRACELEXER
#define LEXTRACE(msg) fputs(msg, stderr)
LEXTRACE("\n");
return COMMENT;
} /* return comments */
-[@$%^&*()"'`/_+.]* { return ERROR; } /* return error */
-[?;<>\[\]{}|~-]* { return ERROR; } /* return error */
-[0-9_]+ { return ERROR; } /* return error */
-
-{N}\.{N}\.{N}\.{N} { fill(); return NTWKADDR; }
+{N}\.{N}\.{N}\.{N} {
+ fill();
+ return NTWKADDR;
+ }
\/([a-zA-Z0-9_.+-]+\/?)+ {
LEXTRACE("PATH ");
return ERROR;
}
+. { return ERROR; } /* return error */
+
%%
static int fill() {
(void) strcpy(yylval.string, yytext);
}
+
+int yywrap()
+{
+#ifdef YY_NEW_FILE
+ YY_NEW_FILE;
+#endif /* YY_NEW_FILE */
+
+ parser_cleanup();
+ return(1);
+}