aboutsummaryrefslogtreecommitdiff
path: root/scanner.l
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-12-05 09:51:26 -0800
committerGuy Harris <guy@alum.mit.edu>2015-12-05 09:51:26 -0800
commit4241115b0229abc6eaa9856a45dc6700b3b1102f (patch)
tree6147046b05087bd60f8e7b148facf28335f4e0a1 /scanner.l
parent5823e2382c11cb9cdbe895c7e34b045a25c3bd78 (diff)
Use noyywrap rather than supplying a yywrap() that just returns 1.
We require a version of Flex that supports it. That avoids having to change the signature of yywrap().
Diffstat (limited to 'scanner.l')
-rw-r--r--scanner.l19
1 files changed, 9 insertions, 10 deletions
diff --git a/scanner.l b/scanner.l
index 451f86b4..1590926d 100644
--- a/scanner.l
+++ b/scanner.l
@@ -25,6 +25,15 @@
*/
%option never-interactive
+/*
+ * We want to stop processing when we get to the end of the input.
+ */
+%option noyywrap
+
+/*
+ * We want to generate code that can be used by a reentrant parser
+ * generated by Bison or Berkeley YACC.
+ */
%option bison-bridge
%{
@@ -429,16 +438,6 @@ tcp-urg { yylval->i = 0x20; return NUM; }
. { bpf_error("illegal char '%c'", *yytext); }
%%
-/*
- * Also define a yywrap. Note that if we're using flex, it will
- * define a macro to map this identifier to pcap_wrap.
- */
-int
-yywrap()
-{
- return 1;
-}
-
/* Hex digit to integer. */
static inline int
xdtoi(c)