head 1.1; access; symbols pkgsrc-2026Q1:1.1.0.18 pkgsrc-2026Q1-base:1.1 pkgsrc-2025Q4:1.1.0.16 pkgsrc-2025Q4-base:1.1 pkgsrc-2025Q3:1.1.0.14 pkgsrc-2025Q3-base:1.1 pkgsrc-2025Q2:1.1.0.12 pkgsrc-2025Q2-base:1.1 pkgsrc-2025Q1:1.1.0.10 pkgsrc-2025Q1-base:1.1 pkgsrc-2024Q4:1.1.0.8 pkgsrc-2024Q4-base:1.1 pkgsrc-2024Q3:1.1.0.6 pkgsrc-2024Q3-base:1.1 pkgsrc-2024Q2:1.1.0.4 pkgsrc-2024Q2-base:1.1 pkgsrc-2024Q1:1.1.0.2 pkgsrc-2024Q1-base:1.1; locks; strict; comment @# @; 1.1 date 2024.03.21.20.44.40; author wiz; state Exp; branches; next ; commitid V5xA0rDXhaMnl43F; desc @@ 1.1 log @devel/RE-flex: Update to v4.1.2 Prepared by Malte Dehling in wip. pkgsrc change: turn off cpu-optimization option by default. Dec 10, 2021: 3.1.0 improved buffering mechanism with reduced buffer sizes; faster columno() for long lines; fix CP-1251 table typo. Feb 20, 2022: 3.2.0 new %option ctorinit; faster compilation of regular expressions to tables and direct code DFAs; refactored SIMD source code to enable AVX2 and AVX512BW optimizations in multi-version matcher code; updated Windows binary file opening. Feb 23, 2022: 3.2.1 regression bug in 3.2.0 fix. Mar 13, 2022: 3.2.2 minor improvements. Apr 2, 2022: 3.2.3 fixed C++17 compliance and dso build. Apr 29, 2022: 3.2.4 new %begin directive; new --batch=SIZE option argument. Apr 30, 2022: 3.2.5 minor correction. May 6, 2022: 3.2.6 improved fuzzy matcher. May 10, 2022: 3.2.7 improved fuzzy matcher, see also https://github.com/Genivia/FuzzyMatcher. Jul 6, 2022: 3.2.8 minor update to correct a lexer file parsing issue in the reflex code generator tool. Aug 12, 2022: 3.2.9 add cmake rules for Windows builds. Aug 21, 2022: 3.2.10 bug fix in regular expression converter. Aug 29, 2022: 3.2.11 new lua2lisp transpiler example with Bison complete symbols and locations. Jan 6, 2023: 3.2.12 regression bug fix in trailing context pattern matching, e.g. xy and x/x patterns collided when they should not; updated yaml parser example. Jan 24, 2023: 3.3.0 overall update; corrected a problem with Unicode characters in regex patterns adjacent to curly braces; permit cxx extension in FSM filename output. Mar 6, 2023: 3.3.1 for consistency include NAME in default header file name, tables file name, and graphs file name when option --prefix is specified. Mar 17, 2023: 3.3.2 fix a performance issue with case-insensitive pattern construction. May 28, 2023: 3.3.3 fix yyrestart dropping the first character; faster Matcher::find(). May 31, 2023: 3.3.4 fix Matcher::find() initialization issue in 3.3.3. Jun 12, 2023: 3.3.5 improve source code output of lexer class definitions. Jul 11, 2023: 3.3.6 faster Matcher::find(); improved --stdout to include tables. Jul 17, 2023: 3.3.7 faster Matcher::find(). Aug 4, 2023: 3.3.8 minor update to sync up the code base with the ugrep project. Aug 16, 2023: 3.3.9 fix avx512bw compilation error; new LineMatcher matching engine. Sep 16, 2023: 3.4.0 fix FuzzyMatcher::DEL flag when this is the only flag selected; fix FuzzyMatcher::matches() bug that incorrectly matched an extra character before the end of the input; optimize find(); updated saving the FSM pred[] hashes to a file, which has changed; increase default buffer size REFLEX_BUFSZ to 128K for best throughput performance. Sep 25, 2023: 3.4.1 make word boundaries \b, \B, \< and \> applicable anywhere in a pattern. Oct 7, 2023: 3.5.0 updated to Unicode 15.1; clarify . (dot) with %unicode enabled, which is a catch-all pattern; update \X to match only valid Unicode characters. Nov 5, 2023: 3.5.1 minor improvements. Feb 17, 2024: 4.0.0 faster Matcher::find() with a new DFA cut algorithm to optimize match prediction speed and accuracy, see also ugrep 5.0; apply Unicode pattern canonicalization with reflex::convert(..., reflex::convert_flag::unicode). Feb 23, 2024: 4.0.1 new rawk example to demonstrate awk-like fast search in C++; enable <> rules for option find to generate a fast search engine. Mar 5, 2024: 4.1.0 improved lazy quantifiers for POSIX regex lazy matching in linear time using an advanced DFA transformation algorithm introduced in RE/flex in 2016. Mar 11, 2024: 4.1.1 minor update to correct a DFA construction problem for POSIX regex lazy quantifiers matching too much in some cases. Mar 17, 2024: 4.1.2 updated configure scripts; cast negative ctype function arguments (problem detected on NetBSD 10). @ text @$NetBSD$ build examples out of tree and assume pkgsrc for dependencies --- examples/Make.orig 2024-03-05 18:02:16.000000000 +0000 +++ examples/Make @@@@ -1,50 +1,32 @@@@ -# Some of these examples require Bison +# To build the examples: +# > make # -# Change INCBOOST and LIBBOOST below to point to your Boost install paths +# url_boost and wc_boost require devel/boost-{headers,libs} +# > make boostexamples # -# To quickly build the examples: -# > make -f Make -# -# Or use configure and make to build: -# > ./configure --enable-examples && make -# -# Bison C++ examples are built with: -# > make -f Make examplesxx -# -# flexexample9xx, reflexexample9xx, flexexample11xx, reflexexample11xx require Bison 3.0 or greater: -# > make -f Make examples3.2 -# -# url_boost and wc_boost requires Boost.Regex installed: -# > make -f Make boostexamples -# Boost.regex normally includes libboost_regex-mt, if not change LIBBOOST below -# -# url_pcre2 and wc_pcre2 requires PCRE2 installed: -# > make -f Make pcre2examples +# url_pcre2 and wc_pcre2 require devel/pcre2 +# > make pcre2examples + +CC = @@CC@@ +CXX = @@CXX@@ + +CFLAGS = -O2 -I. -I@@PREFIX@@/include -Wall -Wunused -Wextra #-DDEBUG +CXXFLAGS = $(CFLAGS) -fpermissive -CXX = c++ -REFLEX = ../bin/reflex +REFLEX = @@PREFIX@@/bin/reflex REFLAGS = -LIBREFLEX = ../lib/libreflex.a +LIBREFLEX = @@PREFIX@@/lib/libreflex.a -YACC = bison -y -BISON = bison +YACC = @@PREFIX@@/bin/bison -y +BISON = @@PREFIX@@/bin/bison -INCPCRE2 = /opt/local/include -LIBPCRE2 = -L/opt/local/lib -lpcre2-8 +INCPCRE2 = @@PREFIX@@/include +LIBPCRE2 = -L@@PREFIX@@/lib -lpcre2-8 -INCBOOST = /opt/local/include -# LIBBOOST = -L/opt/local/lib -lboost_regex -# LIBBOOST = -L/opt/homebrew/lib -lboost_regex-mt -LIBBOOST = -L/opt/local/lib -lboost_regex-mt - -CXXOFLAGS = -O2 -CXXWFLAGS = -Wall -Wunused -Wextra -CXXIFLAGS = -I. -I../include -I $(INCBOOST) -CXXMFLAGS = -# CXXMFLAGS =-DDEBUG -CXXFLAGS = $(CXXWFLAGS) $(CXXOFLAGS) $(CXXIFLAGS) $(CXXMFLAGS) +INCBOOST = @@PREFIX@@/include +LIBBOOST = -L@@PREFIX@@/lib -lboost_regex -all: examples examplesxx +all: examples examplesxx examples3.2 .PHONY: examples examplesxx examples3.2 boostexamples pcre2examples @@@@ -135,7 +117,7 @@@@ flexexample2: flexexample2.l flexexample3: flexexample3.l flexexample3.y $(YACC) -d flexexample3.y $(REFLEX) $(REFLAGS) --flex --bison --header-file flexexample3.l - $(CC) $(CXXFLAGS) -c y.tab.c + $(CC) $(CFLAGS) -c y.tab.c $(CXX) $(CXXFLAGS) -o $@@ y.tab.o lex.yy.cpp $(LIBREFLEX) ./flexexample3 < flexexample3.test @@@@ -148,7 +130,7 @@@@ flexexample3xx: flexexample3.lxx flexex flexexample4: flexexample4.l flexexample4.y $(YACC) -d flexexample4.y $(REFLEX) $(REFLAGS) --flex --bison-bridge --header-file flexexample4.l - $(CC) $(CXXFLAGS) -c y.tab.c + $(CC) $(CFLAGS) -c y.tab.c $(CXX) $(CXXFLAGS) -o $@@ y.tab.o lex.yy.cpp $(LIBREFLEX) ./flexexample4 < flexexample4.test @@@@ -161,7 +143,7 @@@@ flexexample4xx: flexexample4.lxx flexex flexexample5: flexexample5.l flexexample5.y $(YACC) -d flexexample5.y $(REFLEX) $(REFLAGS) --flex --bison-bridge --header-file flexexample5.l - $(CC) $(CXXFLAGS) -c y.tab.c + $(CC) $(CFLAGS) -c y.tab.c $(CXX) $(CXXFLAGS) -o $@@ y.tab.o lex.yy.cpp $(LIBREFLEX) ./flexexample5 < flexexample5.test @@@@ -179,7 +161,7 @@@@ flexexample6: flexexample6.l flexexample7: flexexample7.l flexexample7.y $(YACC) -d flexexample7.y $(REFLEX) $(REFLAGS) --flex --bison-locations --header-file flexexample7.l - $(CC) $(CXXFLAGS) -c y.tab.c + $(CC) $(CFLAGS) -c y.tab.c $(CXX) $(CXXFLAGS) -o $@@ y.tab.o lex.yy.cpp $(LIBREFLEX) ./flexexample7 < flexexample7.test @@@@ -192,7 +174,7 @@@@ flexexample7xx: flexexample7.lxx flexex flexexample8: flexexample8.l flexexample8.y $(YACC) -d flexexample8.y $(REFLEX) $(REFLAGS) --flex --bison-locations --bison-bridge --header-file flexexample8.l - $(CC) $(CXXFLAGS) -c y.tab.c + $(CC) $(CFLAGS) -c y.tab.c $(CXX) $(CXXFLAGS) -o $@@ y.tab.o lex.yy.cpp $(LIBREFLEX) ./flexexample8 < flexexample8.test @@@@ -472,7 +454,7 @@@@ minic: minic.l minic.y minic.hpp $(CXX) $(CXXFLAGS) -o $@@ parser.cpp scanner.cpp $(LIBREFLEX) rm -f minicdemo.class ./minic minicdemo.c - java minicdemo + #java minicdemo lua2lisp: lua.l lua.y lua.hpp $(BISON) -d lua.y @