Currently, we don't use any Flexisms in scanner.l, we *do* use

        %a 18400
        %o 21500
        %e 7600
        %k 4550
        %p 27600
        %n 2000

to try to boost some of lex's table sizes to handle it, and we make an effort 
in the configure file to find regular lex and see if it's capable of processing 
scanner.l.  There may be some outstanding bugs for lex on some platforms not 
being able to handle scanner.l even with those directives.

Using Flex would also let us use this:

        https://github.com/the-tcpdump-group/libpcap/pull/359

rather than this:

        https://github.com/the-tcpdump-group/libpcap/pull/360

to fix _LARGE_FILES issues on AIX (at the cost of possibly requiring AIX users 
to download and install Flex :-)).

We could also at least clean up, if not eliminate, the runlex.sh script.

Flex 2.5.1 (from 1995-03-28) adds %option never-interactive, which avoids 
calling isatty() and fileno(), which means we wouldn't have to throw in some 
#defines for Windows.

Flex 2.5.6 (from some time in 2002, I think) adds support for reentrant 
scanners.  This, plus using Bison's or Berkeley YACC's %pure-parser support for 
reentrant parsers, could let us make pcap_compile() thread-safe.

Should we continue supporting lex, or should we require Flex?  If we require 
Flex, should we require 2.5.6 or later, along with Bison or Berkeley YACC, and 
make the scanner and parser reentrant?
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers

Reply via email to