diff --git a/README.md b/README.md index 1f11d69e0..e021f3ff2 100644 --- a/README.md +++ b/README.md @@ -593,6 +593,7 @@ Changelog - Mar 17, 2024: 4.1.2 updated configure scripts; cast negative ctype function arguments (problem detected on NetBSD 10). - Mar 27, 2024: 4.2.0 support pkg-config with `reflex.pc` (and `reflexmin.pc` minimized library) to use the reflex library `-lreflex`. - Apr 10, 2024: 4.2.1 minor update to adjust the current input pointer by one when not matching anything. +- May 12, 2024: 4.3.0 faster `Matcher::find()` with refactored SIMD (SSE2/AVX2/AVX512BW/NEON/AArch64) code; larger default 256KB buffer (from 128KB). [logo-url]: https://www.genivia.com/images/reflex-logo.png [reflex-url]: https://www.genivia.com/reflex.html diff --git a/aclocal.m4 b/aclocal.m4 index e42711b55..142119717 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -14,8 +14,8 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, -[m4_warning([this file was generated for autoconf 2.71. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],, +[m4_warning([this file was generated for autoconf 2.72. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) diff --git a/bin/win32/reflex.exe b/bin/win32/reflex.exe index fec9d7c68..a54c36f3a 100755 Binary files a/bin/win32/reflex.exe and b/bin/win32/reflex.exe differ diff --git a/bin/win64/reflex.exe b/bin/win64/reflex.exe index 91278c0f4..afa8b5a37 100755 Binary files a/bin/win64/reflex.exe and b/bin/win64/reflex.exe differ diff --git a/config.h.in b/config.h.in index a152a8c0f..378feda91 100644 --- a/config.h.in +++ b/config.h.in @@ -51,7 +51,7 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if all of the C90 standard headers exist (not just the ones +/* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS @@ -74,10 +74,10 @@ #define below would cause a syntax error. */ #undef _UINT8_T -/* Define to `long int' if does not define. */ +/* Define to 'long int' if does not define. */ #undef off_t -/* Define to `unsigned int' if does not define. */ +/* Define as 'unsigned int' if doesn't define. */ #undef size_t /* Define to the type of an unsigned integer type of width exactly 16 bits if diff --git a/configure b/configure index 4fefc4fd6..82772964a 100755 --- a/configure +++ b/configure @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for re-flex 4.2.1. +# Generated by GNU Autoconf 2.72 for re-flex 4.3.0. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # @@ -19,7 +19,6 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -28,12 +27,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -105,7 +105,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -135,15 +135,14 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: @@ -151,12 +150,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else \$as_nop - case \`(set -o) 2>/dev/null\` in #( +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi " @@ -174,8 +174,9 @@ as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : -else \$as_nop - exitcode=1; echo positional parameters were not saved. +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) @@ -188,14 +189,15 @@ test -x / || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes -else $as_nop - as_have_required=no +else case e in #( + e) as_have_required=no ;; +esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do @@ -228,12 +230,13 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes -fi +fi ;; +esac fi @@ -255,7 +258,7 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi @@ -275,7 +278,8 @@ $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 -fi +fi ;; +esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} @@ -314,14 +318,6 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -390,11 +386,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -408,21 +405,14 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -496,6 +486,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits /[$]LINENO/= ' <$as_myself | sed ' + t clear + :clear s/[$]LINENO.*/&-/ t lineno b @@ -544,7 +536,6 @@ esac as_echo='printf %s\n' as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -556,9 +547,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -583,10 +574,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated test -n "$DJDIR" || exec 7<&0 /dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -925,7 +918,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1138,7 +1131,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1154,7 +1147,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1184,8 +1177,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" ;; *=*) @@ -1193,7 +1186,7 @@ Try \`$0 --help' for more information" # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1243,7 +1236,7 @@ do as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done -# There might be people who depend on the old broken behavior: `$host' +# There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias @@ -1311,7 +1304,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` @@ -1339,7 +1332,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures re-flex 4.2.1 to adapt to many kinds of systems. +'configure' configures re-flex 4.3.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1353,11 +1346,11 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages + -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' + -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] + --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX @@ -1365,10 +1358,10 @@ Installation directories: --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. For better control, use the options below. @@ -1410,7 +1403,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of re-flex 4.2.1:";; + short | recursive ) echo "Configuration of re-flex 4.3.0:";; esac cat <<\_ACEOF @@ -1439,14 +1432,14 @@ Some influential environment variables: you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags - YACC The `Yet Another Compiler Compiler' implementation to use. - Defaults to the first program found out of: `bison -y', `byacc', - `yacc'. + YACC The 'Yet Another Compiler Compiler' implementation to use. + Defaults to the first program found out of: 'bison -y', 'byacc', + 'yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a - default value of `-d' given by some make applications. + default value of '-d' given by some make applications. -Use these variables to override the choices made by `configure' or to help +Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . @@ -1513,10 +1506,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -re-flex configure 4.2.1 -generated by GNU Autoconf 2.71 +re-flex configure 4.3.0 +generated by GNU Autoconf 2.72 -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. @@ -1557,11 +1550,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } && test -s conftest.$ac_objext then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1580,8 +1574,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @@ -1611,12 +1605,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - eval "$3=yes" +else case e in #( + e) eval "$3=yes" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1637,8 +1633,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> @@ -1646,10 +1642,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1670,8 +1668,8 @@ printf %s "checking for uint$2_t... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ @@ -1703,10 +1701,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if eval test \"x\$"$3"\" = x"no" then : -else $as_nop - break +else case e in #( + e) break ;; +esac fi - done + done ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1743,11 +1743,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } && test -s conftest.$ac_objext then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1766,8 +1767,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> @@ -1775,10 +1776,12 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1817,12 +1820,13 @@ printf "%s\n" "$ac_try_echo"; } >&5 test $ac_status = 0; }; } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: program exited with status $ac_status" >&5 +else case e in #( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=$ac_status + ac_retval=$ac_status ;; +esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno @@ -1853,8 +1857,8 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by re-flex $as_me 4.2.1, which was -generated by GNU Autoconf 2.71. Invocation command line was +It was created by re-flex $as_me 4.3.0, which was +generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -2100,10 +2104,10 @@ esac printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi done @@ -2139,9 +2143,7 @@ struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; +static char *e (char **p, int i) { return p[i]; } @@ -2155,6 +2157,21 @@ static char *f (char * (*g) (char **, int), char **p, ...) return s; } +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated @@ -2182,16 +2199,19 @@ ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? +/* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif +// See if C++-style comments work. + #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); +extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare @@ -2241,7 +2261,6 @@ typedef const char *ccp; static inline int test_restrict (ccp restrict text) { - // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) @@ -2307,6 +2326,8 @@ ac_c_conftest_c99_main=' ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); // Check named initializers. struct named_init ni = { @@ -2328,7 +2349,7 @@ ac_c_conftest_c99_main=' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? +/* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif @@ -2736,8 +2757,9 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +else case e in #( + e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; +esac fi @@ -2765,12 +2787,12 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -2779,18 +2801,18 @@ printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. @@ -2806,11 +2828,11 @@ printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## @@ -2848,8 +2870,8 @@ if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS @@ -2903,7 +2925,8 @@ esac IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir - + ;; +esac fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install @@ -2999,7 +3022,7 @@ test "$program_prefix" != NONE && test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. -# By default was `s,x,x', remove it if useless. +# By default was 's,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` @@ -3042,8 +3065,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$STRIP"; then +else case e in #( + e) if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3065,7 +3088,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then @@ -3087,8 +3111,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_STRIP"; then +else case e in #( + e) if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3110,7 +3134,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then @@ -3146,8 +3171,8 @@ if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS @@ -3161,7 +3186,7 @@ do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ - 'BusyBox '* | \ + *'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; @@ -3170,18 +3195,17 @@ do done done IFS=$as_save_IFS - + ;; +esac fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" + # As a last resort, use plain mkdir -p, + # in the hope it doesn't have the bugs of ancient mkdir. + MKDIR_P='mkdir -p' fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 @@ -3196,8 +3220,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AWK"; then +else case e in #( + e) if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3219,7 +3243,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then @@ -3241,8 +3266,8 @@ ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 -else $as_nop - cat >conftest.make <<\_ACEOF +else case e in #( + e) cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' @@ -3254,7 +3279,8 @@ case `${MAKE-make} -f conftest.make 2>/dev/null` in *) eval ac_cv_prog_make_${ac_make}_set=no;; esac -rm -f conftest.make +rm -f conftest.make ;; +esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -3292,8 +3318,8 @@ printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 -else $as_nop - if printf "%s\n" 'TRUE=$(BAR$(V)) +else case e in #( + e) if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -3303,7 +3329,8 @@ am__doit: am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no -fi +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } @@ -3338,7 +3365,7 @@ fi # Define the identity of the package. PACKAGE='reflex' - VERSION='4.2.1' + VERSION='4.3.0' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -3531,8 +3558,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3554,7 +3581,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3576,8 +3604,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3599,7 +3627,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3634,8 +3663,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3657,7 +3686,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3679,8 +3709,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -3719,7 +3749,8 @@ if test $ac_prog_rejected = yes; then ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3743,8 +3774,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3766,7 +3797,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3792,8 +3824,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3815,7 +3847,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3853,8 +3886,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3876,7 +3909,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3898,8 +3932,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3921,7 +3955,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3950,10 +3985,10 @@ fi fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -4025,8 +4060,8 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. @@ -4046,7 +4081,7 @@ do ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' + # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. @@ -4057,8 +4092,9 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else $as_nop - ac_file='' +else case e in #( + e) ac_file='' ;; +esac fi if test -z "$ac_file" then : @@ -4067,13 +4103,14 @@ printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } @@ -4097,10 +4134,10 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in @@ -4110,11 +4147,12 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -4130,6 +4168,8 @@ int main (void) { FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; return ferror (f) || fclose (f) != 0; ; @@ -4169,26 +4209,27 @@ printf "%s\n" "$ac_try_echo"; } >&5 if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4220,16 +4261,18 @@ then : break;; esac done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } @@ -4240,8 +4283,8 @@ printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4258,12 +4301,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } @@ -4281,8 +4326,8 @@ printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -4300,8 +4345,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" +else case e in #( + e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4316,8 +4361,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4334,12 +4379,15 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } @@ -4366,8 +4414,8 @@ printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no +else case e in #( + e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4384,25 +4432,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" + CC="$CC $ac_cv_prog_cc_c11" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 + ac_prog_cc_stdc=c11 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -4412,8 +4463,8 @@ printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no +else case e in #( + e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4430,25 +4481,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" + CC="$CC $ac_cv_prog_cc_c99" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 + ac_prog_cc_stdc=c99 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -4458,8 +4512,8 @@ printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no +else case e in #( + e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4476,25 +4530,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" + CC="$CC $ac_cv_prog_cc_c89" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 + ac_prog_cc_stdc=c89 ;; +esac fi fi @@ -4515,8 +4572,8 @@ printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4546,7 +4603,8 @@ _ACEOF fi done rm -f core conftest* - unset am_i + unset am_i ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } @@ -4572,8 +4630,8 @@ printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then +else case e in #( + e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up @@ -4677,7 +4735,8 @@ else $as_nop else am_cv_CC_dependencies_compiler_type=none fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } @@ -4728,20 +4787,22 @@ ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define size_t unsigned int" >>confdefs.h - + ;; +esac fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define off_t long int" >>confdefs.h - + ;; +esac fi ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" @@ -4825,8 +4886,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CXX"; then +else case e in #( + e) if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4848,7 +4909,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then @@ -4874,8 +4936,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CXX"; then +else case e in #( + e) if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4897,7 +4959,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then @@ -4957,8 +5020,8 @@ printf %s "checking whether the compiler supports GNU C++... " >&6; } if test ${ac_cv_cxx_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4975,12 +5038,14 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } @@ -4998,8 +5063,8 @@ printf %s "checking whether $CXX accepts -g... " >&6; } if test ${ac_cv_prog_cxx_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_cxx_werror_flag=$ac_cxx_werror_flag +else case e in #( + e) ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" @@ -5017,8 +5082,8 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes -else $as_nop - CXXFLAGS="" +else case e in #( + e) CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5033,8 +5098,8 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : -else $as_nop - ac_cxx_werror_flag=$ac_save_cxx_werror_flag +else case e in #( + e) ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5051,12 +5116,15 @@ if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag + ac_cxx_werror_flag=$ac_save_cxx_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } @@ -5080,11 +5148,11 @@ if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 printf %s "checking for $CXX option to enable C++11 features... " >&6; } -if test ${ac_cv_prog_cxx_11+y} +if test ${ac_cv_prog_cxx_cxx11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_11=no +else case e in #( + e) ac_cv_prog_cxx_cxx11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5101,36 +5169,39 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx11" != "xno" && break done rm -f conftest.$ac_ext -CXX=$ac_save_CXX +CXX=$ac_save_CXX ;; +esac fi if test "x$ac_cv_prog_cxx_cxx11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx11" = x +else case e in #( + e) if test "x$ac_cv_prog_cxx_cxx11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx11" + CXX="$CXX $ac_cv_prog_cxx_cxx11" ;; +esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 - ac_prog_cxx_stdcxx=cxx11 + ac_prog_cxx_stdcxx=cxx11 ;; +esac fi fi if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 printf %s "checking for $CXX option to enable C++98 features... " >&6; } -if test ${ac_cv_prog_cxx_98+y} +if test ${ac_cv_prog_cxx_cxx98+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_98=no +else case e in #( + e) ac_cv_prog_cxx_cxx98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5147,25 +5218,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx98" != "xno" && break done rm -f conftest.$ac_ext -CXX=$ac_save_CXX +CXX=$ac_save_CXX ;; +esac fi if test "x$ac_cv_prog_cxx_cxx98" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx98" = x +else case e in #( + e) if test "x$ac_cv_prog_cxx_cxx98" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx98" + CXX="$CXX $ac_cv_prog_cxx_cxx98" ;; +esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 - ac_prog_cxx_stdcxx=cxx98 + ac_prog_cxx_stdcxx=cxx98 ;; +esac fi fi @@ -5182,8 +5256,8 @@ printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CXX_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then +else case e in #( + e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up @@ -5287,7 +5361,8 @@ else $as_nop else am_cv_CXX_dependencies_compiler_type=none fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } @@ -5315,8 +5390,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AR"; then +else case e in #( + e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5338,7 +5413,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then @@ -5364,8 +5440,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_AR"; then +else case e in #( + e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5387,7 +5463,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then @@ -5422,8 +5499,8 @@ printf %s "checking the archiver ($AR) interface... " >&6; } if test ${am_cv_ar_interface+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_ext=c +else case e in #( + e) ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -5466,7 +5543,8 @@ ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 printf "%s\n" "$am_cv_ar_interface" >&6; } @@ -5496,8 +5574,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$RANLIB"; then +else case e in #( + e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5519,7 +5597,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then @@ -5541,8 +5620,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_RANLIB"; then +else case e in #( + e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5564,7 +5643,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then @@ -5613,8 +5693,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_YACC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$YACC"; then +else case e in #( + e) if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5636,7 +5716,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then @@ -5665,15 +5746,16 @@ printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_build_alias=$build_alias +else case e in #( + e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } @@ -5700,14 +5782,15 @@ printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "x$host_alias" = x; then +else case e in #( + e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } @@ -5741,8 +5824,9 @@ PLATFORM=${host} if test ${enable_sse2+y} then : enableval=$enable_sse2; with_no_sse2="yes" -else $as_nop - with_no_sse2="no" +else case e in #( + e) with_no_sse2="no" ;; +esac fi @@ -5751,8 +5835,9 @@ fi if test ${enable_avx2+y} then : enableval=$enable_avx2; with_no_avx2="yes" -else $as_nop - with_no_avx2="no" +else case e in #( + e) with_no_avx2="no" ;; +esac fi @@ -5761,8 +5846,9 @@ fi if test ${enable_neon+y} then : enableval=$enable_neon; with_no_neon="yes" -else $as_nop - with_no_neon="no" +else case e in #( + e) with_no_neon="no" ;; +esac fi @@ -5798,8 +5884,9 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : msse2_ok=yes -else $as_nop - msse2_ok=no +else case e in #( + e) msse2_ok=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CXXFLAGS=$save_CXXFLAGS @@ -5818,7 +5905,7 @@ printf %s "checking whether ${CXX} supports AVX2/AVX512BW intrinsics... " >&6; } int main (void) { -__m512 n = _mm512_set1_epi8(42); (void)_mm512_cmpeq_epi8_mask(n, n); +__m512i n = _mm512_set1_epi8(42); (void)_mm512_cmpeq_epi8_mask(n, n); ; return 0; } @@ -5826,8 +5913,9 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : mavx_ok=yes -else $as_nop - mavx_ok=no +else case e in #( + e) mavx_ok=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "x$mavx_ok" = "xyes"; then @@ -5850,8 +5938,9 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : mavx_ok=yes -else $as_nop - mavx_ok=no +else case e in #( + e) mavx_ok=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "x$mavx_ok" = "xyes"; then @@ -5887,8 +5976,9 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : mneon_ok=yes -else $as_nop - mneon_ok=no +else case e in #( + e) mneon_ok=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "x$mneon_ok" = "xyes"; then @@ -5910,8 +6000,9 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : mneon_ok=yes -else $as_nop - mneon_ok=no +else case e in #( + e) mneon_ok=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "x$mneon_ok" = "xyes"; then @@ -5933,8 +6024,9 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : mneon_ok=yes -else $as_nop - mneon_ok=no +else case e in #( + e) mneon_ok=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "x$mneon_ok" = "xyes"; then @@ -5964,12 +6056,12 @@ printf %s "checking whether ${CXX} supports SSE2 intrinsics... " >&6; } CXXFLAGS="-msse2" if test "$cross_compiling" = yes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -5983,11 +6075,13 @@ _ACEOF if ac_fn_cxx_try_run "$LINENO" then : msse2_ok=yes -else $as_nop - msse2_ok=no +else case e in #( + e) msse2_ok=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi CXXFLAGS=$save_CXXFLAGS @@ -6006,18 +6100,18 @@ printf %s "checking whether ${CXX} supports AVX2/AVX512BW intrinsics... " >&6; } CXXFLAGS="-mavx512bw" if test "$cross_compiling" = yes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { -__m512 n = _mm512_set1_epi8(42); (void)_mm512_cmpeq_epi8_mask(n, n); +__m512i n = _mm512_set1_epi8(42); (void)_mm512_cmpeq_epi8_mask(n, n); ; return 0; } @@ -6025,11 +6119,13 @@ _ACEOF if ac_fn_cxx_try_run "$LINENO" then : mavx_ok=yes -else $as_nop - mavx_ok=no +else case e in #( + e) mavx_ok=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi if test "x$mavx_ok" = "xyes"; then @@ -6040,12 +6136,12 @@ fi CXXFLAGS="-mavx2" if test "$cross_compiling" = yes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -6059,11 +6155,13 @@ _ACEOF if ac_fn_cxx_try_run "$LINENO" then : mavx_ok=yes -else $as_nop - mavx_ok=no +else case e in #( + e) mavx_ok=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi if test "x$mavx_ok" = "xyes"; then @@ -6087,12 +6185,12 @@ printf "%s\n" "yes" >&6; } printf %s "checking whether ${CXX} supports NEON/AArch64 intrinsics... " >&6; } if test "$cross_compiling" = yes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -6106,11 +6204,13 @@ _ACEOF if ac_fn_cxx_try_run "$LINENO" then : mneon_ok=yes -else $as_nop - mneon_ok=no +else case e in #( + e) mneon_ok=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi if test "x$mneon_ok" = "xyes"; then @@ -6120,12 +6220,12 @@ fi CXXFLAGS="-mfpu=neon" if test "$cross_compiling" = yes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -6139,11 +6239,13 @@ _ACEOF if ac_fn_cxx_try_run "$LINENO" then : mneon_ok=yes -else $as_nop - mneon_ok=no +else case e in #( + e) mneon_ok=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi if test "x$mneon_ok" = "xyes"; then @@ -6152,12 +6254,12 @@ fi CXXFLAGS="-march=native -mfpu=neon" if test "$cross_compiling" = yes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -6171,11 +6273,13 @@ _ACEOF if ac_fn_cxx_try_run "$LINENO" then : mneon_ok=yes -else $as_nop - mneon_ok=no +else case e in #( + e) mneon_ok=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi if test "x$mneon_ok" = "xyes"; then @@ -6203,8 +6307,9 @@ fi if test ${enable_examples+y} then : enableval=$enable_examples; enable_examples=yes -else $as_nop - enable_examples=no +else case e in #( + e) enable_examples=no ;; +esac fi if test "x$enable_examples" = "xyes"; then @@ -6235,8 +6340,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_DOXYGEN+y} then : printf %s "(cached) " >&6 -else $as_nop - case $DOXYGEN in +else case e in #( + e) case $DOXYGEN in [\\/]* | ?:[\\/]*) ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path. ;; @@ -6262,6 +6367,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_DOXYGEN" && ac_cv_path_DOXYGEN="NO_DOXYGEN" ;; +esac ;; esac fi DOXYGEN=$ac_cv_path_DOXYGEN @@ -6314,8 +6420,8 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -6345,14 +6451,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) - # `set' quotes correctly as required by POSIX, so do not add quotes. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -6474,7 +6580,6 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -6483,12 +6588,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -6560,7 +6666,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -6589,7 +6695,6 @@ as_fn_error () } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -6629,11 +6734,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -6647,11 +6753,12 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith @@ -6734,9 +6841,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -6817,10 +6924,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 @@ -6835,8 +6944,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by re-flex $as_me 4.2.1, which was -generated by GNU Autoconf 2.71. Invocation command line was +This file was extended by re-flex $as_me 4.3.0, which was +generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -6868,7 +6977,7 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions +'$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. @@ -6903,11 +7012,11 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -re-flex config.status 4.2.1 -configured by $0, generated by GNU Autoconf 2.71, +re-flex config.status 4.3.0 +configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -6969,8 +7078,8 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -6978,8 +7087,8 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; @@ -7043,7 +7152,7 @@ do "reflex.pc") CONFIG_FILES="$CONFIG_FILES reflex.pc" ;; "reflexmin.pc") CONFIG_FILES="$CONFIG_FILES reflexmin.pc" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done @@ -7063,7 +7172,7 @@ fi # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= @@ -7087,7 +7196,7 @@ ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then @@ -7245,13 +7354,13 @@ fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. +# This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as +# Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. @@ -7361,7 +7470,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -7383,19 +7492,19 @@ do -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. + # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done - # Let's still pretend it is `configure' which instantiates (i.e., don't + # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` @@ -7528,7 +7637,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 esac _ACEOF -# Neutralize VPATH when `$srcdir' = `.'. +# Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -7559,9 +7668,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -7716,15 +7825,15 @@ printf "%s\n" X/"$am_mf" | (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} diff --git a/configure.ac b/configure.ac index 6d11d2741..19631b16f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([re-flex],[4.2.1],[https://github.com/Genivia/RE-flex/issues],[reflex]) +AC_INIT([re-flex],[4.3.0],[https://github.com/Genivia/RE-flex/issues],[reflex]) AM_INIT_AUTOMAKE([foreign subdir-objects]) AC_CONFIG_HEADERS([config.h]) AC_COPYRIGHT([Copyright (C) 2016-2024 Robert van Engelen, Genivia Inc.]) @@ -84,7 +84,7 @@ if test "x$cross_compiling" = "xyes"; then AC_MSG_CHECKING([whether ${CXX} supports AVX2/AVX512BW intrinsics]) save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-mavx512bw" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[__m512 n = _mm512_set1_epi8(42); (void)_mm512_cmpeq_epi8_mask(n, n);]])], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[__m512i n = _mm512_set1_epi8(42); (void)_mm512_cmpeq_epi8_mask(n, n);]])], [mavx_ok=yes], [mavx_ok=no]) if test "x$mavx_ok" = "xyes"; then @@ -168,7 +168,7 @@ else AC_MSG_CHECKING([whether ${CXX} supports AVX2/AVX512BW intrinsics]) save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-mavx512bw" - AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include ]],[[__m512 n = _mm512_set1_epi8(42); (void)_mm512_cmpeq_epi8_mask(n, n);]])], + AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include ]],[[__m512i n = _mm512_set1_epi8(42); (void)_mm512_cmpeq_epi8_mask(n, n);]])], [mavx_ok=yes], [mavx_ok=no]) if test "x$mavx_ok" = "xyes"; then diff --git a/doc/html/abslexer_8h.html b/doc/html/abslexer_8h.html index 90e52350a..b304c51d7 100644 --- a/doc/html/abslexer_8h.html +++ b/doc/html/abslexer_8h.html @@ -21,7 +21,7 @@
abslexer.h File Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -68,14 +68,14 @@
- - - - - - - - + + + + + + + +
@@ -110,7 +110,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/abslexer_8h__incl.map b/doc/html/abslexer_8h__incl.map index 1eb56b458..9ef4c51c1 100644 --- a/doc/html/abslexer_8h__incl.map +++ b/doc/html/abslexer_8h__incl.map @@ -1,10 +1,10 @@ - - - - - - - - + + + + + + + + diff --git a/doc/html/abslexer_8h__incl.md5 b/doc/html/abslexer_8h__incl.md5 index c68bfe3ef..6be20e994 100644 --- a/doc/html/abslexer_8h__incl.md5 +++ b/doc/html/abslexer_8h__incl.md5 @@ -1 +1 @@ -0352b9a3674ae57a779bfd1f30b47c0d \ No newline at end of file +7452a3556b0aa2d610a5d727eda2113c \ No newline at end of file diff --git a/doc/html/abslexer_8h__incl.png b/doc/html/abslexer_8h__incl.png index 7f929e90f..8af512b98 100644 Binary files a/doc/html/abslexer_8h__incl.png and b/doc/html/abslexer_8h__incl.png differ diff --git a/doc/html/absmatcher_8h.html b/doc/html/absmatcher_8h.html index 9b491e1e7..cf8681bdd 100644 --- a/doc/html/absmatcher_8h.html +++ b/doc/html/absmatcher_8h.html @@ -21,7 +21,7 @@
absmatcher.h File Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -75,13 +75,13 @@
- - - - - - - + + + + + + +
@@ -140,10 +140,10 @@  This compile-time option may speed up buffer reallocation with realloc() instead of new and delete. More...
  #define WITH_FAST_GET   1 - This compile-time option speeds up matching, but slows input(). More...
+ This compile-time option speeds up matching, but slows input() somewhat. More...
  #define WITH_SPAN   1 - This compile-time option adds span(), line(), wline(), bol(), eol() More...
+ This compile-time option adds span(), line(), wline(), bol(), eol(). More...
 

@@ -161,7 +161,7 @@

Detailed Description

RE/flex abstract matcher base class and pattern matcher class.

Author
Robert van Engelen - engel.nosp@m.en@g.nosp@m.enivi.nosp@m.a.co.nosp@m.m
-

Macro Definition Documentation

@@ -175,7 +175,7 @@
-

This compile-time option speeds up matching, but slows input().

+

This compile-time option speeds up matching, but slows input() somewhat.

@@ -203,7 +203,7 @@
-

This compile-time option adds span(), line(), wline(), bol(), eol()

+

This compile-time option adds span(), line(), wline(), bol(), eol().

@@ -283,7 +283,7 @@

Function Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/absmatcher_8h__incl.map b/doc/html/absmatcher_8h__incl.map index a86173f03..1ca4a2005 100644 --- a/doc/html/absmatcher_8h__incl.map +++ b/doc/html/absmatcher_8h__incl.map @@ -1,9 +1,9 @@ - - - - - - - + + + + + + + diff --git a/doc/html/absmatcher_8h__incl.md5 b/doc/html/absmatcher_8h__incl.md5 index 159766897..dc875a5dc 100644 --- a/doc/html/absmatcher_8h__incl.md5 +++ b/doc/html/absmatcher_8h__incl.md5 @@ -1 +1 @@ -d26621782a4a27fd515df001e9c599d0 \ No newline at end of file +990f950248ac6dcdf9a8360c1600b1de \ No newline at end of file diff --git a/doc/html/absmatcher_8h__incl.png b/doc/html/absmatcher_8h__incl.png index dee9b5012..218ad0f34 100644 Binary files a/doc/html/absmatcher_8h__incl.png and b/doc/html/absmatcher_8h__incl.png differ diff --git a/doc/html/annotated.html b/doc/html/annotated.html index 2c9721151..5a288218f 100644 --- a/doc/html/annotated.html +++ b/doc/html/annotated.html @@ -21,7 +21,7 @@
Class List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -120,7 +120,7 @@
+Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
diff --git a/doc/html/bits_8h.html b/doc/html/bits_8h.html index d988c65ee..00786c8d7 100644 --- a/doc/html/bits_8h.html +++ b/doc/html/bits_8h.html @@ -21,7 +21,7 @@
bits.h File Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -101,7 +101,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/boostmatcher_8h.html b/doc/html/boostmatcher_8h.html index 07236db6c..71e2000a4 100644 --- a/doc/html/boostmatcher_8h.html +++ b/doc/html/boostmatcher_8h.html @@ -21,7 +21,7 @@
boostmatcher.h File Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -66,14 +66,14 @@
- - - - - - - - + + + + + + + +
@@ -103,7 +103,7 @@ +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/boostmatcher_8h__incl.map b/doc/html/boostmatcher_8h__incl.map index d73db2ff1..0697415bb 100644 --- a/doc/html/boostmatcher_8h__incl.map +++ b/doc/html/boostmatcher_8h__incl.map @@ -1,10 +1,10 @@ - - - - - - - - + + + + + + + + diff --git a/doc/html/boostmatcher_8h__incl.md5 b/doc/html/boostmatcher_8h__incl.md5 index 968bb2533..5709161c6 100644 --- a/doc/html/boostmatcher_8h__incl.md5 +++ b/doc/html/boostmatcher_8h__incl.md5 @@ -1 +1 @@ -32fc3ae52f8e0a18b5622f06f0a6371e \ No newline at end of file +c9913b7851a6fdea406f650d2e2f2631 \ No newline at end of file diff --git a/doc/html/boostmatcher_8h__incl.png b/doc/html/boostmatcher_8h__incl.png index 76e07f6b6..73c51cb53 100644 Binary files a/doc/html/boostmatcher_8h__incl.png and b/doc/html/boostmatcher_8h__incl.png differ diff --git a/doc/html/class_reflex-members.html b/doc/html/class_reflex-members.html index 2b2b42274..5fd944cb4 100644 --- a/doc/html/class_reflex-members.html +++ b/doc/html/class_reflex-members.html @@ -21,7 +21,7 @@
@@ -151,7 +151,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/class_reflex.html b/doc/html/class_reflex.html index 5447be510..3d20c1a9a 100644 --- a/doc/html/class_reflex.html +++ b/doc/html/class_reflex.html @@ -21,7 +21,7 @@
Reflex Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -2755,7 +2755,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classes.html b/doc/html/classes.html index 89550b996..561d327ad 100644 --- a/doc/html/classes.html +++ b/doc/html/classes.html @@ -21,7 +21,7 @@
Class Index

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -96,7 +96,7 @@
+Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_abstract_lexer-members.html b/doc/html/classreflex_1_1_abstract_lexer-members.html index d6559a49f..1da1db3f2 100644 --- a/doc/html/classreflex_1_1_abstract_lexer-members.html +++ b/doc/html/classreflex_1_1_abstract_lexer-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -114,7 +114,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_abstract_lexer.html b/doc/html/classreflex_1_1_abstract_lexer.html index 54949d05f..12ecbed3b 100644 --- a/doc/html/classreflex_1_1_abstract_lexer.html +++ b/doc/html/classreflex_1_1_abstract_lexer.html @@ -21,7 +21,7 @@
reflex::AbstractLexer< M > Class Template Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -1874,7 +1874,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_abstract_lexer_1_1_matcher-members.html b/doc/html/classreflex_1_1_abstract_lexer_1_1_matcher-members.html index e5464b417..e7d0ae15b 100644 --- a/doc/html/classreflex_1_1_abstract_lexer_1_1_matcher-members.html +++ b/doc/html/classreflex_1_1_abstract_lexer_1_1_matcher-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -64,7 +64,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_abstract_lexer_1_1_matcher.html b/doc/html/classreflex_1_1_abstract_lexer_1_1_matcher.html index 8cb67b741..c80365aec 100644 --- a/doc/html/classreflex_1_1_abstract_lexer_1_1_matcher.html +++ b/doc/html/classreflex_1_1_abstract_lexer_1_1_matcher.html @@ -21,7 +21,7 @@
reflex::AbstractLexer< M >::Matcher Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -296,7 +296,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_abstract_matcher-members.html b/doc/html/classreflex_1_1_abstract_matcher-members.html index d2548eb3a..f636d37d9 100644 --- a/doc/html/classreflex_1_1_abstract_matcher-members.html +++ b/doc/html/classreflex_1_1_abstract_matcher-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -80,19 +80,21 @@ chr() const reflex::AbstractMatcherinline chr_reflex::AbstractMatcherprotected clone()=0reflex::AbstractMatcherpure virtual - cno_reflex::AbstractMatcherprotected - columno(size_t n)reflex::AbstractMatcherinline - columno()reflex::AbstractMatcherinline - columno_end()reflex::AbstractMatcherinline - columns()reflex::AbstractMatcherinline - const_iterator typedefreflex::AbstractMatcher - cpb_reflex::AbstractMatcherprotected - cur_reflex::AbstractMatcherprotected - end() const reflex::AbstractMatcherinline - end_reflex::AbstractMatcherprotected - eof_reflex::AbstractMatcherprotected - eol(bool inclusive=false)reflex::AbstractMatcherinline - evh_reflex::AbstractMatcherprotected + cml_reflex::AbstractMatcherprotected + cno_reflex::AbstractMatcherprotected + columno(size_t n)reflex::AbstractMatcherinline + columno()reflex::AbstractMatcherinline + columno_end()reflex::AbstractMatcherinline + columns()reflex::AbstractMatcherinline + const_iterator typedefreflex::AbstractMatcher + cpb_reflex::AbstractMatcherprotected + cur_reflex::AbstractMatcherprotected + end() const reflex::AbstractMatcherinline + end_reflex::AbstractMatcherprotected + eof_reflex::AbstractMatcherprotected + eol(bool inclusive=false)reflex::AbstractMatcherinline + evh_reflex::AbstractMatcherprotected + fetch(size_t len)reflex::AbstractMatcherinline findreflex::AbstractMatcher first() const reflex::AbstractMatcherinline flush()reflex::AbstractMatcherinline @@ -118,70 +120,71 @@ lineno(size_t n)reflex::AbstractMatcherinline lineno()reflex::AbstractMatcherinline lineno_end()reflex::AbstractMatcherinline - lines()reflex::AbstractMatcherinline - lno_reflex::AbstractMatcherprotected - lpb_reflex::AbstractMatcherprotected - mat_reflex::AbstractMatcherprotected - match(Method method)=0reflex::AbstractMatcherprotectedpure virtual - matches()reflex::AbstractMatcherinline - max_reflex::AbstractMatcherprotected - Method typedefreflex::AbstractMatcherprotected - more()reflex::AbstractMatcherinline - num_reflex::AbstractMatcherprotected - operator size_t() const reflex::AbstractMatcherinline - operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline - operator std::string() const reflex::AbstractMatcherinline - operator std::wstring() const reflex::AbstractMatcherinline - operator!=(const char *rhs) const reflex::AbstractMatcherinline - operator!=(const std::string &rhs) const reflex::AbstractMatcherinline - operator!=(size_t rhs) const reflex::AbstractMatcherinline - operator!=(int rhs) const reflex::AbstractMatcherinline - operator==(const char *rhs) const reflex::AbstractMatcherinline - operator==(const std::string &rhs) const reflex::AbstractMatcherinline - operator==(size_t rhs) const reflex::AbstractMatcherinline - operator==(int rhs) const reflex::AbstractMatcherinline - operator[](size_t n) const =0reflex::AbstractMatcherpure virtual - opt_reflex::AbstractMatcherprotected - own_reflex::AbstractMatcherprotected - pair() const reflex::AbstractMatcherinline - peek()reflex::AbstractMatcherinline - peek_more()reflex::AbstractMatcherinlineprotected - pos_reflex::AbstractMatcherprotected - reset(const char *opt=NULL)reflex::AbstractMatcherinlinevirtual - reset_text()reflex::AbstractMatcherinlineprotected - rest()reflex::AbstractMatcherinline - scanreflex::AbstractMatcher - set_bob(bool bob)reflex::AbstractMatcherinline - set_bol(bool bol)reflex::AbstractMatcherinline - set_current(size_t loc)reflex::AbstractMatcherinlineprotected - set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected - set_end(bool eof)reflex::AbstractMatcherinline - set_handler(Handler *handler)reflex::AbstractMatcherinline - size() const reflex::AbstractMatcherinline - skip(char c)reflex::AbstractMatcherinline - skip(wchar_t c)reflex::AbstractMatcherinline - skip(const char *s)reflex::AbstractMatcherinline - span()reflex::AbstractMatcherinline - splitreflex::AbstractMatcher - str() const reflex::AbstractMatcherinline - tabs(char n)reflex::AbstractMatcherinline - tabs()reflex::AbstractMatcherinline - text()reflex::AbstractMatcherinline - txt_reflex::AbstractMatcherprotected - unput(char c)reflex::AbstractMatcherinline - wchr() const reflex::AbstractMatcherinline - winput()reflex::AbstractMatcherinline - wline()reflex::AbstractMatcherinline - wpair() const reflex::AbstractMatcherinline - wrap()reflex::AbstractMatcherinlinevirtual - wsize() const reflex::AbstractMatcherinline - wstr() const reflex::AbstractMatcherinline - wunput(int c)reflex::AbstractMatcherinline - ~AbstractMatcher()reflex::AbstractMatcherinlinevirtual + lineno_skip(bool f=false)reflex::AbstractMatcherinline + lines()reflex::AbstractMatcherinline + lno_reflex::AbstractMatcherprotected + lpb_reflex::AbstractMatcherprotected + mat_reflex::AbstractMatcherprotected + match(Method method)=0reflex::AbstractMatcherprotectedpure virtual + matches()reflex::AbstractMatcherinline + max_reflex::AbstractMatcherprotected + Method typedefreflex::AbstractMatcherprotected + more()reflex::AbstractMatcherinline + num_reflex::AbstractMatcherprotected + operator size_t() const reflex::AbstractMatcherinline + operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline + operator std::string() const reflex::AbstractMatcherinline + operator std::wstring() const reflex::AbstractMatcherinline + operator!=(const char *rhs) const reflex::AbstractMatcherinline + operator!=(const std::string &rhs) const reflex::AbstractMatcherinline + operator!=(size_t rhs) const reflex::AbstractMatcherinline + operator!=(int rhs) const reflex::AbstractMatcherinline + operator==(const char *rhs) const reflex::AbstractMatcherinline + operator==(const std::string &rhs) const reflex::AbstractMatcherinline + operator==(size_t rhs) const reflex::AbstractMatcherinline + operator==(int rhs) const reflex::AbstractMatcherinline + operator[](size_t n) const =0reflex::AbstractMatcherpure virtual + opt_reflex::AbstractMatcherprotected + own_reflex::AbstractMatcherprotected + pair() const reflex::AbstractMatcherinline + peek()reflex::AbstractMatcherinline + peek_more()reflex::AbstractMatcherinlineprotected + pos_reflex::AbstractMatcherprotected + reset(const char *opt=NULL)reflex::AbstractMatcherinlinevirtual + reset_text()reflex::AbstractMatcherinlineprotected + rest()reflex::AbstractMatcherinline + scanreflex::AbstractMatcher + set_bob(bool bob)reflex::AbstractMatcherinline + set_bol(bool bol)reflex::AbstractMatcherinline + set_current(size_t loc)reflex::AbstractMatcherinlineprotected + set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected + set_end(bool eof)reflex::AbstractMatcherinline + set_handler(Handler *handler)reflex::AbstractMatcherinline + size() const reflex::AbstractMatcherinline + skip(char c)reflex::AbstractMatcherinline + skip(wchar_t c)reflex::AbstractMatcherinline + skip(const char *s)reflex::AbstractMatcherinline + span()reflex::AbstractMatcherinline + splitreflex::AbstractMatcher + str() const reflex::AbstractMatcherinline + tabs(char n)reflex::AbstractMatcherinline + tabs()reflex::AbstractMatcherinline + text()reflex::AbstractMatcherinline + txt_reflex::AbstractMatcherprotected + unput(char c)reflex::AbstractMatcherinline + wchr() const reflex::AbstractMatcherinline + winput()reflex::AbstractMatcherinline + wline()reflex::AbstractMatcherinline + wpair() const reflex::AbstractMatcherinline + wrap()reflex::AbstractMatcherinlinevirtual + wsize() const reflex::AbstractMatcherinline + wstr() const reflex::AbstractMatcherinline + wunput(int c)reflex::AbstractMatcherinline + ~AbstractMatcher()reflex::AbstractMatcherinlinevirtual
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_abstract_matcher.html b/doc/html/classreflex_1_1_abstract_matcher.html index 33391849e..202b712b3 100644 --- a/doc/html/classreflex_1_1_abstract_matcher.html +++ b/doc/html/classreflex_1_1_abstract_matcher.html @@ -21,7 +21,7 @@
reflex::AbstractMatcher Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -216,6 +216,9 @@ int wchr () const  Returns the first wide character of the text matched. More...
  +void lineno_skip (bool f=false) + Set or reset mode to count matching lines only and skip other (e.g. for speed). More...
+  void lineno (size_t n)  Set or change the starting line number of the last match. More...
  @@ -300,6 +303,9 @@ const char * eol (bool inclusive=false)  Returns pointer to the end of the line (last char + 1) in the buffer containing the matched text, DANGER: invalidates previous bol() and text() pointers, use eol() before bol(), text(), begin(), and end() when those are used. More...
  +size_t fetch (size_t len) + Return number of bytes available given number of bytes to fetch ahead, limited by input size and buffer size. More...
+  size_t avail ()  Returns the number of bytes in the buffer available to search from the current begin()/text() position. More...
  @@ -510,6 +516,9 @@ bool mat_  true if AbstractMatcher::matches() was successful More...
  +bool cml_ + true when counting matching lines instead of line numbers More...

Detailed Description

The abstract matcher base class template defines an interface for all pattern matcher engines.

@@ -1112,7 +1121,7 @@

Member Function Documentation

Polymorphic cloning.

-

Implemented in reflex::PCRE2Matcher, reflex::Matcher, reflex::BoostMatcher, reflex::StdMatcher, and reflex::LineMatcher.

+

Implemented in reflex::Matcher, reflex::PCRE2Matcher, reflex::BoostMatcher, reflex::StdMatcher, and reflex::LineMatcher.

@@ -1285,6 +1294,33 @@

Member Function Documentation

+ + + +
+
+ + + + + +
+ + + + + + + + +
size_t reflex::AbstractMatcher::fetch (size_t len)
+
+inline
+
+ +

Return number of bytes available given number of bytes to fetch ahead, limited by input size and buffer size.

+
Returns
number of bytes available after fetching.
+
@@ -1463,7 +1499,7 @@

Member Function Documentation

Returns the group capture identifier containing the group capture index >0 and name (or NULL) of a named group capture, or (1,NULL) by default.

Returns
a pair of size_t and string
-

Implemented in reflex::PCRE2Matcher, reflex::BoostMatcher, reflex::StdMatcher, reflex::Matcher, and reflex::LineMatcher.

+

Implemented in reflex::PCRE2Matcher, reflex::Matcher, reflex::BoostMatcher, reflex::StdMatcher, and reflex::LineMatcher.

@@ -1491,7 +1527,7 @@

Member Function Documentation

Returns the next group capture identifier containing the group capture index >0 and name (or NULL) of a named group capture, or (0,NULL) when no more groups matched.

Returns
a pair of size_t and string
-

Implemented in reflex::PCRE2Matcher, reflex::BoostMatcher, reflex::StdMatcher, reflex::Matcher, and reflex::LineMatcher.

+

Implemented in reflex::PCRE2Matcher, reflex::Matcher, reflex::BoostMatcher, reflex::StdMatcher, and reflex::LineMatcher.

@@ -1838,6 +1874,32 @@

Member Function Documentation

Returns the inclusive ending line number of the match in the input character sequence.

Returns
line number
+ + + +
+
+ + + + + +
+ + + + + + + + +
void reflex::AbstractMatcher::lineno_skip (bool f = false)
+
+inline
+
+ +

Set or reset mode to count matching lines only and skip other (e.g. for speed).

+
@@ -2339,7 +2401,7 @@

Member Function Documentation

Returns captured text as a std::pair<const char*,size_t> with string pointer (non-0-terminated) and length.

Returns
std::pair of string pointer and length in the captured text, where [0] returns std::pair(begin(), size())
-

Implemented in reflex::PCRE2Matcher, reflex::StdMatcher, reflex::BoostMatcher, reflex::Matcher, and reflex::LineMatcher.

+

Implemented in reflex::PCRE2Matcher, reflex::Matcher, reflex::StdMatcher, reflex::BoostMatcher, and reflex::LineMatcher.

@@ -2445,7 +2507,7 @@

Member Function Documentation

Reset this matcher's state to the initial state and set options (when provided).

-

Reimplemented in reflex::PCRE2Matcher, reflex::Matcher, reflex::BoostMatcher, reflex::StdMatcher, and reflex::LineMatcher.

+

Reimplemented in reflex::Matcher, reflex::PCRE2Matcher, reflex::BoostMatcher, reflex::StdMatcher, and reflex::LineMatcher.

@@ -3297,6 +3359,28 @@

Member Data Documentation

the character located at AbstractMatcher::txt_[AbstractMatcher::len_]

+ + + +
+
+ + + + + +
+ + + + +
bool reflex::AbstractMatcher::cml_
+
+protected
+
+ +

true when counting matching lines instead of line numbers

+
@@ -3757,7 +3841,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_abstract_matcher_1_1_iterator-members.html b/doc/html/classreflex_1_1_abstract_matcher_1_1_iterator-members.html index 7b616423e..62a18bfd6 100644 --- a/doc/html/classreflex_1_1_abstract_matcher_1_1_iterator-members.html +++ b/doc/html/classreflex_1_1_abstract_matcher_1_1_iterator-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -81,7 +81,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_abstract_matcher_1_1_iterator.html b/doc/html/classreflex_1_1_abstract_matcher_1_1_iterator.html index a310ba8c8..8e1c7f0f4 100644 --- a/doc/html/classreflex_1_1_abstract_matcher_1_1_iterator.html +++ b/doc/html/classreflex_1_1_abstract_matcher_1_1_iterator.html @@ -21,7 +21,7 @@
reflex::AbstractMatcher::Iterator< T > Class Template Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -657,7 +657,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_abstract_matcher_1_1_operation-members.html b/doc/html/classreflex_1_1_abstract_matcher_1_1_operation-members.html index a240f5f91..a944210fd 100644 --- a/doc/html/classreflex_1_1_abstract_matcher_1_1_operation-members.html +++ b/doc/html/classreflex_1_1_abstract_matcher_1_1_operation-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -69,7 +69,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_abstract_matcher_1_1_operation.html b/doc/html/classreflex_1_1_abstract_matcher_1_1_operation.html index 88f3a0c30..211afcea9 100644 --- a/doc/html/classreflex_1_1_abstract_matcher_1_1_operation.html +++ b/doc/html/classreflex_1_1_abstract_matcher_1_1_operation.html @@ -21,7 +21,7 @@
reflex::AbstractMatcher::Operation Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -381,7 +381,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_bits-members.html b/doc/html/classreflex_1_1_bits-members.html index 24bb2d014..d88d83cca 100644 --- a/doc/html/classreflex_1_1_bits-members.html +++ b/doc/html/classreflex_1_1_bits-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -107,7 +107,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_bits.html b/doc/html/classreflex_1_1_bits.html index 87d164eac..c511ecd1c 100644 --- a/doc/html/classreflex_1_1_bits.html +++ b/doc/html/classreflex_1_1_bits.html @@ -21,7 +21,7 @@
reflex::Bits Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -1718,7 +1718,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_boost_matcher-members.html b/doc/html/classreflex_1_1_boost_matcher-members.html index 54111381b..66a35d563 100644 --- a/doc/html/classreflex_1_1_boost_matcher-members.html +++ b/doc/html/classreflex_1_1_boost_matcher-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -84,20 +84,22 @@ chr() const reflex::AbstractMatcherinline chr_reflex::AbstractMatcherprotected clone()reflex::BoostMatcherinlinevirtual - cno_reflex::AbstractMatcherprotected - columno(size_t n)reflex::AbstractMatcherinline - columno()reflex::AbstractMatcherinline - columno_end()reflex::AbstractMatcherinline - columns()reflex::AbstractMatcherinline - const_iterator typedefreflex::AbstractMatcher - convert(T regex, convert_flag_type flags=convert_flag::none, bool *multiline=NULL)reflex::BoostMatcherinlinestatic - cpb_reflex::AbstractMatcherprotected - cur_reflex::AbstractMatcherprotected - end() const reflex::AbstractMatcherinline - end_reflex::AbstractMatcherprotected - eof_reflex::AbstractMatcherprotected - eol(bool inclusive=false)reflex::AbstractMatcherinline - evh_reflex::AbstractMatcherprotected + cml_reflex::AbstractMatcherprotected + cno_reflex::AbstractMatcherprotected + columno(size_t n)reflex::AbstractMatcherinline + columno()reflex::AbstractMatcherinline + columno_end()reflex::AbstractMatcherinline + columns()reflex::AbstractMatcherinline + const_iterator typedefreflex::AbstractMatcher + convert(T regex, convert_flag_type flags=convert_flag::none, bool *multiline=NULL)reflex::BoostMatcherinlinestatic + cpb_reflex::AbstractMatcherprotected + cur_reflex::AbstractMatcherprotected + end() const reflex::AbstractMatcherinline + end_reflex::AbstractMatcherprotected + eof_reflex::AbstractMatcherprotected + eol(bool inclusive=false)reflex::AbstractMatcherinline + evh_reflex::AbstractMatcherprotected + fetch(size_t len)reflex::AbstractMatcherinline fin_reflex::BoostMatcherprotected findreflex::AbstractMatcher first() const reflex::AbstractMatcherinline @@ -128,91 +130,92 @@ lineno(size_t n)reflex::AbstractMatcherinline lineno()reflex::AbstractMatcherinline lineno_end()reflex::AbstractMatcherinline - lines()reflex::AbstractMatcherinline - lno_reflex::AbstractMatcherprotected - lpb_reflex::AbstractMatcherprotected - mat_reflex::AbstractMatcherprotected - match(Method method)reflex::BoostMatcherinlineprotectedvirtual - matches()reflex::AbstractMatcherinline - max_reflex::AbstractMatcherprotected - Method typedefreflex::AbstractMatcherprotected - more()reflex::AbstractMatcherinline - new_itr(Method method)reflex::BoostMatcherinlineprotected - num_reflex::AbstractMatcherprotected - operator size_t() const reflex::AbstractMatcherinline - operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline - operator std::string() const reflex::AbstractMatcherinline - operator std::wstring() const reflex::AbstractMatcherinline - operator!=(const char *rhs) const reflex::AbstractMatcherinline - operator!=(const std::string &rhs) const reflex::AbstractMatcherinline - operator!=(size_t rhs) const reflex::AbstractMatcherinline - operator!=(int rhs) const reflex::AbstractMatcherinline - operator=(const BoostMatcher &matcher)reflex::BoostMatcherinline - PatternMatcher< boost::regex >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inline - operator==(const char *rhs) const reflex::AbstractMatcherinline - operator==(const std::string &rhs) const reflex::AbstractMatcherinline - operator==(size_t rhs) const reflex::AbstractMatcherinline - operator==(int rhs) const reflex::AbstractMatcherinline - operator[](size_t n) const reflex::BoostMatcherinlinevirtual - opt_reflex::AbstractMatcherprotected - own_reflex::PatternMatcher< boost::regex >protected - own_pattern() constreflex::PatternMatcher< boost::regex >inline - pair() const reflex::AbstractMatcherinline - pat_reflex::PatternMatcher< boost::regex >protected - Pattern typedefreflex::PatternMatcher< boost::regex > - pattern(const BoostMatcher &matcher)reflex::BoostMatcherinlinevirtual - pattern(const Pattern &pattern)reflex::BoostMatcherinlinevirtual - pattern(const Pattern *pattern)reflex::BoostMatcherinlinevirtual - pattern(const char *pattern)reflex::BoostMatcherinlinevirtual - pattern(const std::string &pattern)reflex::BoostMatcherinlinevirtual - PatternMatcher< boost::regex >::pattern(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inlinevirtual - PatternMatcher< boost::regex >::pattern(const Pattern &pattern)reflex::PatternMatcher< boost::regex >inlinevirtual - PatternMatcher< boost::regex >::pattern(const Pattern *pattern)reflex::PatternMatcher< boost::regex >inlinevirtual - PatternMatcher< boost::regex >::pattern() constreflex::PatternMatcher< boost::regex >inline - PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inline - PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected - PatternMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected - PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected - PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected - peek()reflex::AbstractMatcherinline - peek_more()reflex::AbstractMatcherinlineprotected - pos_reflex::AbstractMatcherprotected - reset(const char *opt=NULL)reflex::BoostMatcherinlinevirtual - reset_text()reflex::AbstractMatcherinlineprotected - rest()reflex::AbstractMatcherinline - scanreflex::AbstractMatcher - set_bob(bool bob)reflex::AbstractMatcherinline - set_bol(bool bol)reflex::AbstractMatcherinline - set_current(size_t loc)reflex::AbstractMatcherinlineprotected - set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected - set_end(bool eof)reflex::AbstractMatcherinline - set_handler(Handler *handler)reflex::AbstractMatcherinline - size() const reflex::AbstractMatcherinline - skip(char c)reflex::AbstractMatcherinline - skip(wchar_t c)reflex::AbstractMatcherinline - skip(const char *s)reflex::AbstractMatcherinline - span()reflex::AbstractMatcherinline - splitreflex::AbstractMatcher - str() const reflex::AbstractMatcherinline - tabs(char n)reflex::AbstractMatcherinline - tabs()reflex::AbstractMatcherinline - text()reflex::AbstractMatcherinline - txt_reflex::AbstractMatcherprotected - unput(char c)reflex::AbstractMatcherinline - wchr() const reflex::AbstractMatcherinline - winput()reflex::AbstractMatcherinline - wline()reflex::AbstractMatcherinline - wpair() const reflex::AbstractMatcherinline - wrap()reflex::AbstractMatcherinlinevirtual - wsize() const reflex::AbstractMatcherinline - wstr() const reflex::AbstractMatcherinline - wunput(int c)reflex::AbstractMatcherinline - ~AbstractMatcher()reflex::AbstractMatcherinlinevirtual - ~PatternMatcher()reflex::PatternMatcher< boost::regex >inlinevirtual + lineno_skip(bool f=false)reflex::AbstractMatcherinline + lines()reflex::AbstractMatcherinline + lno_reflex::AbstractMatcherprotected + lpb_reflex::AbstractMatcherprotected + mat_reflex::AbstractMatcherprotected + match(Method method)reflex::BoostMatcherinlineprotectedvirtual + matches()reflex::AbstractMatcherinline + max_reflex::AbstractMatcherprotected + Method typedefreflex::AbstractMatcherprotected + more()reflex::AbstractMatcherinline + new_itr(Method method)reflex::BoostMatcherinlineprotected + num_reflex::AbstractMatcherprotected + operator size_t() const reflex::AbstractMatcherinline + operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline + operator std::string() const reflex::AbstractMatcherinline + operator std::wstring() const reflex::AbstractMatcherinline + operator!=(const char *rhs) const reflex::AbstractMatcherinline + operator!=(const std::string &rhs) const reflex::AbstractMatcherinline + operator!=(size_t rhs) const reflex::AbstractMatcherinline + operator!=(int rhs) const reflex::AbstractMatcherinline + operator=(const BoostMatcher &matcher)reflex::BoostMatcherinline + PatternMatcher< boost::regex >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inlinevirtual + operator==(const char *rhs) const reflex::AbstractMatcherinline + operator==(const std::string &rhs) const reflex::AbstractMatcherinline + operator==(size_t rhs) const reflex::AbstractMatcherinline + operator==(int rhs) const reflex::AbstractMatcherinline + operator[](size_t n) const reflex::BoostMatcherinlinevirtual + opt_reflex::AbstractMatcherprotected + own_reflex::PatternMatcher< boost::regex >protected + own_pattern() constreflex::PatternMatcher< boost::regex >inline + pair() const reflex::AbstractMatcherinline + pat_reflex::PatternMatcher< boost::regex >protected + Pattern typedefreflex::PatternMatcher< boost::regex > + pattern(const BoostMatcher &matcher)reflex::BoostMatcherinlinevirtual + pattern(const Pattern &pattern)reflex::BoostMatcherinlinevirtual + pattern(const Pattern *pattern)reflex::BoostMatcherinlinevirtual + pattern(const char *pattern)reflex::BoostMatcherinlinevirtual + pattern(const std::string &pattern)reflex::BoostMatcherinlinevirtual + PatternMatcher< boost::regex >::pattern(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inlinevirtual + PatternMatcher< boost::regex >::pattern(const Pattern &pattern)reflex::PatternMatcher< boost::regex >inlinevirtual + PatternMatcher< boost::regex >::pattern(const Pattern *pattern)reflex::PatternMatcher< boost::regex >inlinevirtual + PatternMatcher< boost::regex >::pattern() constreflex::PatternMatcher< boost::regex >inlinevirtual + PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inline + PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected + PatternMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected + PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected + PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected + peek()reflex::AbstractMatcherinline + peek_more()reflex::AbstractMatcherinlineprotected + pos_reflex::AbstractMatcherprotected + reset(const char *opt=NULL)reflex::BoostMatcherinlinevirtual + reset_text()reflex::AbstractMatcherinlineprotected + rest()reflex::AbstractMatcherinline + scanreflex::AbstractMatcher + set_bob(bool bob)reflex::AbstractMatcherinline + set_bol(bool bol)reflex::AbstractMatcherinline + set_current(size_t loc)reflex::AbstractMatcherinlineprotected + set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected + set_end(bool eof)reflex::AbstractMatcherinline + set_handler(Handler *handler)reflex::AbstractMatcherinline + size() const reflex::AbstractMatcherinline + skip(char c)reflex::AbstractMatcherinline + skip(wchar_t c)reflex::AbstractMatcherinline + skip(const char *s)reflex::AbstractMatcherinline + span()reflex::AbstractMatcherinline + splitreflex::AbstractMatcher + str() const reflex::AbstractMatcherinline + tabs(char n)reflex::AbstractMatcherinline + tabs()reflex::AbstractMatcherinline + text()reflex::AbstractMatcherinline + txt_reflex::AbstractMatcherprotected + unput(char c)reflex::AbstractMatcherinline + wchr() const reflex::AbstractMatcherinline + winput()reflex::AbstractMatcherinline + wline()reflex::AbstractMatcherinline + wpair() const reflex::AbstractMatcherinline + wrap()reflex::AbstractMatcherinlinevirtual + wsize() const reflex::AbstractMatcherinline + wstr() const reflex::AbstractMatcherinline + wunput(int c)reflex::AbstractMatcherinline + ~AbstractMatcher()reflex::AbstractMatcherinlinevirtual + ~PatternMatcher()reflex::PatternMatcher< boost::regex >inlinevirtual
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_boost_matcher.html b/doc/html/classreflex_1_1_boost_matcher.html index 09f461b05..79d8aca61 100644 --- a/doc/html/classreflex_1_1_boost_matcher.html +++ b/doc/html/classreflex_1_1_boost_matcher.html @@ -21,7 +21,7 @@
reflex::BoostMatcher Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -164,9 +164,9 @@ virtual ~PatternMatcher ()  Delete matcher, deletes pattern when owned. More...
  -PatternMatcheroperator= (const PatternMatcher &matcher) - Assign a matcher, the underlying pattern object is shared (not deep copied). More...
-  +virtual PatternMatcheroperator= (const PatternMatcher &matcher) + Assign a matcher, the underlying pattern object is shared (not deep copied). More...
+  virtual PatternMatcherpattern (const PatternMatcher &matcher)  Set the pattern to use with this matcher as a shared pointer to another matcher pattern. More...
  @@ -176,9 +176,9 @@ virtual PatternMatcherpattern (const Pattern *pattern)  Set the pattern to use with this matcher (the given pattern is shared and must be persistent). More...
  -const Patternpattern () const - Returns a reference to the pattern object associated with this matcher. More...
-  +virtual const Patternpattern () const + Returns a reference to the pattern object associated with this matcher. More...
+  bool has_pattern () const  Returns true if this matcher has a pattern. More...
  @@ -258,6 +258,9 @@ int wchr () const  Returns the first wide character of the text matched. More...
  +void lineno_skip (bool f=false) + Set or reset mode to count matching lines only and skip other (e.g. for speed). More...
+  void lineno (size_t n)  Set or change the starting line number of the last match. More...
  @@ -342,6 +345,9 @@ const char * eol (bool inclusive=false)  Returns pointer to the end of the line (last char + 1) in the buffer containing the matched text, DANGER: invalidates previous bol() and text() pointers, use eol() before bol(), text(), begin(), and end() when those are used. More...
  +size_t fetch (size_t len) + Return number of bytes available given number of bytes to fetch ahead, limited by input size and buffer size. More...
+  size_t avail ()  Returns the number of bytes in the buffer available to search from the current begin()/text() position. More...
  @@ -566,6 +572,9 @@ bool mat_  true if AbstractMatcher::matches() was successful More...
  +bool cml_ + true when counting matching lines instead of line numbers More...
+  @@ -1320,7 +1329,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_boost_perl_matcher-members.html b/doc/html/classreflex_1_1_boost_perl_matcher-members.html index 84906b8db..9dc89874c 100644 --- a/doc/html/classreflex_1_1_boost_perl_matcher-members.html +++ b/doc/html/classreflex_1_1_boost_perl_matcher-members.html @@ -21,7 +21,7 @@
@@ -87,20 +87,22 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -131,91 +133,92 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Additional Inherited Members

Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
chr() const reflex::AbstractMatcherinline
chr_reflex::AbstractMatcherprotected
clone()reflex::BoostMatcherinlinevirtual
cno_reflex::AbstractMatcherprotected
columno(size_t n)reflex::AbstractMatcherinline
columno()reflex::AbstractMatcherinline
columno_end()reflex::AbstractMatcherinline
columns()reflex::AbstractMatcherinline
const_iterator typedefreflex::AbstractMatcher
convert(T regex, convert_flag_type flags=convert_flag::none, bool *multiline=NULL)reflex::BoostMatcherinlinestatic
cpb_reflex::AbstractMatcherprotected
cur_reflex::AbstractMatcherprotected
end() const reflex::AbstractMatcherinline
end_reflex::AbstractMatcherprotected
eof_reflex::AbstractMatcherprotected
eol(bool inclusive=false)reflex::AbstractMatcherinline
evh_reflex::AbstractMatcherprotected
cml_reflex::AbstractMatcherprotected
cno_reflex::AbstractMatcherprotected
columno(size_t n)reflex::AbstractMatcherinline
columno()reflex::AbstractMatcherinline
columno_end()reflex::AbstractMatcherinline
columns()reflex::AbstractMatcherinline
const_iterator typedefreflex::AbstractMatcher
convert(T regex, convert_flag_type flags=convert_flag::none, bool *multiline=NULL)reflex::BoostMatcherinlinestatic
cpb_reflex::AbstractMatcherprotected
cur_reflex::AbstractMatcherprotected
end() const reflex::AbstractMatcherinline
end_reflex::AbstractMatcherprotected
eof_reflex::AbstractMatcherprotected
eol(bool inclusive=false)reflex::AbstractMatcherinline
evh_reflex::AbstractMatcherprotected
fetch(size_t len)reflex::AbstractMatcherinline
fin_reflex::BoostMatcherprotected
findreflex::AbstractMatcher
first() const reflex::AbstractMatcherinline
lineno(size_t n)reflex::AbstractMatcherinline
lineno()reflex::AbstractMatcherinline
lineno_end()reflex::AbstractMatcherinline
lines()reflex::AbstractMatcherinline
lno_reflex::AbstractMatcherprotected
lpb_reflex::AbstractMatcherprotected
mat_reflex::AbstractMatcherprotected
match(Method method)reflex::BoostMatcherinlineprotectedvirtual
matches()reflex::AbstractMatcherinline
max_reflex::AbstractMatcherprotected
Method typedefreflex::AbstractMatcherprotected
more()reflex::AbstractMatcherinline
new_itr(Method method)reflex::BoostMatcherinlineprotected
num_reflex::AbstractMatcherprotected
operator size_t() const reflex::AbstractMatcherinline
operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline
operator std::string() const reflex::AbstractMatcherinline
operator std::wstring() const reflex::AbstractMatcherinline
operator!=(const char *rhs) const reflex::AbstractMatcherinline
operator!=(const std::string &rhs) const reflex::AbstractMatcherinline
operator!=(size_t rhs) const reflex::AbstractMatcherinline
operator!=(int rhs) const reflex::AbstractMatcherinline
operator=(const BoostMatcher &matcher)reflex::BoostMatcherinline
PatternMatcher< boost::regex >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inline
operator==(const char *rhs) const reflex::AbstractMatcherinline
operator==(const std::string &rhs) const reflex::AbstractMatcherinline
operator==(size_t rhs) const reflex::AbstractMatcherinline
operator==(int rhs) const reflex::AbstractMatcherinline
operator[](size_t n) const reflex::BoostMatcherinlinevirtual
opt_reflex::AbstractMatcherprotected
own_reflex::PatternMatcher< boost::regex >protected
own_pattern() constreflex::PatternMatcher< boost::regex >inline
pair() const reflex::AbstractMatcherinline
pat_reflex::PatternMatcher< boost::regex >protected
Pattern typedefreflex::PatternMatcher< boost::regex >
pattern(const BoostMatcher &matcher)reflex::BoostMatcherinlinevirtual
pattern(const Pattern &pattern)reflex::BoostMatcherinlinevirtual
pattern(const Pattern *pattern)reflex::BoostMatcherinlinevirtual
pattern(const char *pattern)reflex::BoostMatcherinlinevirtual
pattern(const std::string &pattern)reflex::BoostMatcherinlinevirtual
PatternMatcher< boost::regex >::pattern(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inlinevirtual
PatternMatcher< boost::regex >::pattern(const Pattern &pattern)reflex::PatternMatcher< boost::regex >inlinevirtual
PatternMatcher< boost::regex >::pattern(const Pattern *pattern)reflex::PatternMatcher< boost::regex >inlinevirtual
PatternMatcher< boost::regex >::pattern() constreflex::PatternMatcher< boost::regex >inline
PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inline
PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected
PatternMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected
PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected
PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected
peek()reflex::AbstractMatcherinline
peek_more()reflex::AbstractMatcherinlineprotected
pos_reflex::AbstractMatcherprotected
reset(const char *opt=NULL)reflex::BoostMatcherinlinevirtual
reset_text()reflex::AbstractMatcherinlineprotected
rest()reflex::AbstractMatcherinline
scanreflex::AbstractMatcher
set_bob(bool bob)reflex::AbstractMatcherinline
set_bol(bool bol)reflex::AbstractMatcherinline
set_current(size_t loc)reflex::AbstractMatcherinlineprotected
set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected
set_end(bool eof)reflex::AbstractMatcherinline
set_handler(Handler *handler)reflex::AbstractMatcherinline
size() const reflex::AbstractMatcherinline
skip(char c)reflex::AbstractMatcherinline
skip(wchar_t c)reflex::AbstractMatcherinline
skip(const char *s)reflex::AbstractMatcherinline
span()reflex::AbstractMatcherinline
splitreflex::AbstractMatcher
str() const reflex::AbstractMatcherinline
tabs(char n)reflex::AbstractMatcherinline
tabs()reflex::AbstractMatcherinline
text()reflex::AbstractMatcherinline
txt_reflex::AbstractMatcherprotected
unput(char c)reflex::AbstractMatcherinline
wchr() const reflex::AbstractMatcherinline
winput()reflex::AbstractMatcherinline
wline()reflex::AbstractMatcherinline
wpair() const reflex::AbstractMatcherinline
wrap()reflex::AbstractMatcherinlinevirtual
wsize() const reflex::AbstractMatcherinline
wstr() const reflex::AbstractMatcherinline
wunput(int c)reflex::AbstractMatcherinline
~AbstractMatcher()reflex::AbstractMatcherinlinevirtual
~PatternMatcher()reflex::PatternMatcher< boost::regex >inlinevirtual
lineno_skip(bool f=false)reflex::AbstractMatcherinline
lines()reflex::AbstractMatcherinline
lno_reflex::AbstractMatcherprotected
lpb_reflex::AbstractMatcherprotected
mat_reflex::AbstractMatcherprotected
match(Method method)reflex::BoostMatcherinlineprotectedvirtual
matches()reflex::AbstractMatcherinline
max_reflex::AbstractMatcherprotected
Method typedefreflex::AbstractMatcherprotected
more()reflex::AbstractMatcherinline
new_itr(Method method)reflex::BoostMatcherinlineprotected
num_reflex::AbstractMatcherprotected
operator size_t() const reflex::AbstractMatcherinline
operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline
operator std::string() const reflex::AbstractMatcherinline
operator std::wstring() const reflex::AbstractMatcherinline
operator!=(const char *rhs) const reflex::AbstractMatcherinline
operator!=(const std::string &rhs) const reflex::AbstractMatcherinline
operator!=(size_t rhs) const reflex::AbstractMatcherinline
operator!=(int rhs) const reflex::AbstractMatcherinline
operator=(const BoostMatcher &matcher)reflex::BoostMatcherinline
PatternMatcher< boost::regex >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inlinevirtual
operator==(const char *rhs) const reflex::AbstractMatcherinline
operator==(const std::string &rhs) const reflex::AbstractMatcherinline
operator==(size_t rhs) const reflex::AbstractMatcherinline
operator==(int rhs) const reflex::AbstractMatcherinline
operator[](size_t n) const reflex::BoostMatcherinlinevirtual
opt_reflex::AbstractMatcherprotected
own_reflex::PatternMatcher< boost::regex >protected
own_pattern() constreflex::PatternMatcher< boost::regex >inline
pair() const reflex::AbstractMatcherinline
pat_reflex::PatternMatcher< boost::regex >protected
Pattern typedefreflex::PatternMatcher< boost::regex >
pattern(const BoostMatcher &matcher)reflex::BoostMatcherinlinevirtual
pattern(const Pattern &pattern)reflex::BoostMatcherinlinevirtual
pattern(const Pattern *pattern)reflex::BoostMatcherinlinevirtual
pattern(const char *pattern)reflex::BoostMatcherinlinevirtual
pattern(const std::string &pattern)reflex::BoostMatcherinlinevirtual
PatternMatcher< boost::regex >::pattern(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inlinevirtual
PatternMatcher< boost::regex >::pattern(const Pattern &pattern)reflex::PatternMatcher< boost::regex >inlinevirtual
PatternMatcher< boost::regex >::pattern(const Pattern *pattern)reflex::PatternMatcher< boost::regex >inlinevirtual
PatternMatcher< boost::regex >::pattern() constreflex::PatternMatcher< boost::regex >inlinevirtual
PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inline
PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected
PatternMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected
PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected
PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected
peek()reflex::AbstractMatcherinline
peek_more()reflex::AbstractMatcherinlineprotected
pos_reflex::AbstractMatcherprotected
reset(const char *opt=NULL)reflex::BoostMatcherinlinevirtual
reset_text()reflex::AbstractMatcherinlineprotected
rest()reflex::AbstractMatcherinline
scanreflex::AbstractMatcher
set_bob(bool bob)reflex::AbstractMatcherinline
set_bol(bool bol)reflex::AbstractMatcherinline
set_current(size_t loc)reflex::AbstractMatcherinlineprotected
set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected
set_end(bool eof)reflex::AbstractMatcherinline
set_handler(Handler *handler)reflex::AbstractMatcherinline
size() const reflex::AbstractMatcherinline
skip(char c)reflex::AbstractMatcherinline
skip(wchar_t c)reflex::AbstractMatcherinline
skip(const char *s)reflex::AbstractMatcherinline
span()reflex::AbstractMatcherinline
splitreflex::AbstractMatcher
str() const reflex::AbstractMatcherinline
tabs(char n)reflex::AbstractMatcherinline
tabs()reflex::AbstractMatcherinline
text()reflex::AbstractMatcherinline
txt_reflex::AbstractMatcherprotected
unput(char c)reflex::AbstractMatcherinline
wchr() const reflex::AbstractMatcherinline
winput()reflex::AbstractMatcherinline
wline()reflex::AbstractMatcherinline
wpair() const reflex::AbstractMatcherinline
wrap()reflex::AbstractMatcherinlinevirtual
wsize() const reflex::AbstractMatcherinline
wstr() const reflex::AbstractMatcherinline
wunput(int c)reflex::AbstractMatcherinline
~AbstractMatcher()reflex::AbstractMatcherinlinevirtual
~PatternMatcher()reflex::PatternMatcher< boost::regex >inlinevirtual
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_boost_perl_matcher.html b/doc/html/classreflex_1_1_boost_perl_matcher.html index 097281cc5..6ea89de91 100644 --- a/doc/html/classreflex_1_1_boost_perl_matcher.html +++ b/doc/html/classreflex_1_1_boost_perl_matcher.html @@ -21,7 +21,7 @@
reflex::BoostPerlMatcher Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -173,9 +173,9 @@ virtual ~PatternMatcher ()  Delete matcher, deletes pattern when owned. More...
  -PatternMatcheroperator= (const PatternMatcher &matcher) - Assign a matcher, the underlying pattern object is shared (not deep copied). More...
-  +virtual PatternMatcheroperator= (const PatternMatcher &matcher) + Assign a matcher, the underlying pattern object is shared (not deep copied). More...
+  virtual PatternMatcherpattern (const PatternMatcher &matcher)  Set the pattern to use with this matcher as a shared pointer to another matcher pattern. More...
  @@ -185,9 +185,9 @@ virtual PatternMatcherpattern (const Pattern *pattern)  Set the pattern to use with this matcher (the given pattern is shared and must be persistent). More...
  -const Patternpattern () const - Returns a reference to the pattern object associated with this matcher. More...
-  +virtual const Patternpattern () const + Returns a reference to the pattern object associated with this matcher. More...
+  bool has_pattern () const  Returns true if this matcher has a pattern. More...
  @@ -267,6 +267,9 @@ int wchr () const  Returns the first wide character of the text matched. More...
  +void lineno_skip (bool f=false) + Set or reset mode to count matching lines only and skip other (e.g. for speed). More...
+  void lineno (size_t n)  Set or change the starting line number of the last match. More...
  @@ -351,6 +354,9 @@ const char * eol (bool inclusive=false)  Returns pointer to the end of the line (last char + 1) in the buffer containing the matched text, DANGER: invalidates previous bol() and text() pointers, use eol() before bol(), text(), begin(), and end() when those are used. More...
  +size_t fetch (size_t len) + Return number of bytes available given number of bytes to fetch ahead, limited by input size and buffer size. More...
+  size_t avail ()  Returns the number of bytes in the buffer available to search from the current begin()/text() position. More...
  @@ -598,6 +604,9 @@ bool mat_  true if AbstractMatcher::matches() was successful More...
  +bool cml_ + true when counting matching lines instead of line numbers More...

Detailed Description

Boost matcher engine class, extends reflex::BoostMatcher for Boost Perl regex matching.

@@ -744,7 +753,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_boost_posix_matcher-members.html b/doc/html/classreflex_1_1_boost_posix_matcher-members.html index 03e5c537b..b9bcf37c3 100644 --- a/doc/html/classreflex_1_1_boost_posix_matcher-members.html +++ b/doc/html/classreflex_1_1_boost_posix_matcher-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -87,20 +87,22 @@ chr() const reflex::AbstractMatcherinline chr_reflex::AbstractMatcherprotected clone()reflex::BoostMatcherinlinevirtual - cno_reflex::AbstractMatcherprotected - columno(size_t n)reflex::AbstractMatcherinline - columno()reflex::AbstractMatcherinline - columno_end()reflex::AbstractMatcherinline - columns()reflex::AbstractMatcherinline - const_iterator typedefreflex::AbstractMatcher - convert(T regex, convert_flag_type flags=convert_flag::none, bool *multiline=NULL)reflex::BoostPosixMatcherinlinestatic - cpb_reflex::AbstractMatcherprotected - cur_reflex::AbstractMatcherprotected - end() const reflex::AbstractMatcherinline - end_reflex::AbstractMatcherprotected - eof_reflex::AbstractMatcherprotected - eol(bool inclusive=false)reflex::AbstractMatcherinline - evh_reflex::AbstractMatcherprotected + cml_reflex::AbstractMatcherprotected + cno_reflex::AbstractMatcherprotected + columno(size_t n)reflex::AbstractMatcherinline + columno()reflex::AbstractMatcherinline + columno_end()reflex::AbstractMatcherinline + columns()reflex::AbstractMatcherinline + const_iterator typedefreflex::AbstractMatcher + convert(T regex, convert_flag_type flags=convert_flag::none, bool *multiline=NULL)reflex::BoostPosixMatcherinlinestatic + cpb_reflex::AbstractMatcherprotected + cur_reflex::AbstractMatcherprotected + end() const reflex::AbstractMatcherinline + end_reflex::AbstractMatcherprotected + eof_reflex::AbstractMatcherprotected + eol(bool inclusive=false)reflex::AbstractMatcherinline + evh_reflex::AbstractMatcherprotected + fetch(size_t len)reflex::AbstractMatcherinline fin_reflex::BoostMatcherprotected findreflex::AbstractMatcher first() const reflex::AbstractMatcherinline @@ -131,91 +133,92 @@ lineno(size_t n)reflex::AbstractMatcherinline lineno()reflex::AbstractMatcherinline lineno_end()reflex::AbstractMatcherinline - lines()reflex::AbstractMatcherinline - lno_reflex::AbstractMatcherprotected - lpb_reflex::AbstractMatcherprotected - mat_reflex::AbstractMatcherprotected - match(Method method)reflex::BoostMatcherinlineprotectedvirtual - matches()reflex::AbstractMatcherinline - max_reflex::AbstractMatcherprotected - Method typedefreflex::AbstractMatcherprotected - more()reflex::AbstractMatcherinline - new_itr(Method method)reflex::BoostMatcherinlineprotected - num_reflex::AbstractMatcherprotected - operator size_t() const reflex::AbstractMatcherinline - operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline - operator std::string() const reflex::AbstractMatcherinline - operator std::wstring() const reflex::AbstractMatcherinline - operator!=(const char *rhs) const reflex::AbstractMatcherinline - operator!=(const std::string &rhs) const reflex::AbstractMatcherinline - operator!=(size_t rhs) const reflex::AbstractMatcherinline - operator!=(int rhs) const reflex::AbstractMatcherinline - operator=(const BoostMatcher &matcher)reflex::BoostMatcherinline - PatternMatcher< boost::regex >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inline - operator==(const char *rhs) const reflex::AbstractMatcherinline - operator==(const std::string &rhs) const reflex::AbstractMatcherinline - operator==(size_t rhs) const reflex::AbstractMatcherinline - operator==(int rhs) const reflex::AbstractMatcherinline - operator[](size_t n) const reflex::BoostMatcherinlinevirtual - opt_reflex::AbstractMatcherprotected - own_reflex::PatternMatcher< boost::regex >protected - own_pattern() constreflex::PatternMatcher< boost::regex >inline - pair() const reflex::AbstractMatcherinline - pat_reflex::PatternMatcher< boost::regex >protected - Pattern typedefreflex::PatternMatcher< boost::regex > - pattern(const BoostMatcher &matcher)reflex::BoostMatcherinlinevirtual - pattern(const Pattern &pattern)reflex::BoostMatcherinlinevirtual - pattern(const Pattern *pattern)reflex::BoostMatcherinlinevirtual - pattern(const char *pattern)reflex::BoostMatcherinlinevirtual - pattern(const std::string &pattern)reflex::BoostMatcherinlinevirtual - PatternMatcher< boost::regex >::pattern(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inlinevirtual - PatternMatcher< boost::regex >::pattern(const Pattern &pattern)reflex::PatternMatcher< boost::regex >inlinevirtual - PatternMatcher< boost::regex >::pattern(const Pattern *pattern)reflex::PatternMatcher< boost::regex >inlinevirtual - PatternMatcher< boost::regex >::pattern() constreflex::PatternMatcher< boost::regex >inline - PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inline - PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected - PatternMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected - PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected - PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected - peek()reflex::AbstractMatcherinline - peek_more()reflex::AbstractMatcherinlineprotected - pos_reflex::AbstractMatcherprotected - reset(const char *opt=NULL)reflex::BoostMatcherinlinevirtual - reset_text()reflex::AbstractMatcherinlineprotected - rest()reflex::AbstractMatcherinline - scanreflex::AbstractMatcher - set_bob(bool bob)reflex::AbstractMatcherinline - set_bol(bool bol)reflex::AbstractMatcherinline - set_current(size_t loc)reflex::AbstractMatcherinlineprotected - set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected - set_end(bool eof)reflex::AbstractMatcherinline - set_handler(Handler *handler)reflex::AbstractMatcherinline - size() const reflex::AbstractMatcherinline - skip(char c)reflex::AbstractMatcherinline - skip(wchar_t c)reflex::AbstractMatcherinline - skip(const char *s)reflex::AbstractMatcherinline - span()reflex::AbstractMatcherinline - splitreflex::AbstractMatcher - str() const reflex::AbstractMatcherinline - tabs(char n)reflex::AbstractMatcherinline - tabs()reflex::AbstractMatcherinline - text()reflex::AbstractMatcherinline - txt_reflex::AbstractMatcherprotected - unput(char c)reflex::AbstractMatcherinline - wchr() const reflex::AbstractMatcherinline - winput()reflex::AbstractMatcherinline - wline()reflex::AbstractMatcherinline - wpair() const reflex::AbstractMatcherinline - wrap()reflex::AbstractMatcherinlinevirtual - wsize() const reflex::AbstractMatcherinline - wstr() const reflex::AbstractMatcherinline - wunput(int c)reflex::AbstractMatcherinline - ~AbstractMatcher()reflex::AbstractMatcherinlinevirtual - ~PatternMatcher()reflex::PatternMatcher< boost::regex >inlinevirtual + lineno_skip(bool f=false)reflex::AbstractMatcherinline + lines()reflex::AbstractMatcherinline + lno_reflex::AbstractMatcherprotected + lpb_reflex::AbstractMatcherprotected + mat_reflex::AbstractMatcherprotected + match(Method method)reflex::BoostMatcherinlineprotectedvirtual + matches()reflex::AbstractMatcherinline + max_reflex::AbstractMatcherprotected + Method typedefreflex::AbstractMatcherprotected + more()reflex::AbstractMatcherinline + new_itr(Method method)reflex::BoostMatcherinlineprotected + num_reflex::AbstractMatcherprotected + operator size_t() const reflex::AbstractMatcherinline + operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline + operator std::string() const reflex::AbstractMatcherinline + operator std::wstring() const reflex::AbstractMatcherinline + operator!=(const char *rhs) const reflex::AbstractMatcherinline + operator!=(const std::string &rhs) const reflex::AbstractMatcherinline + operator!=(size_t rhs) const reflex::AbstractMatcherinline + operator!=(int rhs) const reflex::AbstractMatcherinline + operator=(const BoostMatcher &matcher)reflex::BoostMatcherinline + PatternMatcher< boost::regex >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inlinevirtual + operator==(const char *rhs) const reflex::AbstractMatcherinline + operator==(const std::string &rhs) const reflex::AbstractMatcherinline + operator==(size_t rhs) const reflex::AbstractMatcherinline + operator==(int rhs) const reflex::AbstractMatcherinline + operator[](size_t n) const reflex::BoostMatcherinlinevirtual + opt_reflex::AbstractMatcherprotected + own_reflex::PatternMatcher< boost::regex >protected + own_pattern() constreflex::PatternMatcher< boost::regex >inline + pair() const reflex::AbstractMatcherinline + pat_reflex::PatternMatcher< boost::regex >protected + Pattern typedefreflex::PatternMatcher< boost::regex > + pattern(const BoostMatcher &matcher)reflex::BoostMatcherinlinevirtual + pattern(const Pattern &pattern)reflex::BoostMatcherinlinevirtual + pattern(const Pattern *pattern)reflex::BoostMatcherinlinevirtual + pattern(const char *pattern)reflex::BoostMatcherinlinevirtual + pattern(const std::string &pattern)reflex::BoostMatcherinlinevirtual + PatternMatcher< boost::regex >::pattern(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inlinevirtual + PatternMatcher< boost::regex >::pattern(const Pattern &pattern)reflex::PatternMatcher< boost::regex >inlinevirtual + PatternMatcher< boost::regex >::pattern(const Pattern *pattern)reflex::PatternMatcher< boost::regex >inlinevirtual + PatternMatcher< boost::regex >::pattern() constreflex::PatternMatcher< boost::regex >inlinevirtual + PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< boost::regex >inline + PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected + PatternMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected + PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected + PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< boost::regex >inlineprotected + peek()reflex::AbstractMatcherinline + peek_more()reflex::AbstractMatcherinlineprotected + pos_reflex::AbstractMatcherprotected + reset(const char *opt=NULL)reflex::BoostMatcherinlinevirtual + reset_text()reflex::AbstractMatcherinlineprotected + rest()reflex::AbstractMatcherinline + scanreflex::AbstractMatcher + set_bob(bool bob)reflex::AbstractMatcherinline + set_bol(bool bol)reflex::AbstractMatcherinline + set_current(size_t loc)reflex::AbstractMatcherinlineprotected + set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected + set_end(bool eof)reflex::AbstractMatcherinline + set_handler(Handler *handler)reflex::AbstractMatcherinline + size() const reflex::AbstractMatcherinline + skip(char c)reflex::AbstractMatcherinline + skip(wchar_t c)reflex::AbstractMatcherinline + skip(const char *s)reflex::AbstractMatcherinline + span()reflex::AbstractMatcherinline + splitreflex::AbstractMatcher + str() const reflex::AbstractMatcherinline + tabs(char n)reflex::AbstractMatcherinline + tabs()reflex::AbstractMatcherinline + text()reflex::AbstractMatcherinline + txt_reflex::AbstractMatcherprotected + unput(char c)reflex::AbstractMatcherinline + wchr() const reflex::AbstractMatcherinline + winput()reflex::AbstractMatcherinline + wline()reflex::AbstractMatcherinline + wpair() const reflex::AbstractMatcherinline + wrap()reflex::AbstractMatcherinlinevirtual + wsize() const reflex::AbstractMatcherinline + wstr() const reflex::AbstractMatcherinline + wunput(int c)reflex::AbstractMatcherinline + ~AbstractMatcher()reflex::AbstractMatcherinlinevirtual + ~PatternMatcher()reflex::PatternMatcher< boost::regex >inlinevirtual
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_boost_posix_matcher.html b/doc/html/classreflex_1_1_boost_posix_matcher.html index 4f7ee5265..84dfa7577 100644 --- a/doc/html/classreflex_1_1_boost_posix_matcher.html +++ b/doc/html/classreflex_1_1_boost_posix_matcher.html @@ -21,7 +21,7 @@
reflex::BoostPosixMatcher Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -174,9 +174,9 @@ virtual ~PatternMatcher ()  Delete matcher, deletes pattern when owned. More...
  -PatternMatcheroperator= (const PatternMatcher &matcher) - Assign a matcher, the underlying pattern object is shared (not deep copied). More...
-  +virtual PatternMatcheroperator= (const PatternMatcher &matcher) + Assign a matcher, the underlying pattern object is shared (not deep copied). More...
+  virtual PatternMatcherpattern (const PatternMatcher &matcher)  Set the pattern to use with this matcher as a shared pointer to another matcher pattern. More...
  @@ -186,9 +186,9 @@ virtual PatternMatcherpattern (const Pattern *pattern)  Set the pattern to use with this matcher (the given pattern is shared and must be persistent). More...
  -const Patternpattern () const - Returns a reference to the pattern object associated with this matcher. More...
-  +virtual const Patternpattern () const + Returns a reference to the pattern object associated with this matcher. More...
+  bool has_pattern () const  Returns true if this matcher has a pattern. More...
  @@ -268,6 +268,9 @@ int wchr () const  Returns the first wide character of the text matched. More...
  +void lineno_skip (bool f=false) + Set or reset mode to count matching lines only and skip other (e.g. for speed). More...
+  void lineno (size_t n)  Set or change the starting line number of the last match. More...
  @@ -352,6 +355,9 @@ const char * eol (bool inclusive=false)  Returns pointer to the end of the line (last char + 1) in the buffer containing the matched text, DANGER: invalidates previous bol() and text() pointers, use eol() before bol(), text(), begin(), and end() when those are used. More...
  +size_t fetch (size_t len) + Return number of bytes available given number of bytes to fetch ahead, limited by input size and buffer size. More...
+  size_t avail ()  Returns the number of bytes in the buffer available to search from the current begin()/text() position. More...
  @@ -606,6 +612,9 @@ bool mat_  true if AbstractMatcher::matches() was successful More...
  +bool cml_ + true when counting matching lines instead of line numbers More...

Detailed Description

Boost matcher engine class, extends reflex::BoostMatcher for Boost POSIX regex matching.

@@ -797,7 +806,7 @@

Member Function Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_buffered_input-members.html b/doc/html/classreflex_1_1_buffered_input-members.html index 7685e0a88..d1d5e9fc2 100644 --- a/doc/html/classreflex_1_1_buffered_input-members.html +++ b/doc/html/classreflex_1_1_buffered_input-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -124,7 +124,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_buffered_input.html b/doc/html/classreflex_1_1_buffered_input.html index 0dc8b3ac9..90bedd77e 100644 --- a/doc/html/classreflex_1_1_buffered_input.html +++ b/doc/html/classreflex_1_1_buffered_input.html @@ -21,7 +21,7 @@
reflex::BufferedInput Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -775,7 +775,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_buffered_input_1_1dos__streambuf-members.html b/doc/html/classreflex_1_1_buffered_input_1_1dos__streambuf-members.html index df7be0665..0fc49e205 100644 --- a/doc/html/classreflex_1_1_buffered_input_1_1dos__streambuf-members.html +++ b/doc/html/classreflex_1_1_buffered_input_1_1dos__streambuf-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -70,7 +70,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_buffered_input_1_1dos__streambuf.html b/doc/html/classreflex_1_1_buffered_input_1_1dos__streambuf.html index f5ef80e77..23704c9a1 100644 --- a/doc/html/classreflex_1_1_buffered_input_1_1dos__streambuf.html +++ b/doc/html/classreflex_1_1_buffered_input_1_1dos__streambuf.html @@ -21,7 +21,7 @@
reflex::BufferedInput::dos_streambuf Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -358,7 +358,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_buffered_input_1_1streambuf-members.html b/doc/html/classreflex_1_1_buffered_input_1_1streambuf-members.html index 734d45053..595366c71 100644 --- a/doc/html/classreflex_1_1_buffered_input_1_1streambuf-members.html +++ b/doc/html/classreflex_1_1_buffered_input_1_1streambuf-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -67,7 +67,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_buffered_input_1_1streambuf.html b/doc/html/classreflex_1_1_buffered_input_1_1streambuf.html index aaef9186a..bf0243e56 100644 --- a/doc/html/classreflex_1_1_buffered_input_1_1streambuf.html +++ b/doc/html/classreflex_1_1_buffered_input_1_1streambuf.html @@ -21,7 +21,7 @@
reflex::BufferedInput::streambuf Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -289,7 +289,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_flex_lexer-members.html b/doc/html/classreflex_1_1_flex_lexer-members.html index 73eff0d4b..bde74442d 100644 --- a/doc/html/classreflex_1_1_flex_lexer-members.html +++ b/doc/html/classreflex_1_1_flex_lexer-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -130,7 +130,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_flex_lexer.html b/doc/html/classreflex_1_1_flex_lexer.html index f5ddd4d14..bf356fc65 100644 --- a/doc/html/classreflex_1_1_flex_lexer.html +++ b/doc/html/classreflex_1_1_flex_lexer.html @@ -21,7 +21,7 @@
reflex::FlexLexer< M > Class Template Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -872,7 +872,7 @@

Member Function Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_flex_lexer_1_1_matcher-members.html b/doc/html/classreflex_1_1_flex_lexer_1_1_matcher-members.html index ac016303d..cd4aa3958 100644 --- a/doc/html/classreflex_1_1_flex_lexer_1_1_matcher-members.html +++ b/doc/html/classreflex_1_1_flex_lexer_1_1_matcher-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -67,7 +67,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_flex_lexer_1_1_matcher.html b/doc/html/classreflex_1_1_flex_lexer_1_1_matcher.html index 4841a2878..ca86c34e6 100644 --- a/doc/html/classreflex_1_1_flex_lexer_1_1_matcher.html +++ b/doc/html/classreflex_1_1_flex_lexer_1_1_matcher.html @@ -21,7 +21,7 @@
reflex::FlexLexer< M >::Matcher Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -320,7 +320,7 @@

Member Function Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_input-members.html b/doc/html/classreflex_1_1_input-members.html index af5c8b4bc..3e629f280 100644 --- a/doc/html/classreflex_1_1_input-members.html +++ b/doc/html/classreflex_1_1_input-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -111,7 +111,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_input.html b/doc/html/classreflex_1_1_input.html index 0795a45f4..ce6c5ed04 100644 --- a/doc/html/classreflex_1_1_input.html +++ b/doc/html/classreflex_1_1_input.html @@ -21,7 +21,7 @@
reflex::Input Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -1674,7 +1674,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_input_1_1dos__streambuf-members.html b/doc/html/classreflex_1_1_input_1_1dos__streambuf-members.html index dd7889e28..33668c95e 100644 --- a/doc/html/classreflex_1_1_input_1_1dos__streambuf-members.html +++ b/doc/html/classreflex_1_1_input_1_1dos__streambuf-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -69,7 +69,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_input_1_1dos__streambuf.html b/doc/html/classreflex_1_1_input_1_1dos__streambuf.html index 219b7a547..2034994e5 100644 --- a/doc/html/classreflex_1_1_input_1_1dos__streambuf.html +++ b/doc/html/classreflex_1_1_input_1_1dos__streambuf.html @@ -21,7 +21,7 @@
reflex::Input::dos_streambuf Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -331,7 +331,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_input_1_1streambuf-members.html b/doc/html/classreflex_1_1_input_1_1streambuf-members.html index 7fcb7ed88..cbde7da16 100644 --- a/doc/html/classreflex_1_1_input_1_1streambuf-members.html +++ b/doc/html/classreflex_1_1_input_1_1streambuf-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -67,7 +67,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_input_1_1streambuf.html b/doc/html/classreflex_1_1_input_1_1streambuf.html index 9ad548691..2b9b09eb1 100644 --- a/doc/html/classreflex_1_1_input_1_1streambuf.html +++ b/doc/html/classreflex_1_1_input_1_1streambuf.html @@ -21,7 +21,7 @@
reflex::Input::streambuf Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -284,7 +284,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_line_matcher-members.html b/doc/html/classreflex_1_1_line_matcher-members.html index 198308ab1..5e2f971e0 100644 --- a/doc/html/classreflex_1_1_line_matcher-members.html +++ b/doc/html/classreflex_1_1_line_matcher-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -80,19 +80,21 @@ chr() const reflex::AbstractMatcherinline chr_reflex::AbstractMatcherprotected clone()reflex::LineMatcherinlinevirtual - cno_reflex::AbstractMatcherprotected - columno(size_t n)reflex::AbstractMatcherinline - columno()reflex::AbstractMatcherinline - columno_end()reflex::AbstractMatcherinline - columns()reflex::AbstractMatcherinline - const_iterator typedefreflex::AbstractMatcher - cpb_reflex::AbstractMatcherprotected - cur_reflex::AbstractMatcherprotected - end() const reflex::AbstractMatcherinline - end_reflex::AbstractMatcherprotected - eof_reflex::AbstractMatcherprotected - eol(bool inclusive=false)reflex::AbstractMatcherinline - evh_reflex::AbstractMatcherprotected + cml_reflex::AbstractMatcherprotected + cno_reflex::AbstractMatcherprotected + columno(size_t n)reflex::AbstractMatcherinline + columno()reflex::AbstractMatcherinline + columno_end()reflex::AbstractMatcherinline + columns()reflex::AbstractMatcherinline + const_iterator typedefreflex::AbstractMatcher + cpb_reflex::AbstractMatcherprotected + cur_reflex::AbstractMatcherprotected + end() const reflex::AbstractMatcherinline + end_reflex::AbstractMatcherprotected + eof_reflex::AbstractMatcherprotected + eol(bool inclusive=false)reflex::AbstractMatcherinline + evh_reflex::AbstractMatcherprotected + fetch(size_t len)reflex::AbstractMatcherinline findreflex::AbstractMatcher first() const reflex::AbstractMatcherinline flush()reflex::AbstractMatcherinline @@ -121,72 +123,73 @@ lineno(size_t n)reflex::AbstractMatcherinline lineno()reflex::AbstractMatcherinline lineno_end()reflex::AbstractMatcherinline - lines()reflex::AbstractMatcherinline - lno_reflex::AbstractMatcherprotected - lpb_reflex::AbstractMatcherprotected - mat_reflex::AbstractMatcherprotected - match(Method method)reflex::LineMatcherinlineprotectedvirtual - matches()reflex::AbstractMatcherinline - max_reflex::AbstractMatcherprotected - Method typedefreflex::AbstractMatcherprotected - more()reflex::AbstractMatcherinline - num_reflex::AbstractMatcherprotected - operator size_t() const reflex::AbstractMatcherinline - operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline - operator std::string() const reflex::AbstractMatcherinline - operator std::wstring() const reflex::AbstractMatcherinline - operator!=(const char *rhs) const reflex::AbstractMatcherinline - operator!=(const std::string &rhs) const reflex::AbstractMatcherinline - operator!=(size_t rhs) const reflex::AbstractMatcherinline - operator!=(int rhs) const reflex::AbstractMatcherinline - operator=(const LineMatcher &matcher)reflex::LineMatcherinline - operator==(const char *rhs) const reflex::AbstractMatcherinline - operator==(const std::string &rhs) const reflex::AbstractMatcherinline - operator==(size_t rhs) const reflex::AbstractMatcherinline - operator==(int rhs) const reflex::AbstractMatcherinline - operator[](size_t) const reflex::LineMatcherinlinevirtual - opt_reflex::AbstractMatcherprotected - own_reflex::AbstractMatcherprotected - pair() const reflex::AbstractMatcherinline - peek()reflex::AbstractMatcherinline - peek_more()reflex::AbstractMatcherinlineprotected - pos_reflex::AbstractMatcherprotected - reset(const char *opt=NULL)reflex::LineMatcherinlinevirtual - reset_text()reflex::AbstractMatcherinlineprotected - rest()reflex::AbstractMatcherinline - scanreflex::AbstractMatcher - set_bob(bool bob)reflex::AbstractMatcherinline - set_bol(bool bol)reflex::AbstractMatcherinline - set_current(size_t loc)reflex::AbstractMatcherinlineprotected - set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected - set_end(bool eof)reflex::AbstractMatcherinline - set_handler(Handler *handler)reflex::AbstractMatcherinline - size() const reflex::AbstractMatcherinline - skip(char c)reflex::AbstractMatcherinline - skip(wchar_t c)reflex::AbstractMatcherinline - skip(const char *s)reflex::AbstractMatcherinline - span()reflex::AbstractMatcherinline - splitreflex::AbstractMatcher - str() const reflex::AbstractMatcherinline - tabs(char n)reflex::AbstractMatcherinline - tabs()reflex::AbstractMatcherinline - text()reflex::AbstractMatcherinline - txt_reflex::AbstractMatcherprotected - unput(char c)reflex::AbstractMatcherinline - wchr() const reflex::AbstractMatcherinline - winput()reflex::AbstractMatcherinline - wline()reflex::AbstractMatcherinline - wpair() const reflex::AbstractMatcherinline - wrap()reflex::AbstractMatcherinlinevirtual - wsize() const reflex::AbstractMatcherinline - wstr() const reflex::AbstractMatcherinline - wunput(int c)reflex::AbstractMatcherinline - ~AbstractMatcher()reflex::AbstractMatcherinlinevirtual - ~LineMatcher()reflex::LineMatcherinlinevirtual + lineno_skip(bool f=false)reflex::AbstractMatcherinline + lines()reflex::AbstractMatcherinline + lno_reflex::AbstractMatcherprotected + lpb_reflex::AbstractMatcherprotected + mat_reflex::AbstractMatcherprotected + match(Method method)reflex::LineMatcherinlineprotectedvirtual + matches()reflex::AbstractMatcherinline + max_reflex::AbstractMatcherprotected + Method typedefreflex::AbstractMatcherprotected + more()reflex::AbstractMatcherinline + num_reflex::AbstractMatcherprotected + operator size_t() const reflex::AbstractMatcherinline + operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline + operator std::string() const reflex::AbstractMatcherinline + operator std::wstring() const reflex::AbstractMatcherinline + operator!=(const char *rhs) const reflex::AbstractMatcherinline + operator!=(const std::string &rhs) const reflex::AbstractMatcherinline + operator!=(size_t rhs) const reflex::AbstractMatcherinline + operator!=(int rhs) const reflex::AbstractMatcherinline + operator=(const LineMatcher &matcher)reflex::LineMatcherinline + operator==(const char *rhs) const reflex::AbstractMatcherinline + operator==(const std::string &rhs) const reflex::AbstractMatcherinline + operator==(size_t rhs) const reflex::AbstractMatcherinline + operator==(int rhs) const reflex::AbstractMatcherinline + operator[](size_t) const reflex::LineMatcherinlinevirtual + opt_reflex::AbstractMatcherprotected + own_reflex::AbstractMatcherprotected + pair() const reflex::AbstractMatcherinline + peek()reflex::AbstractMatcherinline + peek_more()reflex::AbstractMatcherinlineprotected + pos_reflex::AbstractMatcherprotected + reset(const char *opt=NULL)reflex::LineMatcherinlinevirtual + reset_text()reflex::AbstractMatcherinlineprotected + rest()reflex::AbstractMatcherinline + scanreflex::AbstractMatcher + set_bob(bool bob)reflex::AbstractMatcherinline + set_bol(bool bol)reflex::AbstractMatcherinline + set_current(size_t loc)reflex::AbstractMatcherinlineprotected + set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected + set_end(bool eof)reflex::AbstractMatcherinline + set_handler(Handler *handler)reflex::AbstractMatcherinline + size() const reflex::AbstractMatcherinline + skip(char c)reflex::AbstractMatcherinline + skip(wchar_t c)reflex::AbstractMatcherinline + skip(const char *s)reflex::AbstractMatcherinline + span()reflex::AbstractMatcherinline + splitreflex::AbstractMatcher + str() const reflex::AbstractMatcherinline + tabs(char n)reflex::AbstractMatcherinline + tabs()reflex::AbstractMatcherinline + text()reflex::AbstractMatcherinline + txt_reflex::AbstractMatcherprotected + unput(char c)reflex::AbstractMatcherinline + wchr() const reflex::AbstractMatcherinline + winput()reflex::AbstractMatcherinline + wline()reflex::AbstractMatcherinline + wpair() const reflex::AbstractMatcherinline + wrap()reflex::AbstractMatcherinlinevirtual + wsize() const reflex::AbstractMatcherinline + wstr() const reflex::AbstractMatcherinline + wunput(int c)reflex::AbstractMatcherinline + ~AbstractMatcher()reflex::AbstractMatcherinlinevirtual + ~LineMatcher()reflex::LineMatcherinlinevirtual
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_line_matcher.html b/doc/html/classreflex_1_1_line_matcher.html index ab86142b5..d36a7fa5c 100644 --- a/doc/html/classreflex_1_1_line_matcher.html +++ b/doc/html/classreflex_1_1_line_matcher.html @@ -21,7 +21,7 @@
reflex::LineMatcher Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -192,6 +192,9 @@ int wchr () const  Returns the first wide character of the text matched. More...
  +void lineno_skip (bool f=false) + Set or reset mode to count matching lines only and skip other (e.g. for speed). More...
+  void lineno (size_t n)  Set or change the starting line number of the last match. More...
  @@ -276,6 +279,9 @@ const char * eol (bool inclusive=false)  Returns pointer to the end of the line (last char + 1) in the buffer containing the matched text, DANGER: invalidates previous bol() and text() pointers, use eol() before bol(), text(), begin(), and end() when those are used. More...
  +size_t fetch (size_t len) + Return number of bytes available given number of bytes to fetch ahead, limited by input size and buffer size. More...
+  size_t avail ()  Returns the number of bytes in the buffer available to search from the current begin()/text() position. More...
  @@ -462,6 +468,9 @@ bool mat_  true if AbstractMatcher::matches() was successful More...
  +bool cml_ + true when counting matching lines instead of line numbers More...
+  @@ -830,7 +839,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_matcher-members.html b/doc/html/classreflex_1_1_matcher-members.html index 91ee9f65a..edd2e8055 100644 --- a/doc/html/classreflex_1_1_matcher-members.html +++ b/doc/html/classreflex_1_1_matcher-members.html @@ -21,7 +21,7 @@
@@ -60,29 +60,71 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -101,51 +143,53 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -160,74 +204,116 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -259,7 +345,7 @@

Additional Inherited Members

Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
AbstractMatcher(const Input &input, const char *opt)reflex::AbstractMatcherinline
AbstractMatcher(const Input &input, const Option &opt)reflex::AbstractMatcherinline
accept() const reflex::AbstractMatcherinline
advance()reflex::Matcherprotected
after()reflex::AbstractMatcherinline
anc_reflex::Matcherprotected
at_bob() const reflex::AbstractMatcherinline
at_bol() const reflex::AbstractMatcherinline
at_bow()reflex::AbstractMatcherinline
at_end()reflex::AbstractMatcherinline
at_eow()reflex::AbstractMatcherinline
avail()reflex::AbstractMatcherinline
before()reflex::AbstractMatcherinline
begin() const reflex::AbstractMatcherinline
blk_reflex::AbstractMatcherprotected
bol()reflex::AbstractMatcherinline
bol_reflex::AbstractMatcherprotected
border()reflex::AbstractMatcherinline
buf_reflex::AbstractMatcherprotected
buffer(size_t blk=0)reflex::AbstractMatcherinline
buffer(char *base, size_t size)reflex::AbstractMatcherinline
cap_reflex::AbstractMatcherprotected
chr() const reflex::AbstractMatcherinline
chr_reflex::AbstractMatcherprotected
clear_stops()reflex::Matcherinline
clone()reflex::Matcherinlinevirtual
adv_reflex::Matcherprotected
advance_char(size_t loc)reflex::Matcherprotected
advance_char_pma(size_t loc)reflex::Matcherprotected
advance_char_pmh(size_t loc)reflex::Matcherprotected
advance_chars(size_t loc)reflex::Matcherprotected
advance_chars_pma(size_t loc)reflex::Matcherprotected
advance_chars_pmh(size_t loc)reflex::Matcherprotected
advance_none(size_t loc)reflex::Matcherprotected
advance_pattern(size_t loc)reflex::Matcherprotected
advance_pattern_min1(size_t loc)reflex::Matcherprotected
advance_pattern_min2(size_t loc)reflex::Matcherprotected
advance_pattern_min3(size_t loc)reflex::Matcherprotected
advance_pattern_min4(size_t loc)reflex::Matcherprotected
advance_pattern_pin1_pma(size_t loc)reflex::Matcherprotected
advance_pattern_pin1_pmh(size_t loc)reflex::Matcherprotected
advance_pattern_pin2_one(size_t loc)reflex::Matcherprotected
advance_pattern_pin2_pma(size_t loc)reflex::Matcherprotected
advance_pattern_pin2_pmh(size_t loc)reflex::Matcherprotected
advance_pattern_pin3_one(size_t loc)reflex::Matcherprotected
advance_pattern_pin3_pma(size_t loc)reflex::Matcherprotected
advance_pattern_pin3_pmh(size_t loc)reflex::Matcherprotected
advance_pattern_pin4_one(size_t loc)reflex::Matcherprotected
advance_pattern_pin4_pma(size_t loc)reflex::Matcherprotected
advance_pattern_pin4_pmh(size_t loc)reflex::Matcherprotected
advance_pattern_pin5_one(size_t loc)reflex::Matcherprotected
advance_pattern_pin5_pma(size_t loc)reflex::Matcherprotected
advance_pattern_pin5_pmh(size_t loc)reflex::Matcherprotected
advance_pattern_pin6_one(size_t loc)reflex::Matcherprotected
advance_pattern_pin6_pma(size_t loc)reflex::Matcherprotected
advance_pattern_pin6_pmh(size_t loc)reflex::Matcherprotected
advance_pattern_pin7_one(size_t loc)reflex::Matcherprotected
advance_pattern_pin7_pma(size_t loc)reflex::Matcherprotected
advance_pattern_pin7_pmh(size_t loc)reflex::Matcherprotected
advance_pattern_pin8_one(size_t loc)reflex::Matcherprotected
advance_pattern_pin8_pma(size_t loc)reflex::Matcherprotected
advance_pattern_pin8_pmh(size_t loc)reflex::Matcherprotected
advance_string(size_t loc)reflex::Matcherprotected
advance_string_bm(size_t loc)reflex::Matcherprotected
advance_string_bm_pma(size_t loc)reflex::Matcherprotected
advance_string_bm_pmh(size_t loc)reflex::Matcherprotected
advance_string_pma(size_t loc)reflex::Matcherprotected
advance_string_pmh(size_t loc)reflex::Matcherprotected
after()reflex::AbstractMatcherinline
anc_reflex::Matcherprotected
at_bob() const reflex::AbstractMatcherinline
at_bol() const reflex::AbstractMatcherinline
at_bow()reflex::AbstractMatcherinline
at_end()reflex::AbstractMatcherinline
at_eow()reflex::AbstractMatcherinline
avail()reflex::AbstractMatcherinline
before()reflex::AbstractMatcherinline
begin() const reflex::AbstractMatcherinline
blk_reflex::AbstractMatcherprotected
bol()reflex::AbstractMatcherinline
bol_reflex::AbstractMatcherprotected
border()reflex::AbstractMatcherinline
buf_reflex::AbstractMatcherprotected
buffer(size_t blk=0)reflex::AbstractMatcherinline
buffer(char *base, size_t size)reflex::AbstractMatcherinline
cap_reflex::AbstractMatcherprotected
chr() const reflex::AbstractMatcherinline
chr_reflex::AbstractMatcherprotected
clear_stops()reflex::Matcherinline
clone()reflex::Matcherinlinevirtual
cml_reflex::AbstractMatcherprotected
cno_reflex::AbstractMatcherprotected
col_reflex::Matcherprotected
columno(size_t n)reflex::AbstractMatcherinline
eof_reflex::AbstractMatcherprotected
eol(bool inclusive=false)reflex::AbstractMatcherinline
evh_reflex::AbstractMatcherprotected
findreflex::AbstractMatcher
first() const reflex::AbstractMatcherinline
flush()reflex::AbstractMatcherinline
fsm_reflex::Matcherprotected
FSM_BACK(size_t pos)reflex::Matcherinline
FSM_CHAR()reflex::Matcherinline
FSM_DENT()reflex::Matcherinline
FSM_FIND()reflex::Matcherinline
FSM_HALT(int c1=AbstractMatcher::Const::UNK)reflex::Matcherinline
FSM_HEAD(Pattern::Lookahead la)reflex::Matcherinline
FSM_INIT(int &c1)reflex::Matcherinline
FSM_META_BOB()reflex::Matcherinline
FSM_META_BOL()reflex::Matcherinline
FSM_META_BWB()reflex::Matcherinline
FSM_META_BWE(int c0, int c1)reflex::Matcherinline
FSM_META_DED()reflex::Matcherinline
FSM_META_EOB(int c1)reflex::Matcherinline
FSM_META_EOL(int c1)reflex::Matcherinline
FSM_META_EWB()reflex::Matcherinline
FSM_META_EWE(int c0, int c1)reflex::Matcherinline
FSM_META_IND()reflex::Matcherinline
FSM_META_NWB()reflex::Matcherinline
FSM_META_NWE(int c0, int c1)reflex::Matcherinline
FSM_META_UND()reflex::Matcherinline
FSM_META_WBB()reflex::Matcherinline
FSM_META_WBE(int c0, int c1)reflex::Matcherinline
FSM_POSN()reflex::Matcherinline
FSM_REDO()reflex::Matcherinline
FSM_REDO(int c1)reflex::Matcherinline
FSM_TAIL(Pattern::Lookahead la)reflex::Matcherinline
FSM_TAKE(Pattern::Accept cap)reflex::Matcherinline
FSM_TAKE(Pattern::Accept cap, int c1)reflex::Matcherinline
get(char *s, size_t n)reflex::AbstractMatcherinlinevirtual
get()reflex::AbstractMatcherinlineprotected
get_more()reflex::AbstractMatcherinlineprotected
got_reflex::AbstractMatcherprotected
group_id()reflex::Matcherinlinevirtual
group_next_id()reflex::Matcherinlinevirtual
grow(size_t need=Const::BLOCK)reflex::AbstractMatcherinlineprotected
has_pattern() constreflex::PatternMatcher< reflex::Pattern >inline
hit_end() const reflex::AbstractMatcherinline
inreflex::AbstractMatcher
ind_reflex::AbstractMatcherprotected
indent()reflex::Matcherinlineprotected
init(const char *opt=NULL)reflex::AbstractMatcherinlineprotectedvirtual
fetch(size_t len)reflex::AbstractMatcherinline
findreflex::AbstractMatcher
first() const reflex::AbstractMatcherinline
flush()reflex::AbstractMatcherinline
fsm_reflex::Matcherprotected
FSM_BACK(size_t pos)reflex::Matcherinline
FSM_CHAR()reflex::Matcherinline
FSM_DENT()reflex::Matcherinline
FSM_FIND()reflex::Matcherinline
FSM_HALT(int c1=AbstractMatcher::Const::UNK)reflex::Matcherinline
FSM_HEAD(Pattern::Lookahead la)reflex::Matcherinline
FSM_INIT(int &c1)reflex::Matcherinline
FSM_META_BOB()reflex::Matcherinline
FSM_META_BOL()reflex::Matcherinline
FSM_META_BWB()reflex::Matcherinline
FSM_META_BWE(int c0, int c1)reflex::Matcherinline
FSM_META_DED()reflex::Matcherinline
FSM_META_EOB(int c1)reflex::Matcherinline
FSM_META_EOL(int c1)reflex::Matcherinline
FSM_META_EWB()reflex::Matcherinline
FSM_META_EWE(int c0, int c1)reflex::Matcherinline
FSM_META_IND()reflex::Matcherinline
FSM_META_NWB()reflex::Matcherinline
FSM_META_NWE(int c0, int c1)reflex::Matcherinline
FSM_META_UND()reflex::Matcherinline
FSM_META_WBB()reflex::Matcherinline
FSM_META_WBE(int c0, int c1)reflex::Matcherinline
FSM_POSN()reflex::Matcherinline
FSM_REDO()reflex::Matcherinline
FSM_REDO(int c1)reflex::Matcherinline
FSM_TAIL(Pattern::Lookahead la)reflex::Matcherinline
FSM_TAKE(Pattern::Accept cap)reflex::Matcherinline
FSM_TAKE(Pattern::Accept cap, int c1)reflex::Matcherinline
get(char *s, size_t n)reflex::AbstractMatcherinlinevirtual
get()reflex::AbstractMatcherinlineprotected
get_more()reflex::AbstractMatcherinlineprotected
got_reflex::AbstractMatcherprotected
group_id()reflex::Matcherinlinevirtual
group_next_id()reflex::Matcherinlinevirtual
grow(size_t need=Const::BLOCK)reflex::AbstractMatcherinlineprotected
has_pattern() constreflex::PatternMatcher< reflex::Pattern >inline
hit_end() const reflex::AbstractMatcherinline
inreflex::AbstractMatcher
ind_reflex::AbstractMatcherprotected
indent()reflex::Matcherinlineprotected
init(const char *opt=NULL)reflex::AbstractMatcherinlineprotectedvirtual
init_advance()reflex::Matcherprotected
input(const Input &input)reflex::AbstractMatcherinlinevirtual
input()reflex::AbstractMatcherinline
insert_stop(size_t n)reflex::Matcherinline
lineno(size_t n)reflex::AbstractMatcherinline
lineno()reflex::AbstractMatcherinline
lineno_end()reflex::AbstractMatcherinline
lines()reflex::AbstractMatcherinline
lno_reflex::AbstractMatcherprotected
lpb_reflex::AbstractMatcherprotected
mat_reflex::AbstractMatcherprotected
match(Method method)reflex::Matcherprotectedvirtual
Matcher()reflex::Matcherinline
Matcher(const Pattern *pattern, const Input &input=Input(), const char *opt=NULL)reflex::Matcherinline
Matcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::Matcherinline
Matcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::Matcherinline
Matcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::Matcherinline
Matcher(const Matcher &matcher)reflex::Matcherinline
matches()reflex::AbstractMatcherinline
max_reflex::AbstractMatcherprotected
Method typedefreflex::AbstractMatcherprotected
more()reflex::AbstractMatcherinline
mrk_reflex::Matcherprotected
newline()reflex::Matcherinlineprotected
nodent()reflex::Matcherinlineprotected
num_reflex::AbstractMatcherprotected
operator size_t() const reflex::AbstractMatcherinline
operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline
operator std::string() const reflex::AbstractMatcherinline
operator std::wstring() const reflex::AbstractMatcherinline
operator!=(const char *rhs) const reflex::AbstractMatcherinline
operator!=(const std::string &rhs) const reflex::AbstractMatcherinline
operator!=(size_t rhs) const reflex::AbstractMatcherinline
operator!=(int rhs) const reflex::AbstractMatcherinline
operator=(const Matcher &matcher)reflex::Matcherinline
PatternMatcher< reflex::Pattern >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< reflex::Pattern >inline
operator==(const char *rhs) const reflex::AbstractMatcherinline
operator==(const std::string &rhs) const reflex::AbstractMatcherinline
operator==(size_t rhs) const reflex::AbstractMatcherinline
operator==(int rhs) const reflex::AbstractMatcherinline
operator[](size_t n) const reflex::Matcherinlinevirtual
opt_reflex::AbstractMatcherprotected
own_reflex::PatternMatcher< reflex::Pattern >protected
own_pattern() constreflex::PatternMatcher< reflex::Pattern >inline
pair() const reflex::AbstractMatcherinline
pat_reflex::PatternMatcher< reflex::Pattern >protected
pattern(const PatternMatcher &matcher)reflex::PatternMatcher< reflex::Pattern >inlinevirtual
pattern(const Pattern &pattern)reflex::PatternMatcher< reflex::Pattern >inlinevirtual
pattern(const Pattern *pattern)reflex::PatternMatcher< reflex::Pattern >inlinevirtual
pattern(const char *pattern)reflex::PatternMatcher< reflex::Pattern >inlinevirtual
pattern(const std::string &pattern)reflex::PatternMatcher< reflex::Pattern >inlinevirtual
pattern() constreflex::PatternMatcher< reflex::Pattern >inline
Pattern typedefreflex::PatternMatcher< reflex::Pattern >
PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< reflex::Pattern >inline
PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< reflex::Pattern >inlineprotected
PatternMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< reflex::Pattern >inlineprotected
PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< reflex::Pattern >inlineprotected
PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< reflex::Pattern >inlineprotected
peek()reflex::AbstractMatcherinline
peek_more()reflex::AbstractMatcherinlineprotected
pop_stops()reflex::Matcherinline
pos_reflex::AbstractMatcherprotected
push_stops()reflex::Matcherinline
reset(const char *opt=NULL)reflex::Matcherinlinevirtual
reset_text()reflex::AbstractMatcherinlineprotected
rest()reflex::AbstractMatcherinline
scanreflex::AbstractMatcher
set_bob(bool bob)reflex::AbstractMatcherinline
set_bol(bool bol)reflex::AbstractMatcherinline
set_current(size_t loc)reflex::AbstractMatcherinlineprotected
set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected
set_end(bool eof)reflex::AbstractMatcherinline
set_handler(Handler *handler)reflex::AbstractMatcherinline
simd_advance_avx2()reflex::Matcherprotected
simd_advance_avx512bw()reflex::Matcherprotected
lineno_skip(bool f=false)reflex::AbstractMatcherinline
lines()reflex::AbstractMatcherinline
lno_reflex::AbstractMatcherprotected
lpb_reflex::AbstractMatcherprotected
mat_reflex::AbstractMatcherprotected
match(Method method)reflex::Matcherprotectedvirtual
Matcher()reflex::Matcherinline
Matcher(const Pattern *pattern, const Input &input=Input(), const char *opt=NULL)reflex::Matcherinline
Matcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::Matcherinline
Matcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::Matcherinline
Matcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::Matcherinline
Matcher(const Matcher &matcher)reflex::Matcherinline
matches()reflex::AbstractMatcherinline
max_reflex::AbstractMatcherprotected
Method typedefreflex::AbstractMatcherprotected
more()reflex::AbstractMatcherinline
mrk_reflex::Matcherprotected
newline()reflex::Matcherinlineprotected
nodent()reflex::Matcherinlineprotected
num_reflex::AbstractMatcherprotected
operator size_t() const reflex::AbstractMatcherinline
operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline
operator std::string() const reflex::AbstractMatcherinline
operator std::wstring() const reflex::AbstractMatcherinline
operator!=(const char *rhs) const reflex::AbstractMatcherinline
operator!=(const std::string &rhs) const reflex::AbstractMatcherinline
operator!=(size_t rhs) const reflex::AbstractMatcherinline
operator!=(int rhs) const reflex::AbstractMatcherinline
operator=(const Matcher &matcher)reflex::Matcherinline
PatternMatcher< reflex::Pattern >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< reflex::Pattern >inlinevirtual
operator==(const char *rhs) const reflex::AbstractMatcherinline
operator==(const std::string &rhs) const reflex::AbstractMatcherinline
operator==(size_t rhs) const reflex::AbstractMatcherinline
operator==(int rhs) const reflex::AbstractMatcherinline
operator[](size_t n) const reflex::Matcherinlinevirtual
opt_reflex::AbstractMatcherprotected
own_reflex::PatternMatcher< reflex::Pattern >protected
own_pattern() constreflex::PatternMatcher< reflex::Pattern >inline
pair() const reflex::AbstractMatcherinline
pat_reflex::PatternMatcher< reflex::Pattern >protected
Pattern typedefreflex::PatternMatcher< reflex::Pattern >
pattern(const Pattern &pattern)reflex::Matcherinlinevirtual
pattern(const Pattern *pattern)reflex::Matcherinlinevirtual
pattern(const char *pattern)reflex::Matcherinlinevirtual
pattern(const std::string &pattern)reflex::Matcherinlinevirtual
pattern() const reflex::Matcherinlinevirtual
PatternMatcher< reflex::Pattern >::pattern(const PatternMatcher &matcher)reflex::PatternMatcher< reflex::Pattern >inlinevirtual
PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< reflex::Pattern >inline
PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< reflex::Pattern >inlineprotected
PatternMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< reflex::Pattern >inlineprotected
PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< reflex::Pattern >inlineprotected
PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< reflex::Pattern >inlineprotected
peek()reflex::AbstractMatcherinline
peek_more()reflex::AbstractMatcherinlineprotected
pop_stops()reflex::Matcherinline
pos_reflex::AbstractMatcherprotected
push_stops()reflex::Matcherinline
reset(const char *opt=NULL)reflex::Matcherinlinevirtual
reset_text()reflex::AbstractMatcherinlineprotected
rest()reflex::AbstractMatcherinline
scanreflex::AbstractMatcher
set_bob(bool bob)reflex::AbstractMatcherinline
set_bol(bool bol)reflex::AbstractMatcherinline
set_current(size_t loc)reflex::AbstractMatcherinlineprotected
set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected
set_end(bool eof)reflex::AbstractMatcherinline
set_handler(Handler *handler)reflex::AbstractMatcherinline
simd_advance_chars_avx2(size_t loc)reflex::Matcherprotected
simd_advance_chars_avx512bw(size_t loc)reflex::Matcherprotected
simd_advance_chars_pma_avx2(size_t loc)reflex::Matcherprotected
simd_advance_chars_pma_avx512bw(size_t loc)reflex::Matcherprotected
simd_advance_chars_pmh_avx2(size_t loc)reflex::Matcherprotected
simd_advance_chars_pmh_avx512bw(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin16_one_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin16_pma_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin16_pmh_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin1_pma_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin1_pmh_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin2_one_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin2_pma_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin2_pmh_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin3_one_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin3_pma_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin3_pmh_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin4_one_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin4_pma_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin4_pmh_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin5_one_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin5_pma_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin5_pmh_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin6_one_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin6_pma_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin6_pmh_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin7_one_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin7_pma_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin7_pmh_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin8_one_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin8_pma_avx2(size_t loc)reflex::Matcherprotected
simd_advance_pattern_pin8_pmh_avx2(size_t loc)reflex::Matcherprotected
simd_advance_string_avx2(size_t loc)reflex::Matcherprotected
simd_advance_string_avx512bw(size_t loc)reflex::Matcherprotected
simd_advance_string_neon(const char *&s, const char *e)reflex::Matcherprotected
simd_advance_string_pma_avx2(size_t loc)reflex::Matcherprotected
simd_advance_string_pma_avx512bw(size_t loc)reflex::Matcherprotected
simd_advance_string_pma_neon(const char *&s, const char *e)reflex::Matcherprotected
simd_advance_string_pmh_avx2(size_t loc)reflex::Matcherprotected
simd_advance_string_pmh_avx512bw(size_t loc)reflex::Matcherprotected
simd_advance_string_pmh_neon(const char *&s, const char *e)reflex::Matcherprotected
simd_init_advance_avx2()reflex::Matcherprotected
simd_init_advance_avx512bw()reflex::Matcherprotected
simd_match_avx2(Method method)reflex::Matcherprotected
simd_match_avx512bw(Method method)reflex::Matcherprotected
size() const reflex::AbstractMatcherinline
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_matcher.html b/doc/html/classreflex_1_1_matcher.html index 9d83b3bca..f414f4bc8 100644 --- a/doc/html/classreflex_1_1_matcher.html +++ b/doc/html/classreflex_1_1_matcher.html @@ -21,7 +21,7 @@
reflex::Matcher Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -117,24 +117,39 @@  Matcher ()  Default constructor. More...
  - Matcher (const Pattern *pattern, const Input &input=Input(), const char *opt=NULL) + Matcher (const Pattern *pattern, const Input &input=Input(), const char *opt=NULL)  Construct matcher engine from a pattern, and an input character sequence. More...
  - Matcher (const char *pattern, const Input &input=Input(), const char *opt=NULL) + Matcher (const char *pattern, const Input &input=Input(), const char *opt=NULL)  Construct matcher engine from a string regex, and an input character sequence. More...
  - Matcher (const Pattern &pattern, const Input &input=Input(), const char *opt=NULL) + Matcher (const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)  Construct matcher engine from a pattern, and an input character sequence. More...
  - Matcher (const std::string &pattern, const Input &input=Input(), const char *opt=NULL) + Matcher (const std::string &pattern, const Input &input=Input(), const char *opt=NULL)  Construct matcher engine from a string regex, and an input character sequence. More...
   Matcher (const Matcher &matcher)  Copy constructor. More...
  Matcheroperator= (const Matcher &matcher) - Assign a matcher. More...
+ Assign a matcher, the underlying pattern string is shared (not deep copied). More...
  +Matcherpattern (const Pattern &pattern) + Set the pattern to use with this matcher (the given pattern is shared and must be persistent). More...
+  +Matcherpattern (const Pattern *pattern) + Set the pattern to use with this matcher (the given pattern is shared and must be persistent). More...
+  +Matcherpattern (const char *pattern) + Set the pattern from a regex string to use with this matcher. More...
+  +Matcherpattern (const std::string &pattern) + Set the pattern from a regex string to use with this matcher. More...
+  +virtual const Patternpattern () const + Returns a reference to the pattern associated with this matcher. More...
+  virtual Matcherclone ()  Polymorphic cloning. More...
  @@ -262,27 +277,12 @@ virtual ~PatternMatcher ()  Delete matcher, deletes pattern when owned. More...
  -PatternMatcheroperator= (const PatternMatcher &matcher) - Assign a matcher, the underlying pattern object is shared (not deep copied). More...
-  +virtual PatternMatcheroperator= (const PatternMatcher &matcher) + Assign a matcher, the underlying pattern object is shared (not deep copied). More...
+  virtual PatternMatcherpattern (const PatternMatcher &matcher)  Set the pattern to use with this matcher as a shared pointer to another matcher pattern. More...
  -virtual PatternMatcherpattern (const Pattern &pattern) - Set the pattern to use with this matcher (the given pattern is shared and must be persistent). More...
-  -virtual PatternMatcherpattern (const Pattern *pattern) - Set the pattern to use with this matcher (the given pattern is shared and must be persistent). More...
-  -virtual PatternMatcherpattern (const char *pattern) - Set the pattern from a regex string to use with this matcher. More...
-  -virtual PatternMatcherpattern (const std::string &pattern) - Set the pattern from a regex string to use with this matcher. More...
-  -const Patternpattern () const - Returns a reference to the pattern object associated with this matcher. More...
-  bool has_pattern () const  Returns true if this matcher has a pattern. More...
  @@ -362,6 +362,9 @@ int wchr () const  Returns the first wide character of the text matched. More...
  +void lineno_skip (bool f=false) + Set or reset mode to count matching lines only and skip other (e.g. for speed). More...
+  void lineno (size_t n)  Set or change the starting line number of the last match. More...
  @@ -446,6 +449,9 @@ const char * eol (bool inclusive=false)  Returns pointer to the end of the line (last char + 1) in the buffer containing the matched text, DANGER: invalidates previous bol() and text() pointers, use eol() before bol(), text(), begin(), and end() when those are used. More...
  +size_t fetch (size_t len) + Return number of bytes available given number of bytes to fetch ahead, limited by input size and buffer size. More...
+  size_t avail ()  Returns the number of bytes in the buffer available to search from the current begin()/text() position. More...
  @@ -550,15 +556,189 @@   size_t simd_match_avx2 (Method method)   -bool advance () - Returns true if able to advance to next possible match. More...
-  -bool simd_advance_avx512bw () - optimized AVX512BW version of advance() defined in matcher_avx512bw.cpp More...
-  -bool simd_advance_avx2 () - optimized AVX2 version of advance() defined in matcher_avx2.cpp More...
-  +void init_advance () + Initialize specialized (+ SSE2/NEON) pattern search methods to advance the engine to a possible match. More...
+  +void simd_init_advance_avx2 () + Initialize specialized AVX2 pattern search methods to advance the engine to a possible match. More...
+  +void simd_init_advance_avx512bw () + Initialize specialized AVX512BW pattern search methods to advance the engine to a possible match. More...
+  +bool advance_none (size_t loc) + Default method is none (unset) More...
+  +bool advance_pattern_pin1_pma (size_t loc) +  +bool advance_pattern_pin1_pmh (size_t loc) +  +bool advance_pattern_pin2_one (size_t loc) +  +bool advance_pattern_pin2_pma (size_t loc) +  +bool advance_pattern_pin2_pmh (size_t loc) +  +bool advance_pattern_pin3_one (size_t loc) +  +bool advance_pattern_pin3_pma (size_t loc) +  +bool advance_pattern_pin3_pmh (size_t loc) +  +bool advance_pattern_pin4_one (size_t loc) +  +bool advance_pattern_pin4_pma (size_t loc) +  +bool advance_pattern_pin4_pmh (size_t loc) +  +bool advance_pattern_pin5_one (size_t loc) +  +bool advance_pattern_pin5_pma (size_t loc) +  +bool advance_pattern_pin5_pmh (size_t loc) +  +bool advance_pattern_pin6_one (size_t loc) +  +bool advance_pattern_pin6_pma (size_t loc) +  +bool advance_pattern_pin6_pmh (size_t loc) +  +bool advance_pattern_pin7_one (size_t loc) +  +bool advance_pattern_pin7_pma (size_t loc) +  +bool advance_pattern_pin7_pmh (size_t loc) +  +bool advance_pattern_pin8_one (size_t loc) +  +bool advance_pattern_pin8_pma (size_t loc) +  +bool advance_pattern_pin8_pmh (size_t loc) +  +bool simd_advance_pattern_pin1_pma_avx2 (size_t loc) +  +bool simd_advance_pattern_pin1_pmh_avx2 (size_t loc) +  +bool simd_advance_pattern_pin2_one_avx2 (size_t loc) +  +bool simd_advance_pattern_pin2_pma_avx2 (size_t loc) +  +bool simd_advance_pattern_pin2_pmh_avx2 (size_t loc) +  +bool simd_advance_pattern_pin3_one_avx2 (size_t loc) +  +bool simd_advance_pattern_pin3_pma_avx2 (size_t loc) +  +bool simd_advance_pattern_pin3_pmh_avx2 (size_t loc) +  +bool simd_advance_pattern_pin4_one_avx2 (size_t loc) +  +bool simd_advance_pattern_pin4_pma_avx2 (size_t loc) +  +bool simd_advance_pattern_pin4_pmh_avx2 (size_t loc) +  +bool simd_advance_pattern_pin5_one_avx2 (size_t loc) +  +bool simd_advance_pattern_pin5_pma_avx2 (size_t loc) +  +bool simd_advance_pattern_pin5_pmh_avx2 (size_t loc) +  +bool simd_advance_pattern_pin6_one_avx2 (size_t loc) +  +bool simd_advance_pattern_pin6_pma_avx2 (size_t loc) +  +bool simd_advance_pattern_pin6_pmh_avx2 (size_t loc) +  +bool simd_advance_pattern_pin7_one_avx2 (size_t loc) +  +bool simd_advance_pattern_pin7_pma_avx2 (size_t loc) +  +bool simd_advance_pattern_pin7_pmh_avx2 (size_t loc) +  +bool simd_advance_pattern_pin8_one_avx2 (size_t loc) +  +bool simd_advance_pattern_pin8_pma_avx2 (size_t loc) +  +bool simd_advance_pattern_pin8_pmh_avx2 (size_t loc) +  +bool simd_advance_pattern_pin16_one_avx2 (size_t loc) +  +bool simd_advance_pattern_pin16_pma_avx2 (size_t loc) +  +bool simd_advance_pattern_pin16_pmh_avx2 (size_t loc) +  +bool advance_pattern_min1 (size_t loc) +  +bool advance_pattern_min2 (size_t loc) +  +bool advance_pattern_min3 (size_t loc) +  +bool advance_pattern_min4 (size_t loc) +  +bool advance_pattern (size_t loc) +  +bool advance_char (size_t loc) +  +bool advance_char_pma (size_t loc) +  +bool advance_char_pmh (size_t loc) +  +template<uint8_t LEN> +bool advance_chars (size_t loc) +  +template<uint8_t LEN> +bool advance_chars_pma (size_t loc) +  +template<uint8_t LEN> +bool advance_chars_pmh (size_t loc) +  +template<uint8_t LEN> +bool simd_advance_chars_avx2 (size_t loc) +  +template<uint8_t LEN> +bool simd_advance_chars_pma_avx2 (size_t loc) +  +template<uint8_t LEN> +bool simd_advance_chars_pmh_avx2 (size_t loc) +  +template<uint8_t LEN> +bool simd_advance_chars_avx512bw (size_t loc) +  +template<uint8_t LEN> +bool simd_advance_chars_pma_avx512bw (size_t loc) +  +template<uint8_t LEN> +bool simd_advance_chars_pmh_avx512bw (size_t loc) +  +bool advance_string (size_t loc) +  +bool advance_string_pma (size_t loc) +  +bool advance_string_pmh (size_t loc) +  +bool simd_advance_string_avx2 (size_t loc) +  +bool simd_advance_string_pma_avx2 (size_t loc) +  +bool simd_advance_string_pmh_avx2 (size_t loc) +  +bool simd_advance_string_avx512bw (size_t loc) +  +bool simd_advance_string_pma_avx512bw (size_t loc) +  +bool simd_advance_string_pmh_avx512bw (size_t loc) +  +bool simd_advance_string_neon (const char *&s, const char *e) +  +bool simd_advance_string_pma_neon (const char *&s, const char *e) +  +bool simd_advance_string_pmh_neon (const char *&s, const char *e) +  +bool advance_string_bm (size_t loc) +  +bool advance_string_bm_pma (size_t loc) +  +bool advance_string_bm_pmh (size_t loc) +  void newline ()  Update indentation column counter for indent() and dedent(). More...
  @@ -630,6 +810,9 @@ FSM fsm_  local state for FSM code More...
  +bool(Matcher::* adv_ )(size_t loc) + advance FIND More...
+  bool mrk_  indent or dedent in pattern found: should check and update indent stops More...
  @@ -713,6 +896,9 @@ bool mat_  true if AbstractMatcher::matches() was successful More...
  +bool cml_ + true when counting matching lines instead of line numbers More...
+  @@ -1022,7 +1208,7 @@

Constructor & Destructor Documentation

Member Function Documentation

- +

Additional Inherited Members

@@ -1030,9 +1216,10 @@

Member Function Documentation

- + - + +
bool reflex::Matcher::advance bool reflex::Matcher::advance_char ()size_t loc)
@@ -1043,12 +1230,9 @@

Member Function Documentation

-

Returns true if able to advance to next possible match.

-
Returns
true if possible match found
-
- +
@@ -1056,24 +1240,23 @@

Member Function Documentation

+protected
- + - + +
void reflex::Matcher::clear_stops bool reflex::Matcher::advance_char_pma ()size_t loc)
-inline
-

Clear indent stop positions.

-
- +
@@ -1081,122 +1264,101 @@

Member Function Documentation

+protected
- + - + +
virtual Matcher* reflex::Matcher::clone bool reflex::Matcher::advance_char_pmh ()size_t loc)
-inlinevirtual
-

Polymorphic cloning.

- -

Implements reflex::AbstractMatcher.

-
- +
-template<typename T >
+template<uint8_t LEN>
+protected
- + - - - - - - - - - - - - - - - - + + - -
static std::string reflex::Matcher::convert bool reflex::Matcher::advance_chars (regex,
convert_flag_type flags = convert_flag::none,
bool * multiline = NULL 
size_t loc) )
-inlinestatic
-

Convert a regex to an acceptable form, given the specified regex library signature "[decls:]escapes[?+]", see reflex::convert.

-
- +
+
+template<uint8_t LEN>
+protected
- + - + +
bool reflex::Matcher::dedent bool reflex::Matcher::advance_chars_pma ()size_t loc)
-inlineprotected
-

Returns true if looking at dedent.

-
Returns
true if dedent
-
- +
+
+template<uint8_t LEN>
+protected
- + - +
void reflex::Matcher::delete_stop bool reflex::Matcher::advance_chars_pmh ( size_t n)loc)
-inline
-

Remove all stop positions from position n and up until the last.

-
- +
@@ -1204,25 +1366,25 @@

Member Function Documentation

+protected
- + - +
void reflex::Matcher::FSM_BACK bool reflex::Matcher::advance_none ( size_t pos)loc)
-inline
-

FSM extra code BACK position to a previous position returned by FSM_POSN().

+

Default method is none (unset)

- +
@@ -1230,24 +1392,23 @@

Member Function Documentation

+protected
- + - + +
int reflex::Matcher::FSM_CHAR bool reflex::Matcher::advance_pattern ()size_t loc)
-inline
-

FSM code CHAR.

-
- +
@@ -1255,24 +1416,23 @@

Member Function Documentation

+protected
- + - + +
bool reflex::Matcher::FSM_DENT bool reflex::Matcher::advance_pattern_min1 ()size_t loc)
-inline
-

FSM code DENT.

-
- +
@@ -1280,24 +1440,23 @@

Member Function Documentation

+protected
- + - + +
void reflex::Matcher::FSM_FIND bool reflex::Matcher::advance_pattern_min2 ()size_t loc)
-inline
-

FSM code FIND.

-
- +
@@ -1305,25 +1464,23 @@

Member Function Documentation

+protected
- + - - + +
void reflex::Matcher::FSM_HALT bool reflex::Matcher::advance_pattern_min3 (int c1 = AbstractMatcher::Const::UNK)size_t loc)
-inline
-

FSM code HALT.

-
- +
@@ -1331,25 +1488,23 @@

Member Function Documentation

+protected
- + - - + +
void reflex::Matcher::FSM_HEAD bool reflex::Matcher::advance_pattern_min4 (Pattern::Lookahead la)size_t loc)
-inline
-

FSM code HEAD.

-
- +
@@ -1357,25 +1512,23 @@

Member Function Documentation

+protected
- + - - + +
void reflex::Matcher::FSM_INIT bool reflex::Matcher::advance_pattern_pin1_pma (int & c1)size_t loc)
-inline
-

FSM code INIT.

-
- +
@@ -1383,24 +1536,23 @@

Member Function Documentation

+protected
- + - + +
bool reflex::Matcher::FSM_META_BOB bool reflex::Matcher::advance_pattern_pin1_pmh ()size_t loc)
-inline
-

FSM code META BOB.

-
- +
@@ -1408,24 +1560,23 @@

Member Function Documentation

+protected
- + - + +
bool reflex::Matcher::FSM_META_BOL bool reflex::Matcher::advance_pattern_pin2_one ()size_t loc)
-inline
-

FSM code META BOL.

-
- +
@@ -1433,24 +1584,23 @@

Member Function Documentation

+protected
- + - + +
bool reflex::Matcher::FSM_META_BWB bool reflex::Matcher::advance_pattern_pin2_pma ()size_t loc)
-inline
-

FSM code META BWB.

-
- +
@@ -1458,35 +1608,23 @@

Member Function Documentation

+protected
- + - - - - - - - - - - + + - -
bool reflex::Matcher::FSM_META_BWE bool reflex::Matcher::advance_pattern_pin2_pmh (int c0,
int c1 
size_t loc) )
-inline
-

FSM code META BWE.

-
- +
@@ -1494,24 +1632,23 @@

Member Function Documentation

+protected
- + - + +
bool reflex::Matcher::FSM_META_DED bool reflex::Matcher::advance_pattern_pin3_one ()size_t loc)
-inline
-

FSM code META DED.

-
- +
@@ -1519,25 +1656,23 @@

Member Function Documentation

+protected
- + - - + +
bool reflex::Matcher::FSM_META_EOB bool reflex::Matcher::advance_pattern_pin3_pma (int c1)size_t loc)
-inline
-

FSM code META EOB.

-
- +
@@ -1545,25 +1680,23 @@

Member Function Documentation

+protected
- + - - + +
bool reflex::Matcher::FSM_META_EOL bool reflex::Matcher::advance_pattern_pin3_pmh (int c1)size_t loc)
-inline
-

FSM code META EOL.

-
- +
@@ -1571,24 +1704,23 @@

Member Function Documentation

+protected
- + - + +
bool reflex::Matcher::FSM_META_EWB bool reflex::Matcher::advance_pattern_pin4_one ()size_t loc)
-inline
-

FSM code META EWB.

-
- +
@@ -1596,35 +1728,23 @@

Member Function Documentation

+protected
- + - - - - - - - - - - + + - -
bool reflex::Matcher::FSM_META_EWE bool reflex::Matcher::advance_pattern_pin4_pma (int c0,
int c1 
size_t loc) )
-inline
-

FSM code META EWE.

-
- +
@@ -1632,24 +1752,23 @@

Member Function Documentation

+protected
- + - + +
bool reflex::Matcher::FSM_META_IND bool reflex::Matcher::advance_pattern_pin4_pmh ()size_t loc)
-inline
-

FSM code META IND.

-
- +
@@ -1657,24 +1776,23 @@

Member Function Documentation

+protected
- + - + +
bool reflex::Matcher::FSM_META_NWB bool reflex::Matcher::advance_pattern_pin5_one ()size_t loc)
-inline
-

FSM code META NWB.

-
- +
@@ -1682,35 +1800,23 @@

Member Function Documentation

+protected
- + - - - - - - - - - - + + - -
bool reflex::Matcher::FSM_META_NWE bool reflex::Matcher::advance_pattern_pin5_pma (int c0,
int c1 
size_t loc) )
-inline
-

FSM code META NWE.

-
- +
@@ -1718,24 +1824,2097 @@

Member Function Documentation

+ + +
- + - + + + + +
bool reflex::Matcher::FSM_META_UND bool reflex::Matcher::advance_pattern_pin5_pmh ()size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::advance_pattern_pin6_one (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::advance_pattern_pin6_pma (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::advance_pattern_pin6_pmh (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::advance_pattern_pin7_one (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::advance_pattern_pin7_pma (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::advance_pattern_pin7_pmh (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::advance_pattern_pin8_one (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::advance_pattern_pin8_pma (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::advance_pattern_pin8_pmh (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::advance_string (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::advance_string_bm (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::advance_string_bm_pma (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::advance_string_bm_pmh (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::advance_string_pma (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::advance_string_pmh (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void reflex::Matcher::clear_stops ()
+
+inline
+
+ +

Clear indent stop positions.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
virtual Matcher* reflex::Matcher::clone ()
+
+inlinevirtual
+
+ +

Polymorphic cloning.

+ +

Implements reflex::AbstractMatcher.

+ +
+
+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static std::string reflex::Matcher::convert (regex,
convert_flag_type flags = convert_flag::none,
bool * multiline = NULL 
)
+
+inlinestatic
+
+ +

Convert a regex to an acceptable form, given the specified regex library signature "[decls:]escapes[?+]", see reflex::convert.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool reflex::Matcher::dedent ()
+
+inlineprotected
+
+ +

Returns true if looking at dedent.

+
Returns
true if dedent
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void reflex::Matcher::delete_stop (size_t n)
+
+inline
+
+ +

Remove all stop positions from position n and up until the last.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void reflex::Matcher::FSM_BACK (size_t pos)
+
+inline
+
+ +

FSM extra code BACK position to a previous position returned by FSM_POSN().

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
int reflex::Matcher::FSM_CHAR ()
+
+inline
+
+ +

FSM code CHAR.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool reflex::Matcher::FSM_DENT ()
+
+inline
+
+ +

FSM code DENT.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void reflex::Matcher::FSM_FIND ()
+
+inline
+
+ +

FSM code FIND.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void reflex::Matcher::FSM_HALT (int c1 = AbstractMatcher::Const::UNK)
+
+inline
+
+ +

FSM code HALT.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void reflex::Matcher::FSM_HEAD (Pattern::Lookahead la)
+
+inline
+
+ +

FSM code HEAD.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void reflex::Matcher::FSM_INIT (int & c1)
+
+inline
+
+ +

FSM code INIT.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool reflex::Matcher::FSM_META_BOB ()
+
+inline
+
+ +

FSM code META BOB.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool reflex::Matcher::FSM_META_BOL ()
+
+inline
+
+ +

FSM code META BOL.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool reflex::Matcher::FSM_META_BWB ()
+
+inline
+
+ +

FSM code META BWB.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool reflex::Matcher::FSM_META_BWE (int c0,
int c1 
)
+
+inline
+
+ +

FSM code META BWE.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool reflex::Matcher::FSM_META_DED ()
+
+inline
+
+ +

FSM code META DED.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::FSM_META_EOB (int c1)
+
+inline
+
+ +

FSM code META EOB.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::FSM_META_EOL (int c1)
+
+inline
+
+ +

FSM code META EOL.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool reflex::Matcher::FSM_META_EWB ()
+
+inline
+
+ +

FSM code META EWB.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool reflex::Matcher::FSM_META_EWE (int c0,
int c1 
)
+
+inline
+
+ +

FSM code META EWE.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool reflex::Matcher::FSM_META_IND ()
+
+inline
+
+ +

FSM code META IND.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool reflex::Matcher::FSM_META_NWB ()
+
+inline
+
+ +

FSM code META NWB.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool reflex::Matcher::FSM_META_NWE (int c0,
int c1 
)
+
+inline
+
+ +

FSM code META NWE.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool reflex::Matcher::FSM_META_UND ()
+
+inline
+
+ +

FSM code META UND.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool reflex::Matcher::FSM_META_WBB ()
+
+inline
+
+ +

FSM code META WBB.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool reflex::Matcher::FSM_META_WBE (int c0,
int c1 
)
+
+inline
+
+ +

FSM code META WBE.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t reflex::Matcher::FSM_POSN ()
+
+inline
+
+ +

FSM extra code POSN returns current position.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void reflex::Matcher::FSM_REDO ()
+
+inline
+
+ +

FSM code REDO.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void reflex::Matcher::FSM_REDO (int c1)
+
+inline
+
+ +

FSM code REDO.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void reflex::Matcher::FSM_TAIL (Pattern::Lookahead la)
+
+inline
+
+ +

FSM code TAIL.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void reflex::Matcher::FSM_TAKE (Pattern::Accept cap)
+
+inline
+
+ +

FSM code TAKE.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void reflex::Matcher::FSM_TAKE (Pattern::Accept cap,
int c1 
)
+
+inline
+
+ +

FSM code TAKE.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
virtual std::pair<size_t,const char*> reflex::Matcher::group_id ()
+
+inlinevirtual
+
+ +

Returns the group capture identifier containing the group capture index >0 and name (or NULL) of a named group capture, or (1,NULL) by default.

+
Returns
a pair of size_t and string
+ +

Implements reflex::AbstractMatcher.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
virtual std::pair<size_t,const char*> reflex::Matcher::group_next_id ()
+
+inlinevirtual
+
+ +

Returns the next group capture identifier containing the group capture index >0 and name (or NULL) of a named group capture, or (0,NULL) when no more groups matched.

+
Returns
(0,NULL)
+ +

Implements reflex::AbstractMatcher.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool reflex::Matcher::indent ()
+
+inlineprotected
+
+ +

Returns true if looking at indent.

+
Returns
true if indent
+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void reflex::Matcher::init_advance ()
+
+protected
+
+ +

Initialize specialized (+ SSE2/NEON) pattern search methods to advance the engine to a possible match.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void reflex::Matcher::insert_stop (size_t n)
+
+inline
+
+ +

Inserts or appends an indent stop position, keeping indent stops sorted.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
size_t reflex::Matcher::last_stop ()
+
+inline
+
+ +

Returns the position of the last indent stop.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
virtual size_t reflex::Matcher::match (Method method)
+
+protectedvirtual
+
+ +

Returns true if input matched the pattern using method Const::SCAN, Const::FIND, Const::SPLIT, or Const::MATCH.

+
Returns
nonzero if input matched the pattern
+
Parameters
+ + +
methodConst::SCAN, Const::FIND, Const::SPLIT, or Const::MATCH
+
+
+ +

Implements reflex::AbstractMatcher.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void reflex::Matcher::newline ()
+
+inlineprotected
+
+ +

Update indentation column counter for indent() and dedent().

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
bool reflex::Matcher::nodent ()
+
+inlineprotected
+
+ +

Returns true if nodent.

+
Returns
true if nodent
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
Matcher& reflex::Matcher::operator= (const Matchermatcher)
+
+inline
+
+ +

Assign a matcher, the underlying pattern string is shared (not deep copied).

+
Parameters
+ + +
matchermatcher to copy
+
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
virtual std::pair<const char*,size_t> reflex::Matcher::operator[] (size_t n) const
+
+inlinevirtual
+
+ +

Returns captured text as a std::pair<const char*,size_t> with string pointer (non-0-terminated) and length.

+ +

Implements reflex::AbstractMatcher.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
Matcher& reflex::Matcher::pattern (const Patternpattern)
+
+inlinevirtual
+
+ +

Set the pattern to use with this matcher (the given pattern is shared and must be persistent).

+
Returns
this matcher
+
Parameters
+ + +
patternpattern object for this matcher
+
+
+ +

Reimplemented from reflex::PatternMatcher< reflex::Pattern >.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
Matcher& reflex::Matcher::pattern (const Patternpattern)
+
+inlinevirtual
+
+ +

Set the pattern to use with this matcher (the given pattern is shared and must be persistent).

+
Returns
this matcher
+
Parameters
+ + +
patternpattern object for this matcher
+
+
+ +

Reimplemented from reflex::PatternMatcher< reflex::Pattern >.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
Matcher& reflex::Matcher::pattern (const char * pattern)
+
+inlinevirtual
+
+ +

Set the pattern from a regex string to use with this matcher.

+
Returns
this matcher
+
Parameters
+ + +
patternregex string to instantiate internal pattern object
+
+
+ +

Reimplemented from reflex::PatternMatcher< reflex::Pattern >.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
Matcher& reflex::Matcher::pattern (const std::string & pattern)
+
+inlinevirtual
+
+ +

Set the pattern from a regex string to use with this matcher.

+
Returns
this matcher
+
Parameters
+ + +
patternregex string to instantiate internal pattern object
+
+
+ +

Reimplemented from reflex::PatternMatcher< reflex::Pattern >.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
virtual const Pattern& reflex::Matcher::pattern () const
+
+inlinevirtual
+
+ +

Returns a reference to the pattern associated with this matcher.

+
Returns
reference to pattern
+ +

Reimplemented from reflex::PatternMatcher< reflex::Pattern >.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void reflex::Matcher::pop_stops ()
+
+inline
+
+ +

Pop indent stops.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void reflex::Matcher::push_stops ()
+
+inline
+
+ +

Push current indent stops and clear current indent stops.

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
virtual void reflex::Matcher::reset (const char * opt = NULL)
+
+inlinevirtual
+
+ +

Reset this matcher's state to the initial state.

+ +

Reimplemented from reflex::AbstractMatcher.

+ +
+
+ +
+
+
+template<uint8_t LEN>
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_chars_avx2 (size_t loc)
+
+protected
+
+ +
+
+ +
+
+
+template<uint8_t LEN>
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_chars_avx512bw (size_t loc)
+
+protected
+
+ +
+
+ +
+
+
+template<uint8_t LEN>
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_chars_pma_avx2 (size_t loc)
+
+protected
+
+ +
+
+ +
+
+
+template<uint8_t LEN>
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_chars_pma_avx512bw (size_t loc)
+
+protected
+
+ +
+
+ +
+
+
+template<uint8_t LEN>
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_chars_pmh_avx2 (size_t loc)
+
+protected
+
+ +
+
+ +
+
+
+template<uint8_t LEN>
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_chars_pmh_avx512bw (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_pattern_pin16_one_avx2 (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_pattern_pin16_pma_avx2 (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + +protected
+ + + + + +
bool reflex::Matcher::simd_advance_pattern_pin16_pmh_avx2 (size_t loc)
-inline
-

FSM code META UND.

+
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_pattern_pin1_pma_avx2 (size_t loc)
+
+protected
+
- +
@@ -1743,24 +3922,263 @@

Member Function Documentation

+protected
- + - + +
bool reflex::Matcher::FSM_META_WBB bool reflex::Matcher::simd_advance_pattern_pin1_pmh_avx2 ()size_t loc)
-inline
-

FSM code META WBB.

+
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_pattern_pin2_one_avx2 (size_t loc)
+
+protected
+
- + +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_pattern_pin2_pma_avx2 (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_pattern_pin2_pmh_avx2 (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_pattern_pin3_one_avx2 (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_pattern_pin3_pma_avx2 (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_pattern_pin3_pmh_avx2 (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_pattern_pin4_one_avx2 (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_pattern_pin4_pma_avx2 (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_pattern_pin4_pmh_avx2 (size_t loc)
+
+protected
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
bool reflex::Matcher::simd_advance_pattern_pin5_one_avx2 (size_t loc)
+
+protected
+
+ +
+
+
@@ -1768,35 +4186,23 @@

Member Function Documentation

+protected
- + - - - - - - - - - - + + - -
bool reflex::Matcher::FSM_META_WBE bool reflex::Matcher::simd_advance_pattern_pin5_pma_avx2 (int c0,
int c1 
size_t loc) )
-inline
-

FSM code META WBE.

-
- +
@@ -1804,24 +4210,23 @@

Member Function Documentation

+protected
- + - + +
size_t reflex::Matcher::FSM_POSN bool reflex::Matcher::simd_advance_pattern_pin5_pmh_avx2 ()size_t loc)
-inline
-

FSM extra code POSN returns current position.

-
- +
@@ -1829,24 +4234,23 @@

Member Function Documentation

+protected
- + - + +
void reflex::Matcher::FSM_REDO bool reflex::Matcher::simd_advance_pattern_pin6_one_avx2 ()size_t loc)
-inline
-

FSM code REDO.

-
- +
@@ -1854,25 +4258,23 @@

Member Function Documentation

+protected
- + - - + +
void reflex::Matcher::FSM_REDO bool reflex::Matcher::simd_advance_pattern_pin6_pma_avx2 (int c1)size_t loc)
-inline
-

FSM code REDO.

-
- +
@@ -1880,25 +4282,23 @@

Member Function Documentation

+protected
- + - - + +
void reflex::Matcher::FSM_TAIL bool reflex::Matcher::simd_advance_pattern_pin6_pmh_avx2 (Pattern::Lookahead la)size_t loc)
-inline
-

FSM code TAIL.

-
- +
@@ -1906,25 +4306,23 @@

Member Function Documentation

+protected
- + - - + +
void reflex::Matcher::FSM_TAKE bool reflex::Matcher::simd_advance_pattern_pin7_one_avx2 (Pattern::Accept cap)size_t loc)
-inline
-

FSM code TAKE.

-
- +
@@ -1932,35 +4330,23 @@

Member Function Documentation

+protected
- + - - - - - - - - - - + + - -
void reflex::Matcher::FSM_TAKE bool reflex::Matcher::simd_advance_pattern_pin7_pma_avx2 (Pattern::Accept cap,
int c1 
size_t loc) )
-inline
-

FSM code TAKE.

-
- +
@@ -1968,27 +4354,23 @@

Member Function Documentation

+protected
- + - + +
virtual std::pair<size_t,const char*> reflex::Matcher::group_id bool reflex::Matcher::simd_advance_pattern_pin7_pmh_avx2 ()size_t loc)
-inlinevirtual
-

Returns the group capture identifier containing the group capture index >0 and name (or NULL) of a named group capture, or (1,NULL) by default.

-
Returns
a pair of size_t and string
- -

Implements reflex::AbstractMatcher.

-
- +
@@ -1996,27 +4378,23 @@

Member Function Documentation

+protected
- + - + +
virtual std::pair<size_t,const char*> reflex::Matcher::group_next_id bool reflex::Matcher::simd_advance_pattern_pin8_one_avx2 ()size_t loc)
-inlinevirtual
-

Returns the next group capture identifier containing the group capture index >0 and name (or NULL) of a named group capture, or (0,NULL) when no more groups matched.

-
Returns
(0,NULL)
- -

Implements reflex::AbstractMatcher.

-
- +
@@ -2024,25 +4402,23 @@

Member Function Documentation

+protected
- + - + +
bool reflex::Matcher::indent bool reflex::Matcher::simd_advance_pattern_pin8_pma_avx2 ()size_t loc)
-inlineprotected
-

Returns true if looking at indent.

-
Returns
true if indent
-
- +
@@ -2050,25 +4426,23 @@

Member Function Documentation

+protected
- + - +
void reflex::Matcher::insert_stop bool reflex::Matcher::simd_advance_pattern_pin8_pmh_avx2 ( size_t n)loc)
-inline
-

Inserts or appends an indent stop position, keeping indent stops sorted.

-
- +
@@ -2076,24 +4450,23 @@

Member Function Documentation

+protected
- + - + +
size_t reflex::Matcher::last_stop bool reflex::Matcher::simd_advance_string_avx2 ()size_t loc)
-inline
-

Returns the position of the last indent stop.

-
- +
@@ -2101,34 +4474,23 @@

Member Function Documentation

+protected
- + - - + +
virtual size_t reflex::Matcher::match bool reflex::Matcher::simd_advance_string_avx512bw (Method method)size_t loc)
-protectedvirtual
-

Returns true if input matched the pattern using method Const::SCAN, Const::FIND, Const::SPLIT, or Const::MATCH.

-
Returns
nonzero if input matched the pattern
-
Parameters
- - -
methodConst::SCAN, Const::FIND, Const::SPLIT, or Const::MATCH
-
-
- -

Implements reflex::AbstractMatcher.

-
- +
@@ -2136,24 +4498,33 @@

Member Function Documentation

+protected
- + - + + + + + + + + + + + +
void reflex::Matcher::newline bool reflex::Matcher::simd_advance_string_neon ()const char *& s,
const char * e 
)
-inlineprotected
-

Update indentation column counter for indent() and dedent().

-
- +
@@ -2161,25 +4532,23 @@

Member Function Documentation

+protected
- + - + +
bool reflex::Matcher::nodent bool reflex::Matcher::simd_advance_string_pma_avx2 ()size_t loc)
-inlineprotected
-

Returns true if nodent.

-
Returns
true if nodent
-
- +
@@ -2187,31 +4556,23 @@

Member Function Documentation

+protected
- + - - + +
Matcher& reflex::Matcher::operator= bool reflex::Matcher::simd_advance_string_pma_avx512bw (const Matchermatcher)size_t loc)
-inline
-

Assign a matcher.

-
Parameters
- - -
matchermatcher to copy
-
-
-
- +
@@ -2219,27 +4580,33 @@

Member Function Documentation

+protected
- + - - - + + + + + + + + + + + + +
virtual std::pair<const char*,size_t> reflex::Matcher::operator[] bool reflex::Matcher::simd_advance_string_pma_neon (size_t n) constconst char *& s,
const char * e 
)
-inlinevirtual
-

Returns captured text as a std::pair<const char*,size_t> with string pointer (non-0-terminated) and length.

- -

Implements reflex::AbstractMatcher.

-
- +
@@ -2247,24 +4614,23 @@

Member Function Documentation

+protected
- + - + +
void reflex::Matcher::pop_stops bool reflex::Matcher::simd_advance_string_pmh_avx2 ()size_t loc)
-inline
-

Pop indent stops.

-
- +
@@ -2272,24 +4638,23 @@

Member Function Documentation

+protected
- + - + +
void reflex::Matcher::push_stops bool reflex::Matcher::simd_advance_string_pmh_avx512bw ()size_t loc)
-inline
-

Push current indent stops and clear current indent stops.

-
- +
@@ -2297,27 +4662,33 @@

Member Function Documentation

+protected
- + + + + + + + - + + + + +
virtual void reflex::Matcher::reset bool reflex::Matcher::simd_advance_string_pmh_neon (const char *& s,
const char * opt = NULL)e 
)
-inlinevirtual
-

Reset this matcher's state to the initial state.

- -

Reimplemented from reflex::AbstractMatcher.

-
- +
@@ -2325,7 +4696,7 @@

Member Function Documentation

@@ -1127,7 +1127,7 @@

Member Function Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_p_c_r_e2_matcher-members.html b/doc/html/classreflex_1_1_p_c_r_e2_matcher-members.html index e417c7238..adfacf3f4 100644 --- a/doc/html/classreflex_1_1_p_c_r_e2_matcher-members.html +++ b/doc/html/classreflex_1_1_p_c_r_e2_matcher-members.html @@ -21,7 +21,7 @@
@@ -80,24 +80,26 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -128,94 +130,95 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- + @@ -2338,11 +4709,11 @@

Member Function Documentation

bool reflex::Matcher::simd_advance_avx2 void reflex::Matcher::simd_init_advance_avx2 ( )
-

optimized AVX2 version of advance() defined in matcher_avx2.cpp

+

Initialize specialized AVX2 pattern search methods to advance the engine to a possible match.

- +
@@ -2350,7 +4721,7 @@

Member Function Documentation

@@ -106,7 +106,7 @@
- + @@ -2363,7 +4734,7 @@

Member Function Documentation

bool reflex::Matcher::simd_advance_avx512bw void reflex::Matcher::simd_init_advance_avx512bw ( )
-

optimized AVX512BW version of advance() defined in matcher_avx512bw.cpp

+

Initialize specialized AVX512BW pattern search methods to advance the engine to a possible match.

@@ -2442,6 +4813,28 @@

Member Function Documentation

Member Data Documentation

+ +
+
+ + + + + +
+ + + + +
bool(Matcher::* reflex::Matcher::adv_) (size_t loc)
+
+protected
+
+ +

advance FIND

+ +
+
@@ -2624,7 +5017,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_o_ranges-members.html b/doc/html/classreflex_1_1_o_ranges-members.html index 05ce46256..b2e847158 100644 --- a/doc/html/classreflex_1_1_o_ranges-members.html +++ b/doc/html/classreflex_1_1_o_ranges-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_o_ranges.html b/doc/html/classreflex_1_1_o_ranges.html index 16cf6e278..1254af5a8 100644 --- a/doc/html/classreflex_1_1_o_ranges.html +++ b/doc/html/classreflex_1_1_o_ranges.html @@ -21,7 +21,7 @@
reflex::ORanges< T > Class Template Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
chr() const reflex::AbstractMatcherinline
chr_reflex::AbstractMatcherprotected
clone()reflex::PCRE2Matcherinlinevirtual
cno_reflex::AbstractMatcherprotected
columno(size_t n)reflex::AbstractMatcherinline
columno()reflex::AbstractMatcherinline
columno_end()reflex::AbstractMatcherinline
columns()reflex::AbstractMatcherinline
compile()reflex::PCRE2Matcherinlineprotected
const_iterator typedefreflex::AbstractMatcher
convert(T regex, convert_flag_type flags=convert_flag::none, bool *multiline=NULL)reflex::PCRE2Matcherinlinestatic
cop_reflex::PCRE2Matcherprotected
cpb_reflex::AbstractMatcherprotected
ctx_reflex::PCRE2Matcherprotected
cur_reflex::AbstractMatcherprotected
dat_reflex::PCRE2Matcherprotected
end() const reflex::AbstractMatcherinline
end_reflex::AbstractMatcherprotected
eof_reflex::AbstractMatcherprotected
eol(bool inclusive=false)reflex::AbstractMatcherinline
evh_reflex::AbstractMatcherprotected
cml_reflex::AbstractMatcherprotected
cno_reflex::AbstractMatcherprotected
columno(size_t n)reflex::AbstractMatcherinline
columno()reflex::AbstractMatcherinline
columno_end()reflex::AbstractMatcherinline
columns()reflex::AbstractMatcherinline
compile()reflex::PCRE2Matcherinlineprotected
const_iterator typedefreflex::AbstractMatcher
convert(T regex, convert_flag_type flags=convert_flag::none, bool *multiline=NULL)reflex::PCRE2Matcherinlinestatic
cop_reflex::PCRE2Matcherprotected
cpb_reflex::AbstractMatcherprotected
ctx_reflex::PCRE2Matcherprotected
cur_reflex::AbstractMatcherprotected
dat_reflex::PCRE2Matcherprotected
end() const reflex::AbstractMatcherinline
end_reflex::AbstractMatcherprotected
eof_reflex::AbstractMatcherprotected
eol(bool inclusive=false)reflex::AbstractMatcherinline
evh_reflex::AbstractMatcherprotected
fetch(size_t len)reflex::AbstractMatcherinline
findreflex::AbstractMatcher
first() const reflex::AbstractMatcherinline
flg_reflex::PCRE2Matcherprotected
lineno(size_t n)reflex::AbstractMatcherinline
lineno()reflex::AbstractMatcherinline
lineno_end()reflex::AbstractMatcherinline
lines()reflex::AbstractMatcherinline
lno_reflex::AbstractMatcherprotected
lpb_reflex::AbstractMatcherprotected
mat_reflex::AbstractMatcherprotected
match(Method method)reflex::PCRE2Matcherinlineprotectedvirtual
matches()reflex::AbstractMatcherinline
max_reflex::AbstractMatcherprotected
Method typedefreflex::AbstractMatcherprotected
more()reflex::AbstractMatcherinline
next_match(Method method)reflex::PCRE2Matcherinlineprotected
num_reflex::AbstractMatcherprotected
opc_reflex::PCRE2Matcherprotected
operator size_t() const reflex::AbstractMatcherinline
operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline
operator std::string() const reflex::AbstractMatcherinline
operator std::wstring() const reflex::AbstractMatcherinline
operator!=(const char *rhs) const reflex::AbstractMatcherinline
operator!=(const std::string &rhs) const reflex::AbstractMatcherinline
operator!=(size_t rhs) const reflex::AbstractMatcherinline
operator!=(int rhs) const reflex::AbstractMatcherinline
operator=(const PCRE2Matcher &matcher)reflex::PCRE2Matcherinline
reflex::PatternMatcher< std::string >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< std::string >inline
operator==(const char *rhs) const reflex::AbstractMatcherinline
operator==(const std::string &rhs) const reflex::AbstractMatcherinline
operator==(size_t rhs) const reflex::AbstractMatcherinline
operator==(int rhs) const reflex::AbstractMatcherinline
operator[](size_t n) const reflex::PCRE2Matcherinlinevirtual
opt_reflex::AbstractMatcherprotected
own_reflex::PatternMatcher< std::string >protected
own_pattern() const reflex::PatternMatcher< std::string >inline
pair() const reflex::AbstractMatcherinline
pat_reflex::PatternMatcher< std::string >protected
lineno_skip(bool f=false)reflex::AbstractMatcherinline
lines()reflex::AbstractMatcherinline
lno_reflex::AbstractMatcherprotected
lpb_reflex::AbstractMatcherprotected
mat_reflex::AbstractMatcherprotected
match(Method method)reflex::PCRE2Matcherinlineprotectedvirtual
matches()reflex::AbstractMatcherinline
max_reflex::AbstractMatcherprotected
Method typedefreflex::AbstractMatcherprotected
more()reflex::AbstractMatcherinline
next_match(Method method)reflex::PCRE2Matcherinlineprotected
num_reflex::AbstractMatcherprotected
opc_reflex::PCRE2Matcherprotected
operator size_t() const reflex::AbstractMatcherinline
operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline
operator std::string() const reflex::AbstractMatcherinline
operator std::wstring() const reflex::AbstractMatcherinline
operator!=(const char *rhs) const reflex::AbstractMatcherinline
operator!=(const std::string &rhs) const reflex::AbstractMatcherinline
operator!=(size_t rhs) const reflex::AbstractMatcherinline
operator!=(int rhs) const reflex::AbstractMatcherinline
operator=(const PCRE2Matcher &matcher)reflex::PCRE2Matcherinline
reflex::PatternMatcher< std::string >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< std::string >inlinevirtual
operator==(const char *rhs) const reflex::AbstractMatcherinline
operator==(const std::string &rhs) const reflex::AbstractMatcherinline
operator==(size_t rhs) const reflex::AbstractMatcherinline
operator==(int rhs) const reflex::AbstractMatcherinline
operator[](size_t n) const reflex::PCRE2Matcherinlinevirtual
opt_reflex::AbstractMatcherprotected
own_reflex::PatternMatcher< std::string >protected
own_pattern() const reflex::PatternMatcher< std::string >inline
pair() const reflex::AbstractMatcherinline
pat_reflex::PatternMatcher< std::string >protected
Pattern typedefreflex::PatternMatcher< std::string >
pattern(const PCRE2Matcher &matcher)reflex::PCRE2Matcherinlinevirtual
pattern(const Pattern *pattern)reflex::PCRE2Matcherinlinevirtual
pattern(const char *pattern)reflex::PCRE2Matcherinlinevirtual
pattern(const std::string &pattern)reflex::PCRE2Matcherinlinevirtual
reflex::PatternMatcher< std::string >::pattern(const PatternMatcher &matcher)reflex::PatternMatcher< std::string >inlinevirtual
reflex::PatternMatcher< std::string >::pattern() const reflex::PatternMatcher< std::string >inline
Pattern typedefreflex::PatternMatcher< std::string >
PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< std::string >inline
PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected
PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected
PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected
PCRE2Matcher()reflex::PCRE2Matcherinline
PCRE2Matcher(const P *pattern, const Input &input=Input(), const char *opt=NULL, uint32_t options=0)reflex::PCRE2Matcherinline
PCRE2Matcher(const P &pattern, const Input &input=Input(), const char *opt=NULL, uint32_t options=0)reflex::PCRE2Matcherinline
PCRE2Matcher(const PCRE2Matcher &matcher)reflex::PCRE2Matcherinline
peek()reflex::AbstractMatcherinline
peek_more()reflex::AbstractMatcherinlineprotected
pos_reflex::AbstractMatcherprotected
reset(const char *opt=NULL)reflex::PCRE2Matcherinlinevirtual
reset_text()reflex::AbstractMatcherinlineprotected
rest()reflex::AbstractMatcherinline
scanreflex::AbstractMatcher
set_bob(bool bob)reflex::AbstractMatcherinline
set_bol(bool bol)reflex::AbstractMatcherinline
set_current(size_t loc)reflex::AbstractMatcherinlineprotected
set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected
set_end(bool eof)reflex::AbstractMatcherinline
set_handler(Handler *handler)reflex::AbstractMatcherinline
size() const reflex::AbstractMatcherinline
skip(char c)reflex::AbstractMatcherinline
skip(wchar_t c)reflex::AbstractMatcherinline
skip(const char *s)reflex::AbstractMatcherinline
span()reflex::AbstractMatcherinline
splitreflex::AbstractMatcher
stk_reflex::PCRE2Matcherprotected
str() const reflex::AbstractMatcherinline
tabs(char n)reflex::AbstractMatcherinline
tabs()reflex::AbstractMatcherinline
text()reflex::AbstractMatcherinline
txt_reflex::AbstractMatcherprotected
unput(char c)reflex::AbstractMatcherinline
wchr() const reflex::AbstractMatcherinline
winput()reflex::AbstractMatcherinline
wline()reflex::AbstractMatcherinline
wpair() const reflex::AbstractMatcherinline
wrap()reflex::AbstractMatcherinlinevirtual
wsize() const reflex::AbstractMatcherinline
wstr() const reflex::AbstractMatcherinline
wunput(int c)reflex::AbstractMatcherinline
~AbstractMatcher()reflex::AbstractMatcherinlinevirtual
~PatternMatcher()reflex::PatternMatcher< std::string >inlinevirtual
~PCRE2Matcher()reflex::PCRE2Matcherinlinevirtual
reflex::PatternMatcher< std::string >::pattern() const reflex::PatternMatcher< std::string >inlinevirtual
PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< std::string >inline
PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected
PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected
PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected
PCRE2Matcher()reflex::PCRE2Matcherinline
PCRE2Matcher(const P *pattern, const Input &input=Input(), const char *opt=NULL, uint32_t options=0)reflex::PCRE2Matcherinline
PCRE2Matcher(const P &pattern, const Input &input=Input(), const char *opt=NULL, uint32_t options=0)reflex::PCRE2Matcherinline
PCRE2Matcher(const PCRE2Matcher &matcher)reflex::PCRE2Matcherinline
peek()reflex::AbstractMatcherinline
peek_more()reflex::AbstractMatcherinlineprotected
pos_reflex::AbstractMatcherprotected
reset(const char *opt=NULL)reflex::PCRE2Matcherinlinevirtual
reset_text()reflex::AbstractMatcherinlineprotected
rest()reflex::AbstractMatcherinline
scanreflex::AbstractMatcher
set_bob(bool bob)reflex::AbstractMatcherinline
set_bol(bool bol)reflex::AbstractMatcherinline
set_current(size_t loc)reflex::AbstractMatcherinlineprotected
set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected
set_end(bool eof)reflex::AbstractMatcherinline
set_handler(Handler *handler)reflex::AbstractMatcherinline
size() const reflex::AbstractMatcherinline
skip(char c)reflex::AbstractMatcherinline
skip(wchar_t c)reflex::AbstractMatcherinline
skip(const char *s)reflex::AbstractMatcherinline
span()reflex::AbstractMatcherinline
splitreflex::AbstractMatcher
stk_reflex::PCRE2Matcherprotected
str() const reflex::AbstractMatcherinline
tabs(char n)reflex::AbstractMatcherinline
tabs()reflex::AbstractMatcherinline
text()reflex::AbstractMatcherinline
txt_reflex::AbstractMatcherprotected
unput(char c)reflex::AbstractMatcherinline
wchr() const reflex::AbstractMatcherinline
winput()reflex::AbstractMatcherinline
wline()reflex::AbstractMatcherinline
wpair() const reflex::AbstractMatcherinline
wrap()reflex::AbstractMatcherinlinevirtual
wsize() const reflex::AbstractMatcherinline
wstr() const reflex::AbstractMatcherinline
wunput(int c)reflex::AbstractMatcherinline
~AbstractMatcher()reflex::AbstractMatcherinlinevirtual
~PatternMatcher()reflex::PatternMatcher< std::string >inlinevirtual
~PCRE2Matcher()reflex::PCRE2Matcherinlinevirtual
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_p_c_r_e2_matcher.html b/doc/html/classreflex_1_1_p_c_r_e2_matcher.html index 92bc14526..08eb61349 100644 --- a/doc/html/classreflex_1_1_p_c_r_e2_matcher.html +++ b/doc/html/classreflex_1_1_p_c_r_e2_matcher.html @@ -21,7 +21,7 @@
reflex::PCRE2Matcher Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -152,9 +152,9 @@ virtual ~PatternMatcher ()  Delete matcher, deletes pattern when owned. More...
  -PatternMatcheroperator= (const PatternMatcher &matcher) - Assign a matcher, the underlying pattern string is shared (not deep copied). More...
-  +virtual PatternMatcheroperator= (const PatternMatcher &matcher) + Assign a matcher, the underlying pattern string is shared (not deep copied). More...
+  virtual PatternMatcherpattern (const PatternMatcher &matcher)  Set the pattern to use with this matcher as a shared pointer to another matcher pattern. More...
  @@ -164,9 +164,9 @@ bool own_pattern () const  Returns true if this matcher has its own pattern not received from another matcher (responsible to delete). More...
  -const Patternpattern () const - Returns a reference to the pattern string associated with this matcher. More...
-  +virtual const Patternpattern () const + Returns a reference to the pattern string associated with this matcher. More...
- Public Member Functions inherited from reflex::AbstractMatcher  AbstractMatcher (const Input &input, const char *opt)  Construct a base abstract matcher. More...
@@ -240,6 +240,9 @@ int wchr () const  Returns the first wide character of the text matched. More...
  +void lineno_skip (bool f=false) + Set or reset mode to count matching lines only and skip other (e.g. for speed). More...
+  void lineno (size_t n)  Set or change the starting line number of the last match. More...
  @@ -324,6 +327,9 @@ const char * eol (bool inclusive=false)  Returns pointer to the end of the line (last char + 1) in the buffer containing the matched text, DANGER: invalidates previous bol() and text() pointers, use eol() before bol(), text(), begin(), and end() when those are used. More...
  +size_t fetch (size_t len) + Return number of bytes available given number of bytes to fetch ahead, limited by input size and buffer size. More...
+  size_t avail ()  Returns the number of bytes in the buffer available to search from the current begin()/text() position. More...
  @@ -563,6 +569,9 @@ bool mat_  true if AbstractMatcher::matches() was successful More...
  +bool cml_ + true when counting matching lines instead of line numbers More...
+  @@ -1470,7 +1479,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_p_c_r_e2_u_t_f_matcher-members.html b/doc/html/classreflex_1_1_p_c_r_e2_u_t_f_matcher-members.html index 4657bf63e..244a10edf 100644 --- a/doc/html/classreflex_1_1_p_c_r_e2_u_t_f_matcher-members.html +++ b/doc/html/classreflex_1_1_p_c_r_e2_u_t_f_matcher-members.html @@ -21,7 +21,7 @@
@@ -80,24 +80,26 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -128,97 +130,98 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Additional Inherited Members

Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
chr() const reflex::AbstractMatcherinline
chr_reflex::AbstractMatcherprotected
clone()reflex::PCRE2Matcherinlinevirtual
cno_reflex::AbstractMatcherprotected
columno(size_t n)reflex::AbstractMatcherinline
columno()reflex::AbstractMatcherinline
columno_end()reflex::AbstractMatcherinline
columns()reflex::AbstractMatcherinline
compile()reflex::PCRE2Matcherinlineprotected
const_iterator typedefreflex::AbstractMatcher
convert(T regex, convert_flag_type flags=convert_flag::none, bool *multiline=NULL)reflex::PCRE2UTFMatcherinlinestatic
cop_reflex::PCRE2Matcherprotected
cpb_reflex::AbstractMatcherprotected
ctx_reflex::PCRE2Matcherprotected
cur_reflex::AbstractMatcherprotected
dat_reflex::PCRE2Matcherprotected
end() const reflex::AbstractMatcherinline
end_reflex::AbstractMatcherprotected
eof_reflex::AbstractMatcherprotected
eol(bool inclusive=false)reflex::AbstractMatcherinline
evh_reflex::AbstractMatcherprotected
cml_reflex::AbstractMatcherprotected
cno_reflex::AbstractMatcherprotected
columno(size_t n)reflex::AbstractMatcherinline
columno()reflex::AbstractMatcherinline
columno_end()reflex::AbstractMatcherinline
columns()reflex::AbstractMatcherinline
compile()reflex::PCRE2Matcherinlineprotected
const_iterator typedefreflex::AbstractMatcher
convert(T regex, convert_flag_type flags=convert_flag::none, bool *multiline=NULL)reflex::PCRE2UTFMatcherinlinestatic
cop_reflex::PCRE2Matcherprotected
cpb_reflex::AbstractMatcherprotected
ctx_reflex::PCRE2Matcherprotected
cur_reflex::AbstractMatcherprotected
dat_reflex::PCRE2Matcherprotected
end() const reflex::AbstractMatcherinline
end_reflex::AbstractMatcherprotected
eof_reflex::AbstractMatcherprotected
eol(bool inclusive=false)reflex::AbstractMatcherinline
evh_reflex::AbstractMatcherprotected
fetch(size_t len)reflex::AbstractMatcherinline
findreflex::AbstractMatcher
first() const reflex::AbstractMatcherinline
flg_reflex::PCRE2Matcherprotected
lineno(size_t n)reflex::AbstractMatcherinline
lineno()reflex::AbstractMatcherinline
lineno_end()reflex::AbstractMatcherinline
lines()reflex::AbstractMatcherinline
lno_reflex::AbstractMatcherprotected
lpb_reflex::AbstractMatcherprotected
mat_reflex::AbstractMatcherprotected
match(Method method)reflex::PCRE2Matcherinlineprotectedvirtual
matches()reflex::AbstractMatcherinline
max_reflex::AbstractMatcherprotected
Method typedefreflex::AbstractMatcherprotected
more()reflex::AbstractMatcherinline
next_match(Method method)reflex::PCRE2Matcherinlineprotected
num_reflex::AbstractMatcherprotected
opc_reflex::PCRE2Matcherprotected
operator size_t() const reflex::AbstractMatcherinline
operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline
operator std::string() const reflex::AbstractMatcherinline
operator std::wstring() const reflex::AbstractMatcherinline
operator!=(const char *rhs) const reflex::AbstractMatcherinline
operator!=(const std::string &rhs) const reflex::AbstractMatcherinline
operator!=(size_t rhs) const reflex::AbstractMatcherinline
operator!=(int rhs) const reflex::AbstractMatcherinline
operator=(const PCRE2Matcher &matcher)reflex::PCRE2Matcherinline
reflex::PatternMatcher< std::string >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< std::string >inline
operator==(const char *rhs) const reflex::AbstractMatcherinline
operator==(const std::string &rhs) const reflex::AbstractMatcherinline
operator==(size_t rhs) const reflex::AbstractMatcherinline
operator==(int rhs) const reflex::AbstractMatcherinline
operator[](size_t n) const reflex::PCRE2Matcherinlinevirtual
opt_reflex::AbstractMatcherprotected
own_reflex::PatternMatcher< std::string >protected
own_pattern() const reflex::PatternMatcher< std::string >inline
pair() const reflex::AbstractMatcherinline
pat_reflex::PatternMatcher< std::string >protected
pattern(const PCRE2Matcher &matcher)reflex::PCRE2Matcherinlinevirtual
pattern(const Pattern *pattern)reflex::PCRE2Matcherinlinevirtual
pattern(const char *pattern)reflex::PCRE2Matcherinlinevirtual
pattern(const std::string &pattern)reflex::PCRE2Matcherinlinevirtual
reflex::PatternMatcher< std::string >::pattern(const PatternMatcher &matcher)reflex::PatternMatcher< std::string >inlinevirtual
reflex::PatternMatcher< std::string >::pattern() const reflex::PatternMatcher< std::string >inline
Pattern typedefreflex::PatternMatcher< std::string >
PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< std::string >inline
PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected
PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected
PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected
PCRE2Matcher()reflex::PCRE2Matcherinline
PCRE2Matcher(const P *pattern, const Input &input=Input(), const char *opt=NULL, uint32_t options=0)reflex::PCRE2Matcherinline
PCRE2Matcher(const P &pattern, const Input &input=Input(), const char *opt=NULL, uint32_t options=0)reflex::PCRE2Matcherinline
PCRE2Matcher(const PCRE2Matcher &matcher)reflex::PCRE2Matcherinline
PCRE2UTFMatcher()reflex::PCRE2UTFMatcherinline
PCRE2UTFMatcher(const P *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PCRE2UTFMatcherinline
PCRE2UTFMatcher(const P &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PCRE2UTFMatcherinline
peek()reflex::AbstractMatcherinline
peek_more()reflex::AbstractMatcherinlineprotected
pos_reflex::AbstractMatcherprotected
reset(const char *opt=NULL)reflex::PCRE2Matcherinlinevirtual
reset_text()reflex::AbstractMatcherinlineprotected
rest()reflex::AbstractMatcherinline
scanreflex::AbstractMatcher
set_bob(bool bob)reflex::AbstractMatcherinline
set_bol(bool bol)reflex::AbstractMatcherinline
set_current(size_t loc)reflex::AbstractMatcherinlineprotected
set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected
set_end(bool eof)reflex::AbstractMatcherinline
set_handler(Handler *handler)reflex::AbstractMatcherinline
size() const reflex::AbstractMatcherinline
skip(char c)reflex::AbstractMatcherinline
skip(wchar_t c)reflex::AbstractMatcherinline
skip(const char *s)reflex::AbstractMatcherinline
span()reflex::AbstractMatcherinline
splitreflex::AbstractMatcher
stk_reflex::PCRE2Matcherprotected
str() const reflex::AbstractMatcherinline
tabs(char n)reflex::AbstractMatcherinline
tabs()reflex::AbstractMatcherinline
text()reflex::AbstractMatcherinline
txt_reflex::AbstractMatcherprotected
unput(char c)reflex::AbstractMatcherinline
wchr() const reflex::AbstractMatcherinline
winput()reflex::AbstractMatcherinline
wline()reflex::AbstractMatcherinline
wpair() const reflex::AbstractMatcherinline
wrap()reflex::AbstractMatcherinlinevirtual
wsize() const reflex::AbstractMatcherinline
wstr() const reflex::AbstractMatcherinline
wunput(int c)reflex::AbstractMatcherinline
~AbstractMatcher()reflex::AbstractMatcherinlinevirtual
~PatternMatcher()reflex::PatternMatcher< std::string >inlinevirtual
~PCRE2Matcher()reflex::PCRE2Matcherinlinevirtual
lineno_skip(bool f=false)reflex::AbstractMatcherinline
lines()reflex::AbstractMatcherinline
lno_reflex::AbstractMatcherprotected
lpb_reflex::AbstractMatcherprotected
mat_reflex::AbstractMatcherprotected
match(Method method)reflex::PCRE2Matcherinlineprotectedvirtual
matches()reflex::AbstractMatcherinline
max_reflex::AbstractMatcherprotected
Method typedefreflex::AbstractMatcherprotected
more()reflex::AbstractMatcherinline
next_match(Method method)reflex::PCRE2Matcherinlineprotected
num_reflex::AbstractMatcherprotected
opc_reflex::PCRE2Matcherprotected
operator size_t() const reflex::AbstractMatcherinline
operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline
operator std::string() const reflex::AbstractMatcherinline
operator std::wstring() const reflex::AbstractMatcherinline
operator!=(const char *rhs) const reflex::AbstractMatcherinline
operator!=(const std::string &rhs) const reflex::AbstractMatcherinline
operator!=(size_t rhs) const reflex::AbstractMatcherinline
operator!=(int rhs) const reflex::AbstractMatcherinline
operator=(const PCRE2Matcher &matcher)reflex::PCRE2Matcherinline
reflex::PatternMatcher< std::string >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< std::string >inlinevirtual
operator==(const char *rhs) const reflex::AbstractMatcherinline
operator==(const std::string &rhs) const reflex::AbstractMatcherinline
operator==(size_t rhs) const reflex::AbstractMatcherinline
operator==(int rhs) const reflex::AbstractMatcherinline
operator[](size_t n) const reflex::PCRE2Matcherinlinevirtual
opt_reflex::AbstractMatcherprotected
own_reflex::PatternMatcher< std::string >protected
own_pattern() const reflex::PatternMatcher< std::string >inline
pair() const reflex::AbstractMatcherinline
pat_reflex::PatternMatcher< std::string >protected
pattern(const PCRE2Matcher &matcher)reflex::PCRE2Matcherinlinevirtual
pattern(const Pattern *pattern)reflex::PCRE2Matcherinlinevirtual
pattern(const char *pattern)reflex::PCRE2Matcherinlinevirtual
pattern(const std::string &pattern)reflex::PCRE2Matcherinlinevirtual
reflex::PatternMatcher< std::string >::pattern(const PatternMatcher &matcher)reflex::PatternMatcher< std::string >inlinevirtual
reflex::PatternMatcher< std::string >::pattern() const reflex::PatternMatcher< std::string >inlinevirtual
Pattern typedefreflex::PatternMatcher< std::string >
PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< std::string >inline
PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected
PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected
PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected
PCRE2Matcher()reflex::PCRE2Matcherinline
PCRE2Matcher(const P *pattern, const Input &input=Input(), const char *opt=NULL, uint32_t options=0)reflex::PCRE2Matcherinline
PCRE2Matcher(const P &pattern, const Input &input=Input(), const char *opt=NULL, uint32_t options=0)reflex::PCRE2Matcherinline
PCRE2Matcher(const PCRE2Matcher &matcher)reflex::PCRE2Matcherinline
PCRE2UTFMatcher()reflex::PCRE2UTFMatcherinline
PCRE2UTFMatcher(const P *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PCRE2UTFMatcherinline
PCRE2UTFMatcher(const P &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PCRE2UTFMatcherinline
peek()reflex::AbstractMatcherinline
peek_more()reflex::AbstractMatcherinlineprotected
pos_reflex::AbstractMatcherprotected
reset(const char *opt=NULL)reflex::PCRE2Matcherinlinevirtual
reset_text()reflex::AbstractMatcherinlineprotected
rest()reflex::AbstractMatcherinline
scanreflex::AbstractMatcher
set_bob(bool bob)reflex::AbstractMatcherinline
set_bol(bool bol)reflex::AbstractMatcherinline
set_current(size_t loc)reflex::AbstractMatcherinlineprotected
set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected
set_end(bool eof)reflex::AbstractMatcherinline
set_handler(Handler *handler)reflex::AbstractMatcherinline
size() const reflex::AbstractMatcherinline
skip(char c)reflex::AbstractMatcherinline
skip(wchar_t c)reflex::AbstractMatcherinline
skip(const char *s)reflex::AbstractMatcherinline
span()reflex::AbstractMatcherinline
splitreflex::AbstractMatcher
stk_reflex::PCRE2Matcherprotected
str() const reflex::AbstractMatcherinline
tabs(char n)reflex::AbstractMatcherinline
tabs()reflex::AbstractMatcherinline
text()reflex::AbstractMatcherinline
txt_reflex::AbstractMatcherprotected
unput(char c)reflex::AbstractMatcherinline
wchr() const reflex::AbstractMatcherinline
winput()reflex::AbstractMatcherinline
wline()reflex::AbstractMatcherinline
wpair() const reflex::AbstractMatcherinline
wrap()reflex::AbstractMatcherinlinevirtual
wsize() const reflex::AbstractMatcherinline
wstr() const reflex::AbstractMatcherinline
wunput(int c)reflex::AbstractMatcherinline
~AbstractMatcher()reflex::AbstractMatcherinlinevirtual
~PatternMatcher()reflex::PatternMatcher< std::string >inlinevirtual
~PCRE2Matcher()reflex::PCRE2Matcherinlinevirtual
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_p_c_r_e2_u_t_f_matcher.html b/doc/html/classreflex_1_1_p_c_r_e2_u_t_f_matcher.html index 974d2594d..dee7e17c1 100644 --- a/doc/html/classreflex_1_1_p_c_r_e2_u_t_f_matcher.html +++ b/doc/html/classreflex_1_1_p_c_r_e2_u_t_f_matcher.html @@ -21,7 +21,7 @@
reflex::PCRE2UTFMatcher Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -163,9 +163,9 @@ virtual ~PatternMatcher ()  Delete matcher, deletes pattern when owned. More...
  -PatternMatcheroperator= (const PatternMatcher &matcher) - Assign a matcher, the underlying pattern string is shared (not deep copied). More...
-  +virtual PatternMatcheroperator= (const PatternMatcher &matcher) + Assign a matcher, the underlying pattern string is shared (not deep copied). More...
+  virtual PatternMatcherpattern (const PatternMatcher &matcher)  Set the pattern to use with this matcher as a shared pointer to another matcher pattern. More...
  @@ -175,9 +175,9 @@ bool own_pattern () const  Returns true if this matcher has its own pattern not received from another matcher (responsible to delete). More...
  -const Patternpattern () const - Returns a reference to the pattern string associated with this matcher. More...
-  +virtual const Patternpattern () const + Returns a reference to the pattern string associated with this matcher. More...
- Public Member Functions inherited from reflex::AbstractMatcher  AbstractMatcher (const Input &input, const char *opt)  Construct a base abstract matcher. More...
@@ -251,6 +251,9 @@ int wchr () const  Returns the first wide character of the text matched. More...
  +void lineno_skip (bool f=false) + Set or reset mode to count matching lines only and skip other (e.g. for speed). More...
+  void lineno (size_t n)  Set or change the starting line number of the last match. More...
  @@ -335,6 +338,9 @@ const char * eol (bool inclusive=false)  Returns pointer to the end of the line (last char + 1) in the buffer containing the matched text, DANGER: invalidates previous bol() and text() pointers, use eol() before bol(), text(), begin(), and end() when those are used. More...
  +size_t fetch (size_t len) + Return number of bytes available given number of bytes to fetch ahead, limited by input size and buffer size. More...
+  size_t avail ()  Returns the number of bytes in the buffer available to search from the current begin()/text() position. More...
  @@ -604,6 +610,9 @@ bool mat_  true if AbstractMatcher::matches() was successful More...
  +bool cml_ + true when counting matching lines instead of line numbers More...

Detailed Description

PCRE2 JIT-optimized native PCRE2_UTF+PCRE2_UCP matcher engine class, extends PCRE2Matcher.

@@ -800,7 +809,7 @@

Member Function Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_pattern-members.html b/doc/html/classreflex_1_1_pattern-members.html index f48a2870e..f49c00835 100644 --- a/doc/html/classreflex_1_1_pattern-members.html +++ b/doc/html/classreflex_1_1_pattern-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -257,7 +257,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_pattern.html b/doc/html/classreflex_1_1_pattern.html index 026c3a948..17e6a5288 100644 --- a/doc/html/classreflex_1_1_pattern.html +++ b/doc/html/classreflex_1_1_pattern.html @@ -21,7 +21,7 @@
reflex::Pattern Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -553,7 +553,7 @@  patterns after the prefix are at least this long but no more than 8 More...
  size_t pin_ - number of needles More...
+ number of needles, 0 to 16 More...
  std::bitset< 256 > cbk_  characters to look back over when lbk_ > 0, never includes
@@ -587,7 +587,7 @@  secondary least common character position in the pattern or 0xffff More...
  size_t bmd_ - Boyer-Moore jump distance on mismatch, B-M is enabled when bmd_ > 0. More...
+ Boyer-Moore jump distance on mismatch, B-M is enabled when bmd_ > 0 (<= 255) More...
  uint8_t bms_ [256]  Boyer-Moore skip array. More...
@@ -5120,7 +5120,7 @@

Member Data Documentation

-

Boyer-Moore jump distance on mismatch, B-M is enabled when bmd_ > 0.

+

Boyer-Moore jump distance on mismatch, B-M is enabled when bmd_ > 0 (<= 255)

@@ -5649,7 +5649,7 @@

Member Data Documentation

-

number of needles

+

number of needles, 0 to 16

@@ -5835,7 +5835,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_pattern_matcher-members.html b/doc/html/classreflex_1_1_pattern_matcher-members.html index d7308def1..50b8df7be 100644 --- a/doc/html/classreflex_1_1_pattern_matcher-members.html +++ b/doc/html/classreflex_1_1_pattern_matcher-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -80,19 +80,21 @@ chr() const reflex::AbstractMatcherinline chr_reflex::AbstractMatcherprotected clone()=0reflex::AbstractMatcherpure virtual - cno_reflex::AbstractMatcherprotected - columno(size_t n)reflex::AbstractMatcherinline - columno()reflex::AbstractMatcherinline - columno_end()reflex::AbstractMatcherinline - columns()reflex::AbstractMatcherinline - const_iterator typedefreflex::AbstractMatcher - cpb_reflex::AbstractMatcherprotected - cur_reflex::AbstractMatcherprotected - end() const reflex::AbstractMatcherinline - end_reflex::AbstractMatcherprotected - eof_reflex::AbstractMatcherprotected - eol(bool inclusive=false)reflex::AbstractMatcherinline - evh_reflex::AbstractMatcherprotected + cml_reflex::AbstractMatcherprotected + cno_reflex::AbstractMatcherprotected + columno(size_t n)reflex::AbstractMatcherinline + columno()reflex::AbstractMatcherinline + columno_end()reflex::AbstractMatcherinline + columns()reflex::AbstractMatcherinline + const_iterator typedefreflex::AbstractMatcher + cpb_reflex::AbstractMatcherprotected + cur_reflex::AbstractMatcherprotected + end() const reflex::AbstractMatcherinline + end_reflex::AbstractMatcherprotected + eof_reflex::AbstractMatcherprotected + eol(bool inclusive=false)reflex::AbstractMatcherinline + evh_reflex::AbstractMatcherprotected + fetch(size_t len)reflex::AbstractMatcherinline findreflex::AbstractMatcher first() const reflex::AbstractMatcherinline flush()reflex::AbstractMatcherinline @@ -119,86 +121,87 @@ lineno(size_t n)reflex::AbstractMatcherinline lineno()reflex::AbstractMatcherinline lineno_end()reflex::AbstractMatcherinline - lines()reflex::AbstractMatcherinline - lno_reflex::AbstractMatcherprotected - lpb_reflex::AbstractMatcherprotected - mat_reflex::AbstractMatcherprotected - match(Method method)=0reflex::AbstractMatcherprotectedpure virtual - matches()reflex::AbstractMatcherinline - max_reflex::AbstractMatcherprotected - Method typedefreflex::AbstractMatcherprotected - more()reflex::AbstractMatcherinline - num_reflex::AbstractMatcherprotected - operator size_t() const reflex::AbstractMatcherinline - operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline - operator std::string() const reflex::AbstractMatcherinline - operator std::wstring() const reflex::AbstractMatcherinline - operator!=(const char *rhs) const reflex::AbstractMatcherinline - operator!=(const std::string &rhs) const reflex::AbstractMatcherinline - operator!=(size_t rhs) const reflex::AbstractMatcherinline - operator!=(int rhs) const reflex::AbstractMatcherinline - operator=(const PatternMatcher &matcher)reflex::PatternMatcher< P >inline - operator==(const char *rhs) const reflex::AbstractMatcherinline - operator==(const std::string &rhs) const reflex::AbstractMatcherinline - operator==(size_t rhs) const reflex::AbstractMatcherinline - operator==(int rhs) const reflex::AbstractMatcherinline - operator[](size_t n) const =0reflex::AbstractMatcherpure virtual - opt_reflex::AbstractMatcherprotected - own_reflex::PatternMatcher< P >protected - own_pattern() const reflex::PatternMatcher< P >inline - pair() const reflex::AbstractMatcherinline - pat_reflex::PatternMatcher< P >protected - Pattern typedefreflex::PatternMatcher< P > - pattern(const PatternMatcher &matcher)reflex::PatternMatcher< P >inlinevirtual - pattern(const Pattern &pattern)reflex::PatternMatcher< P >inlinevirtual - pattern(const Pattern *pattern)reflex::PatternMatcher< P >inlinevirtual - pattern(const char *pattern)reflex::PatternMatcher< P >inlinevirtual - pattern(const std::string &pattern)reflex::PatternMatcher< P >inlinevirtual - pattern() const reflex::PatternMatcher< P >inline - PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< P >inline - PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< P >inlineprotected - PatternMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< P >inlineprotected - PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< P >inlineprotected - PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< P >inlineprotected - peek()reflex::AbstractMatcherinline - peek_more()reflex::AbstractMatcherinlineprotected - pos_reflex::AbstractMatcherprotected - reset(const char *opt=NULL)reflex::AbstractMatcherinlinevirtual - reset_text()reflex::AbstractMatcherinlineprotected - rest()reflex::AbstractMatcherinline - scanreflex::AbstractMatcher - set_bob(bool bob)reflex::AbstractMatcherinline - set_bol(bool bol)reflex::AbstractMatcherinline - set_current(size_t loc)reflex::AbstractMatcherinlineprotected - set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected - set_end(bool eof)reflex::AbstractMatcherinline - set_handler(Handler *handler)reflex::AbstractMatcherinline - size() const reflex::AbstractMatcherinline - skip(char c)reflex::AbstractMatcherinline - skip(wchar_t c)reflex::AbstractMatcherinline - skip(const char *s)reflex::AbstractMatcherinline - span()reflex::AbstractMatcherinline - splitreflex::AbstractMatcher - str() const reflex::AbstractMatcherinline - tabs(char n)reflex::AbstractMatcherinline - tabs()reflex::AbstractMatcherinline - text()reflex::AbstractMatcherinline - txt_reflex::AbstractMatcherprotected - unput(char c)reflex::AbstractMatcherinline - wchr() const reflex::AbstractMatcherinline - winput()reflex::AbstractMatcherinline - wline()reflex::AbstractMatcherinline - wpair() const reflex::AbstractMatcherinline - wrap()reflex::AbstractMatcherinlinevirtual - wsize() const reflex::AbstractMatcherinline - wstr() const reflex::AbstractMatcherinline - wunput(int c)reflex::AbstractMatcherinline - ~AbstractMatcher()reflex::AbstractMatcherinlinevirtual - ~PatternMatcher()reflex::PatternMatcher< P >inlinevirtual + lineno_skip(bool f=false)reflex::AbstractMatcherinline + lines()reflex::AbstractMatcherinline + lno_reflex::AbstractMatcherprotected + lpb_reflex::AbstractMatcherprotected + mat_reflex::AbstractMatcherprotected + match(Method method)=0reflex::AbstractMatcherprotectedpure virtual + matches()reflex::AbstractMatcherinline + max_reflex::AbstractMatcherprotected + Method typedefreflex::AbstractMatcherprotected + more()reflex::AbstractMatcherinline + num_reflex::AbstractMatcherprotected + operator size_t() const reflex::AbstractMatcherinline + operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline + operator std::string() const reflex::AbstractMatcherinline + operator std::wstring() const reflex::AbstractMatcherinline + operator!=(const char *rhs) const reflex::AbstractMatcherinline + operator!=(const std::string &rhs) const reflex::AbstractMatcherinline + operator!=(size_t rhs) const reflex::AbstractMatcherinline + operator!=(int rhs) const reflex::AbstractMatcherinline + operator=(const PatternMatcher &matcher)reflex::PatternMatcher< P >inlinevirtual + operator==(const char *rhs) const reflex::AbstractMatcherinline + operator==(const std::string &rhs) const reflex::AbstractMatcherinline + operator==(size_t rhs) const reflex::AbstractMatcherinline + operator==(int rhs) const reflex::AbstractMatcherinline + operator[](size_t n) const =0reflex::AbstractMatcherpure virtual + opt_reflex::AbstractMatcherprotected + own_reflex::PatternMatcher< P >protected + own_pattern() const reflex::PatternMatcher< P >inline + pair() const reflex::AbstractMatcherinline + pat_reflex::PatternMatcher< P >protected + Pattern typedefreflex::PatternMatcher< P > + pattern(const PatternMatcher &matcher)reflex::PatternMatcher< P >inlinevirtual + pattern(const Pattern &pattern)reflex::PatternMatcher< P >inlinevirtual + pattern(const Pattern *pattern)reflex::PatternMatcher< P >inlinevirtual + pattern(const char *pattern)reflex::PatternMatcher< P >inlinevirtual + pattern(const std::string &pattern)reflex::PatternMatcher< P >inlinevirtual + pattern() const reflex::PatternMatcher< P >inlinevirtual + PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< P >inline + PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< P >inlineprotected + PatternMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< P >inlineprotected + PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< P >inlineprotected + PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< P >inlineprotected + peek()reflex::AbstractMatcherinline + peek_more()reflex::AbstractMatcherinlineprotected + pos_reflex::AbstractMatcherprotected + reset(const char *opt=NULL)reflex::AbstractMatcherinlinevirtual + reset_text()reflex::AbstractMatcherinlineprotected + rest()reflex::AbstractMatcherinline + scanreflex::AbstractMatcher + set_bob(bool bob)reflex::AbstractMatcherinline + set_bol(bool bol)reflex::AbstractMatcherinline + set_current(size_t loc)reflex::AbstractMatcherinlineprotected + set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected + set_end(bool eof)reflex::AbstractMatcherinline + set_handler(Handler *handler)reflex::AbstractMatcherinline + size() const reflex::AbstractMatcherinline + skip(char c)reflex::AbstractMatcherinline + skip(wchar_t c)reflex::AbstractMatcherinline + skip(const char *s)reflex::AbstractMatcherinline + span()reflex::AbstractMatcherinline + splitreflex::AbstractMatcher + str() const reflex::AbstractMatcherinline + tabs(char n)reflex::AbstractMatcherinline + tabs()reflex::AbstractMatcherinline + text()reflex::AbstractMatcherinline + txt_reflex::AbstractMatcherprotected + unput(char c)reflex::AbstractMatcherinline + wchr() const reflex::AbstractMatcherinline + winput()reflex::AbstractMatcherinline + wline()reflex::AbstractMatcherinline + wpair() const reflex::AbstractMatcherinline + wrap()reflex::AbstractMatcherinlinevirtual + wsize() const reflex::AbstractMatcherinline + wstr() const reflex::AbstractMatcherinline + wunput(int c)reflex::AbstractMatcherinline + ~AbstractMatcher()reflex::AbstractMatcherinlinevirtual + ~PatternMatcher()reflex::PatternMatcher< P >inlinevirtual
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_pattern_matcher.html b/doc/html/classreflex_1_1_pattern_matcher.html index a989263e0..0baddcf8d 100644 --- a/doc/html/classreflex_1_1_pattern_matcher.html +++ b/doc/html/classreflex_1_1_pattern_matcher.html @@ -21,7 +21,7 @@
reflex::PatternMatcher< P > Class Template Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -110,9 +110,9 @@ virtual ~PatternMatcher ()  Delete matcher, deletes pattern when owned. More...
  -PatternMatcheroperator= (const PatternMatcher &matcher) - Assign a matcher, the underlying pattern object is shared (not deep copied). More...
-  +virtual PatternMatcheroperator= (const PatternMatcher &matcher) + Assign a matcher, the underlying pattern object is shared (not deep copied). More...
+  virtual PatternMatcherpattern (const PatternMatcher &matcher)  Set the pattern to use with this matcher as a shared pointer to another matcher pattern. More...
  @@ -134,9 +134,9 @@ bool own_pattern () const  Returns true if this matcher has its own pattern not received from another matcher (responsible to delete). More...
  -const Patternpattern () const - Returns a reference to the pattern object associated with this matcher. More...
-  +virtual const Patternpattern () const + Returns a reference to the pattern object associated with this matcher. More...
- Public Member Functions inherited from reflex::AbstractMatcher  AbstractMatcher (const Input &input, const char *opt)  Construct a base abstract matcher. More...
@@ -216,6 +216,9 @@ int wchr () const  Returns the first wide character of the text matched. More...
  +void lineno_skip (bool f=false) + Set or reset mode to count matching lines only and skip other (e.g. for speed). More...
+  void lineno (size_t n)  Set or change the starting line number of the last match. More...
  @@ -300,6 +303,9 @@ const char * eol (bool inclusive=false)  Returns pointer to the end of the line (last char + 1) in the buffer containing the matched text, DANGER: invalidates previous bol() and text() pointers, use eol() before bol(), text(), begin(), and end() when those are used. More...
  +size_t fetch (size_t len) + Return number of bytes available given number of bytes to fetch ahead, limited by input size and buffer size. More...
+  size_t avail ()  Returns the number of bytes in the buffer available to search from the current begin()/text() position. More...
  @@ -509,6 +515,9 @@ bool mat_  true if AbstractMatcher::matches() was successful More...
  +bool cml_ + true when counting matching lines instead of line numbers More...
+  @@ -856,7 +865,7 @@

Member Function Documentation

- +
@@ -866,7 +875,7 @@

Member Function Documentation

+inlinevirtual

Additional Inherited Members

- + @@ -875,7 +884,7 @@

Member Function Documentation

PatternMatcher& reflex::PatternMatcher< P >::operator= virtual PatternMatcher& reflex::PatternMatcher< P >::operator= ( const PatternMatcher< P > &  matcher)
-inline
@@ -986,7 +995,7 @@

Member Function Documentation

-

Reimplemented in reflex::StdPosixMatcher, and reflex::StdEcmaMatcher.

+

Reimplemented in reflex::StdPosixMatcher, reflex::StdEcmaMatcher, and reflex::Matcher.

@@ -1023,7 +1032,7 @@

Member Function Documentation

-

Reimplemented in reflex::StdPosixMatcher, and reflex::StdEcmaMatcher.

+

Reimplemented in reflex::StdPosixMatcher, reflex::StdEcmaMatcher, and reflex::Matcher.

@@ -1060,7 +1069,7 @@

Member Function Documentation

-

Reimplemented in reflex::StdPosixMatcher, reflex::StdEcmaMatcher, reflex::BoostMatcher, and reflex::StdMatcher.

+

Reimplemented in reflex::StdPosixMatcher, reflex::StdEcmaMatcher, reflex::Matcher, reflex::BoostMatcher, and reflex::StdMatcher.

@@ -1097,11 +1106,11 @@

Member Function Documentation

-

Reimplemented in reflex::StdPosixMatcher, reflex::StdEcmaMatcher, reflex::BoostMatcher, and reflex::StdMatcher.

+

Reimplemented in reflex::StdPosixMatcher, reflex::StdEcmaMatcher, reflex::Matcher, reflex::BoostMatcher, and reflex::StdMatcher.

- +
@@ -1111,7 +1120,7 @@

Member Function Documentation

- + @@ -1119,7 +1128,7 @@

Member Function Documentation

const Pattern& reflex::PatternMatcher< P >::pattern virtual const Pattern& reflex::PatternMatcher< P >::pattern ( ) const
-inline +inlinevirtual
@@ -1127,6 +1136,8 @@

Member Function Documentation

Returns a reference to the pattern object associated with this matcher.

Returns
reference to pattern object
+

Reimplemented in reflex::Matcher.

+

Member Data Documentation

@@ -1184,7 +1195,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_pattern_matcher_3_01std_1_1string_01_4-members.html b/doc/html/classreflex_1_1_pattern_matcher_3_01std_1_1string_01_4-members.html index 4339a205d..8f677f125 100644 --- a/doc/html/classreflex_1_1_pattern_matcher_3_01std_1_1string_01_4-members.html +++ b/doc/html/classreflex_1_1_pattern_matcher_3_01std_1_1string_01_4-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -80,19 +80,21 @@ chr() const reflex::AbstractMatcherinline chr_reflex::AbstractMatcherprotected clone()=0reflex::AbstractMatcherpure virtual - cno_reflex::AbstractMatcherprotected - columno(size_t n)reflex::AbstractMatcherinline - columno()reflex::AbstractMatcherinline - columno_end()reflex::AbstractMatcherinline - columns()reflex::AbstractMatcherinline - const_iterator typedefreflex::AbstractMatcher - cpb_reflex::AbstractMatcherprotected - cur_reflex::AbstractMatcherprotected - end() const reflex::AbstractMatcherinline - end_reflex::AbstractMatcherprotected - eof_reflex::AbstractMatcherprotected - eol(bool inclusive=false)reflex::AbstractMatcherinline - evh_reflex::AbstractMatcherprotected + cml_reflex::AbstractMatcherprotected + cno_reflex::AbstractMatcherprotected + columno(size_t n)reflex::AbstractMatcherinline + columno()reflex::AbstractMatcherinline + columno_end()reflex::AbstractMatcherinline + columns()reflex::AbstractMatcherinline + const_iterator typedefreflex::AbstractMatcher + cpb_reflex::AbstractMatcherprotected + cur_reflex::AbstractMatcherprotected + end() const reflex::AbstractMatcherinline + end_reflex::AbstractMatcherprotected + eof_reflex::AbstractMatcherprotected + eol(bool inclusive=false)reflex::AbstractMatcherinline + evh_reflex::AbstractMatcherprotected + fetch(size_t len)reflex::AbstractMatcherinline findreflex::AbstractMatcher first() const reflex::AbstractMatcherinline flush()reflex::AbstractMatcherinline @@ -119,84 +121,85 @@ lineno(size_t n)reflex::AbstractMatcherinline lineno()reflex::AbstractMatcherinline lineno_end()reflex::AbstractMatcherinline - lines()reflex::AbstractMatcherinline - lno_reflex::AbstractMatcherprotected - lpb_reflex::AbstractMatcherprotected - mat_reflex::AbstractMatcherprotected - match(Method method)=0reflex::AbstractMatcherprotectedpure virtual - matches()reflex::AbstractMatcherinline - max_reflex::AbstractMatcherprotected - Method typedefreflex::AbstractMatcherprotected - more()reflex::AbstractMatcherinline - num_reflex::AbstractMatcherprotected - operator size_t() const reflex::AbstractMatcherinline - operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline - operator std::string() const reflex::AbstractMatcherinline - operator std::wstring() const reflex::AbstractMatcherinline - operator!=(const char *rhs) const reflex::AbstractMatcherinline - operator!=(const std::string &rhs) const reflex::AbstractMatcherinline - operator!=(size_t rhs) const reflex::AbstractMatcherinline - operator!=(int rhs) const reflex::AbstractMatcherinline - operator=(const PatternMatcher &matcher)reflex::PatternMatcher< std::string >inline - operator==(const char *rhs) const reflex::AbstractMatcherinline - operator==(const std::string &rhs) const reflex::AbstractMatcherinline - operator==(size_t rhs) const reflex::AbstractMatcherinline - operator==(int rhs) const reflex::AbstractMatcherinline - operator[](size_t n) const =0reflex::AbstractMatcherpure virtual - opt_reflex::AbstractMatcherprotected - own_reflex::PatternMatcher< std::string >protected - own_pattern() const reflex::PatternMatcher< std::string >inline - pair() const reflex::AbstractMatcherinline - pat_reflex::PatternMatcher< std::string >protected - Pattern typedefreflex::PatternMatcher< std::string > - pattern(const PatternMatcher &matcher)reflex::PatternMatcher< std::string >inlinevirtual - pattern(const Pattern *pattern)reflex::PatternMatcher< std::string >inlinevirtual - pattern(const char *pattern)reflex::PatternMatcher< std::string >inlinevirtual - pattern(const std::string &pattern)reflex::PatternMatcher< std::string >inlinevirtual - pattern() const reflex::PatternMatcher< std::string >inline - PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< std::string >inline - PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected - PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected - PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected - peek()reflex::AbstractMatcherinline - peek_more()reflex::AbstractMatcherinlineprotected - pos_reflex::AbstractMatcherprotected - reset(const char *opt=NULL)reflex::AbstractMatcherinlinevirtual - reset_text()reflex::AbstractMatcherinlineprotected - rest()reflex::AbstractMatcherinline - scanreflex::AbstractMatcher - set_bob(bool bob)reflex::AbstractMatcherinline - set_bol(bool bol)reflex::AbstractMatcherinline - set_current(size_t loc)reflex::AbstractMatcherinlineprotected - set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected - set_end(bool eof)reflex::AbstractMatcherinline - set_handler(Handler *handler)reflex::AbstractMatcherinline - size() const reflex::AbstractMatcherinline - skip(char c)reflex::AbstractMatcherinline - skip(wchar_t c)reflex::AbstractMatcherinline - skip(const char *s)reflex::AbstractMatcherinline - span()reflex::AbstractMatcherinline - splitreflex::AbstractMatcher - str() const reflex::AbstractMatcherinline - tabs(char n)reflex::AbstractMatcherinline - tabs()reflex::AbstractMatcherinline - text()reflex::AbstractMatcherinline - txt_reflex::AbstractMatcherprotected - unput(char c)reflex::AbstractMatcherinline - wchr() const reflex::AbstractMatcherinline - winput()reflex::AbstractMatcherinline - wline()reflex::AbstractMatcherinline - wpair() const reflex::AbstractMatcherinline - wrap()reflex::AbstractMatcherinlinevirtual - wsize() const reflex::AbstractMatcherinline - wstr() const reflex::AbstractMatcherinline - wunput(int c)reflex::AbstractMatcherinline - ~AbstractMatcher()reflex::AbstractMatcherinlinevirtual - ~PatternMatcher()reflex::PatternMatcher< std::string >inlinevirtual + lineno_skip(bool f=false)reflex::AbstractMatcherinline + lines()reflex::AbstractMatcherinline + lno_reflex::AbstractMatcherprotected + lpb_reflex::AbstractMatcherprotected + mat_reflex::AbstractMatcherprotected + match(Method method)=0reflex::AbstractMatcherprotectedpure virtual + matches()reflex::AbstractMatcherinline + max_reflex::AbstractMatcherprotected + Method typedefreflex::AbstractMatcherprotected + more()reflex::AbstractMatcherinline + num_reflex::AbstractMatcherprotected + operator size_t() const reflex::AbstractMatcherinline + operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline + operator std::string() const reflex::AbstractMatcherinline + operator std::wstring() const reflex::AbstractMatcherinline + operator!=(const char *rhs) const reflex::AbstractMatcherinline + operator!=(const std::string &rhs) const reflex::AbstractMatcherinline + operator!=(size_t rhs) const reflex::AbstractMatcherinline + operator!=(int rhs) const reflex::AbstractMatcherinline + operator=(const PatternMatcher &matcher)reflex::PatternMatcher< std::string >inlinevirtual + operator==(const char *rhs) const reflex::AbstractMatcherinline + operator==(const std::string &rhs) const reflex::AbstractMatcherinline + operator==(size_t rhs) const reflex::AbstractMatcherinline + operator==(int rhs) const reflex::AbstractMatcherinline + operator[](size_t n) const =0reflex::AbstractMatcherpure virtual + opt_reflex::AbstractMatcherprotected + own_reflex::PatternMatcher< std::string >protected + own_pattern() const reflex::PatternMatcher< std::string >inline + pair() const reflex::AbstractMatcherinline + pat_reflex::PatternMatcher< std::string >protected + Pattern typedefreflex::PatternMatcher< std::string > + pattern(const PatternMatcher &matcher)reflex::PatternMatcher< std::string >inlinevirtual + pattern(const Pattern *pattern)reflex::PatternMatcher< std::string >inlinevirtual + pattern(const char *pattern)reflex::PatternMatcher< std::string >inlinevirtual + pattern(const std::string &pattern)reflex::PatternMatcher< std::string >inlinevirtual + pattern() const reflex::PatternMatcher< std::string >inlinevirtual + PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< std::string >inline + PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected + PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected + PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::string >inlineprotected + peek()reflex::AbstractMatcherinline + peek_more()reflex::AbstractMatcherinlineprotected + pos_reflex::AbstractMatcherprotected + reset(const char *opt=NULL)reflex::AbstractMatcherinlinevirtual + reset_text()reflex::AbstractMatcherinlineprotected + rest()reflex::AbstractMatcherinline + scanreflex::AbstractMatcher + set_bob(bool bob)reflex::AbstractMatcherinline + set_bol(bool bol)reflex::AbstractMatcherinline + set_current(size_t loc)reflex::AbstractMatcherinlineprotected + set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected + set_end(bool eof)reflex::AbstractMatcherinline + set_handler(Handler *handler)reflex::AbstractMatcherinline + size() const reflex::AbstractMatcherinline + skip(char c)reflex::AbstractMatcherinline + skip(wchar_t c)reflex::AbstractMatcherinline + skip(const char *s)reflex::AbstractMatcherinline + span()reflex::AbstractMatcherinline + splitreflex::AbstractMatcher + str() const reflex::AbstractMatcherinline + tabs(char n)reflex::AbstractMatcherinline + tabs()reflex::AbstractMatcherinline + text()reflex::AbstractMatcherinline + txt_reflex::AbstractMatcherprotected + unput(char c)reflex::AbstractMatcherinline + wchr() const reflex::AbstractMatcherinline + winput()reflex::AbstractMatcherinline + wline()reflex::AbstractMatcherinline + wpair() const reflex::AbstractMatcherinline + wrap()reflex::AbstractMatcherinlinevirtual + wsize() const reflex::AbstractMatcherinline + wstr() const reflex::AbstractMatcherinline + wunput(int c)reflex::AbstractMatcherinline + ~AbstractMatcher()reflex::AbstractMatcherinlinevirtual + ~PatternMatcher()reflex::PatternMatcher< std::string >inlinevirtual
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_pattern_matcher_3_01std_1_1string_01_4.html b/doc/html/classreflex_1_1_pattern_matcher_3_01std_1_1string_01_4.html index fbbbca46f..2e7d49d2a 100644 --- a/doc/html/classreflex_1_1_pattern_matcher_3_01std_1_1string_01_4.html +++ b/doc/html/classreflex_1_1_pattern_matcher_3_01std_1_1string_01_4.html @@ -21,7 +21,7 @@
reflex::PatternMatcher< std::string > Class Template Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -114,9 +114,9 @@ virtual ~PatternMatcher ()  Delete matcher, deletes pattern when owned. More...
  -PatternMatcheroperator= (const PatternMatcher &matcher) - Assign a matcher, the underlying pattern string is shared (not deep copied). More...
-  +virtual PatternMatcheroperator= (const PatternMatcher &matcher) + Assign a matcher, the underlying pattern string is shared (not deep copied). More...
+  virtual PatternMatcherpattern (const PatternMatcher &matcher)  Set the pattern to use with this matcher as a shared pointer to another matcher pattern. More...
  @@ -135,9 +135,9 @@ bool own_pattern () const  Returns true if this matcher has its own pattern not received from another matcher (responsible to delete). More...
  -const Patternpattern () const - Returns a reference to the pattern string associated with this matcher. More...
-  +virtual const Patternpattern () const + Returns a reference to the pattern string associated with this matcher. More...
- Public Member Functions inherited from reflex::AbstractMatcher  AbstractMatcher (const Input &input, const char *opt)  Construct a base abstract matcher. More...
@@ -217,6 +217,9 @@ int wchr () const  Returns the first wide character of the text matched. More...
  +void lineno_skip (bool f=false) + Set or reset mode to count matching lines only and skip other (e.g. for speed). More...
+  void lineno (size_t n)  Set or change the starting line number of the last match. More...
  @@ -301,6 +304,9 @@ const char * eol (bool inclusive=false)  Returns pointer to the end of the line (last char + 1) in the buffer containing the matched text, DANGER: invalidates previous bol() and text() pointers, use eol() before bol(), text(), begin(), and end() when those are used. More...
  +size_t fetch (size_t len) + Return number of bytes available given number of bytes to fetch ahead, limited by input size and buffer size. More...
+  size_t avail ()  Returns the number of bytes in the buffer available to search from the current begin()/text() position. More...
  @@ -507,6 +513,9 @@ bool mat_  true if AbstractMatcher::matches() was successful More...
  +bool cml_ + true when counting matching lines instead of line numbers More...
+  @@ -782,7 +791,7 @@

Member Function Documentation

- +

Additional Inherited Members

@@ -790,7 +799,7 @@

Member Function Documentation

+inlinevirtual
- + @@ -799,7 +808,7 @@

Member Function Documentation

PatternMatcher& reflex::PatternMatcher< std::string >::operator= virtual PatternMatcher& reflex::PatternMatcher< std::string >::operator= ( const PatternMatcher< std::string > &  matcher)
-inline
@@ -978,7 +987,7 @@

Member Function Documentation

- +
@@ -986,7 +995,7 @@

Member Function Documentation

+inlinevirtual
- + @@ -994,7 +1003,7 @@

Member Function Documentation

const Pattern& reflex::PatternMatcher< std::string >::pattern virtual const Pattern& reflex::PatternMatcher< std::string >::pattern ( ) const
-inline
@@ -1055,7 +1064,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_posix_1_1_tables-members.html b/doc/html/classreflex_1_1_posix_1_1_tables-members.html index db3b15f29..90bb1f209 100644 --- a/doc/html/classreflex_1_1_posix_1_1_tables-members.html +++ b/doc/html/classreflex_1_1_posix_1_1_tables-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -63,7 +63,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_posix_1_1_tables.html b/doc/html/classreflex_1_1_posix_1_1_tables.html index ca1e4325b..4cc60a491 100644 --- a/doc/html/classreflex_1_1_posix_1_1_tables.html +++ b/doc/html/classreflex_1_1_posix_1_1_tables.html @@ -21,7 +21,7 @@
reflex::Posix::Tables Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -144,7 +144,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_ranges-members.html b/doc/html/classreflex_1_1_ranges-members.html index a133bab15..59d5ce7d7 100644 --- a/doc/html/classreflex_1_1_ranges-members.html +++ b/doc/html/classreflex_1_1_ranges-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -91,7 +91,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_ranges.html b/doc/html/classreflex_1_1_ranges.html index ba4432602..d128c5dd9 100644 --- a/doc/html/classreflex_1_1_ranges.html +++ b/doc/html/classreflex_1_1_ranges.html @@ -21,7 +21,7 @@
reflex::Ranges< T > Class Template Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -1168,7 +1168,7 @@

Member Function Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_std_ecma_matcher-members.html b/doc/html/classreflex_1_1_std_ecma_matcher-members.html index da00481b2..232791358 100644 --- a/doc/html/classreflex_1_1_std_ecma_matcher-members.html +++ b/doc/html/classreflex_1_1_std_ecma_matcher-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -80,20 +80,22 @@ chr() const reflex::AbstractMatcherinline chr_reflex::AbstractMatcherprotected clone()reflex::StdMatcherinlinevirtual - cno_reflex::AbstractMatcherprotected - columno(size_t n)reflex::AbstractMatcherinline - columno()reflex::AbstractMatcherinline - columno_end()reflex::AbstractMatcherinline - columns()reflex::AbstractMatcherinline - const_iterator typedefreflex::AbstractMatcher - convert(T regex, convert_flag_type flags=convert_flag::none, bool *multiline=NULL)reflex::StdMatcherinlinestatic - cpb_reflex::AbstractMatcherprotected - cur_reflex::AbstractMatcherprotected - end() const reflex::AbstractMatcherinline - end_reflex::AbstractMatcherprotected - eof_reflex::AbstractMatcherprotected - eol(bool inclusive=false)reflex::AbstractMatcherinline - evh_reflex::AbstractMatcherprotected + cml_reflex::AbstractMatcherprotected + cno_reflex::AbstractMatcherprotected + columno(size_t n)reflex::AbstractMatcherinline + columno()reflex::AbstractMatcherinline + columno_end()reflex::AbstractMatcherinline + columns()reflex::AbstractMatcherinline + const_iterator typedefreflex::AbstractMatcher + convert(T regex, convert_flag_type flags=convert_flag::none, bool *multiline=NULL)reflex::StdMatcherinlinestatic + cpb_reflex::AbstractMatcherprotected + cur_reflex::AbstractMatcherprotected + end() const reflex::AbstractMatcherinline + end_reflex::AbstractMatcherprotected + eof_reflex::AbstractMatcherprotected + eol(bool inclusive=false)reflex::AbstractMatcherinline + evh_reflex::AbstractMatcherprotected + fetch(size_t len)reflex::AbstractMatcherinline fin_reflex::StdMatcherprotected findreflex::AbstractMatcher first() const reflex::AbstractMatcherinline @@ -124,99 +126,100 @@ lineno(size_t n)reflex::AbstractMatcherinline lineno()reflex::AbstractMatcherinline lineno_end()reflex::AbstractMatcherinline - lines()reflex::AbstractMatcherinline - lno_reflex::AbstractMatcherprotected - lpb_reflex::AbstractMatcherprotected - mat_reflex::AbstractMatcherprotected - match(Method method)reflex::StdMatcherinlineprotectedvirtual - matches()reflex::AbstractMatcherinline - max_reflex::AbstractMatcherprotected - Method typedefreflex::AbstractMatcherprotected - more()reflex::AbstractMatcherinline - new_itr(Method method)reflex::StdMatcherinlineprotected - num_reflex::AbstractMatcherprotected - operator size_t() const reflex::AbstractMatcherinline - operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline - operator std::string() const reflex::AbstractMatcherinline - operator std::wstring() const reflex::AbstractMatcherinline - operator!=(const char *rhs) const reflex::AbstractMatcherinline - operator!=(const std::string &rhs) const reflex::AbstractMatcherinline - operator!=(size_t rhs) const reflex::AbstractMatcherinline - operator!=(int rhs) const reflex::AbstractMatcherinline - operator=(const StdMatcher &matcher)reflex::StdMatcherinline - PatternMatcher< std::regex >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inline - operator==(const char *rhs) const reflex::AbstractMatcherinline - operator==(const std::string &rhs) const reflex::AbstractMatcherinline - operator==(size_t rhs) const reflex::AbstractMatcherinline - operator==(int rhs) const reflex::AbstractMatcherinline - operator[](size_t n) const reflex::StdMatcherinlinevirtual - opt_reflex::AbstractMatcherprotected - own_reflex::PatternMatcher< std::regex >protected - own_pattern() constreflex::PatternMatcher< std::regex >inline - pair() const reflex::AbstractMatcherinline - pat_reflex::PatternMatcher< std::regex >protected - Pattern typedefreflex::PatternMatcher< std::regex > - pattern(const Pattern &pattern)reflex::StdEcmaMatcherinlinevirtual - pattern(const Pattern *pattern)reflex::StdEcmaMatcherinlinevirtual - pattern(const char *pattern)reflex::StdEcmaMatcherinlinevirtual - pattern(const std::string &pattern)reflex::StdEcmaMatcherinlinevirtual - reflex::StdMatcher::pattern(const StdMatcher &matcher)reflex::StdMatcherinlinevirtual - reflex::StdMatcher::pattern(const Pattern *pattern)reflex::StdMatcherinlinevirtual - reflex::StdMatcher::pattern(const Pattern &pattern)reflex::StdMatcherinlinevirtual - PatternMatcher< std::regex >::pattern(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inlinevirtual - PatternMatcher< std::regex >::pattern() constreflex::PatternMatcher< std::regex >inline - PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inline - PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected - PatternMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected - PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected - PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected - peek()reflex::AbstractMatcherinline - peek_more()reflex::AbstractMatcherinlineprotected - pos_reflex::AbstractMatcherprotected - reset(const char *opt=NULL)reflex::StdMatcherinlinevirtual - reset_text()reflex::AbstractMatcherinlineprotected - rest()reflex::AbstractMatcherinline - scanreflex::AbstractMatcher - set_bob(bool bob)reflex::AbstractMatcherinline - set_bol(bool bol)reflex::AbstractMatcherinline - set_current(size_t loc)reflex::AbstractMatcherinlineprotected - set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected - set_end(bool eof)reflex::AbstractMatcherinline - set_handler(Handler *handler)reflex::AbstractMatcherinline - size() const reflex::AbstractMatcherinline - skip(char c)reflex::AbstractMatcherinline - skip(wchar_t c)reflex::AbstractMatcherinline - skip(const char *s)reflex::AbstractMatcherinline - span()reflex::AbstractMatcherinline - splitreflex::AbstractMatcher - StdEcmaMatcher()reflex::StdEcmaMatcherinline - StdEcmaMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdEcmaMatcherinline - StdEcmaMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdEcmaMatcherinline - StdEcmaMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdEcmaMatcherinline - StdMatcher()reflex::StdMatcherinline - StdMatcher(const P *pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdMatcherinline - StdMatcher(const P &pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdMatcherinline - StdMatcher(const StdMatcher &matcher)reflex::StdMatcherinline - str() const reflex::AbstractMatcherinline - tabs(char n)reflex::AbstractMatcherinline - tabs()reflex::AbstractMatcherinline - text()reflex::AbstractMatcherinline - txt_reflex::AbstractMatcherprotected - unput(char c)reflex::AbstractMatcherinline - wchr() const reflex::AbstractMatcherinline - winput()reflex::AbstractMatcherinline - wline()reflex::AbstractMatcherinline - wpair() const reflex::AbstractMatcherinline - wrap()reflex::AbstractMatcherinlinevirtual - wsize() const reflex::AbstractMatcherinline - wstr() const reflex::AbstractMatcherinline - wunput(int c)reflex::AbstractMatcherinline - ~AbstractMatcher()reflex::AbstractMatcherinlinevirtual - ~PatternMatcher()reflex::PatternMatcher< std::regex >inlinevirtual + lineno_skip(bool f=false)reflex::AbstractMatcherinline + lines()reflex::AbstractMatcherinline + lno_reflex::AbstractMatcherprotected + lpb_reflex::AbstractMatcherprotected + mat_reflex::AbstractMatcherprotected + match(Method method)reflex::StdMatcherinlineprotectedvirtual + matches()reflex::AbstractMatcherinline + max_reflex::AbstractMatcherprotected + Method typedefreflex::AbstractMatcherprotected + more()reflex::AbstractMatcherinline + new_itr(Method method)reflex::StdMatcherinlineprotected + num_reflex::AbstractMatcherprotected + operator size_t() const reflex::AbstractMatcherinline + operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline + operator std::string() const reflex::AbstractMatcherinline + operator std::wstring() const reflex::AbstractMatcherinline + operator!=(const char *rhs) const reflex::AbstractMatcherinline + operator!=(const std::string &rhs) const reflex::AbstractMatcherinline + operator!=(size_t rhs) const reflex::AbstractMatcherinline + operator!=(int rhs) const reflex::AbstractMatcherinline + operator=(const StdMatcher &matcher)reflex::StdMatcherinline + PatternMatcher< std::regex >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inlinevirtual + operator==(const char *rhs) const reflex::AbstractMatcherinline + operator==(const std::string &rhs) const reflex::AbstractMatcherinline + operator==(size_t rhs) const reflex::AbstractMatcherinline + operator==(int rhs) const reflex::AbstractMatcherinline + operator[](size_t n) const reflex::StdMatcherinlinevirtual + opt_reflex::AbstractMatcherprotected + own_reflex::PatternMatcher< std::regex >protected + own_pattern() constreflex::PatternMatcher< std::regex >inline + pair() const reflex::AbstractMatcherinline + pat_reflex::PatternMatcher< std::regex >protected + Pattern typedefreflex::PatternMatcher< std::regex > + pattern(const Pattern &pattern)reflex::StdEcmaMatcherinlinevirtual + pattern(const Pattern *pattern)reflex::StdEcmaMatcherinlinevirtual + pattern(const char *pattern)reflex::StdEcmaMatcherinlinevirtual + pattern(const std::string &pattern)reflex::StdEcmaMatcherinlinevirtual + reflex::StdMatcher::pattern(const StdMatcher &matcher)reflex::StdMatcherinlinevirtual + reflex::StdMatcher::pattern(const Pattern *pattern)reflex::StdMatcherinlinevirtual + reflex::StdMatcher::pattern(const Pattern &pattern)reflex::StdMatcherinlinevirtual + PatternMatcher< std::regex >::pattern(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inlinevirtual + PatternMatcher< std::regex >::pattern() constreflex::PatternMatcher< std::regex >inlinevirtual + PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inline + PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected + PatternMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected + PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected + PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected + peek()reflex::AbstractMatcherinline + peek_more()reflex::AbstractMatcherinlineprotected + pos_reflex::AbstractMatcherprotected + reset(const char *opt=NULL)reflex::StdMatcherinlinevirtual + reset_text()reflex::AbstractMatcherinlineprotected + rest()reflex::AbstractMatcherinline + scanreflex::AbstractMatcher + set_bob(bool bob)reflex::AbstractMatcherinline + set_bol(bool bol)reflex::AbstractMatcherinline + set_current(size_t loc)reflex::AbstractMatcherinlineprotected + set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected + set_end(bool eof)reflex::AbstractMatcherinline + set_handler(Handler *handler)reflex::AbstractMatcherinline + size() const reflex::AbstractMatcherinline + skip(char c)reflex::AbstractMatcherinline + skip(wchar_t c)reflex::AbstractMatcherinline + skip(const char *s)reflex::AbstractMatcherinline + span()reflex::AbstractMatcherinline + splitreflex::AbstractMatcher + StdEcmaMatcher()reflex::StdEcmaMatcherinline + StdEcmaMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdEcmaMatcherinline + StdEcmaMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdEcmaMatcherinline + StdEcmaMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdEcmaMatcherinline + StdMatcher()reflex::StdMatcherinline + StdMatcher(const P *pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdMatcherinline + StdMatcher(const P &pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdMatcherinline + StdMatcher(const StdMatcher &matcher)reflex::StdMatcherinline + str() const reflex::AbstractMatcherinline + tabs(char n)reflex::AbstractMatcherinline + tabs()reflex::AbstractMatcherinline + text()reflex::AbstractMatcherinline + txt_reflex::AbstractMatcherprotected + unput(char c)reflex::AbstractMatcherinline + wchr() const reflex::AbstractMatcherinline + winput()reflex::AbstractMatcherinline + wline()reflex::AbstractMatcherinline + wpair() const reflex::AbstractMatcherinline + wrap()reflex::AbstractMatcherinlinevirtual + wsize() const reflex::AbstractMatcherinline + wstr() const reflex::AbstractMatcherinline + wunput(int c)reflex::AbstractMatcherinline + ~AbstractMatcher()reflex::AbstractMatcherinlinevirtual + ~PatternMatcher()reflex::PatternMatcher< std::regex >inlinevirtual
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_std_ecma_matcher.html b/doc/html/classreflex_1_1_std_ecma_matcher.html index 117a2da4a..b365bb1ff 100644 --- a/doc/html/classreflex_1_1_std_ecma_matcher.html +++ b/doc/html/classreflex_1_1_std_ecma_matcher.html @@ -21,7 +21,7 @@
reflex::StdEcmaMatcher Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -180,15 +180,15 @@ virtual ~PatternMatcher ()  Delete matcher, deletes pattern when owned. More...
  -PatternMatcheroperator= (const PatternMatcher &matcher) - Assign a matcher, the underlying pattern object is shared (not deep copied). More...
-  +virtual PatternMatcheroperator= (const PatternMatcher &matcher) + Assign a matcher, the underlying pattern object is shared (not deep copied). More...
+  virtual PatternMatcherpattern (const PatternMatcher &matcher)  Set the pattern to use with this matcher as a shared pointer to another matcher pattern. More...
  -const Patternpattern () const - Returns a reference to the pattern object associated with this matcher. More...
-  +virtual const Patternpattern () const + Returns a reference to the pattern object associated with this matcher. More...
+  bool has_pattern () const  Returns true if this matcher has a pattern. More...
  @@ -268,6 +268,9 @@ int wchr () const  Returns the first wide character of the text matched. More...
  +void lineno_skip (bool f=false) + Set or reset mode to count matching lines only and skip other (e.g. for speed). More...
+  void lineno (size_t n)  Set or change the starting line number of the last match. More...
  @@ -352,6 +355,9 @@ const char * eol (bool inclusive=false)  Returns pointer to the end of the line (last char + 1) in the buffer containing the matched text, DANGER: invalidates previous bol() and text() pointers, use eol() before bol(), text(), begin(), and end() when those are used. More...
  +size_t fetch (size_t len) + Return number of bytes available given number of bytes to fetch ahead, limited by input size and buffer size. More...
+  size_t avail ()  Returns the number of bytes in the buffer available to search from the current begin()/text() position. More...
  @@ -599,6 +605,9 @@ bool mat_  true if AbstractMatcher::matches() was successful More...
  +bool cml_ + true when counting matching lines instead of line numbers More...

Detailed Description

std matcher engine class, extends reflex::StdMatcher for ECMA std::regex::ECMAScript syntax and regex matching.

@@ -926,7 +935,7 @@

Member Function Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_std_matcher-members.html b/doc/html/classreflex_1_1_std_matcher-members.html index 3a8b9858e..16e40bdfb 100644 --- a/doc/html/classreflex_1_1_std_matcher-members.html +++ b/doc/html/classreflex_1_1_std_matcher-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -80,20 +80,22 @@ chr() const reflex::AbstractMatcherinline chr_reflex::AbstractMatcherprotected clone()reflex::StdMatcherinlinevirtual - cno_reflex::AbstractMatcherprotected - columno(size_t n)reflex::AbstractMatcherinline - columno()reflex::AbstractMatcherinline - columno_end()reflex::AbstractMatcherinline - columns()reflex::AbstractMatcherinline - const_iterator typedefreflex::AbstractMatcher - convert(T regex, convert_flag_type flags=convert_flag::none, bool *multiline=NULL)reflex::StdMatcherinlinestatic - cpb_reflex::AbstractMatcherprotected - cur_reflex::AbstractMatcherprotected - end() const reflex::AbstractMatcherinline - end_reflex::AbstractMatcherprotected - eof_reflex::AbstractMatcherprotected - eol(bool inclusive=false)reflex::AbstractMatcherinline - evh_reflex::AbstractMatcherprotected + cml_reflex::AbstractMatcherprotected + cno_reflex::AbstractMatcherprotected + columno(size_t n)reflex::AbstractMatcherinline + columno()reflex::AbstractMatcherinline + columno_end()reflex::AbstractMatcherinline + columns()reflex::AbstractMatcherinline + const_iterator typedefreflex::AbstractMatcher + convert(T regex, convert_flag_type flags=convert_flag::none, bool *multiline=NULL)reflex::StdMatcherinlinestatic + cpb_reflex::AbstractMatcherprotected + cur_reflex::AbstractMatcherprotected + end() const reflex::AbstractMatcherinline + end_reflex::AbstractMatcherprotected + eof_reflex::AbstractMatcherprotected + eol(bool inclusive=false)reflex::AbstractMatcherinline + evh_reflex::AbstractMatcherprotected + fetch(size_t len)reflex::AbstractMatcherinline fin_reflex::StdMatcherprotected findreflex::AbstractMatcher first() const reflex::AbstractMatcherinline @@ -124,95 +126,96 @@ lineno(size_t n)reflex::AbstractMatcherinline lineno()reflex::AbstractMatcherinline lineno_end()reflex::AbstractMatcherinline - lines()reflex::AbstractMatcherinline - lno_reflex::AbstractMatcherprotected - lpb_reflex::AbstractMatcherprotected - mat_reflex::AbstractMatcherprotected - match(Method method)reflex::StdMatcherinlineprotectedvirtual - matches()reflex::AbstractMatcherinline - max_reflex::AbstractMatcherprotected - Method typedefreflex::AbstractMatcherprotected - more()reflex::AbstractMatcherinline - new_itr(Method method)reflex::StdMatcherinlineprotected - num_reflex::AbstractMatcherprotected - operator size_t() const reflex::AbstractMatcherinline - operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline - operator std::string() const reflex::AbstractMatcherinline - operator std::wstring() const reflex::AbstractMatcherinline - operator!=(const char *rhs) const reflex::AbstractMatcherinline - operator!=(const std::string &rhs) const reflex::AbstractMatcherinline - operator!=(size_t rhs) const reflex::AbstractMatcherinline - operator!=(int rhs) const reflex::AbstractMatcherinline - operator=(const StdMatcher &matcher)reflex::StdMatcherinline - PatternMatcher< std::regex >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inline - operator==(const char *rhs) const reflex::AbstractMatcherinline - operator==(const std::string &rhs) const reflex::AbstractMatcherinline - operator==(size_t rhs) const reflex::AbstractMatcherinline - operator==(int rhs) const reflex::AbstractMatcherinline - operator[](size_t n) const reflex::StdMatcherinlinevirtual - opt_reflex::AbstractMatcherprotected - own_reflex::PatternMatcher< std::regex >protected - own_pattern() constreflex::PatternMatcher< std::regex >inline - pair() const reflex::AbstractMatcherinline - pat_reflex::PatternMatcher< std::regex >protected - Pattern typedefreflex::PatternMatcher< std::regex > - pattern(const StdMatcher &matcher)reflex::StdMatcherinlinevirtual - pattern(const Pattern *pattern)reflex::StdMatcherinlinevirtual - pattern(const Pattern &pattern)reflex::StdMatcherinlinevirtual - pattern(const char *pattern)reflex::StdMatcherinlinevirtual - pattern(const std::string &pattern)reflex::StdMatcherinlinevirtual - PatternMatcher< std::regex >::pattern(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inlinevirtual - PatternMatcher< std::regex >::pattern(const Pattern &pattern)reflex::PatternMatcher< std::regex >inlinevirtual - PatternMatcher< std::regex >::pattern(const Pattern *pattern)reflex::PatternMatcher< std::regex >inlinevirtual - PatternMatcher< std::regex >::pattern() constreflex::PatternMatcher< std::regex >inline - PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inline - PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected - PatternMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected - PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected - PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected - peek()reflex::AbstractMatcherinline - peek_more()reflex::AbstractMatcherinlineprotected - pos_reflex::AbstractMatcherprotected - reset(const char *opt=NULL)reflex::StdMatcherinlinevirtual - reset_text()reflex::AbstractMatcherinlineprotected - rest()reflex::AbstractMatcherinline - scanreflex::AbstractMatcher - set_bob(bool bob)reflex::AbstractMatcherinline - set_bol(bool bol)reflex::AbstractMatcherinline - set_current(size_t loc)reflex::AbstractMatcherinlineprotected - set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected - set_end(bool eof)reflex::AbstractMatcherinline - set_handler(Handler *handler)reflex::AbstractMatcherinline - size() const reflex::AbstractMatcherinline - skip(char c)reflex::AbstractMatcherinline - skip(wchar_t c)reflex::AbstractMatcherinline - skip(const char *s)reflex::AbstractMatcherinline - span()reflex::AbstractMatcherinline - splitreflex::AbstractMatcher - StdMatcher()reflex::StdMatcherinline - StdMatcher(const P *pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdMatcherinline - StdMatcher(const P &pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdMatcherinline - StdMatcher(const StdMatcher &matcher)reflex::StdMatcherinline - str() const reflex::AbstractMatcherinline - tabs(char n)reflex::AbstractMatcherinline - tabs()reflex::AbstractMatcherinline - text()reflex::AbstractMatcherinline - txt_reflex::AbstractMatcherprotected - unput(char c)reflex::AbstractMatcherinline - wchr() const reflex::AbstractMatcherinline - winput()reflex::AbstractMatcherinline - wline()reflex::AbstractMatcherinline - wpair() const reflex::AbstractMatcherinline - wrap()reflex::AbstractMatcherinlinevirtual - wsize() const reflex::AbstractMatcherinline - wstr() const reflex::AbstractMatcherinline - wunput(int c)reflex::AbstractMatcherinline - ~AbstractMatcher()reflex::AbstractMatcherinlinevirtual - ~PatternMatcher()reflex::PatternMatcher< std::regex >inlinevirtual + lineno_skip(bool f=false)reflex::AbstractMatcherinline + lines()reflex::AbstractMatcherinline + lno_reflex::AbstractMatcherprotected + lpb_reflex::AbstractMatcherprotected + mat_reflex::AbstractMatcherprotected + match(Method method)reflex::StdMatcherinlineprotectedvirtual + matches()reflex::AbstractMatcherinline + max_reflex::AbstractMatcherprotected + Method typedefreflex::AbstractMatcherprotected + more()reflex::AbstractMatcherinline + new_itr(Method method)reflex::StdMatcherinlineprotected + num_reflex::AbstractMatcherprotected + operator size_t() const reflex::AbstractMatcherinline + operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline + operator std::string() const reflex::AbstractMatcherinline + operator std::wstring() const reflex::AbstractMatcherinline + operator!=(const char *rhs) const reflex::AbstractMatcherinline + operator!=(const std::string &rhs) const reflex::AbstractMatcherinline + operator!=(size_t rhs) const reflex::AbstractMatcherinline + operator!=(int rhs) const reflex::AbstractMatcherinline + operator=(const StdMatcher &matcher)reflex::StdMatcherinline + PatternMatcher< std::regex >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inlinevirtual + operator==(const char *rhs) const reflex::AbstractMatcherinline + operator==(const std::string &rhs) const reflex::AbstractMatcherinline + operator==(size_t rhs) const reflex::AbstractMatcherinline + operator==(int rhs) const reflex::AbstractMatcherinline + operator[](size_t n) const reflex::StdMatcherinlinevirtual + opt_reflex::AbstractMatcherprotected + own_reflex::PatternMatcher< std::regex >protected + own_pattern() constreflex::PatternMatcher< std::regex >inline + pair() const reflex::AbstractMatcherinline + pat_reflex::PatternMatcher< std::regex >protected + Pattern typedefreflex::PatternMatcher< std::regex > + pattern(const StdMatcher &matcher)reflex::StdMatcherinlinevirtual + pattern(const Pattern *pattern)reflex::StdMatcherinlinevirtual + pattern(const Pattern &pattern)reflex::StdMatcherinlinevirtual + pattern(const char *pattern)reflex::StdMatcherinlinevirtual + pattern(const std::string &pattern)reflex::StdMatcherinlinevirtual + PatternMatcher< std::regex >::pattern(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inlinevirtual + PatternMatcher< std::regex >::pattern(const Pattern &pattern)reflex::PatternMatcher< std::regex >inlinevirtual + PatternMatcher< std::regex >::pattern(const Pattern *pattern)reflex::PatternMatcher< std::regex >inlinevirtual + PatternMatcher< std::regex >::pattern() constreflex::PatternMatcher< std::regex >inlinevirtual + PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inline + PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected + PatternMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected + PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected + PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected + peek()reflex::AbstractMatcherinline + peek_more()reflex::AbstractMatcherinlineprotected + pos_reflex::AbstractMatcherprotected + reset(const char *opt=NULL)reflex::StdMatcherinlinevirtual + reset_text()reflex::AbstractMatcherinlineprotected + rest()reflex::AbstractMatcherinline + scanreflex::AbstractMatcher + set_bob(bool bob)reflex::AbstractMatcherinline + set_bol(bool bol)reflex::AbstractMatcherinline + set_current(size_t loc)reflex::AbstractMatcherinlineprotected + set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected + set_end(bool eof)reflex::AbstractMatcherinline + set_handler(Handler *handler)reflex::AbstractMatcherinline + size() const reflex::AbstractMatcherinline + skip(char c)reflex::AbstractMatcherinline + skip(wchar_t c)reflex::AbstractMatcherinline + skip(const char *s)reflex::AbstractMatcherinline + span()reflex::AbstractMatcherinline + splitreflex::AbstractMatcher + StdMatcher()reflex::StdMatcherinline + StdMatcher(const P *pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdMatcherinline + StdMatcher(const P &pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdMatcherinline + StdMatcher(const StdMatcher &matcher)reflex::StdMatcherinline + str() const reflex::AbstractMatcherinline + tabs(char n)reflex::AbstractMatcherinline + tabs()reflex::AbstractMatcherinline + text()reflex::AbstractMatcherinline + txt_reflex::AbstractMatcherprotected + unput(char c)reflex::AbstractMatcherinline + wchr() const reflex::AbstractMatcherinline + winput()reflex::AbstractMatcherinline + wline()reflex::AbstractMatcherinline + wpair() const reflex::AbstractMatcherinline + wrap()reflex::AbstractMatcherinlinevirtual + wsize() const reflex::AbstractMatcherinline + wstr() const reflex::AbstractMatcherinline + wunput(int c)reflex::AbstractMatcherinline + ~AbstractMatcher()reflex::AbstractMatcherinlinevirtual + ~PatternMatcher()reflex::PatternMatcher< std::regex >inlinevirtual
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_std_matcher.html b/doc/html/classreflex_1_1_std_matcher.html index 83171fc68..769df1c6b 100644 --- a/doc/html/classreflex_1_1_std_matcher.html +++ b/doc/html/classreflex_1_1_std_matcher.html @@ -21,7 +21,7 @@
reflex::StdMatcher Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -164,9 +164,9 @@ virtual ~PatternMatcher ()  Delete matcher, deletes pattern when owned. More...
  -PatternMatcheroperator= (const PatternMatcher &matcher) - Assign a matcher, the underlying pattern object is shared (not deep copied). More...
-  +virtual PatternMatcheroperator= (const PatternMatcher &matcher) + Assign a matcher, the underlying pattern object is shared (not deep copied). More...
+  virtual PatternMatcherpattern (const PatternMatcher &matcher)  Set the pattern to use with this matcher as a shared pointer to another matcher pattern. More...
  @@ -176,9 +176,9 @@ virtual PatternMatcherpattern (const Pattern *pattern)  Set the pattern to use with this matcher (the given pattern is shared and must be persistent). More...
  -const Patternpattern () const - Returns a reference to the pattern object associated with this matcher. More...
-  +virtual const Patternpattern () const + Returns a reference to the pattern object associated with this matcher. More...
+  bool has_pattern () const  Returns true if this matcher has a pattern. More...
  @@ -258,6 +258,9 @@ int wchr () const  Returns the first wide character of the text matched. More...
  +void lineno_skip (bool f=false) + Set or reset mode to count matching lines only and skip other (e.g. for speed). More...
+  void lineno (size_t n)  Set or change the starting line number of the last match. More...
  @@ -342,6 +345,9 @@ const char * eol (bool inclusive=false)  Returns pointer to the end of the line (last char + 1) in the buffer containing the matched text, DANGER: invalidates previous bol() and text() pointers, use eol() before bol(), text(), begin(), and end() when those are used. More...
  +size_t fetch (size_t len) + Return number of bytes available given number of bytes to fetch ahead, limited by input size and buffer size. More...
+  size_t avail ()  Returns the number of bytes in the buffer available to search from the current begin()/text() position. More...
  @@ -566,6 +572,9 @@ bool mat_  true if AbstractMatcher::matches() was successful More...
  +bool cml_ + true when counting matching lines instead of line numbers More...
+  @@ -1318,7 +1327,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_std_posix_matcher-members.html b/doc/html/classreflex_1_1_std_posix_matcher-members.html index d7ae07256..1f3e2d14d 100644 --- a/doc/html/classreflex_1_1_std_posix_matcher-members.html +++ b/doc/html/classreflex_1_1_std_posix_matcher-members.html @@ -21,7 +21,7 @@
@@ -80,20 +80,22 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -124,99 +126,100 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Additional Inherited Members

Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
chr() const reflex::AbstractMatcherinline
chr_reflex::AbstractMatcherprotected
clone()reflex::StdMatcherinlinevirtual
cno_reflex::AbstractMatcherprotected
columno(size_t n)reflex::AbstractMatcherinline
columno()reflex::AbstractMatcherinline
columno_end()reflex::AbstractMatcherinline
columns()reflex::AbstractMatcherinline
const_iterator typedefreflex::AbstractMatcher
convert(T regex, convert_flag_type flags=convert_flag::none, bool *multiline=NULL)reflex::StdPosixMatcherinlinestatic
cpb_reflex::AbstractMatcherprotected
cur_reflex::AbstractMatcherprotected
end() const reflex::AbstractMatcherinline
end_reflex::AbstractMatcherprotected
eof_reflex::AbstractMatcherprotected
eol(bool inclusive=false)reflex::AbstractMatcherinline
evh_reflex::AbstractMatcherprotected
cml_reflex::AbstractMatcherprotected
cno_reflex::AbstractMatcherprotected
columno(size_t n)reflex::AbstractMatcherinline
columno()reflex::AbstractMatcherinline
columno_end()reflex::AbstractMatcherinline
columns()reflex::AbstractMatcherinline
const_iterator typedefreflex::AbstractMatcher
convert(T regex, convert_flag_type flags=convert_flag::none, bool *multiline=NULL)reflex::StdPosixMatcherinlinestatic
cpb_reflex::AbstractMatcherprotected
cur_reflex::AbstractMatcherprotected
end() const reflex::AbstractMatcherinline
end_reflex::AbstractMatcherprotected
eof_reflex::AbstractMatcherprotected
eol(bool inclusive=false)reflex::AbstractMatcherinline
evh_reflex::AbstractMatcherprotected
fetch(size_t len)reflex::AbstractMatcherinline
fin_reflex::StdMatcherprotected
findreflex::AbstractMatcher
first() const reflex::AbstractMatcherinline
lineno(size_t n)reflex::AbstractMatcherinline
lineno()reflex::AbstractMatcherinline
lineno_end()reflex::AbstractMatcherinline
lines()reflex::AbstractMatcherinline
lno_reflex::AbstractMatcherprotected
lpb_reflex::AbstractMatcherprotected
mat_reflex::AbstractMatcherprotected
match(Method method)reflex::StdMatcherinlineprotectedvirtual
matches()reflex::AbstractMatcherinline
max_reflex::AbstractMatcherprotected
Method typedefreflex::AbstractMatcherprotected
more()reflex::AbstractMatcherinline
new_itr(Method method)reflex::StdMatcherinlineprotected
num_reflex::AbstractMatcherprotected
operator size_t() const reflex::AbstractMatcherinline
operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline
operator std::string() const reflex::AbstractMatcherinline
operator std::wstring() const reflex::AbstractMatcherinline
operator!=(const char *rhs) const reflex::AbstractMatcherinline
operator!=(const std::string &rhs) const reflex::AbstractMatcherinline
operator!=(size_t rhs) const reflex::AbstractMatcherinline
operator!=(int rhs) const reflex::AbstractMatcherinline
operator=(const StdMatcher &matcher)reflex::StdMatcherinline
PatternMatcher< std::regex >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inline
operator==(const char *rhs) const reflex::AbstractMatcherinline
operator==(const std::string &rhs) const reflex::AbstractMatcherinline
operator==(size_t rhs) const reflex::AbstractMatcherinline
operator==(int rhs) const reflex::AbstractMatcherinline
operator[](size_t n) const reflex::StdMatcherinlinevirtual
opt_reflex::AbstractMatcherprotected
own_reflex::PatternMatcher< std::regex >protected
own_pattern() constreflex::PatternMatcher< std::regex >inline
pair() const reflex::AbstractMatcherinline
pat_reflex::PatternMatcher< std::regex >protected
Pattern typedefreflex::PatternMatcher< std::regex >
pattern(const Pattern &pattern)reflex::StdPosixMatcherinlinevirtual
pattern(const Pattern *pattern)reflex::StdPosixMatcherinlinevirtual
pattern(const char *pattern)reflex::StdPosixMatcherinlinevirtual
pattern(const std::string &pattern)reflex::StdPosixMatcherinlinevirtual
reflex::StdMatcher::pattern(const StdMatcher &matcher)reflex::StdMatcherinlinevirtual
reflex::StdMatcher::pattern(const Pattern *pattern)reflex::StdMatcherinlinevirtual
reflex::StdMatcher::pattern(const Pattern &pattern)reflex::StdMatcherinlinevirtual
PatternMatcher< std::regex >::pattern(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inlinevirtual
PatternMatcher< std::regex >::pattern() constreflex::PatternMatcher< std::regex >inline
PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inline
PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected
PatternMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected
PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected
PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected
peek()reflex::AbstractMatcherinline
peek_more()reflex::AbstractMatcherinlineprotected
pos_reflex::AbstractMatcherprotected
reset(const char *opt=NULL)reflex::StdMatcherinlinevirtual
reset_text()reflex::AbstractMatcherinlineprotected
rest()reflex::AbstractMatcherinline
scanreflex::AbstractMatcher
set_bob(bool bob)reflex::AbstractMatcherinline
set_bol(bool bol)reflex::AbstractMatcherinline
set_current(size_t loc)reflex::AbstractMatcherinlineprotected
set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected
set_end(bool eof)reflex::AbstractMatcherinline
set_handler(Handler *handler)reflex::AbstractMatcherinline
size() const reflex::AbstractMatcherinline
skip(char c)reflex::AbstractMatcherinline
skip(wchar_t c)reflex::AbstractMatcherinline
skip(const char *s)reflex::AbstractMatcherinline
span()reflex::AbstractMatcherinline
splitreflex::AbstractMatcher
StdMatcher()reflex::StdMatcherinline
StdMatcher(const P *pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdMatcherinline
StdMatcher(const P &pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdMatcherinline
StdMatcher(const StdMatcher &matcher)reflex::StdMatcherinline
StdPosixMatcher()reflex::StdPosixMatcherinline
StdPosixMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdPosixMatcherinline
StdPosixMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdPosixMatcherinline
StdPosixMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdPosixMatcherinline
str() const reflex::AbstractMatcherinline
tabs(char n)reflex::AbstractMatcherinline
tabs()reflex::AbstractMatcherinline
text()reflex::AbstractMatcherinline
txt_reflex::AbstractMatcherprotected
unput(char c)reflex::AbstractMatcherinline
wchr() const reflex::AbstractMatcherinline
winput()reflex::AbstractMatcherinline
wline()reflex::AbstractMatcherinline
wpair() const reflex::AbstractMatcherinline
wrap()reflex::AbstractMatcherinlinevirtual
wsize() const reflex::AbstractMatcherinline
wstr() const reflex::AbstractMatcherinline
wunput(int c)reflex::AbstractMatcherinline
~AbstractMatcher()reflex::AbstractMatcherinlinevirtual
~PatternMatcher()reflex::PatternMatcher< std::regex >inlinevirtual
lineno_skip(bool f=false)reflex::AbstractMatcherinline
lines()reflex::AbstractMatcherinline
lno_reflex::AbstractMatcherprotected
lpb_reflex::AbstractMatcherprotected
mat_reflex::AbstractMatcherprotected
match(Method method)reflex::StdMatcherinlineprotectedvirtual
matches()reflex::AbstractMatcherinline
max_reflex::AbstractMatcherprotected
Method typedefreflex::AbstractMatcherprotected
more()reflex::AbstractMatcherinline
new_itr(Method method)reflex::StdMatcherinlineprotected
num_reflex::AbstractMatcherprotected
operator size_t() const reflex::AbstractMatcherinline
operator std::pair< size_t, std::string >() const reflex::AbstractMatcherinline
operator std::string() const reflex::AbstractMatcherinline
operator std::wstring() const reflex::AbstractMatcherinline
operator!=(const char *rhs) const reflex::AbstractMatcherinline
operator!=(const std::string &rhs) const reflex::AbstractMatcherinline
operator!=(size_t rhs) const reflex::AbstractMatcherinline
operator!=(int rhs) const reflex::AbstractMatcherinline
operator=(const StdMatcher &matcher)reflex::StdMatcherinline
PatternMatcher< std::regex >::operator=(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inlinevirtual
operator==(const char *rhs) const reflex::AbstractMatcherinline
operator==(const std::string &rhs) const reflex::AbstractMatcherinline
operator==(size_t rhs) const reflex::AbstractMatcherinline
operator==(int rhs) const reflex::AbstractMatcherinline
operator[](size_t n) const reflex::StdMatcherinlinevirtual
opt_reflex::AbstractMatcherprotected
own_reflex::PatternMatcher< std::regex >protected
own_pattern() constreflex::PatternMatcher< std::regex >inline
pair() const reflex::AbstractMatcherinline
pat_reflex::PatternMatcher< std::regex >protected
Pattern typedefreflex::PatternMatcher< std::regex >
pattern(const Pattern &pattern)reflex::StdPosixMatcherinlinevirtual
pattern(const Pattern *pattern)reflex::StdPosixMatcherinlinevirtual
pattern(const char *pattern)reflex::StdPosixMatcherinlinevirtual
pattern(const std::string &pattern)reflex::StdPosixMatcherinlinevirtual
reflex::StdMatcher::pattern(const StdMatcher &matcher)reflex::StdMatcherinlinevirtual
reflex::StdMatcher::pattern(const Pattern *pattern)reflex::StdMatcherinlinevirtual
reflex::StdMatcher::pattern(const Pattern &pattern)reflex::StdMatcherinlinevirtual
PatternMatcher< std::regex >::pattern(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inlinevirtual
PatternMatcher< std::regex >::pattern() constreflex::PatternMatcher< std::regex >inlinevirtual
PatternMatcher(const PatternMatcher &matcher)reflex::PatternMatcher< std::regex >inline
PatternMatcher(const Pattern *pattern=NULL, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected
PatternMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected
PatternMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected
PatternMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::PatternMatcher< std::regex >inlineprotected
peek()reflex::AbstractMatcherinline
peek_more()reflex::AbstractMatcherinlineprotected
pos_reflex::AbstractMatcherprotected
reset(const char *opt=NULL)reflex::StdMatcherinlinevirtual
reset_text()reflex::AbstractMatcherinlineprotected
rest()reflex::AbstractMatcherinline
scanreflex::AbstractMatcher
set_bob(bool bob)reflex::AbstractMatcherinline
set_bol(bool bol)reflex::AbstractMatcherinline
set_current(size_t loc)reflex::AbstractMatcherinlineprotected
set_current_and_peek_more(size_t loc)reflex::AbstractMatcherinlineprotected
set_end(bool eof)reflex::AbstractMatcherinline
set_handler(Handler *handler)reflex::AbstractMatcherinline
size() const reflex::AbstractMatcherinline
skip(char c)reflex::AbstractMatcherinline
skip(wchar_t c)reflex::AbstractMatcherinline
skip(const char *s)reflex::AbstractMatcherinline
span()reflex::AbstractMatcherinline
splitreflex::AbstractMatcher
StdMatcher()reflex::StdMatcherinline
StdMatcher(const P *pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdMatcherinline
StdMatcher(const P &pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdMatcherinline
StdMatcher(const StdMatcher &matcher)reflex::StdMatcherinline
StdPosixMatcher()reflex::StdPosixMatcherinline
StdPosixMatcher(const char *pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdPosixMatcherinline
StdPosixMatcher(const std::string &pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdPosixMatcherinline
StdPosixMatcher(const Pattern &pattern, const Input &input=Input(), const char *opt=NULL)reflex::StdPosixMatcherinline
str() const reflex::AbstractMatcherinline
tabs(char n)reflex::AbstractMatcherinline
tabs()reflex::AbstractMatcherinline
text()reflex::AbstractMatcherinline
txt_reflex::AbstractMatcherprotected
unput(char c)reflex::AbstractMatcherinline
wchr() const reflex::AbstractMatcherinline
winput()reflex::AbstractMatcherinline
wline()reflex::AbstractMatcherinline
wpair() const reflex::AbstractMatcherinline
wrap()reflex::AbstractMatcherinlinevirtual
wsize() const reflex::AbstractMatcherinline
wstr() const reflex::AbstractMatcherinline
wunput(int c)reflex::AbstractMatcherinline
~AbstractMatcher()reflex::AbstractMatcherinlinevirtual
~PatternMatcher()reflex::PatternMatcher< std::regex >inlinevirtual
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_std_posix_matcher.html b/doc/html/classreflex_1_1_std_posix_matcher.html index e1aca1669..85987ab42 100644 --- a/doc/html/classreflex_1_1_std_posix_matcher.html +++ b/doc/html/classreflex_1_1_std_posix_matcher.html @@ -21,7 +21,7 @@
reflex::StdPosixMatcher Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -181,15 +181,15 @@ virtual ~PatternMatcher ()  Delete matcher, deletes pattern when owned. More...
  -PatternMatcheroperator= (const PatternMatcher &matcher) - Assign a matcher, the underlying pattern object is shared (not deep copied). More...
-  +virtual PatternMatcheroperator= (const PatternMatcher &matcher) + Assign a matcher, the underlying pattern object is shared (not deep copied). More...
+  virtual PatternMatcherpattern (const PatternMatcher &matcher)  Set the pattern to use with this matcher as a shared pointer to another matcher pattern. More...
  -const Patternpattern () const - Returns a reference to the pattern object associated with this matcher. More...
-  +virtual const Patternpattern () const + Returns a reference to the pattern object associated with this matcher. More...
+  bool has_pattern () const  Returns true if this matcher has a pattern. More...
  @@ -269,6 +269,9 @@ int wchr () const  Returns the first wide character of the text matched. More...
  +void lineno_skip (bool f=false) + Set or reset mode to count matching lines only and skip other (e.g. for speed). More...
+  void lineno (size_t n)  Set or change the starting line number of the last match. More...
  @@ -353,6 +356,9 @@ const char * eol (bool inclusive=false)  Returns pointer to the end of the line (last char + 1) in the buffer containing the matched text, DANGER: invalidates previous bol() and text() pointers, use eol() before bol(), text(), begin(), and end() when those are used. More...
  +size_t fetch (size_t len) + Return number of bytes available given number of bytes to fetch ahead, limited by input size and buffer size. More...
+  size_t avail ()  Returns the number of bytes in the buffer available to search from the current begin()/text() position. More...
  @@ -607,6 +613,9 @@ bool mat_  true if AbstractMatcher::matches() was successful More...
  +bool cml_ + true when counting matching lines instead of line numbers More...

Detailed Description

std matcher engine class, extends reflex::StdMatcher for POSIX ERE std::regex::awk syntax and regex matching.

@@ -978,7 +987,7 @@

Member Function Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_unicode_1_1_tables-members.html b/doc/html/classreflex_1_1_unicode_1_1_tables-members.html index 4e708b4d2..fa70e222c 100644 --- a/doc/html/classreflex_1_1_unicode_1_1_tables-members.html +++ b/doc/html/classreflex_1_1_unicode_1_1_tables-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -69,7 +69,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1_unicode_1_1_tables.html b/doc/html/classreflex_1_1_unicode_1_1_tables.html index 27e5f951a..403ea71b5 100644 --- a/doc/html/classreflex_1_1_unicode_1_1_tables.html +++ b/doc/html/classreflex_1_1_unicode_1_1_tables.html @@ -21,7 +21,7 @@
reflex::Unicode::Tables Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -255,7 +255,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1regex__error-members.html b/doc/html/classreflex_1_1regex__error-members.html index dfe830cfa..8590cd331 100644 --- a/doc/html/classreflex_1_1regex__error-members.html +++ b/doc/html/classreflex_1_1regex__error-members.html @@ -21,7 +21,7 @@
Member List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -92,7 +92,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/classreflex_1_1regex__error.html b/doc/html/classreflex_1_1regex__error.html index 90d4f2612..84e067c92 100644 --- a/doc/html/classreflex_1_1regex__error.html +++ b/doc/html/classreflex_1_1regex__error.html @@ -21,7 +21,7 @@
reflex::regex_error Class Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -1041,7 +1041,7 @@

Member Data Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/convert_8h.html b/doc/html/convert_8h.html index 6596cbc7e..ab991a718 100644 --- a/doc/html/convert_8h.html +++ b/doc/html/convert_8h.html @@ -21,7 +21,7 @@
convert.h File Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -167,7 +167,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/debug_8h.html b/doc/html/debug_8h.html index 3f956238c..201926b86 100644 --- a/doc/html/debug_8h.html +++ b/doc/html/debug_8h.html @@ -21,7 +21,7 @@
debug.h File Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -402,7 +402,7 @@

Variable Documentation

+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/dir_000002_000000.html b/doc/html/dir_000002_000000.html index ae1e2d53e..9d3bc19f7 100644 --- a/doc/html/dir_000002_000000.html +++ b/doc/html/dir_000002_000000.html @@ -21,7 +21,7 @@
src -> include Relation

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -46,7 +46,7 @@

src → include Relation

File in srcIncludes file in include
reflex.hreflex / convert.h
reflex.hreflex / error.h
reflex.hreflex / input.h
reflex.hreflex / pattern.h
reflex.hreflex / utf8.h
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html index 965712db2..c510ab3ef 100644 --- a/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -21,7 +21,7 @@
src Directory Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -76,7 +76,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/dir_bb8a7beb94a1b7afd52842cbf47ddd3e.html b/doc/html/dir_bb8a7beb94a1b7afd52842cbf47ddd3e.html index a4c8bcc94..ceb4140a4 100644 --- a/doc/html/dir_bb8a7beb94a1b7afd52842cbf47ddd3e.html +++ b/doc/html/dir_bb8a7beb94a1b7afd52842cbf47ddd3e.html @@ -21,7 +21,7 @@
reflex Directory Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -105,7 +105,7 @@  RE/flex operations on STL containers and sets.
  file  simd.h - RE/flex SIMD intrinsics.
+ RE/flex SIMD primitives.
  file  stdmatcher.h  C++11 std::regex-based matcher engines for pattern matching.
@@ -126,7 +126,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/dir_d44c64559bbebec7f509842c48db8b23.html b/doc/html/dir_d44c64559bbebec7f509842c48db8b23.html index 4fc14a821..9b2e45b4b 100644 --- a/doc/html/dir_d44c64559bbebec7f509842c48db8b23.html +++ b/doc/html/dir_d44c64559bbebec7f509842c48db8b23.html @@ -21,7 +21,7 @@
include Directory Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -62,7 +62,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/dot_inline_dotgraph_1.png b/doc/html/dot_inline_dotgraph_1.png index f8c1a09fc..2ab100464 100644 Binary files a/doc/html/dot_inline_dotgraph_1.png and b/doc/html/dot_inline_dotgraph_1.png differ diff --git a/doc/html/dot_inline_dotgraph_2.png b/doc/html/dot_inline_dotgraph_2.png index 27b03d5e1..6da654588 100644 Binary files a/doc/html/dot_inline_dotgraph_2.png and b/doc/html/dot_inline_dotgraph_2.png differ diff --git a/doc/html/dot_inline_dotgraph_3.png b/doc/html/dot_inline_dotgraph_3.png index 274087db0..58bd7b2b0 100644 Binary files a/doc/html/dot_inline_dotgraph_3.png and b/doc/html/dot_inline_dotgraph_3.png differ diff --git a/doc/html/dot_inline_dotgraph_4.png b/doc/html/dot_inline_dotgraph_4.png index bf9ece75c..d3a6f89c7 100644 Binary files a/doc/html/dot_inline_dotgraph_4.png and b/doc/html/dot_inline_dotgraph_4.png differ diff --git a/doc/html/error_8h.html b/doc/html/error_8h.html index a8e762b33..67ba0d605 100644 --- a/doc/html/error_8h.html +++ b/doc/html/error_8h.html @@ -21,7 +21,7 @@
error.h File Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -120,7 +120,7 @@
+Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/files.html b/doc/html/files.html index 4d6aae769..74eb5735e 100644 --- a/doc/html/files.html +++ b/doc/html/files.html @@ -21,7 +21,7 @@
File List

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -69,7 +69,7 @@  reflex.cppRE/flex scanner generator replacement for Flex/Lex  reflex.hRE/flex scanner generator replacement for Flex/Lex  setop.hRE/flex operations on STL containers and sets - simd.hRE/flex SIMD intrinsics + simd.hRE/flex SIMD primitives  stdmatcher.hC++11 std::regex-based matcher engines for pattern matching  timer.hMeasure elapsed wall-clock time in milliseconds  traits.hType traits for (non-)const type inference @@ -80,7 +80,7 @@
+Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
diff --git a/doc/html/flexlexer_8h.html b/doc/html/flexlexer_8h.html index e4ffe79ce..db6e11fde 100644 --- a/doc/html/flexlexer_8h.html +++ b/doc/html/flexlexer_8h.html @@ -21,7 +21,7 @@
flexlexer.h File Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -66,15 +66,15 @@
- - - - - - - - - + + + + + + + + +
@@ -1171,7 +1171,7 @@ +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/flexlexer_8h__incl.map b/doc/html/flexlexer_8h__incl.map index ec63ace48..d68ab4d9e 100644 --- a/doc/html/flexlexer_8h__incl.map +++ b/doc/html/flexlexer_8h__incl.map @@ -1,11 +1,11 @@ - - - - - - - - - + + + + + + + + + diff --git a/doc/html/flexlexer_8h__incl.md5 b/doc/html/flexlexer_8h__incl.md5 index e65bdcde2..a3042368c 100644 --- a/doc/html/flexlexer_8h__incl.md5 +++ b/doc/html/flexlexer_8h__incl.md5 @@ -1 +1 @@ -cf5418492749afc7234b9ffbe75565b6 \ No newline at end of file +7c0545eb54e332999856d28dd45ffa57 \ No newline at end of file diff --git a/doc/html/flexlexer_8h__incl.png b/doc/html/flexlexer_8h__incl.png index 1e457322e..e8d69ce25 100644 Binary files a/doc/html/flexlexer_8h__incl.png and b/doc/html/flexlexer_8h__incl.png differ diff --git a/doc/html/functions.html b/doc/html/functions.html index d7515b19f..4ded3ac9d 100644 --- a/doc/html/functions.html +++ b/doc/html/functions.html @@ -21,7 +21,7 @@
@@ -129,8 +129,131 @@

- a -

@@ -124,7 +124,7 @@

- ~ -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_b.html b/doc/html/functions_b.html index 33ad78feb..fe44464d5 100644 --- a/doc/html/functions_b.html +++ b/doc/html/functions_b.html @@ -21,7 +21,7 @@
@@ -187,7 +187,7 @@

- b -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_c.html b/doc/html/functions_c.html index e34fc6d80..a8b6c22d9 100644 --- a/doc/html/functions_c.html +++ b/doc/html/functions_c.html @@ -21,7 +21,7 @@
@@ -155,6 +155,9 @@

- c -

@@ -144,7 +144,7 @@

- d -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_e.html b/doc/html/functions_e.html index 39e515e22..76b4e317d 100644 --- a/doc/html/functions_e.html +++ b/doc/html/functions_e.html @@ -21,7 +21,7 @@
@@ -198,7 +198,7 @@

- e -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_enum.html b/doc/html/functions_enum.html index 734da02cb..3040947a0 100644 --- a/doc/html/functions_enum.html +++ b/doc/html/functions_enum.html @@ -21,7 +21,7 @@
@@ -65,7 +65,7 @@ +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
diff --git a/doc/html/functions_eval.html b/doc/html/functions_eval.html index 668f61c2d..4c4048580 100644 --- a/doc/html/functions_eval.html +++ b/doc/html/functions_eval.html @@ -21,7 +21,7 @@
@@ -113,7 +113,7 @@ +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
diff --git a/doc/html/functions_f.html b/doc/html/functions_f.html index 9f3412606..17936cf3c 100644 --- a/doc/html/functions_f.html +++ b/doc/html/functions_f.html @@ -21,7 +21,7 @@
@@ -94,6 +94,9 @@

- f -

@@ -106,8 +106,128 @@

- a -

@@ -120,7 +120,7 @@

- ~ -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_func_b.html b/doc/html/functions_func_b.html index 4e32c6adb..e96ac1283 100644 --- a/doc/html/functions_func_b.html +++ b/doc/html/functions_func_b.html @@ -21,7 +21,7 @@
@@ -137,7 +137,7 @@

- b -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_func_c.html b/doc/html/functions_func_c.html index 1bff7e92f..d2214b915 100644 --- a/doc/html/functions_func_c.html +++ b/doc/html/functions_func_c.html @@ -21,7 +21,7 @@
@@ -183,7 +183,7 @@

- c -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_func_d.html b/doc/html/functions_func_d.html index 1c8916823..65bad3ebf 100644 --- a/doc/html/functions_func_d.html +++ b/doc/html/functions_func_d.html @@ -21,7 +21,7 @@
@@ -116,7 +116,7 @@

- d -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_func_e.html b/doc/html/functions_func_e.html index 3e60ebfdf..9f64a0b69 100644 --- a/doc/html/functions_func_e.html +++ b/doc/html/functions_func_e.html @@ -21,7 +21,7 @@
@@ -145,7 +145,7 @@

- e -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_func_f.html b/doc/html/functions_func_f.html index 18b61da36..2a3dde881 100644 --- a/doc/html/functions_func_f.html +++ b/doc/html/functions_func_f.html @@ -21,7 +21,7 @@
@@ -87,11 +87,14 @@  

- f -

@@ -182,7 +182,7 @@

- g -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_func_h.html b/doc/html/functions_func_h.html index 2330ac709..72aca95d0 100644 --- a/doc/html/functions_func_h.html +++ b/doc/html/functions_func_h.html @@ -21,7 +21,7 @@
@@ -124,7 +124,7 @@

- h -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_func_i.html b/doc/html/functions_func_i.html index db844eb21..58c0ca3b5 100644 --- a/doc/html/functions_func_i.html +++ b/doc/html/functions_func_i.html @@ -21,7 +21,7 @@
@@ -112,6 +112,9 @@

- i -

@@ -144,6 +144,9 @@

- l -

@@ -125,7 +125,7 @@

- m -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_func_n.html b/doc/html/functions_func_n.html index 2171b4e29..7d6229d17 100644 --- a/doc/html/functions_func_n.html +++ b/doc/html/functions_func_n.html @@ -21,7 +21,7 @@
@@ -126,7 +126,7 @@

- n -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_func_o.html b/doc/html/functions_func_o.html index fe8477888..ffb56dcf8 100644 --- a/doc/html/functions_func_o.html +++ b/doc/html/functions_func_o.html @@ -21,7 +21,7 @@
@@ -225,8 +225,8 @@

- o -

@@ -126,27 +126,28 @@

- p -

@@ -132,7 +132,7 @@

- r -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_func_s.html b/doc/html/functions_func_s.html index 38ef58c0e..254aeee98 100644 --- a/doc/html/functions_func_s.html +++ b/doc/html/functions_func_s.html @@ -21,7 +21,7 @@
@@ -121,11 +121,134 @@

- s -

@@ -117,7 +117,7 @@

- t -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_func_u.html b/doc/html/functions_func_u.html index 22c9429a4..9111d9ac9 100644 --- a/doc/html/functions_func_u.html +++ b/doc/html/functions_func_u.html @@ -21,7 +21,7 @@
@@ -119,7 +119,7 @@

- u -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_func_v.html b/doc/html/functions_func_v.html index 4c032064e..aa5efcd4c 100644 --- a/doc/html/functions_func_v.html +++ b/doc/html/functions_func_v.html @@ -21,7 +21,7 @@
@@ -103,7 +103,7 @@

- v -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_func_w.html b/doc/html/functions_func_w.html index 23cde7577..8ea3efaf9 100644 --- a/doc/html/functions_func_w.html +++ b/doc/html/functions_func_w.html @@ -21,7 +21,7 @@
@@ -214,7 +214,7 @@

- w -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_func_x.html b/doc/html/functions_func_x.html index 5ccd3647f..d82176774 100644 --- a/doc/html/functions_func_x.html +++ b/doc/html/functions_func_x.html @@ -21,7 +21,7 @@
@@ -97,7 +97,7 @@

- x -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_func_y.html b/doc/html/functions_func_y.html index 3e65bfc4d..465dcff8e 100644 --- a/doc/html/functions_func_y.html +++ b/doc/html/functions_func_y.html @@ -21,7 +21,7 @@
@@ -103,7 +103,7 @@

- y -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_g.html b/doc/html/functions_g.html index 3fdbfc4ec..dcc32b6c6 100644 --- a/doc/html/functions_g.html +++ b/doc/html/functions_g.html @@ -21,7 +21,7 @@
@@ -200,7 +200,7 @@

- g -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_h.html b/doc/html/functions_h.html index c66a048a8..ef1f58512 100644 --- a/doc/html/functions_h.html +++ b/doc/html/functions_h.html @@ -21,7 +21,7 @@
@@ -162,7 +162,7 @@

- h -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_i.html b/doc/html/functions_i.html index 9b1d3d8d0..6af0754eb 100644 --- a/doc/html/functions_i.html +++ b/doc/html/functions_i.html @@ -21,7 +21,7 @@
@@ -167,6 +167,9 @@

- i -

@@ -98,7 +98,7 @@

- j -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_k.html b/doc/html/functions_k.html index a76e4b0c7..b558fb7ec 100644 --- a/doc/html/functions_k.html +++ b/doc/html/functions_k.html @@ -21,7 +21,7 @@
@@ -114,7 +114,7 @@

- k -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_l.html b/doc/html/functions_l.html index 5998ee7d1..7ee98034e 100644 --- a/doc/html/functions_l.html +++ b/doc/html/functions_l.html @@ -21,7 +21,7 @@
@@ -205,6 +205,9 @@

- l -

@@ -275,7 +275,7 @@

- m -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_n.html b/doc/html/functions_n.html index b33fbcb57..2cd0ac701 100644 --- a/doc/html/functions_n.html +++ b/doc/html/functions_n.html @@ -21,7 +21,7 @@
@@ -175,7 +175,7 @@

- n -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_o.html b/doc/html/functions_o.html index cf407ca05..4a523b490 100644 --- a/doc/html/functions_o.html +++ b/doc/html/functions_o.html @@ -21,7 +21,7 @@
@@ -242,8 +242,8 @@

- o -

@@ -142,19 +142,19 @@

- p -

@@ -102,7 +102,7 @@

- q -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_r.html b/doc/html/functions_r.html index 1069e04d5..4b70a255a 100644 --- a/doc/html/functions_r.html +++ b/doc/html/functions_r.html @@ -21,7 +21,7 @@
@@ -184,7 +184,7 @@

- r -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_rela.html b/doc/html/functions_rela.html index cadc8845b..288aac16e 100644 --- a/doc/html/functions_rela.html +++ b/doc/html/functions_rela.html @@ -21,7 +21,7 @@
@@ -77,7 +77,7 @@ +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
diff --git a/doc/html/functions_s.html b/doc/html/functions_s.html index 9ccbc1a61..a1e75a0ec 100644 --- a/doc/html/functions_s.html +++ b/doc/html/functions_s.html @@ -21,7 +21,7 @@
@@ -175,11 +175,134 @@

- s -

@@ -146,7 +146,7 @@

- t -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_type.html b/doc/html/functions_type.html index c84fec1c8..2582ad4ab 100644 --- a/doc/html/functions_type.html +++ b/doc/html/functions_type.html @@ -21,7 +21,7 @@
@@ -366,7 +366,7 @@

- v -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_u.html b/doc/html/functions_u.html index 59f3399e8..9aaf94c8a 100644 --- a/doc/html/functions_u.html +++ b/doc/html/functions_u.html @@ -21,7 +21,7 @@
@@ -91,12 +91,12 @@
Here is a list of all class members with links to the classes they belong to:

- u -

@@ -129,7 +129,7 @@

- v -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars.html b/doc/html/functions_vars.html index b0215b63b..9e98c95d9 100644 --- a/doc/html/functions_vars.html +++ b/doc/html/functions_vars.html @@ -21,7 +21,7 @@
@@ -101,6 +101,9 @@

- a -

  • ACCEPT : reflex::Pattern::Position
  • +
  • adv_ +: reflex::Matcher +
  • ALLOC : reflex::Pattern::DFA
  • @@ -120,7 +123,7 @@

    - a -

      +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
      diff --git a/doc/html/functions_vars_b.html b/doc/html/functions_vars_b.html index b5a167b5a..e50d06c1a 100644 --- a/doc/html/functions_vars_b.html +++ b/doc/html/functions_vars_b.html @@ -21,7 +21,7 @@
@@ -137,7 +137,7 @@

- b -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_c.html b/doc/html/functions_vars_c.html index 010d7ef81..befa13ba0 100644 --- a/doc/html/functions_vars_c.html +++ b/doc/html/functions_vars_c.html @@ -21,7 +21,7 @@
@@ -116,6 +116,9 @@

- c -

@@ -111,7 +111,7 @@

- d -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_e.html b/doc/html/functions_vars_e.html index 8bb7463eb..8021c386c 100644 --- a/doc/html/functions_vars_e.html +++ b/doc/html/functions_vars_e.html @@ -21,7 +21,7 @@
@@ -136,7 +136,7 @@

- e -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_f.html b/doc/html/functions_vars_f.html index 12ded1e8e..587a52b5a 100644 --- a/doc/html/functions_vars_f.html +++ b/doc/html/functions_vars_f.html @@ -21,7 +21,7 @@
@@ -128,7 +128,7 @@

- f -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_g.html b/doc/html/functions_vars_g.html index fb385264c..2953abdcd 100644 --- a/doc/html/functions_vars_g.html +++ b/doc/html/functions_vars_g.html @@ -21,7 +21,7 @@
@@ -107,7 +107,7 @@

- g -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_h.html b/doc/html/functions_vars_h.html index 9f89bf4ed..174101088 100644 --- a/doc/html/functions_vars_h.html +++ b/doc/html/functions_vars_h.html @@ -21,7 +21,7 @@
@@ -117,7 +117,7 @@

- h -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_i.html b/doc/html/functions_vars_i.html index bdd853121..59193d263 100644 --- a/doc/html/functions_vars_i.html +++ b/doc/html/functions_vars_i.html @@ -21,7 +21,7 @@
@@ -228,7 +228,7 @@

- i -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_j.html b/doc/html/functions_vars_j.html index b7dd35496..030354fbf 100644 --- a/doc/html/functions_vars_j.html +++ b/doc/html/functions_vars_j.html @@ -21,7 +21,7 @@
@@ -96,7 +96,7 @@

- j -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_k.html b/doc/html/functions_vars_k.html index 4f6da172b..f66812cd5 100644 --- a/doc/html/functions_vars_k.html +++ b/doc/html/functions_vars_k.html @@ -21,7 +21,7 @@
@@ -108,7 +108,7 @@

- k -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_l.html b/doc/html/functions_vars_l.html index 2d3615bf8..6710cd358 100644 --- a/doc/html/functions_vars_l.html +++ b/doc/html/functions_vars_l.html @@ -21,7 +21,7 @@
@@ -165,7 +165,7 @@

- l -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_m.html b/doc/html/functions_vars_m.html index 3691bdc56..054d13b34 100644 --- a/doc/html/functions_vars_m.html +++ b/doc/html/functions_vars_m.html @@ -21,7 +21,7 @@
@@ -164,7 +164,7 @@

- m -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_n.html b/doc/html/functions_vars_n.html index 6244187d9..ed39757b9 100644 --- a/doc/html/functions_vars_n.html +++ b/doc/html/functions_vars_n.html @@ -21,7 +21,7 @@
@@ -133,7 +133,7 @@

- n -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_o.html b/doc/html/functions_vars_o.html index a0f0c3b8a..36fa11328 100644 --- a/doc/html/functions_vars_o.html +++ b/doc/html/functions_vars_o.html @@ -21,7 +21,7 @@
@@ -121,7 +121,7 @@

- o -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_p.html b/doc/html/functions_vars_p.html index 3ab92046b..81c3fdce1 100644 --- a/doc/html/functions_vars_p.html +++ b/doc/html/functions_vars_p.html @@ -21,7 +21,7 @@
@@ -131,7 +131,7 @@

- p -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_q.html b/doc/html/functions_vars_q.html index fabb26882..f248e78b2 100644 --- a/doc/html/functions_vars_q.html +++ b/doc/html/functions_vars_q.html @@ -21,7 +21,7 @@
@@ -100,7 +100,7 @@

- q -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_r.html b/doc/html/functions_vars_r.html index 768d65072..d137ca4ab 100644 --- a/doc/html/functions_vars_r.html +++ b/doc/html/functions_vars_r.html @@ -21,7 +21,7 @@
@@ -129,7 +129,7 @@

- r -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_s.html b/doc/html/functions_vars_s.html index 954dff055..1013b7e3b 100644 --- a/doc/html/functions_vars_s.html +++ b/doc/html/functions_vars_s.html @@ -21,7 +21,7 @@
@@ -172,7 +172,7 @@

- s -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_t.html b/doc/html/functions_vars_t.html index 405552c0f..8d3b9779a 100644 --- a/doc/html/functions_vars_t.html +++ b/doc/html/functions_vars_t.html @@ -21,7 +21,7 @@
@@ -114,7 +114,7 @@

- t -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_u.html b/doc/html/functions_vars_u.html index 910e13c14..0a8908234 100644 --- a/doc/html/functions_vars_u.html +++ b/doc/html/functions_vars_u.html @@ -21,7 +21,7 @@
@@ -89,12 +89,12 @@  

- u -

@@ -102,7 +102,7 @@

- v -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_w.html b/doc/html/functions_vars_w.html index 3a4fc3206..854fc0f92 100644 --- a/doc/html/functions_vars_w.html +++ b/doc/html/functions_vars_w.html @@ -21,7 +21,7 @@
@@ -105,7 +105,7 @@

- w -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_x.html b/doc/html/functions_vars_x.html index eebeb5ac5..a8d62a578 100644 --- a/doc/html/functions_vars_x.html +++ b/doc/html/functions_vars_x.html @@ -21,7 +21,7 @@
@@ -96,7 +96,7 @@

- x -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_vars_z.html b/doc/html/functions_vars_z.html index 2307f6c0e..9a193cba1 100644 --- a/doc/html/functions_vars_z.html +++ b/doc/html/functions_vars_z.html @@ -21,7 +21,7 @@
@@ -96,7 +96,7 @@

- z -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_w.html b/doc/html/functions_w.html index 176e313a7..54a1840c1 100644 --- a/doc/html/functions_w.html +++ b/doc/html/functions_w.html @@ -21,7 +21,7 @@
@@ -230,7 +230,7 @@

- w -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_x.html b/doc/html/functions_x.html index aa6c713a4..48931fad4 100644 --- a/doc/html/functions_x.html +++ b/doc/html/functions_x.html @@ -21,7 +21,7 @@
@@ -104,7 +104,7 @@

- x -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_y.html b/doc/html/functions_y.html index 608ac2b35..9f83c05e8 100644 --- a/doc/html/functions_y.html +++ b/doc/html/functions_y.html @@ -21,7 +21,7 @@
@@ -107,7 +107,7 @@

- y -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/functions_z.html b/doc/html/functions_z.html index 1bb009f10..c50357bc8 100644 --- a/doc/html/functions_z.html +++ b/doc/html/functions_z.html @@ -21,7 +21,7 @@
@@ -98,7 +98,7 @@

- z -

    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/globals.html b/doc/html/globals.html index 19a41e2c3..e430aae16 100644 --- a/doc/html/globals.html +++ b/doc/html/globals.html @@ -21,7 +21,7 @@
@@ -221,6 +221,9 @@

- w -

  • WITH_SPAN : absmatcher.h
  • +
  • WITH_STRING_PM +: matcher.h +
  • WITH_TREE_DFA : pattern.h
  • @@ -391,7 +394,7 @@

    - y -

      +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
      diff --git a/doc/html/globals_defs.html b/doc/html/globals_defs.html index fb3fc7a46..70a0bec79 100644 --- a/doc/html/globals_defs.html +++ b/doc/html/globals_defs.html @@ -21,7 +21,7 @@
@@ -166,6 +166,9 @@

- w -

  • WITH_SPAN : absmatcher.h
  • +
  • WITH_STRING_PM +: matcher.h +
  • WITH_TREE_DFA : pattern.h
  • @@ -336,7 +339,7 @@

    - y -

      +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
      diff --git a/doc/html/globals_func.html b/doc/html/globals_func.html index 311707086..26a40156a 100644 --- a/doc/html/globals_func.html +++ b/doc/html/globals_func.html @@ -21,7 +21,7 @@
@@ -79,7 +79,7 @@ +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
diff --git a/doc/html/globals_vars.html b/doc/html/globals_vars.html index a683ee191..0b3b994d6 100644 --- a/doc/html/globals_vars.html +++ b/doc/html/globals_vars.html @@ -21,7 +21,7 @@
@@ -67,7 +67,7 @@ +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
diff --git a/doc/html/graph_legend.html b/doc/html/graph_legend.html index 8bd6c5ef4..7772b14ab 100644 --- a/doc/html/graph_legend.html +++ b/doc/html/graph_legend.html @@ -21,7 +21,7 @@
@@ -75,7 +75,7 @@ +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/hierarchy.html b/doc/html/hierarchy.html index d265df25a..091906bd5 100644 --- a/doc/html/hierarchy.html +++ b/doc/html/hierarchy.html @@ -21,7 +21,7 @@
@@ -128,7 +128,7 @@ +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
diff --git a/doc/html/index.html b/doc/html/index.html index 3d8eda3b4..d2b3e63e5 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -21,7 +21,7 @@
@@ -163,34 +163,35 @@ the essential features or qualities of something else." – Oxford Dictionary

What is RE/flex?

-

A high-performance C++ regex library and lexical analyzer generator with Unicode support.

-

The RE/flex lexical analyzer generator is compatible with standard Flex lexer specifications and integrates seamlessly with Bison parsers. The lexical analyzer generator accepts Flex lexer specifications, but also supports indentation anchors, lazy quantifiers, word boundaries, and many other modern features.

-

The RE/flex lexical analyzer generator does all the heavy-lifting for you to make it easier to integrate advanced tokenizers with Bison parsers. It generates the necessary gluing code depending on the type of Bison parser used, such as advanced "Bison complete parsers".

-

The high-performance RE/flex regex library is used by the RE/flex lexical analyzer generator to generate finite state machine tables or direct code to scan and search input efficiently. RE/flex also includes a smart input class to normalize input from files, streams, strings, and memory to standard UTF-8 streams.

-

A quick summary of features:

+

A high-performance C++ regex library and a lexical analyzer generator like Flex and Lex.

+

The RE/flex lexical analyzer generator extends Flex++ with Unicode support and many other useful features, such as regex indentation anchors, regex lazy quantifiers, regex word boundaries, methods for error reporting and recovery, and options to simplify integration with with Bison and other parsers.

+

The RE/flex lexical analyzer generator does all the heavy-lifting for you to make it easier to integrate advanced tokenizers with Bison and other parsers. It generates the necessary gluing code depending on the type of Bison parser used, such as advanced "Bison complete parsers".

+

The high-performance RE/flex regex library generates finite state machine tables or direct code to scan and search input efficiently. RE/flex also includes a smart input class to normalize input from files, streams, strings, and memory to standard UTF-8 streams.

+

In a nutshell, RE/flex

    -
  • faster than Flex++ for typical applications such as tokenization;
  • -
  • accepts Flex/Lex lexer specifications, extended to support Unicode;
  • -
  • IEEE POSIX P1003.2 standard compliant (like Lex and Flex);
  • -
  • fully supports Unicode, auto-detects UTF-8/16/32 with smart input handling;
  • -
  • supports legacy file encoding formats, e.g. CP 1250, EBCDIC.
  • -
  • offers methods for lex/syntax Error reporting and recovery ;
  • -
  • easily integrates with Bison reentrant, C++, bridge and location parsers;
  • -
  • generates source code that is easy to understand;
  • -
  • generates thread-safe scanners;
  • -
  • generates graphviz files for visualization of finite state machines;
  • -
  • options for intuitive customization of the lexer class source code output;
  • -
  • efficient matching in direct code or with finite state machine tables;
  • -
  • optional "free space mode" to improve readability of lexer specifications;
  • -
  • regular expressions may contain lazy quantifiers;
  • -
  • regular expressions may contain word boundary anchors;
  • -
  • regular expressions may contain indent/dedent markers for matching;
  • -
  • other regex engines to choose from, such as PCRE2 and Boost.Regex;
  • -
  • released under a permissive open source license (BSD-3).
  • +
  • extends Flex++ with Unicode and other new featues
  • +
  • accepts legacy Flex and Lex lexer specifications
  • +
  • is faster than Flex++ for typical applications such as tokenization
  • +
  • is compliant to the IEEE POSIX P1003.2 standard (like Lex and Flex)
  • +
  • supports Unicode, auto-detects UTF-8/16/32 with smart input handling
  • +
  • supports legacy file encoding formats, e.g. CP 1250, EBCDIC
  • +
  • includes methods for lex and syntax Error reporting and recovery
  • +
  • integrates with Bison reentrant, C++, bridge and location parsers
  • +
  • generates source code that is easy to understand
  • +
  • generates thread-safe scanners
  • +
  • generates graphviz files for visualization of finite state machines
  • +
  • supports easy customization of the lexer class source code output
  • +
  • is fast with direct code or with finite state machine tables
  • +
  • supports "free space mode" to improve readability of lexer specifications
  • +
  • regular expressions may contain lazy quantifiers
  • +
  • regular expressions may contain word boundary anchors
  • +
  • regular expressions may contain indent/dedent markers for matching
  • +
  • offers other regex engines to choose from, such as PCRE2 and Boost.Regex
  • +
  • is released under a permissive open source license (BSD-3)
-

RE/flex offers many other practical improvements over Flex++, such as:

+

RE/flex includes practical improvements over Flex++, such as:

    -
  • no input buffer length limit (Flex has a 16KB limit);
  • +
  • no input buffer length limit (Flex has a 16K limit);
  • yypush_buffer_state saves the scanner state (line, column, and indentation positions), not just the input buffer;
  • new methods to analyze ASCII and Unicode input, such as str() and wstr() to obtain the (wide) string match, line() and wline() to obtain the current (wide) line for error reporting.
@@ -227,7 +228,7 @@

We may claim our intricate pattern trophies as high achievements to the project team, but our team will quickly point out that a regex <!−−.*?−−> suffices to match HTML comments with the lazy repetition X*? construct, also known as a non-greedy repeat. The ? is a lazy quantifier that modifies the behavior of the X*? repeat to match only X repeately if the rest of the pattern does not match. Therefore, the regex <!−−.*?−−> matches HTML comments and nothing more.

But Flex/Lex does not permit us to be lazy!

Not surprising, even the Flex manual shows ad-hoc code rather than a pattern to scan over C/C++ source code input to match multiline comments that start with a /* and end with the first occurrence of a */. The Flex manual recommends:

-
"/*" { /* skip multiline comments */
int c;
while ((c = yyinput()) != 0)
{
if (c == '\n')
++mylineno;
else if (c == '*')
{
if ((c = yyinput()) == '/')
break;
unput(c);
}
}
}

Another argument to use this code with Flex is that the internal Flex buffer is limited to 16KB. By contrast, RE/flex buffers are dynamically resized and will never run out of buffer space to accept long matches.

+
"/*" { /* skip multiline comments */
int c;
while ((c = yyinput()) != 0)
{
if (c == '\n')
++mylineno;
else if (c == '*')
{
if ((c = yyinput()) == '/')
break;
unput(c);
}
}
}

Another argument to use this code with Flex is that the internal Flex buffer is limited to 16K. By contrast, RE/flex buffers are dynamically resized and will never run out of buffer space to accept long matches.

Workarounds such as these are not necessary with RE/flex. The RE/flex scanners use regex libraries with expressive pattern syntax. We can use lazy repetition to write a regex pattern for multiline comments as follows:

"/*"(.|\n)*?"*/" /* no action: ignore multiline comments */

Most regex libraries support syntaxes and features that we have come to rely on for pattern matching. A regex with lazy quantifiers can be much easier to read and comprehend compared to a greedy variant. Most regex libraries that support lazy quantifiers run in Perl mode, using backtracking over the input. Scanners use POSIX mode matching, meaning that the leftmost longest match is found. The difference is important as we saw earlier and even more so when we consider the problems with Perl mode matching when specifying patterns to tokenize input, as we will explain next.

Consider the lexer specification example shown earlier. Suppose the input text to tokenize is iflag = 1. In POSIX mode we return ASCII_IDENTIFIER for the name iflag, OP_ASSIGN for =, and NUMBER for 1. In Perl mode, we find that iflag matches if and the rest of the name is not consumed, which gives KEYWORD_IF for if, ASCII_IDENTIFIER for lag, OP_ASSIGN for =, and a NUMBER for 1. Perl mode matching greedely returns leftmost matches.

@@ -948,7 +949,7 @@

The matcher().rest() method returns the rest of the input character sequence as a 0-terminated char* string. This method buffers all remaining input to return the string.

The matcher().span() method enlarges the text matched to span the entire line and returns the matching line as a 0-terminated char* string without the \n.

The matcher().line() and matcher().wline() methods return the entire line as a (wide) string with the matched text as a substring. These methods can be used to obtain the context of a match, for example to display the line where a lexical error or syntax error occurred.

-
Warning
The methods matcher().span(), matcher().line(), and matcher().wline() invalidate the previous text(), yytext, begin(), bol(), and end() string pointers. Call these methods again to retrieve the updated pointer or call str() or wstr() to obtain a string copy of the match:
// INCORRECT, because t is invalid after line():
const char *t = matcher().text();
std::string s = matcher().line();
std::cout << t << " in " << s << std::endl;
// OK with line():
std::string s = matcher().line();
const char *t = matcher().text();
std::cout << t << " in " << s << std::endl;
// OK with span():
std::string t = matcher().str();
const char *s = matcher().span();
std::cout << t << " in " << s << std::endl;
The start of a line is truncated when the line is too long. The length of the line's contents before the pattern match on the line is restricted to 8KB, which is the size specified by reflex::AbstractMatcher::Const::BLOCK. When this length is exceeded, the line's length before the match is truncated to 8KB. This ensures that pattern matching binary files or files with very long lines cannot cause memory allocation exceptions.
+
Warning
The methods matcher().span(), matcher().line(), and matcher().wline() invalidate the previous text(), yytext, begin(), bol(), and end() string pointers. Call these methods again to retrieve the updated pointer or call str() or wstr() to obtain a string copy of the match:
// INCORRECT, because t is invalid after line():
const char *t = matcher().text();
std::string s = matcher().line();
std::cout << t << " in " << s << std::endl;
// OK with line():
std::string s = matcher().line();
const char *t = matcher().text();
std::cout << t << " in " << s << std::endl;
// OK with span():
std::string t = matcher().str();
const char *s = matcher().span();
std::cout << t << " in " << s << std::endl;
The start of a line is truncated when the line is too long, longer than 256K which is the initial buffer size reflex::AbstractMatcher::Const::BUFSZ. When this length is exceeded, the line's length before the match is truncated. This ensures that pattern matching binary files or files with very long lines cannot cause memory allocation exceptions.

Because matcher() returns the current matcher object, the following Flex-like actions are also supported:

Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Enumerations

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Enumerator

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Related Functions

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Typedefs

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members - Variables

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
File Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
File Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
File Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
File Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Graph Legend

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Hierarchy

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
RE/flex user guide

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
@@ -3214,7 +3215,7 @@

The rest() method returns the rest of the input character sequence as a 0-terminated char* string. This method buffers all remaining input to return the string.

The span() method enlarges the text matched to span the entire line and returns the matching line as a 0-terminated char* string without the \n.

The line() and wline() methods return the entire line as a (wide) string with the matched text as a substring. These methods can be used to obtain the context of a match.

-
Warning
The methods span(), line(), and wline() invalidate the previous text(), begin(), bol(), and end() string pointers. Call these methods again to retrieve the updated pointer or call str() or wstr() to obtain a string copy of the match:
// INCORRECT, because t is invalid after line():
const char *t = text();
std::string s = line();
std::cout << t << " in " << s << std::endl;
// OK with line():
std::string s = line();
const char *t = text();
std::cout << t << " in " << s << std::endl;
// OK with span():
std::string t = str();
const char *s = span();
std::cout << t << " in " << s << std::endl;
The start of a line is truncated when the line is too long. The length of the line's contents before the pattern match on the line is restricted to 8KB, which is the size specified by reflex::AbstractMatcher::Const::BLOCK. When this length is exceeded, the line's length before the match is truncated to 8KB. This ensures that pattern matching binary files or files with very long lines cannot cause memory allocation exceptions.
+
Warning
The methods span(), line(), and wline() invalidate the previous text(), begin(), bol(), and end() string pointers. Call these methods again to retrieve the updated pointer or call str() or wstr() to obtain a string copy of the match:
// INCORRECT, because t is invalid after line():
const char *t = text();
std::string s = line();
std::cout << t << " in " << s << std::endl;
// OK with line():
std::string s = line();
const char *t = text();
std::cout << t << " in " << s << std::endl;
// OK with span():
std::string t = str();
const char *s = span();
std::cout << t << " in " << s << std::endl;
The start of a line is truncated when the line is too long, longer than 256K which is the initial buffer size reflex::AbstractMatcher::Const::BUFSZ. When this length is exceeded, the line's length before the match is truncated. This ensures that pattern matching binary files or files with very long lines cannot cause memory allocation exceptions.

The matcher().more() method is used to create longer matches by stringing together consecutive matches in the input after scanning the input with the scan() method. When this method is invoked, the next match with scan() has its matched text prepended to it. The matcher().more() operation is often used in lexers and was introduced in Lex.

The less(n) method reduces the size of the matched text to n bytes. This method has no effect if n is larger than size(). The value of n should not be 0. The less(n) operation is often used in lexers and was introduced in Lex.

The first() and last() methods return the position in the input stream of the match, counting in bytes from the start of the input at position 0. If the input stream is a wide character sequence, the UTF-8 positions are returned as a result of the internally-converted UTF-8 wide character input.

@@ -3708,20 +3709,30 @@

🔝 Back to table of contents

Minimized library and cross compiling

-

RE/flex scanners generated by reflex can be linked against a minimized version of the RE/flex library libreflexmin:

c++ ... -lreflexmin
+

RE/flex scanners generated with reflex can be linked against a minimized version of the RE/flex library libreflexmin:

c++ ... -lreflexmin
 

The regex Unicode converters and the Unicode tables that are not used at run time are excluded from the minimized library.

-

If the RE/flex library is not installed, for example when cross-compiling a RE/flex scanner to a different platform, then compile directly from the RE/flex C++ source files located in the reflex/lib and reflex/include directories:

c++ -I. -Iinclude lex.yy.cpp lib/debug.cpp lib/error.cpp \
-    lib/input.cpp lib/matcher.cpp lib/pattern.cpp lib/utf8.cpp
-

This compiles the code without SIMD optimizations. SIMD intrinsics for SSE/AVX and ARM NEON/AArch64 are used to speed up string search and newline detection in the library. However, these optimizations are applicable to searching with the find() method and are not applicable to scanners.

-

🔝 Back to table of contents

+

If the RE/flex library is not installed, for example when cross-compiling a RE/flex scanner to a different platform, then compile directly from the RE/flex C++ source files located in the reflex/lib and reflex/include directories as follows:

c++ -I. -Iinclude lex.yy.cpp lib/debug.cpp lib/error.cpp \
+    lib/input.cpp lib/matcher.cpp lib/pattern.cpp lib/utf8.cpp lib/simd.cpp
+

This compiles the code without SIMD optimizations, despite compiling lib/simd.cpp. SIMD intrinsics for SSE/AVX and ARM NEON/AArch64 are used to speed up string search and newline detection in the library. These optimizations are for the most part applicable to speed up searching with the Matcher::find() method.

+

To compile with NEON/AArch64 optimizations applied (omit -mfpu=neon for AArch64):

c++ -DHAVE_NEON -mfpu=neon -I. -Iinclude lex.yy.cpp lib/debug.cpp lib/error.cpp \
+    lib/input.cpp lib/matcher.cpp lib/pattern.cpp lib/utf8.cpp lib/simd.cpp
+

To compile with SSE2 optimizations applied:

c++ -DHAVE_SSE2 -msse2 -I. -Iinclude lex.yy.cpp lib/debug.cpp lib/error.cpp \
+    lib/input.cpp lib/matcher.cpp lib/pattern.cpp lib/utf8.cpp lib/simd.cpp
+

To compile with AVX2 optimizations applied:

c++ -DHAVE_AVX2 -mavx2 -I. -Iinclude lex.yy.cpp lib/debug.cpp lib/error.cpp \
+    lib/input.cpp lib/matcher.cpp lib/pattern.cpp lib/utf8.cpp lib/simd.cpp \
+    lib/matcher_avx2.cpp lib/simd_avx2.cpp
+

To compile with AVX512BW optimizations applied:

c++ -DHAVE_AVX512BW -mavx512bw -I. -Iinclude lex.yy.cpp lib/debug.cpp lib/error.cpp \
+    lib/input.cpp lib/matcher.cpp lib/pattern.cpp lib/utf8.cpp lib/simd.cpp \
+    lib/matcher_avx2.cpp lib/matcher_avx512bw.cpp lib/simd_avx2.cpp lib/simd_avx512bw.cpp
+

🔝 Back to table of contents

How to minimize runtime memory usage

Runtime memory usage is determined by two entities, the pattern DFA and the input buffer:

  • Use reflex option −−full to create a statically-allocated table DFA for the scanner's regular expression patterns or option −−fast to generate a direct-coded DFA. Without one of these options, by default a DFA is created at runtime and stored in heap space.
  • -
  • Compile the generated source code with -DREFLEX_BUFSZ=16384 to override the internal buffer reflex::AbstractMatcher::Const::BUFSZ size. By default, the reflex::AbstractMatcher::Const::BLOCK size is 64K, which is reasonably optimal for high-performance file searching and tokenization. The buffer is a sliding window over the input, i.e. input files may be much larger than the buffer size. A reasonably small REFLEX_BUFSZ is 16384 for a 16K buffer. A small buffer automatically expands to accommodate larger pattern matches. However, when using the line() and wline() methods, very long lines may not fit and the return string values of line() and wline() may be truncated as a result. Furtheremore, a small buffer increase processing time, i.e. to frequently move the buffered window along a file and increases the cost to decode UTF-16/32 into UTF-8 multibyte sequences.
  • +
  • Compile the generated source code with -DREFLEX_BUFSZ=16384 to override the internal buffer reflex::AbstractMatcher::Const::BUFSZ size. By default, the buffer size is 256K, which is optimal for high-performance file searching and tokenization. The buffer is a sliding window over the input, i.e. input files may be much larger than the buffer size. A reasonably small REFLEX_BUFSZ is 16384 for a 16K buffer. A small buffer automatically expands to accommodate larger pattern matches. However, when using the line() and wline() methods, very long lines may not fit and the return string values of line() and wline() may be truncated as a result. Furtheremore, a small buffer increase processing time, i.e. to frequently move the buffered window along a file and increases the cost to decode UTF-16/32 into UTF-8 multibyte sequences.
-
Warning
The value of REFLEX_BUFSZ should not be less than 8192.
+
Warning
The value of REFLEX_BUFSZ should not be less than 4096.

🔝 Back to table of contents

MSVC++ compiler bug

@@ -3754,7 +3765,7 @@

+Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
diff --git a/doc/html/index_8md.html b/doc/html/index_8md.html index db5023571..692928773 100644 --- a/doc/html/index_8md.html +++ b/doc/html/index_8md.html @@ -21,7 +21,7 @@

@@ -52,7 +52,7 @@ +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/inherits.html b/doc/html/inherits.html index aeeefc839..4adfdef03 100644 --- a/doc/html/inherits.html +++ b/doc/html/inherits.html @@ -21,7 +21,7 @@
@@ -284,7 +284,7 @@ +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
diff --git a/doc/html/input_8h.html b/doc/html/input_8h.html index cce8f0f60..b813bdec0 100644 --- a/doc/html/input_8h.html +++ b/doc/html/input_8h.html @@ -21,7 +21,7 @@
@@ -139,7 +139,7 @@ +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/linematcher_8h.html b/doc/html/linematcher_8h.html index 541413849..1a5155cae 100644 --- a/doc/html/linematcher_8h.html +++ b/doc/html/linematcher_8h.html @@ -21,7 +21,7 @@
@@ -65,14 +65,14 @@
- - - - - - - - + + + + + + + +
index.md File Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
Class Hierarchy

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
input.h File Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
linematcher.h File Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
@@ -96,7 +96,7 @@ +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/linematcher_8h__incl.map b/doc/html/linematcher_8h__incl.map index 59667d421..571d67af9 100644 --- a/doc/html/linematcher_8h__incl.map +++ b/doc/html/linematcher_8h__incl.map @@ -1,10 +1,10 @@ - - - - - - - - + + + + + + + + diff --git a/doc/html/linematcher_8h__incl.md5 b/doc/html/linematcher_8h__incl.md5 index fc1bec94c..af8c53659 100644 --- a/doc/html/linematcher_8h__incl.md5 +++ b/doc/html/linematcher_8h__incl.md5 @@ -1 +1 @@ -5a06b4f8bf0630479aa1724cb9df6235 \ No newline at end of file +5a536ba226c908c4947891cc36e889b9 \ No newline at end of file diff --git a/doc/html/linematcher_8h__incl.png b/doc/html/linematcher_8h__incl.png index e4934c0fd..358cd096f 100644 Binary files a/doc/html/linematcher_8h__incl.png and b/doc/html/linematcher_8h__incl.png differ diff --git a/doc/html/matcher_8h.html b/doc/html/matcher_8h.html index de9687b42..52d7a717d 100644 --- a/doc/html/matcher_8h.html +++ b/doc/html/matcher_8h.html @@ -21,7 +21,7 @@
@@ -51,7 +51,8 @@
matcher.h File Reference
@@ -67,18 +68,18 @@
- - - - - - - - - - - - + + + + + + + + + + + +
matcher.h File Reference

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
 
@@ -95,17 +96,38 @@ Namespaces +
 reflex
 
+ + + +

+Macros

#define WITH_STRING_PM
 enable predict match patterns after strings longer than 4 chars (this is a bit slower on ARM NEON/AArch64) More...
 

Detailed Description

RE/flex matcher engine.

Author
Robert van Engelen - engel.nosp@m.en@g.nosp@m.enivi.nosp@m.a.co.nosp@m.m
-
+

Macro Definition Documentation

+ +
+
+ + + + +
#define WITH_STRING_PM
+
+ +

enable predict match patterns after strings longer than 4 chars (this is a bit slower on ARM NEON/AArch64)

+ +
+
+ +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
diff --git a/doc/html/matcher_8h__incl.map b/doc/html/matcher_8h__incl.map index 0c918d8e3..3e216ee93 100644 --- a/doc/html/matcher_8h__incl.map +++ b/doc/html/matcher_8h__incl.map @@ -1,14 +1,14 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/doc/html/matcher_8h__incl.md5 b/doc/html/matcher_8h__incl.md5 index f7d2ef777..fdfa7a9a3 100644 --- a/doc/html/matcher_8h__incl.md5 +++ b/doc/html/matcher_8h__incl.md5 @@ -1 +1 @@ -47244c09d722e088ae5ac2502a0358a8 \ No newline at end of file +a88026e9cbc2aa0b3a53859a6a437c28 \ No newline at end of file diff --git a/doc/html/matcher_8h__incl.png b/doc/html/matcher_8h__incl.png index dcc6d1347..0ec966a5e 100644 Binary files a/doc/html/matcher_8h__incl.png and b/doc/html/matcher_8h__incl.png differ diff --git a/doc/html/namespacemembers.html b/doc/html/namespacemembers.html index 3a7c39489..13f2e2007 100644 --- a/doc/html/namespacemembers.html +++ b/doc/html/namespacemembers.html @@ -21,7 +21,7 @@
Namespace Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -156,6 +156,9 @@

- m -

+Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
diff --git a/doc/html/namespacemembers_func.html b/doc/html/namespacemembers_func.html index e6acdb37a..217664840 100644 --- a/doc/html/namespacemembers_func.html +++ b/doc/html/namespacemembers_func.html @@ -21,7 +21,7 @@
Namespace Members

-
updated Wed Apr 10 2024 by Robert van Engelen
+
updated Sun May 12 2024 by Robert van Engelen
  @@ -58,7 +58,7 @@ : reflex::Unicode
  • convert() -: reflex +: reflex
  • is_disjoint() : reflex @@ -75,6 +75,9 @@
  • latin1() : reflex
  • +
  • nlcount() +: reflex +
  • range() : reflex::Posix , reflex::Unicode @@ -116,7 +119,7 @@
  • +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/namespacemembers_type.html b/doc/html/namespacemembers_type.html index 98aee6c79..17f2a0ea1 100644 --- a/doc/html/namespacemembers_type.html +++ b/doc/html/namespacemembers_type.html @@ -21,7 +21,7 @@
    Namespace Members

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -67,7 +67,7 @@
    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/namespacemembers_vars.html b/doc/html/namespacemembers_vars.html index 4a82d3e51..f019a57ef 100644 --- a/doc/html/namespacemembers_vars.html +++ b/doc/html/namespacemembers_vars.html @@ -21,7 +21,7 @@
    Namespace Members

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -100,7 +100,7 @@
    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/namespacereflex.html b/doc/html/namespacereflex.html index 6b80464e2..eb90298de 100644 --- a/doc/html/namespacereflex.html +++ b/doc/html/namespacereflex.html @@ -21,7 +21,7 @@
    reflex Namespace Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -204,6 +204,8 @@ void set_erase (S &s, const E &e)  Remove element e from set s when present. More...
      +size_t nlcount (const char *s, const char *t) +  void timer_start (timer_type &t)  Start timer. More...
      @@ -640,6 +642,32 @@

    Function Documentation

    +
    + + +
    +
    + + + + + + + + + + + + + + + + + + +
    size_t reflex::nlcount (const char * s,
    const char * t 
    )
    +
    +
    @@ -1172,7 +1200,7 @@

    Variable Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/namespacereflex_1_1_posix.html b/doc/html/namespacereflex_1_1_posix.html index 982c28041..5c8acdf07 100644 --- a/doc/html/namespacereflex_1_1_posix.html +++ b/doc/html/namespacereflex_1_1_posix.html @@ -21,7 +21,7 @@
    reflex::Posix Namespace Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -87,7 +87,7 @@

    Function Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/namespacereflex_1_1_unicode.html b/doc/html/namespacereflex_1_1_unicode.html index 92c919396..c7d7ee739 100644 --- a/doc/html/namespacereflex_1_1_unicode.html +++ b/doc/html/namespacereflex_1_1_unicode.html @@ -21,7 +21,7 @@
    reflex::Unicode Namespace Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -115,7 +115,7 @@

    Function Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/namespacereflex_1_1convert__flag.html b/doc/html/namespacereflex_1_1convert__flag.html index 1debbfd41..63b6edb64 100644 --- a/doc/html/namespacereflex_1_1convert__flag.html +++ b/doc/html/namespacereflex_1_1convert__flag.html @@ -21,7 +21,7 @@
    reflex::convert_flag Namespace Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -284,7 +284,7 @@

    Variable Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/namespaces.html b/doc/html/namespaces.html index 8c8d65b90..d707dd0a5 100644 --- a/doc/html/namespaces.html +++ b/doc/html/namespaces.html @@ -21,7 +21,7 @@
    Namespace List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -60,7 +60,7 @@
    +Converted on Sun May 12 2024 10:52:15 by Doxygen 1.8.11
    diff --git a/doc/html/pattern_8h.html b/doc/html/pattern_8h.html index ec6c795da..e5f40b39c 100644 --- a/doc/html/pattern_8h.html +++ b/doc/html/pattern_8h.html @@ -21,7 +21,7 @@
    pattern.h File Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -162,7 +162,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/pcre2matcher_8h.html b/doc/html/pcre2matcher_8h.html index a5b65df0a..323368da2 100644 --- a/doc/html/pcre2matcher_8h.html +++ b/doc/html/pcre2matcher_8h.html @@ -21,7 +21,7 @@
    pcre2matcher.h File Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -67,14 +67,14 @@
    - - - - - - - - + + + + + + + +
    @@ -119,7 +119,7 @@ +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/pcre2matcher_8h__incl.map b/doc/html/pcre2matcher_8h__incl.map index 4354e32e4..fbe43584f 100644 --- a/doc/html/pcre2matcher_8h__incl.map +++ b/doc/html/pcre2matcher_8h__incl.map @@ -1,10 +1,10 @@ - - - - - - - - + + + + + + + + diff --git a/doc/html/pcre2matcher_8h__incl.md5 b/doc/html/pcre2matcher_8h__incl.md5 index f3f1ed901..d39cfcca8 100644 --- a/doc/html/pcre2matcher_8h__incl.md5 +++ b/doc/html/pcre2matcher_8h__incl.md5 @@ -1 +1 @@ -603c1da4eaf73deaecf90b2b62e11903 \ No newline at end of file +b64038eea652f692205b30c3703ad858 \ No newline at end of file diff --git a/doc/html/pcre2matcher_8h__incl.png b/doc/html/pcre2matcher_8h__incl.png index 8ac3c5a7d..fd4d8d0d6 100644 Binary files a/doc/html/pcre2matcher_8h__incl.png and b/doc/html/pcre2matcher_8h__incl.png differ diff --git a/doc/html/posix_8h.html b/doc/html/posix_8h.html index 5d75f107b..213642f98 100644 --- a/doc/html/posix_8h.html +++ b/doc/html/posix_8h.html @@ -21,7 +21,7 @@
    @@ -104,7 +104,7 @@ +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/ranges_8h.html b/doc/html/ranges_8h.html index 1280763d3..7aa1f57ca 100644 --- a/doc/html/ranges_8h.html +++ b/doc/html/ranges_8h.html @@ -21,7 +21,7 @@
    @@ -105,7 +105,7 @@ +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/reflex_8cpp.html b/doc/html/reflex_8cpp.html index 787f1fd9a..0647821f6 100644 --- a/doc/html/reflex_8cpp.html +++ b/doc/html/reflex_8cpp.html @@ -21,7 +21,7 @@
    @@ -386,7 +386,7 @@

    Variable Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/reflex_8h.html b/doc/html/reflex_8h.html index 30cb778c5..d0b7686d3 100644 --- a/doc/html/reflex_8h.html +++ b/doc/html/reflex_8h.html @@ -21,7 +21,7 @@
    @@ -119,7 +119,7 @@ Macros - +
    posix.h File Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
     
    ranges.h File Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
     
    reflex.cpp File Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
     
    reflex.h File Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
     
    #define PLATFORM   ""
     
    #define REFLEX_VERSION   "4.2.1"
    #define REFLEX_VERSION   "4.3.0"
     

    Detailed Description

    @@ -146,7 +146,7 @@
    - +
    #define REFLEX_VERSION   "4.2.1"#define REFLEX_VERSION   "4.3.0"
    @@ -156,7 +156,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/setop_8h.html b/doc/html/setop_8h.html index 6ef936f6c..8d68c812e 100644 --- a/doc/html/setop_8h.html +++ b/doc/html/setop_8h.html @@ -21,7 +21,7 @@
    setop.h File Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -142,7 +142,7 @@

    Example

    std::set<int> s1;
    s1.insert(1);
    assert(reflex::is_in_set(1, s1) == true);
    std::set<int> s2;
    s2.insert(1);
    s2.insert(2);
    assert(reflex::is_disjoint(s1, s2) == false);
    assert(reflex::is_subset(s1, s2) == true);
    reflex::lazy_union< std::set<int>,std::set<int> > U(s1, s2);
    for (reflex::lazy_union< std::set<int>,std::set<int> >::iterator i = U.begin(); i != U.end(); ++i)
    std::cout << *i << std::endl; // prints 1 and 2
    reflex::lazy_intersection< std::set<int>,std::set<int> > I(s1, s2);
    for (reflex::lazy_intersection< std::set<int>,std::set<int> >::iterator i = I.begin(); i != I.end(); ++i)
    std::cout << *i << std::endl; // prints 1
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/simd_8h.html b/doc/html/simd_8h.html index 0de1314de..aee7625be 100644 --- a/doc/html/simd_8h.html +++ b/doc/html/simd_8h.html @@ -21,7 +21,7 @@
    simd.h File Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -49,14 +49,25 @@
    +
    simd.h File Reference
    -

    RE/flex SIMD intrinsics. +

    RE/flex SIMD primitives. More...

    -
    +
    #include <cstddef>
    +#include <cstdint>
    +#include <cstdlib>
    +
    +Include dependency graph for simd.h:
    +
    +
    +
    +
    This graph shows which files directly or indirectly include this file:
    @@ -71,16 +82,27 @@
    -

    Detailed Description

    -

    RE/flex SIMD intrinsics.

    +
    + + + +

    +Namespaces

     reflex
     
    + + + +

    +Functions

    size_t reflex::nlcount (const char *s, const char *t)
     
    +

    Detailed Description

    +

    RE/flex SIMD primitives.

    Author
    Robert van Engelen - engel.nosp@m.en@g.nosp@m.enivi.nosp@m.a.co.nosp@m.m
    -
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/simd_8h__incl.map b/doc/html/simd_8h__incl.map new file mode 100644 index 000000000..035f74163 --- /dev/null +++ b/doc/html/simd_8h__incl.map @@ -0,0 +1,2 @@ + + diff --git a/doc/html/simd_8h__incl.md5 b/doc/html/simd_8h__incl.md5 new file mode 100644 index 000000000..3edc3175b --- /dev/null +++ b/doc/html/simd_8h__incl.md5 @@ -0,0 +1 @@ +fd59a69c19f3b20bd7c6b956e7bafab9 \ No newline at end of file diff --git a/doc/html/simd_8h__incl.png b/doc/html/simd_8h__incl.png new file mode 100644 index 000000000..cefe6050f Binary files /dev/null and b/doc/html/simd_8h__incl.png differ diff --git a/doc/html/stdmatcher_8h.html b/doc/html/stdmatcher_8h.html index be2d11074..20577f9c6 100644 --- a/doc/html/stdmatcher_8h.html +++ b/doc/html/stdmatcher_8h.html @@ -21,7 +21,7 @@
    stdmatcher.h File Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -66,14 +66,14 @@
    - - - - - - - - + + + + + + + +
    @@ -103,7 +103,7 @@ +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/stdmatcher_8h__incl.map b/doc/html/stdmatcher_8h__incl.map index 52534a95e..645043ebb 100644 --- a/doc/html/stdmatcher_8h__incl.map +++ b/doc/html/stdmatcher_8h__incl.map @@ -1,10 +1,10 @@ - - - - - - - - + + + + + + + + diff --git a/doc/html/stdmatcher_8h__incl.md5 b/doc/html/stdmatcher_8h__incl.md5 index b49f6bca2..aa399c1b3 100644 --- a/doc/html/stdmatcher_8h__incl.md5 +++ b/doc/html/stdmatcher_8h__incl.md5 @@ -1 +1 @@ -08cf7f290025b506f44a7d9cea40978d \ No newline at end of file +b9356ee57da0063ecd35b892fc0ca36d \ No newline at end of file diff --git a/doc/html/stdmatcher_8h__incl.png b/doc/html/stdmatcher_8h__incl.png index 5a629c81a..e27454c38 100644 Binary files a/doc/html/stdmatcher_8h__incl.png and b/doc/html/stdmatcher_8h__incl.png differ diff --git a/doc/html/struct_reflex_1_1_code-members.html b/doc/html/struct_reflex_1_1_code-members.html index 8dce029ee..4a7289c8b 100644 --- a/doc/html/struct_reflex_1_1_code-members.html +++ b/doc/html/struct_reflex_1_1_code-members.html @@ -21,7 +21,7 @@
    @@ -64,7 +64,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
     
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/struct_reflex_1_1_code.html b/doc/html/struct_reflex_1_1_code.html index 484451db1..ffe8461e4 100644 --- a/doc/html/struct_reflex_1_1_code.html +++ b/doc/html/struct_reflex_1_1_code.html @@ -21,7 +21,7 @@
    Reflex::Code Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -182,7 +182,7 @@

    Member Data Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/struct_reflex_1_1_library-members.html b/doc/html/struct_reflex_1_1_library-members.html index 2d756fb1a..ed637d72a 100644 --- a/doc/html/struct_reflex_1_1_library-members.html +++ b/doc/html/struct_reflex_1_1_library-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -65,7 +65,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/struct_reflex_1_1_library.html b/doc/html/struct_reflex_1_1_library.html index 152f5d155..60b3e5f26 100644 --- a/doc/html/struct_reflex_1_1_library.html +++ b/doc/html/struct_reflex_1_1_library.html @@ -21,7 +21,7 @@
    Reflex::Library Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -160,7 +160,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/struct_reflex_1_1_rule-members.html b/doc/html/struct_reflex_1_1_rule-members.html index b476fcd39..04e855d66 100644 --- a/doc/html/struct_reflex_1_1_rule-members.html +++ b/doc/html/struct_reflex_1_1_rule-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -64,7 +64,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/struct_reflex_1_1_rule.html b/doc/html/struct_reflex_1_1_rule.html index b57a5afed..69b920daa 100644 --- a/doc/html/struct_reflex_1_1_rule.html +++ b/doc/html/struct_reflex_1_1_rule.html @@ -21,7 +21,7 @@
    Reflex::Rule Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -183,7 +183,7 @@

    Member Data Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_abstract_matcher_1_1_const-members.html b/doc/html/structreflex_1_1_abstract_matcher_1_1_const-members.html index df16abf9a..17dd8be54 100644 --- a/doc/html/structreflex_1_1_abstract_matcher_1_1_const-members.html +++ b/doc/html/structreflex_1_1_abstract_matcher_1_1_const-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -73,7 +73,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_abstract_matcher_1_1_const.html b/doc/html/structreflex_1_1_abstract_matcher_1_1_const.html index d5894df9c..aab0a9c43 100644 --- a/doc/html/structreflex_1_1_abstract_matcher_1_1_const.html +++ b/doc/html/structreflex_1_1_abstract_matcher_1_1_const.html @@ -21,7 +21,7 @@
    reflex::AbstractMatcher::Const Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -92,7 +92,7 @@ static const size_t BLOCK = 4096  minimum remaining unused space in the buffer, to prevent excessive shifting More...
      -static const size_t BUFSZ = (128*1024) +static const size_t BUFSZ = (256*1024)  initial buffer size, at least 4096 bytes More...
      static const size_t BOLSZ = BUFSZ @@ -182,7 +182,7 @@ - +
    const size_t reflex::AbstractMatcher::Const::BUFSZ = (128*1024)const size_t reflex::AbstractMatcher::Const::BUFSZ = (256*1024)
    @@ -400,7 +400,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_abstract_matcher_1_1_context-members.html b/doc/html/structreflex_1_1_abstract_matcher_1_1_context-members.html index 250d10338..8df4fcd08 100644 --- a/doc/html/structreflex_1_1_abstract_matcher_1_1_context-members.html +++ b/doc/html/structreflex_1_1_abstract_matcher_1_1_context-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -65,7 +65,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_abstract_matcher_1_1_context.html b/doc/html/structreflex_1_1_abstract_matcher_1_1_context.html index 6a3c20f48..83137414b 100644 --- a/doc/html/structreflex_1_1_abstract_matcher_1_1_context.html +++ b/doc/html/structreflex_1_1_abstract_matcher_1_1_context.html @@ -21,7 +21,7 @@
    reflex::AbstractMatcher::Context Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -198,7 +198,7 @@

    Member Data Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_abstract_matcher_1_1_handler-members.html b/doc/html/structreflex_1_1_abstract_matcher_1_1_handler-members.html index 3aa51139d..6a3310193 100644 --- a/doc/html/structreflex_1_1_abstract_matcher_1_1_handler-members.html +++ b/doc/html/structreflex_1_1_abstract_matcher_1_1_handler-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -62,7 +62,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_abstract_matcher_1_1_handler.html b/doc/html/structreflex_1_1_abstract_matcher_1_1_handler.html index 6f81ff30f..81aafd8ee 100644 --- a/doc/html/structreflex_1_1_abstract_matcher_1_1_handler.html +++ b/doc/html/structreflex_1_1_abstract_matcher_1_1_handler.html @@ -21,7 +21,7 @@
    reflex::AbstractMatcher::Handler Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -149,7 +149,7 @@

    Member Function Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_abstract_matcher_1_1_option-members.html b/doc/html/structreflex_1_1_abstract_matcher_1_1_option-members.html index 0fe4ecea4..737d45c60 100644 --- a/doc/html/structreflex_1_1_abstract_matcher_1_1_option-members.html +++ b/doc/html/structreflex_1_1_abstract_matcher_1_1_option-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -65,7 +65,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_abstract_matcher_1_1_option.html b/doc/html/structreflex_1_1_abstract_matcher_1_1_option.html index eefe86296..34772be34 100644 --- a/doc/html/structreflex_1_1_abstract_matcher_1_1_option.html +++ b/doc/html/structreflex_1_1_abstract_matcher_1_1_option.html @@ -21,7 +21,7 @@
    reflex::AbstractMatcher::Option Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -173,7 +173,7 @@

    Member Data Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_bits_1_1_bitref-members.html b/doc/html/structreflex_1_1_bits_1_1_bitref-members.html index c762a249e..7c61a996c 100644 --- a/doc/html/structreflex_1_1_bits_1_1_bitref-members.html +++ b/doc/html/structreflex_1_1_bits_1_1_bitref-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -68,7 +68,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_bits_1_1_bitref.html b/doc/html/structreflex_1_1_bits_1_1_bitref.html index 7ecaebebc..04b7cc23c 100644 --- a/doc/html/structreflex_1_1_bits_1_1_bitref.html +++ b/doc/html/structreflex_1_1_bits_1_1_bitref.html @@ -21,7 +21,7 @@
    reflex::Bits::Bitref Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -329,7 +329,7 @@

    Member Data Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_input_1_1_handler-members.html b/doc/html/structreflex_1_1_input_1_1_handler-members.html index 782afcf94..9f72a8177 100644 --- a/doc/html/structreflex_1_1_input_1_1_handler-members.html +++ b/doc/html/structreflex_1_1_input_1_1_handler-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -62,7 +62,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_input_1_1_handler.html b/doc/html/structreflex_1_1_input_1_1_handler.html index 2064eaac3..cbeabafea 100644 --- a/doc/html/structreflex_1_1_input_1_1_handler.html +++ b/doc/html/structreflex_1_1_input_1_1_handler.html @@ -21,7 +21,7 @@
    reflex::Input::Handler Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -127,7 +127,7 @@

    Member Function Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_input_1_1file__encoding-members.html b/doc/html/structreflex_1_1_input_1_1file__encoding-members.html index 5c974c10a..41894a0bc 100644 --- a/doc/html/structreflex_1_1_input_1_1file__encoding-members.html +++ b/doc/html/structreflex_1_1_input_1_1file__encoding-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -99,7 +99,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_input_1_1file__encoding.html b/doc/html/structreflex_1_1_input_1_1file__encoding.html index 64c17c2ed..c062089cb 100644 --- a/doc/html/structreflex_1_1_input_1_1file__encoding.html +++ b/doc/html/structreflex_1_1_input_1_1file__encoding.html @@ -21,7 +21,7 @@
    reflex::Input::file_encoding Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -1050,7 +1050,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_matcher_1_1_f_s_m-members.html b/doc/html/structreflex_1_1_matcher_1_1_f_s_m-members.html index 0417f18ee..66f1400d7 100644 --- a/doc/html/structreflex_1_1_matcher_1_1_f_s_m-members.html +++ b/doc/html/structreflex_1_1_matcher_1_1_f_s_m-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -64,7 +64,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_matcher_1_1_f_s_m.html b/doc/html/structreflex_1_1_matcher_1_1_f_s_m.html index ba48cd792..c1cf787c9 100644 --- a/doc/html/structreflex_1_1_matcher_1_1_f_s_m.html +++ b/doc/html/structreflex_1_1_matcher_1_1_f_s_m.html @@ -21,7 +21,7 @@
    reflex::Matcher::FSM Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -147,7 +147,7 @@

    Member Data Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_pattern_1_1_chars-members.html b/doc/html/structreflex_1_1_pattern_1_1_chars-members.html index 0953b9c7e..c0053dcda 100644 --- a/doc/html/structreflex_1_1_pattern_1_1_chars-members.html +++ b/doc/html/structreflex_1_1_pattern_1_1_chars-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -95,7 +95,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_pattern_1_1_chars.html b/doc/html/structreflex_1_1_pattern_1_1_chars.html index 45d836c0b..49af39447 100644 --- a/doc/html/structreflex_1_1_pattern_1_1_chars.html +++ b/doc/html/structreflex_1_1_pattern_1_1_chars.html @@ -21,7 +21,7 @@
    reflex::Pattern::Chars Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -981,7 +981,7 @@

    Member Data Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_pattern_1_1_const-members.html b/doc/html/structreflex_1_1_pattern_1_1_const-members.html index 3bbbbfc41..4ade00be1 100644 --- a/doc/html/structreflex_1_1_pattern_1_1_const-members.html +++ b/doc/html/structreflex_1_1_pattern_1_1_const-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -67,7 +67,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_pattern_1_1_const.html b/doc/html/structreflex_1_1_pattern_1_1_const.html index b54cd37d8..a43e77eb9 100644 --- a/doc/html/structreflex_1_1_pattern_1_1_const.html +++ b/doc/html/structreflex_1_1_pattern_1_1_const.html @@ -21,7 +21,7 @@
    reflex::Pattern::Const Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -250,7 +250,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_pattern_1_1_d_f_a-members.html b/doc/html/structreflex_1_1_pattern_1_1_d_f_a-members.html index ef205d3dc..96b245d7c 100644 --- a/doc/html/structreflex_1_1_pattern_1_1_d_f_a-members.html +++ b/doc/html/structreflex_1_1_pattern_1_1_d_f_a-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -77,7 +77,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_pattern_1_1_d_f_a.html b/doc/html/structreflex_1_1_pattern_1_1_d_f_a.html index f99dbbc2b..a7734c755 100644 --- a/doc/html/structreflex_1_1_pattern_1_1_d_f_a.html +++ b/doc/html/structreflex_1_1_pattern_1_1_d_f_a.html @@ -21,7 +21,7 @@
    reflex::Pattern::DFA Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -535,7 +535,7 @@

    Member Data Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_pattern_1_1_d_f_a_1_1_state-members.html b/doc/html/structreflex_1_1_pattern_1_1_d_f_a_1_1_state-members.html index 60d368442..c702aba08 100644 --- a/doc/html/structreflex_1_1_pattern_1_1_d_f_a_1_1_state-members.html +++ b/doc/html/structreflex_1_1_pattern_1_1_d_f_a_1_1_state-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -74,7 +74,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_pattern_1_1_d_f_a_1_1_state.html b/doc/html/structreflex_1_1_pattern_1_1_d_f_a_1_1_state.html index 34a277995..821f6c338 100644 --- a/doc/html/structreflex_1_1_pattern_1_1_d_f_a_1_1_state.html +++ b/doc/html/structreflex_1_1_pattern_1_1_d_f_a_1_1_state.html @@ -21,7 +21,7 @@
    reflex::Pattern::DFA::State Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -342,7 +342,7 @@

    Member Data Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_pattern_1_1_h_f_a-members.html b/doc/html/structreflex_1_1_pattern_1_1_h_f_a-members.html index b6aabc546..90a3831ae 100644 --- a/doc/html/structreflex_1_1_pattern_1_1_h_f_a-members.html +++ b/doc/html/structreflex_1_1_pattern_1_1_h_f_a-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -74,7 +74,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_pattern_1_1_h_f_a.html b/doc/html/structreflex_1_1_pattern_1_1_h_f_a.html index 5c58f5ed2..421628c23 100644 --- a/doc/html/structreflex_1_1_pattern_1_1_h_f_a.html +++ b/doc/html/structreflex_1_1_pattern_1_1_h_f_a.html @@ -21,7 +21,7 @@
    reflex::Pattern::HFA Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -331,7 +331,7 @@

    Member Data Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_pattern_1_1_mod_const-members.html b/doc/html/structreflex_1_1_pattern_1_1_mod_const-members.html index 7acf8c901..7231ef90a 100644 --- a/doc/html/structreflex_1_1_pattern_1_1_mod_const-members.html +++ b/doc/html/structreflex_1_1_pattern_1_1_mod_const-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -70,7 +70,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_pattern_1_1_mod_const.html b/doc/html/structreflex_1_1_pattern_1_1_mod_const.html index b8fbca859..24860555e 100644 --- a/doc/html/structreflex_1_1_pattern_1_1_mod_const.html +++ b/doc/html/structreflex_1_1_pattern_1_1_mod_const.html @@ -21,7 +21,7 @@
    reflex::Pattern::ModConst Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -293,7 +293,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_pattern_1_1_option-members.html b/doc/html/structreflex_1_1_pattern_1_1_option-members.html index 04cb83000..63e302299 100644 --- a/doc/html/structreflex_1_1_pattern_1_1_option-members.html +++ b/doc/html/structreflex_1_1_pattern_1_1_option-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -77,7 +77,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_pattern_1_1_option.html b/doc/html/structreflex_1_1_pattern_1_1_option.html index ad4220463..856e42123 100644 --- a/doc/html/structreflex_1_1_pattern_1_1_option.html +++ b/doc/html/structreflex_1_1_pattern_1_1_option.html @@ -21,7 +21,7 @@
    reflex::Pattern::Option Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -384,7 +384,7 @@

    Member Data Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_pattern_1_1_position-members.html b/doc/html/structreflex_1_1_pattern_1_1_position-members.html index df111caed..f6f2aead6 100644 --- a/doc/html/structreflex_1_1_pattern_1_1_position-members.html +++ b/doc/html/structreflex_1_1_pattern_1_1_position-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -93,7 +93,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_pattern_1_1_position.html b/doc/html/structreflex_1_1_pattern_1_1_position.html index 8af8e93ca..f65804a86 100644 --- a/doc/html/structreflex_1_1_pattern_1_1_position.html +++ b/doc/html/structreflex_1_1_pattern_1_1_position.html @@ -21,7 +21,7 @@
    reflex::Pattern::Position Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -891,7 +891,7 @@

    Member Data Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_posix_1_1_tables_1_1lt-members.html b/doc/html/structreflex_1_1_posix_1_1_tables_1_1lt-members.html index 07df972a1..1a75babaa 100644 --- a/doc/html/structreflex_1_1_posix_1_1_tables_1_1lt-members.html +++ b/doc/html/structreflex_1_1_posix_1_1_tables_1_1lt-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -61,7 +61,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_posix_1_1_tables_1_1lt.html b/doc/html/structreflex_1_1_posix_1_1_tables_1_1lt.html index e248ac4da..890014936 100644 --- a/doc/html/structreflex_1_1_posix_1_1_tables_1_1lt.html +++ b/doc/html/structreflex_1_1_posix_1_1_tables_1_1lt.html @@ -21,7 +21,7 @@
    reflex::Posix::Tables::lt Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -106,7 +106,7 @@

    Member Function Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_type_op-members.html b/doc/html/structreflex_1_1_type_op-members.html index 29c46b6b4..6ad339d2b 100644 --- a/doc/html/structreflex_1_1_type_op-members.html +++ b/doc/html/structreflex_1_1_type_op-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -63,7 +63,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_type_op.html b/doc/html/structreflex_1_1_type_op.html index 2c6abe221..ca8b41041 100644 --- a/doc/html/structreflex_1_1_type_op.html +++ b/doc/html/structreflex_1_1_type_op.html @@ -21,7 +21,7 @@
    reflex::TypeOp< T > Struct Template Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -141,7 +141,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_type_op_3_01const_01_t_01_4-members.html b/doc/html/structreflex_1_1_type_op_3_01const_01_t_01_4-members.html index 695012780..a041f0bd0 100644 --- a/doc/html/structreflex_1_1_type_op_3_01const_01_t_01_4-members.html +++ b/doc/html/structreflex_1_1_type_op_3_01const_01_t_01_4-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -63,7 +63,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1_type_op_3_01const_01_t_01_4.html b/doc/html/structreflex_1_1_type_op_3_01const_01_t_01_4.html index 5b13b2ffc..b5f3d6f0f 100644 --- a/doc/html/structreflex_1_1_type_op_3_01const_01_t_01_4.html +++ b/doc/html/structreflex_1_1_type_op_3_01const_01_t_01_4.html @@ -21,7 +21,7 @@
    reflex::TypeOp< const T > Struct Template Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -126,7 +126,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1lazy__intersection-members.html b/doc/html/structreflex_1_1lazy__intersection-members.html index c727461be..787665b9a 100644 --- a/doc/html/structreflex_1_1lazy__intersection-members.html +++ b/doc/html/structreflex_1_1lazy__intersection-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -66,7 +66,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1lazy__intersection.html b/doc/html/structreflex_1_1lazy__intersection.html index 3e0f04800..6de247b32 100644 --- a/doc/html/structreflex_1_1lazy__intersection.html +++ b/doc/html/structreflex_1_1lazy__intersection.html @@ -21,7 +21,7 @@
    reflex::lazy_intersection< S1, S2 > Struct Template Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -236,7 +236,7 @@

    Member Data Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1lazy__intersection_1_1iterator-members.html b/doc/html/structreflex_1_1lazy__intersection_1_1iterator-members.html index 026c6699b..a42bf0ffc 100644 --- a/doc/html/structreflex_1_1lazy__intersection_1_1iterator-members.html +++ b/doc/html/structreflex_1_1lazy__intersection_1_1iterator-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -74,7 +74,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1lazy__intersection_1_1iterator.html b/doc/html/structreflex_1_1lazy__intersection_1_1iterator.html index 903f5676c..d8ef667f8 100644 --- a/doc/html/structreflex_1_1lazy__intersection_1_1iterator.html +++ b/doc/html/structreflex_1_1lazy__intersection_1_1iterator.html @@ -21,7 +21,7 @@
    reflex::lazy_intersection< S1, S2 >::iterator Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -432,7 +432,7 @@

    Member Data Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1lazy__union-members.html b/doc/html/structreflex_1_1lazy__union-members.html index f2794c51e..4319ea242 100644 --- a/doc/html/structreflex_1_1lazy__union-members.html +++ b/doc/html/structreflex_1_1lazy__union-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -66,7 +66,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1lazy__union.html b/doc/html/structreflex_1_1lazy__union.html index 76360a844..0d82b9b56 100644 --- a/doc/html/structreflex_1_1lazy__union.html +++ b/doc/html/structreflex_1_1lazy__union.html @@ -21,7 +21,7 @@
    reflex::lazy_union< S1, S2 > Struct Template Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -236,7 +236,7 @@

    Member Data Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1lazy__union_1_1iterator-members.html b/doc/html/structreflex_1_1lazy__union_1_1iterator-members.html index 567c89449..88189a960 100644 --- a/doc/html/structreflex_1_1lazy__union_1_1iterator-members.html +++ b/doc/html/structreflex_1_1lazy__union_1_1iterator-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -75,7 +75,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1lazy__union_1_1iterator.html b/doc/html/structreflex_1_1lazy__union_1_1iterator.html index 4067e376b..91f195327 100644 --- a/doc/html/structreflex_1_1lazy__union_1_1iterator.html +++ b/doc/html/structreflex_1_1lazy__union_1_1iterator.html @@ -21,7 +21,7 @@
    reflex::lazy_union< S1, S2 >::iterator Struct Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -448,7 +448,7 @@

    Member Data Documentation

    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1range__compare-members.html b/doc/html/structreflex_1_1range__compare-members.html index 3a6b526b9..bd20097f7 100644 --- a/doc/html/structreflex_1_1range__compare-members.html +++ b/doc/html/structreflex_1_1range__compare-members.html @@ -21,7 +21,7 @@
    Member List

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -61,7 +61,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/structreflex_1_1range__compare.html b/doc/html/structreflex_1_1range__compare.html index 10eecc9f3..7cf749c66 100644 --- a/doc/html/structreflex_1_1range__compare.html +++ b/doc/html/structreflex_1_1range__compare.html @@ -21,7 +21,7 @@
    reflex::range_compare< T > Struct Template Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -127,7 +127,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/timer_8h.html b/doc/html/timer_8h.html index c13ca3eac..fbb8ebfd3 100644 --- a/doc/html/timer_8h.html +++ b/doc/html/timer_8h.html @@ -21,7 +21,7 @@
    timer.h File Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -96,7 +96,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/traits_8h.html b/doc/html/traits_8h.html index 7966b1257..ce07dae61 100644 --- a/doc/html/traits_8h.html +++ b/doc/html/traits_8h.html @@ -21,7 +21,7 @@
    traits.h File Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -98,7 +98,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/unicode_8h.html b/doc/html/unicode_8h.html index 5a70464e5..7380d613e 100644 --- a/doc/html/unicode_8h.html +++ b/doc/html/unicode_8h.html @@ -21,7 +21,7 @@
    unicode.h File Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -98,7 +98,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/html/utf8_8h.html b/doc/html/utf8_8h.html index 43c2368a3..d63dde8f0 100644 --- a/doc/html/utf8_8h.html +++ b/doc/html/utf8_8h.html @@ -21,7 +21,7 @@
    utf8.h File Reference

    -
    updated Wed Apr 10 2024 by Robert van Engelen
    +
    updated Sun May 12 2024 by Robert van Engelen
      @@ -157,7 +157,7 @@
    +Converted on Sun May 12 2024 10:52:13 by Doxygen 1.8.11
    diff --git a/doc/index.md b/doc/index.md index a18c12f09..33ad84398 100644 --- a/doc/index.md +++ b/doc/index.md @@ -13,50 +13,49 @@ RE/flex user guide {#mainpage} What is RE/flex? {#intro} ================ -A high-performance C++ regex library and lexical analyzer generator with -Unicode support. +A high-performance C++ regex library and a lexical analyzer generator like +Flex and Lex. -The RE/flex lexical analyzer generator is compatible with standard Flex lexer -specifications and integrates seamlessly with Bison parsers. The lexical -analyzer generator accepts Flex lexer specifications, but also supports -indentation anchors, lazy quantifiers, word boundaries, and many other modern -features. +The RE/flex lexical analyzer generator extends Flex++ with Unicode support +and many other useful features, such as regex indentation anchors, regex lazy +quantifiers, regex word boundaries, methods for error reporting and recovery, +and options to simplify integration with with Bison and other parsers. The RE/flex lexical analyzer generator does all the heavy-lifting for you to -make it easier to integrate advanced tokenizers with Bison parsers. It -generates the necessary gluing code depending on the type of Bison parser used, -such as advanced "Bison complete parsers". - -The high-performance RE/flex regex library is used by the RE/flex lexical -analyzer generator to generate finite state machine tables or direct code to -scan and search input efficiently. RE/flex also includes a smart input class -to normalize input from files, streams, strings, and memory to standard UTF-8 -streams. - -A quick summary of features: - -- faster than Flex++ for typical applications such as tokenization; -- accepts Flex/Lex lexer specifications, extended to support Unicode; -- IEEE POSIX P1003.2 standard compliant (like Lex and Flex); -- fully supports Unicode, auto-detects UTF-8/16/32 with smart input handling; -- supports legacy file encoding formats, e.g. CP 1250, EBCDIC. -- offers methods for lex/syntax \ref errors; -- easily integrates with Bison reentrant, C++, bridge and location parsers; -- generates source code that is easy to understand; -- generates thread-safe scanners; -- generates graphviz files for visualization of finite state machines; -- options for intuitive customization of the lexer class source code output; -- efficient matching in direct code or with finite state machine tables; -- optional "free space mode" to improve readability of lexer specifications; -- regular expressions may contain lazy quantifiers; -- regular expressions may contain word boundary anchors; -- regular expressions may contain indent/dedent markers for matching; -- other regex engines to choose from, such as PCRE2 and Boost.Regex; -- released under a permissive open source license (BSD-3). - -RE/flex offers many other practical improvements over Flex++, such as: - -- no input buffer length limit (Flex has a 16KB limit); +make it easier to integrate advanced tokenizers with Bison and other parsers. +It generates the necessary gluing code depending on the type of Bison parser +used, such as advanced "Bison complete parsers". + +The high-performance RE/flex regex library generates finite state machine +tables or direct code to scan and search input efficiently. RE/flex also +includes a smart input class to normalize input from files, streams, strings, +and memory to standard UTF-8 streams. + +In a nutshell, RE/flex + +- extends Flex++ with Unicode and other new featues +- accepts legacy Flex and Lex lexer specifications +- is faster than Flex++ for typical applications such as tokenization +- is compliant to the IEEE POSIX P1003.2 standard (like Lex and Flex) +- supports Unicode, auto-detects UTF-8/16/32 with smart input handling +- supports legacy file encoding formats, e.g. CP 1250, EBCDIC +- includes methods for lex and syntax \ref errors +- integrates with Bison reentrant, C++, bridge and location parsers +- generates source code that is easy to understand +- generates thread-safe scanners +- generates graphviz files for visualization of finite state machines +- supports easy customization of the lexer class source code output +- is fast with direct code or with finite state machine tables +- supports "free space mode" to improve readability of lexer specifications +- regular expressions may contain lazy quantifiers +- regular expressions may contain word boundary anchors +- regular expressions may contain indent/dedent markers for matching +- offers other regex engines to choose from, such as PCRE2 and Boost.Regex +- is released under a permissive open source license (BSD-3) + +RE/flex includes practical improvements over Flex++, such as: + +- no input buffer length limit (Flex has a 16K limit); - `yypush_buffer_state` saves the scanner state (line, column, and indentation positions), not just the input buffer; - new methods to analyze ASCII and Unicode input, such as `str()` and `wstr()` @@ -219,7 +218,7 @@ scan over C/C++ source code input to match multiline comments that start with a
    Another argument to use this code with Flex is that the internal Flex buffer is -limited to 16KB. By contrast, RE/flex buffers are dynamically resized and will +limited to 16K. By contrast, RE/flex buffers are dynamically resized and will never run out of buffer space to accept long matches. Workarounds such as these are not necessary with RE/flex. The RE/flex scanners @@ -2271,12 +2270,11 @@ match: const char *s = matcher().span(); std::cout << t << " in " << s << std::endl; ~~~ -The start of a line is truncated when the line is too long. The length of the -line's contents before the pattern match on the line is restricted to 8KB, -which is the size specified by `reflex::AbstractMatcher::Const::BLOCK`. When -this length is exceeded, the line's length before the match is truncated to -8KB. This ensures that pattern matching binary files or files with very long -lines cannot cause memory allocation exceptions. +The start of a line is truncated when the line is too long, longer than 256K +which is the initial buffer size `reflex::AbstractMatcher::Const::BUFSZ`. When +this length is exceeded, the line's length before the match is truncated. This +ensures that pattern matching binary files or files with very long lines cannot +cause memory allocation exceptions. Because `matcher()` returns the current matcher object, the following Flex-like actions are also supported: @@ -7485,12 +7483,11 @@ string copy of the match: const char *s = span(); std::cout << t << " in " << s << std::endl; ~~~ -The start of a line is truncated when the line is too long. The length of the -line's contents before the pattern match on the line is restricted to 8KB, -which is the size specified by `reflex::AbstractMatcher::Const::BLOCK`. When -this length is exceeded, the line's length before the match is truncated to -8KB. This ensures that pattern matching binary files or files with very long -lines cannot cause memory allocation exceptions. +The start of a line is truncated when the line is too long, longer than 256K +which is the initial buffer size `reflex::AbstractMatcher::Const::BUFSZ`. When +this length is exceeded, the line's length before the match is truncated. This +ensures that pattern matching binary files or files with very long lines cannot +cause memory allocation exceptions. The `matcher().more()` method is used to create longer matches by stringing together consecutive matches in the input after scanning the input with the @@ -9450,8 +9447,8 @@ RE/flex applications: Minimized library and cross compiling {#linking} ------------------------------------- -RE/flex scanners generated by `reflex` can be linked against a minimized -version of the RE/flex library `libreflexmin`: +RE/flex scanners generated with `reflex` can be linked against a +minimized version of the RE/flex library `libreflexmin`: c++ ... -lreflexmin @@ -9461,15 +9458,38 @@ time are excluded from the minimized library. If the RE/flex library is not installed, for example when cross-compiling a RE/flex scanner to a different platform, then compile directly from the RE/flex C++ source files located in the `reflex/lib` and `reflex/include` -directories: +directories as follows: c++ -I. -Iinclude lex.yy.cpp lib/debug.cpp lib/error.cpp \ - lib/input.cpp lib/matcher.cpp lib/pattern.cpp lib/utf8.cpp + lib/input.cpp lib/matcher.cpp lib/pattern.cpp lib/utf8.cpp lib/simd.cpp -This compiles the code without SIMD optimizations. SIMD intrinsics for SSE/AVX -and ARM NEON/AArch64 are used to speed up string search and newline detection -in the library. However, these optimizations are applicable to searching with -the `find()` method and are not applicable to scanners. +This compiles the code without SIMD optimizations, despite compiling +`lib/simd.cpp`. SIMD intrinsics for SSE/AVX and ARM NEON/AArch64 are used to +speed up string search and newline detection in the library. These +optimizations are for the most part applicable to speed up searching with the +`Matcher::find()` method. + +To compile with NEON/AArch64 optimizations applied (omit `-mfpu=neon` for AArch64): + + c++ -DHAVE_NEON -mfpu=neon -I. -Iinclude lex.yy.cpp lib/debug.cpp lib/error.cpp \ + lib/input.cpp lib/matcher.cpp lib/pattern.cpp lib/utf8.cpp lib/simd.cpp + +To compile with SSE2 optimizations applied: + + c++ -DHAVE_SSE2 -msse2 -I. -Iinclude lex.yy.cpp lib/debug.cpp lib/error.cpp \ + lib/input.cpp lib/matcher.cpp lib/pattern.cpp lib/utf8.cpp lib/simd.cpp + +To compile with AVX2 optimizations applied: + + c++ -DHAVE_AVX2 -mavx2 -I. -Iinclude lex.yy.cpp lib/debug.cpp lib/error.cpp \ + lib/input.cpp lib/matcher.cpp lib/pattern.cpp lib/utf8.cpp lib/simd.cpp \ + lib/matcher_avx2.cpp lib/simd_avx2.cpp + +To compile with AVX512BW optimizations applied: + + c++ -DHAVE_AVX512BW -mavx512bw -I. -Iinclude lex.yy.cpp lib/debug.cpp lib/error.cpp \ + lib/input.cpp lib/matcher.cpp lib/pattern.cpp lib/utf8.cpp lib/simd.cpp \ + lib/matcher_avx2.cpp lib/matcher_avx512bw.cpp lib/simd_avx2.cpp lib/simd_avx512bw.cpp 🔝 [Back to table of contents](#) @@ -9487,19 +9507,18 @@ input buffer: - Compile the generated source code with `-DREFLEX_BUFSZ=16384` to override the internal buffer `reflex::AbstractMatcher::Const::BUFSZ` size. By - default, the `reflex::AbstractMatcher::Const::BLOCK` size is 64K, which is - reasonably optimal for high-performance file searching and tokenization. The - buffer is a sliding window over the input, i.e. input files may be much - larger than the buffer size. A reasonably small `REFLEX_BUFSZ` is 16384 - for a 16K buffer. A small buffer automatically expands to accommodate larger - pattern matches. However, when using the `line()` and `wline()` methods, - very long lines may not fit and the return string values of `line()` and - `wline()` may be truncated as a result. Furtheremore, a small buffer - increase processing time, i.e. to frequently move the buffered window along a - file and increases the cost to decode UTF-16/32 into UTF-8 multibyte - sequences. - -@warning The value of `REFLEX_BUFSZ` should not be less than 8192. + default, the buffer size is 256K, which is optimal for high-performance file + searching and tokenization. The buffer is a sliding window over the input, + i.e. input files may be much larger than the buffer size. A reasonably small + `REFLEX_BUFSZ` is 16384 for a 16K buffer. A small buffer automatically + expands to accommodate larger pattern matches. However, when using the + `line()` and `wline()` methods, very long lines may not fit and the return + string values of `line()` and `wline()` may be truncated as a result. + Furtheremore, a small buffer increase processing time, i.e. to frequently + move the buffered window along a file and increases the cost to decode + UTF-16/32 into UTF-8 multibyte sequences. + +@warning The value of `REFLEX_BUFSZ` should not be less than 4096. 🔝 [Back to table of contents](#) diff --git a/doc/man/reflex.1 b/doc/man/reflex.1 index 542c778d0..254b1364a 100644 --- a/doc/man/reflex.1 +++ b/doc/man/reflex.1 @@ -1,4 +1,4 @@ -.TH REFLEX "1" "April 10, 2024" "reflex 4.2.1" "User Commands" +.TH REFLEX "1" "May 12, 2024" "reflex 4.3.0" "User Commands" .SH NAME \fBreflex\fR -- regex\-centric, fast and flexible lexical analyzer generator .SH SYNOPSIS diff --git a/examples/fastfind.l b/examples/fastfind.l index 05c05b793..645b6fd7d 100644 --- a/examples/fastfind.l +++ b/examples/fastfind.l @@ -1,10 +1,11 @@ /* search standard input fast for C/C++ directives such as #define, #include etc. */ -/* This search uses a Bloom filter with SIMD (SSE2/AVX2/AVX512/AArch64) */ +/* This search uses a Bloom filter with SIMD (SSE2/AVX2/AVX512BW/NEON/AArch64) */ +/* > ./fastfind < someinputfile.cpp */ %{ #include %} -/* specify option find to search, not scan */ +/* specify option find to search input, not to scan the input */ %o fast find main directive ^\h*#(.|\\\r?\n)+\n diff --git a/fuzzy/fuzzymatcher.h b/fuzzy/fuzzymatcher.h index 6ee5ad489..e11b04779 100644 --- a/fuzzy/fuzzymatcher.h +++ b/fuzzy/fuzzymatcher.h @@ -726,11 +726,19 @@ class FuzzyMatcher : public Matcher { if (jump == 0) { // loop back to start state w/o full match: advance to avoid backtracking - if (cap_ == 0 && pos_ > cur_ && method == Const::FIND) + if (cap_ == 0 && method == Const::FIND) { - // use bit_[] to check each char in buf_[cur_+1..pos_-1] if it is a starting char, if not then increase cur_ - while (cur_ + 1 < pos_ && !pat_->fst_.test(static_cast(buf_[cur_ + 1]))) + if (cur_ + 1 == pos_) + { + // matched one char in a loop, do not backtrack here ++cur_; + } + else + { + // check each char in buf_[cur_+1..pos_-1] if it is a starting char, if not then increase cur_ + while (cur_ + 1 < pos_ && !pat_->fst_.test(static_cast(buf_[cur_ + 1]))) + ++cur_; + } } } else if (jump >= Pattern::Const::LONG) @@ -1091,8 +1099,8 @@ class FuzzyMatcher : public Matcher { } } } - txt_ = buf_ + cur_; } + txt_ = buf_ + cur_; } else { diff --git a/include/reflex/absmatcher.h b/include/reflex/absmatcher.h index 6f3a13518..454b84614 100644 --- a/include/reflex/absmatcher.h +++ b/include/reflex/absmatcher.h @@ -30,7 +30,7 @@ @file absmatcher.h @brief RE/flex abstract matcher base class and pattern matcher class @author Robert van Engelen - engelen@genivia.com -@copyright (c) 2016-2022, Robert van Engelen, Genivia Inc. All rights reserved. +@copyright (c) 2016-2024, Robert van Engelen, Genivia Inc. All rights reserved. @copyright (c) BSD-3 License - see LICENSE.txt */ @@ -42,12 +42,12 @@ #define WITH_REALLOC 1 #endif -/// This compile-time option speeds up matching, but slows input(). +/// This compile-time option speeds up matching, but slows input() somewhat. #ifndef WITH_FAST_GET #define WITH_FAST_GET 1 #endif -/// This compile-time option adds span(), line(), wline(), bol(), eol() +/// This compile-time option adds span(), line(), wline(), bol(), eol(). #ifndef WITH_SPAN #define WITH_SPAN 1 #endif @@ -111,7 +111,7 @@ class AbstractMatcher { static const int EOB = EOF; ///< end of buffer meta-char marker static const size_t BLOCK = 4096; ///< minimum remaining unused space in the buffer, to prevent excessive shifting #ifndef REFLEX_BUFSZ - static const size_t BUFSZ = (128*1024); ///< initial buffer size, at least 4096 bytes + static const size_t BUFSZ = (256*1024); ///< initial buffer size, at least 4096 bytes #else static const size_t BUFSZ = REFLEX_BUFSZ; #endif @@ -422,6 +422,7 @@ class AbstractMatcher { own_ = true; eof_ = false; mat_ = false; + cml_ = false; } /// Set buffer block size for reading: use 0 (or omit argument) to buffer all input in which case returns true if all the data could be read and false if a read error occurred. bool buffer(size_t blk = 0) ///< new block size between 1 and Const::BLOCK, or 0 to buffer all input (default) @@ -486,7 +487,7 @@ class AbstractMatcher { (void)buffer(1); } /// Flush the buffer's remaining content. - void flush() + inline void flush() { DBGLOG("AbstractMatcher::flush()"); pos_ = end_; @@ -560,6 +561,7 @@ class AbstractMatcher { own_ = false; eof_ = true; mat_ = false; + cml_ = false; } return *this; } @@ -645,6 +647,13 @@ class AbstractMatcher { { return utf8(txt_); } +#if WITH_SPAN + /// Set or reset mode to count matching lines only and skip other (e.g. for speed). + inline void lineno_skip(bool f = false) + { + cml_ = f; + } +#endif /// Set or change the starting line number of the last match. inline void lineno(size_t n) ///< new line number { @@ -652,7 +661,7 @@ class AbstractMatcher { lno_ = n; } /// Updates and returns the starting line number of the match in the input character sequence. - inline size_t lineno() + size_t lineno() /// @returns line number { #if WITH_SPAN @@ -661,55 +670,16 @@ class AbstractMatcher { const char *s = lpb_; const char *t = txt_; size_t n = 0; -#if defined(HAVE_AVX512BW) && (!defined(_MSC_VER) || defined(_WIN64)) - if (have_HW_AVX512BW()) - n = simd_nlcount_avx512bw(s, t); - else if (have_HW_AVX2()) - n = simd_nlcount_avx2(s, t); - else - n = simd_nlcount_sse2(s, t); -#elif defined(HAVE_AVX2) - if (have_HW_AVX2()) - n = simd_nlcount_avx2(s, t); - else - n = simd_nlcount_sse2(s, t); -#elif defined(HAVE_SSE2) - n = simd_nlcount_sse2(s, t); -#endif -#if defined(HAVE_NEON) - // no ARM AArch64/NEON SIMD optimized loop? - no code that runs faster than the code below?! - uint32_t n0 = 0, n1 = 0; - while (s < t - 1) + if (cml_) { - n0 += s[0] == '\n'; - n1 += s[1] == '\n'; - s += 2; + // count number of matching lines only, not line numbers + n = std::memchr(s, '\n', t - s) != NULL; } - n += n0 + n1 + (s < t && *s == '\n'); -#else - // clang/gcc 4-way auto-vectorizable loop - uint32_t n0 = 0, n1 = 0, n2 = 0, n3 = 0; - while (s < t - 3) + else { - n0 += s[0] == '\n'; - n1 += s[1] == '\n'; - n2 += s[2] == '\n'; - n3 += s[3] == '\n'; - s += 4; + // count line numbers + n = nlcount(s, t); } - n += n0 + n1 + n2 + n3; - // epilogue - if (s < t) - { - n += *s == '\n'; - if (++s < t) - { - n += *s == '\n'; - if (++s < t) - n += *s == '\n'; - } - } -#endif // if newlines are detected, then find begin of the last line to adjust bol if (n > 0) { @@ -1116,21 +1086,37 @@ class AbstractMatcher { } return buf_ + end_; } + /// Return number of bytes available given number of bytes to fetch ahead, limited by input size and buffer size + inline size_t fetch(size_t len) + /// @returns number of bytes available after fetching. + { + DBGLOG("AbstractMatcher::fetch(%zu)", len); + if (eof_) + return 0; + if (len <= end_ - (txt_ - buf_)) + return end_ - (txt_ - buf_); + if (end_ + len + 1 >= max_) + (void)grow(); + if (end_ + len + 1 >= max_) + len = max_ - end_ - 1; + end_ += get(buf_ + end_, len); + return avail(); + } /// Returns the number of bytes in the buffer available to search from the current begin()/text() position. - size_t avail() + inline size_t avail() { if (peek() == EOF) return 0; return end_ - (txt_ - buf_); } /// Returns the byte offset of the match from the start of the line. - size_t border() + inline size_t border() /// @returns border offset { return txt_ - bol(); } /// Enlarge the match to span the entire line of input (excluding \n), return text(). - const char *span() + inline const char *span() /// @returns const char* span of text for the entire line { DBGLOG("AbstractMatcher::span()"); @@ -1146,7 +1132,7 @@ class AbstractMatcher { return text(); } /// Returns the line of input (excluding \n) as a string containing the matched text as a substring. - std::string line() + inline std::string line() /// @returns matching line as a string { DBGLOG("AbstractMatcher::line()"); @@ -1156,7 +1142,7 @@ class AbstractMatcher { return std::string(b, e - b); } /// Returns the line of input (excluding \n) as a wide string containing the matched text as a substring. - std::wstring wline() + inline std::wstring wline() /// @returns matching line as a wide string { DBGLOG("AbstractMatcher::wline()"); @@ -1252,12 +1238,12 @@ class AbstractMatcher { return text(); } /// Append the next match to the currently matched text returned by AbstractMatcher::text, when the next match found is adjacent to the current match. - void more() + inline void more() { cur_ = txt_ - buf_; } /// Truncate the AbstractMatcher::text length of the match to n characters in length and reposition for next match. - void less(size_t n) ///< truncated string length + inline void less(size_t n) ///< truncated string length { if (n < len_) { @@ -1270,80 +1256,80 @@ class AbstractMatcher { } } /// Cast this matcher to positive integer indicating the nonzero capture index of the matched text in the pattern, same as AbstractMatcher::accept. - operator size_t() const + inline operator size_t() const /// @returns nonzero capture index of a match, which may be matcher dependent, or zero for a mismatch { return accept(); } /// Cast this matcher to a std::string of the text matched by this matcher. - operator std::string() const + inline operator std::string() const /// @returns std::string with matched text { return str(); } /// Cast this matcher to a std::wstring of the text matched by this matcher. - operator std::wstring() const + inline operator std::wstring() const /// @returns std::wstring converted to UCS from the 0-terminated matched UTF-8 text { return wstr(); } /// Cast the match to std::pair(accept(), wstr()), useful for tokenization into containers. - operator std::pair() const + inline operator std::pair() const /// @returns std::pair(accept(), wstr()) { return pair(); } /// Returns true if matched text is equal to a string, useful for std::algorithm. - bool operator==(const char *rhs) ///< rhs string to compare to + inline bool operator==(const char *rhs) ///< rhs string to compare to /// @returns true if matched text is equal to rhs string const { return std::strncmp(rhs, txt_, len_) == 0 && rhs[len_] == '\0'; } /// Returns true if matched text is equalt to a string, useful for std::algorithm. - bool operator==(const std::string& rhs) ///< rhs string to compare to + inline bool operator==(const std::string& rhs) ///< rhs string to compare to /// @returns true if matched text is equal to rhs string const { return rhs.size() == len_ && rhs.compare(0, std::string::npos, txt_, len_) == 0; } /// Returns true if capture index is equal to a given size_t value, useful for std::algorithm. - bool operator==(size_t rhs) ///< capture index to compare accept() to + inline bool operator==(size_t rhs) ///< capture index to compare accept() to /// @returns true if capture index is equal to rhs const { return accept() == rhs; } /// Returns true if capture index is equal to a given int value, useful for std::algorithm. - bool operator==(int rhs) ///< capture index to compare accept() to + inline bool operator==(int rhs) ///< capture index to compare accept() to /// @returns true if capture index is equal to rhs const { return static_cast(accept()) == rhs; } /// Returns true if matched text is not equal to a string, useful for std::algorithm. - bool operator!=(const char *rhs) ///< rhs string to compare to + inline bool operator!=(const char *rhs) ///< rhs string to compare to /// @returns true if matched text is not equal to rhs string const { return std::strncmp(rhs, txt_, len_) != 0 || rhs[len_] != '\0'; // if static checkers complain here, they are wrong } /// Returns true if matched text is not equal to a string, useful for std::algorithm. - bool operator!=(const std::string& rhs) ///< rhs string to compare to + inline bool operator!=(const std::string& rhs) ///< rhs string to compare to /// @returns true if matched text is not equal to rhs string const { return rhs.size() > len_ || rhs.compare(0, std::string::npos, txt_, len_) != 0; } /// Returns true if capture index is not equal to a given size_t value, useful for std::algorithm. - bool operator!=(size_t rhs) ///< capture index to compare accept() to + inline bool operator!=(size_t rhs) ///< capture index to compare accept() to /// @returns true if capture index is not equal to rhs const { return accept() != rhs; } /// Returns true if capture index is not equal to a given int value, useful for std::algorithm. - bool operator!=(int rhs) ///< capture index to compare accept() to + inline bool operator!=(int rhs) ///< capture index to compare accept() to /// @returns true if capture index is not equal to rhs const { @@ -1632,6 +1618,7 @@ class AbstractMatcher { bool own_; ///< true if AbstractMatcher::buf_ was allocated and should be deleted bool eof_; ///< input has reached EOF bool mat_; ///< true if AbstractMatcher::matches() was successful + bool cml_; ///< true when counting matching lines instead of line numbers }; /// The pattern matcher class template extends abstract matcher base class. @@ -1656,7 +1643,7 @@ class PatternMatcher : public AbstractMatcher { delete pat_; } /// Assign a matcher, the underlying pattern object is shared (not deep copied). - PatternMatcher& operator=(const PatternMatcher& matcher) ///< matcher with pattern to use (pattern may be shared) + virtual PatternMatcher& operator=(const PatternMatcher& matcher) ///< matcher with pattern to use (pattern may be shared) { scan.init(this, Const::SCAN); find.init(this, Const::FIND); @@ -1664,9 +1651,7 @@ class PatternMatcher : public AbstractMatcher { in = matcher.in; reset(); opt_ = matcher.opt_; - pat_ = matcher.pat_, - own_ = false; - return *this; + return pattern(matcher.pat_); } /// Set the pattern to use with this matcher as a shared pointer to another matcher pattern. virtual PatternMatcher& pattern(const PatternMatcher& matcher) ///< the other matcher @@ -1726,19 +1711,19 @@ class PatternMatcher : public AbstractMatcher { return *this; } /// Returns true if this matcher has a pattern. - bool has_pattern() const + inline bool has_pattern() const /// @returns true if this matcher has a pattern { return pat_ != NULL; } /// Returns true if this matcher has its own pattern not received from another matcher (responsible to delete). - bool own_pattern() const + inline bool own_pattern() const /// @returns true if this matcher has its own pattern { return own_ && pat_ != NULL; } /// Returns a reference to the pattern object associated with this matcher. - const Pattern& pattern() const + virtual const Pattern& pattern() const /// @returns reference to pattern object { ASSERT(pat_ != NULL); @@ -1809,7 +1794,7 @@ class PatternMatcher : public AbstractMatcher { delete pat_; } /// Assign a matcher, the underlying pattern string is shared (not deep copied). - PatternMatcher& operator=(const PatternMatcher& matcher) ///< matcher with pattern to use (pattern may be shared) + virtual PatternMatcher& operator=(const PatternMatcher& matcher) ///< matcher with pattern to use (pattern may be shared) { scan.init(this, Const::SCAN); find.init(this, Const::FIND); @@ -1817,9 +1802,7 @@ class PatternMatcher : public AbstractMatcher { in = matcher.in; reset(); opt_ = matcher.opt_; - pat_ = matcher.pat_, - own_ = false; - return *this; + return pattern(matcher.pat_); } /// Set the pattern to use with this matcher as a shared pointer to another matcher pattern. virtual PatternMatcher& pattern(const PatternMatcher& matcher) ///< the other matcher @@ -1865,19 +1848,19 @@ class PatternMatcher : public AbstractMatcher { return *this; } /// Returns true if this matcher has a pattern. - bool has_pattern() const + inline bool has_pattern() const /// @returns true if this matcher has a pattern { return pat_ != NULL; } /// Returns true if this matcher has its own pattern not received from another matcher (responsible to delete). - bool own_pattern() const + inline bool own_pattern() const /// @returns true if this matcher has its own pattern { return own_ && pat_ != NULL; } /// Returns a reference to the pattern string associated with this matcher. - const Pattern& pattern() const + virtual const Pattern& pattern() const /// @returns reference to pattern string { ASSERT(pat_ != NULL); diff --git a/include/reflex/matcher.h b/include/reflex/matcher.h index 224501c84..1c254df76 100644 --- a/include/reflex/matcher.h +++ b/include/reflex/matcher.h @@ -30,13 +30,18 @@ @file matcher.h @brief RE/flex matcher engine @author Robert van Engelen - engelen@genivia.com -@copyright (c) 2016-2022, Robert van Engelen, Genivia Inc. All rights reserved. +@copyright (c) 2016-2024, Robert van Engelen, Genivia Inc. All rights reserved. @copyright (c) BSD-3 License - see LICENSE.txt */ #ifndef REFLEX_MATCHER_H #define REFLEX_MATCHER_H +#if !defined(HAVE_NEON) +/// enable predict match patterns after strings longer than 4 chars (this is a bit slower on ARM NEON/AArch64) +#define WITH_STRING_PM +#endif + #include #include #include @@ -63,7 +68,7 @@ class Matcher : public PatternMatcher { const Input& input = Input(), ///< input character sequence for this matcher const char *opt = NULL) ///< option string of the form `(A|N|T(=[[:digit:]])?|;)*` : - PatternMatcher(pattern, input, opt) + PatternMatcher(pattern, input) { reset(opt); } @@ -73,7 +78,7 @@ class Matcher : public PatternMatcher { const Input& input = Input(), ///< input character sequence for this matcher const char *opt = NULL) ///< option string of the form `(A|N|T(=[[:digit:]])?|;)*` : - PatternMatcher(pattern, input, opt) + PatternMatcher(pattern, input) { reset(opt); } @@ -83,7 +88,7 @@ class Matcher : public PatternMatcher { const Input& input = Input(), ///< input character sequence for this matcher const char *opt = NULL) ///< option string of the form `(A|N|T(=[[:digit:]])?|;)*` : - PatternMatcher(pattern, input, opt) + PatternMatcher(pattern, input) { reset(opt); } @@ -93,7 +98,7 @@ class Matcher : public PatternMatcher { const Input& input = Input(), ///< input character sequence for this matcher const char *opt = NULL) ///< option string of the form `(A|N|T(=[[:digit:]])?|;)*` : - PatternMatcher(pattern, input, opt) + PatternMatcher(pattern, input) { reset(opt); } @@ -105,15 +110,66 @@ class Matcher : public PatternMatcher { tab_(matcher.tab_) { DBGLOG("Matcher::Matcher(matcher)"); + init_advance(); } - /// Assign a matcher. + /// Assign a matcher, the underlying pattern string is shared (not deep copied). Matcher& operator=(const Matcher& matcher) ///< matcher to copy { PatternMatcher::operator=(matcher); ded_ = matcher.ded_; tab_ = matcher.tab_; + init_advance(); + return *this; + } + /// Set the pattern to use with this matcher (the given pattern is shared and must be persistent). + Matcher& pattern(const Pattern& pattern) ///< pattern object for this matcher + /// @returns this matcher + { + DBGLOG("Matcher::pattern()"); + if (pat_ != &pattern) + { + PatternMatcher::pattern(pattern); + init_advance(); + } + return *this; + } + /// Set the pattern to use with this matcher (the given pattern is shared and must be persistent). + Matcher& pattern(const Pattern *pattern) ///< pattern object for this matcher + /// @returns this matcher + { + DBGLOG("Matcher::pattern()"); + if (pat_ != pattern) + { + PatternMatcher::pattern(pattern); + init_advance(); + } + return *this; + } + /// Set the pattern from a regex string to use with this matcher. + Matcher& pattern(const char *pattern) ///< regex string to instantiate internal pattern object + /// @returns this matcher + { + DBGLOG("Matcher::pattern(\"%s\")", pattern); + PatternMatcher::pattern(pattern); + init_advance(); return *this; } + /// Set the pattern from a regex string to use with this matcher. + Matcher& pattern(const std::string& pattern) ///< regex string to instantiate internal pattern object + /// @returns this matcher + { + DBGLOG("Matcher::pattern(\"%s\")", pattern.c_str()); + PatternMatcher::pattern(pattern); + init_advance(); + return *this; + } + /// Returns a reference to the pattern associated with this matcher. + virtual const Pattern& pattern() const + /// @returns reference to pattern + { + ASSERT(pat_ != NULL); + return *pat_; + } /// Polymorphic cloning. virtual Matcher *clone() { @@ -126,6 +182,7 @@ class Matcher : public PatternMatcher { PatternMatcher::reset(opt); ded_ = 0; tab_.resize(0); + init_advance(); } /// Returns captured text as a std::pair with string pointer (non-0-terminated) and length. virtual std::pair operator[](size_t n) const @@ -410,14 +467,120 @@ class Matcher : public PatternMatcher { size_t simd_match_avx512bw(Method method); // match() with optimized AVX2 string search scheme defined in matcher_avx2.cpp size_t simd_match_avx2(Method method); - /// Returns true if able to advance to next possible match - bool advance() - /// @returns true if possible match found - ; - /// optimized AVX512BW version of advance() defined in matcher_avx512bw.cpp - bool simd_advance_avx512bw(); - /// optimized AVX2 version of advance() defined in matcher_avx2.cpp - bool simd_advance_avx2(); + /// Initialize specialized (+ SSE2/NEON) pattern search methods to advance the engine to a possible match + void init_advance(); + /// Initialize specialized AVX2 pattern search methods to advance the engine to a possible match + void simd_init_advance_avx2(); + /// Initialize specialized AVX512BW pattern search methods to advance the engine to a possible match + void simd_init_advance_avx512bw(); + /// Default method is none (unset) + bool advance_none(size_t loc); + // Single needle (SSE2/NEON) methods + bool advance_pattern_pin1_pma(size_t loc); + bool advance_pattern_pin1_pmh(size_t loc); + // Generated multi-needle SSE2 or NEON methods + bool advance_pattern_pin2_one(size_t loc); + bool advance_pattern_pin2_pma(size_t loc); + bool advance_pattern_pin2_pmh(size_t loc); + bool advance_pattern_pin3_one(size_t loc); + bool advance_pattern_pin3_pma(size_t loc); + bool advance_pattern_pin3_pmh(size_t loc); + bool advance_pattern_pin4_one(size_t loc); + bool advance_pattern_pin4_pma(size_t loc); + bool advance_pattern_pin4_pmh(size_t loc); + bool advance_pattern_pin5_one(size_t loc); + bool advance_pattern_pin5_pma(size_t loc); + bool advance_pattern_pin5_pmh(size_t loc); + bool advance_pattern_pin6_one(size_t loc); + bool advance_pattern_pin6_pma(size_t loc); + bool advance_pattern_pin6_pmh(size_t loc); + bool advance_pattern_pin7_one(size_t loc); + bool advance_pattern_pin7_pma(size_t loc); + bool advance_pattern_pin7_pmh(size_t loc); + bool advance_pattern_pin8_one(size_t loc); + bool advance_pattern_pin8_pma(size_t loc); + bool advance_pattern_pin8_pmh(size_t loc); + // Single needle AVX2 methods + bool simd_advance_pattern_pin1_pma_avx2(size_t loc); + bool simd_advance_pattern_pin1_pmh_avx2(size_t loc); + // Generated AVX2 multi-needle methods + bool simd_advance_pattern_pin2_one_avx2(size_t loc); + bool simd_advance_pattern_pin2_pma_avx2(size_t loc); + bool simd_advance_pattern_pin2_pmh_avx2(size_t loc); + bool simd_advance_pattern_pin3_one_avx2(size_t loc); + bool simd_advance_pattern_pin3_pma_avx2(size_t loc); + bool simd_advance_pattern_pin3_pmh_avx2(size_t loc); + bool simd_advance_pattern_pin4_one_avx2(size_t loc); + bool simd_advance_pattern_pin4_pma_avx2(size_t loc); + bool simd_advance_pattern_pin4_pmh_avx2(size_t loc); + bool simd_advance_pattern_pin5_one_avx2(size_t loc); + bool simd_advance_pattern_pin5_pma_avx2(size_t loc); + bool simd_advance_pattern_pin5_pmh_avx2(size_t loc); + bool simd_advance_pattern_pin6_one_avx2(size_t loc); + bool simd_advance_pattern_pin6_pma_avx2(size_t loc); + bool simd_advance_pattern_pin6_pmh_avx2(size_t loc); + bool simd_advance_pattern_pin7_one_avx2(size_t loc); + bool simd_advance_pattern_pin7_pma_avx2(size_t loc); + bool simd_advance_pattern_pin7_pmh_avx2(size_t loc); + bool simd_advance_pattern_pin8_one_avx2(size_t loc); + bool simd_advance_pattern_pin8_pma_avx2(size_t loc); + bool simd_advance_pattern_pin8_pmh_avx2(size_t loc); + bool simd_advance_pattern_pin16_one_avx2(size_t loc); + bool simd_advance_pattern_pin16_pma_avx2(size_t loc); + bool simd_advance_pattern_pin16_pmh_avx2(size_t loc); + // Minimal long patterns + bool advance_pattern_min1(size_t loc); + bool advance_pattern_min2(size_t loc); + bool advance_pattern_min3(size_t loc); + bool advance_pattern_min4(size_t loc); + // Minimal long patterns + bool advance_pattern(size_t loc); + // One char methods + bool advance_char(size_t loc); + bool advance_char_pma(size_t loc); + bool advance_char_pmh(size_t loc); + // Few chars methods + template bool advance_chars(size_t loc); + template bool advance_chars_pma(size_t loc); + template bool advance_chars_pmh(size_t loc); + // Few chars AVX2 methods + template bool simd_advance_chars_avx2(size_t loc); + template bool simd_advance_chars_pma_avx2(size_t loc); + template bool simd_advance_chars_pmh_avx2(size_t loc); + // Few chars AVX512BW methods + template bool simd_advance_chars_avx512bw(size_t loc); + template bool simd_advance_chars_pma_avx512bw(size_t loc); + template bool simd_advance_chars_pmh_avx512bw(size_t loc); + // String methods + bool advance_string(size_t loc); +#if defined(WITH_STRING_PM) + bool advance_string_pma(size_t loc); + bool advance_string_pmh(size_t loc); +#endif + // String AVX2 metnods + bool simd_advance_string_avx2(size_t loc); +#if defined(WITH_STRING_PM) + bool simd_advance_string_pma_avx2(size_t loc); + bool simd_advance_string_pmh_avx2(size_t loc); +#endif + // String AVX512BW metnods + bool simd_advance_string_avx512bw(size_t loc); +#if defined(WITH_STRING_PM) + bool simd_advance_string_pma_avx512bw(size_t loc); + bool simd_advance_string_pmh_avx512bw(size_t loc); +#endif + // String NEON metnods + bool simd_advance_string_neon(const char *&s, const char *e); +#if defined(WITH_STRING_PM) + bool simd_advance_string_pma_neon(const char *&s, const char *e); + bool simd_advance_string_pmh_neon(const char *&s, const char *e); +#endif + // Fallback Boyer-Moore methods + bool advance_string_bm(size_t loc); +#if defined(WITH_STRING_PM) + bool advance_string_bm_pma(size_t loc); + bool advance_string_bm_pmh(size_t loc); +#endif #if !defined(WITH_NO_INDENT) /// Update indentation column counter for indent() and dedent(). inline void newline() @@ -455,6 +618,7 @@ class Matcher : public PatternMatcher { std::vector lap_; ///< lookahead position in input that heads a lookahead match (indexed by lookahead number) std::stack stk_; ///< stack to push/pop stops FSM fsm_; ///< local state for FSM code + bool (Matcher::* adv_)(size_t loc); ///< advance FIND bool mrk_; ///< indent \i or dedent \j in pattern found: should check and update indent stops bool anc_; ///< match is anchored, advance slowly to retry when searching }; diff --git a/include/reflex/pattern.h b/include/reflex/pattern.h index 577f470ec..5591032f8 100644 --- a/include/reflex/pattern.h +++ b/include/reflex/pattern.h @@ -365,8 +365,8 @@ class Pattern { f |= pmh[h] & 4; h = hash(h, static_cast(*++s)); f |= pmh[h] & 8; - Pred m = 16; const char *e = s + n - 3; + Pred m = 16; while (f == 0 && ++s < e) { h = hash(h, static_cast(*s)); @@ -1172,7 +1172,7 @@ class Pattern { Index cut_; ///< DFA s-t cut to improve predict match and HFA accuracy together with lbk_ and cbk_ size_t len_; ///< length of chr_[], less or equal to 255 size_t min_; ///< patterns after the prefix are at least this long but no more than 8 - size_t pin_; ///< number of needles + size_t pin_; ///< number of needles, 0 to 16 std::bitset<256> cbk_; ///< characters to look back over when lbk_ > 0, never includes \n std::bitset<256> fst_; ///< the beginning characters of the pattern char chr_[256]; ///< pattern prefix string or character needles for needle-based search @@ -1183,7 +1183,7 @@ class Pattern { uint16_t lbm_; ///< loopback minimum distance when lbk_ > 0 uint16_t lcp_; ///< primary least common character position in the pattern or 0xffff uint16_t lcs_; ///< secondary least common character position in the pattern or 0xffff - size_t bmd_; ///< Boyer-Moore jump distance on mismatch, B-M is enabled when bmd_ > 0 + size_t bmd_; ///< Boyer-Moore jump distance on mismatch, B-M is enabled when bmd_ > 0 (<= 255) uint8_t bms_[256]; ///< Boyer-Moore skip array float pms_; ///< ms elapsed time to parse regex float vms_; ///< ms elapsed time to compile DFA vertices diff --git a/include/reflex/simd.h b/include/reflex/simd.h index 0fc2f7f30..f5c805bfb 100644 --- a/include/reflex/simd.h +++ b/include/reflex/simd.h @@ -28,15 +28,19 @@ /** @file simd.h -@brief RE/flex SIMD intrinsics +@brief RE/flex SIMD primitives @author Robert van Engelen - engelen@genivia.com -@copyright (c) 2016-2022, Robert van Engelen, Genivia Inc. All rights reserved. +@copyright (c) 2016-2024, Robert van Engelen, Genivia Inc. All rights reserved. @copyright (c) BSD-3 License - see LICENSE.txt */ #ifndef SIMD_H #define SIMD_H +#include +#include +#include + #if defined(HAVE_AVX512BW) # include #elif defined(HAVE_AVX2) @@ -133,15 +137,19 @@ inline uint32_t popcountl(uint64_t x) } #endif -// Partially count newlines in string b up to and including position e in b, updates b close to e with uncounted part -extern size_t simd_nlcount_sse2(const char*& b, const char *e); -extern size_t simd_nlcount_avx2(const char*& b, const char *e); -extern size_t simd_nlcount_avx512bw(const char*& b, const char *e); +// Partially count newlines in string b up to e, updates b close to e with uncounted part +extern size_t simd_nlcount_avx2(const char *&b, const char *e); +extern size_t simd_nlcount_avx512bw(const char *&b, const char *e); } // namespace reflex #endif -#endif +namespace reflex { +// Count newlines in string s up to t +extern size_t nlcount(const char *s, const char *t); +} // namespace reflex + +#endif diff --git a/lib/Make b/lib/Make index d344318a6..ff43bad7e 100644 --- a/lib/Make +++ b/lib/Make @@ -29,18 +29,18 @@ install: release @echo "Installing reflex header files in $(INSTALL_INC)" -cp -f ../include/reflex/*.h $(INSTALL_INC) -libreflex.a: convert.o debug.o error.o input.o block_scripts.o language_scripts.o letter_scripts.o composer.o matcher.o matcher_avx2.o matcher_avx512bw.o pattern.o posix.o simd_avx2.o simd_avx512bw.o unicode.o utf8.o +libreflex.a: convert.o debug.o error.o input.o block_scripts.o language_scripts.o letter_scripts.o composer.o matcher.o matcher_avx2.o matcher_avx512bw.o pattern.o posix.o simd.o simd_avx2.o simd_avx512bw.o unicode.o utf8.o $(AR) -rsc $@ $^ $(RANLIB) $@ -libreflexmin.a: debug.o error.o input.o matcher.o matcher_avx2.o matcher_avx512bw.o pattern.o simd_avx2.o simd_avx512bw.o utf8.o +libreflexmin.a: debug.o error.o input.o matcher.o matcher_avx2.o matcher_avx512bw.o pattern.o simd.o simd_avx2.o simd_avx512bw.o utf8.o $(AR) -rsc $@ $^ $(RANLIB) $@ -libreflex.so: convert.cpp debug.cpp error.cpp input.cpp ../unicode/block_scripts.cpp ../unicode/language_scripts.cpp ../unicode/letter_scripts.cpp ../unicode/composer.cpp matcher.cpp matcher_avx2.cpp matcher_avx512bw.cpp pattern.cpp posix.cpp simd_avx2.cpp simd_avx512bw.cpp unicode.cpp utf8.cpp +libreflex.so: convert.cpp debug.cpp error.cpp input.cpp ../unicode/block_scripts.cpp ../unicode/language_scripts.cpp ../unicode/letter_scripts.cpp ../unicode/composer.cpp matcher.cpp matcher_avx2.cpp matcher_avx512bw.cpp pattern.cpp posix.cpp simd.cpp simd_avx2.cpp simd_avx512bw.cpp unicode.cpp utf8.cpp $(CPP) $(CFLAGS) -shared -o $@ -fPIC $^ -libreflexmin.so: debug.cpp error.cpp input.cpp matcher.cpp matcher_avx2.cpp matcher_avx512bw.cpp pattern.cpp simd_avx2.cpp simd_avx512bw.cpp utf8.cpp +libreflexmin.so: debug.cpp error.cpp input.cpp matcher.cpp matcher_avx2.cpp matcher_avx512bw.cpp pattern.cpp simd.cpp simd_avx2.cpp simd_avx512bw.cpp utf8.cpp $(CPP) $(CFLAGS) -shared -o $@ -fPIC $^ block_scripts.o: ../unicode/block_scripts.cpp diff --git a/lib/Makefile.am b/lib/Makefile.am index fcf4f9926..4f4e54a59 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,6 +1,6 @@ -reflexincludedir = $(includedir)/reflex +reflexincludedir = $(includedir)/reflex -reflexinclude_HEADERS = \ +reflexinclude_HEADERS = \ $(top_srcdir)/include/reflex/abslexer.h \ $(top_srcdir)/include/reflex/absmatcher.h \ $(top_srcdir)/include/reflex/bits.h \ @@ -22,14 +22,14 @@ reflexinclude_HEADERS = \ $(top_srcdir)/include/reflex/unicode.h \ $(top_srcdir)/include/reflex/utf8.h -lib_LIBRARIES = \ +lib_LIBRARIES = \ libreflex.a \ libreflexmin.a -libreflex_a_CPPFLAGS = \ +libreflex_a_CPPFLAGS = \ -I$(top_srcdir)/include \ $(SIMD_FLAGS) -libreflex_a_SOURCES = \ +libreflex_a_SOURCES = \ convert.cpp \ debug.cpp \ error.cpp \ @@ -39,6 +39,7 @@ libreflex_a_SOURCES = \ matcher_avx512bw.cpp \ pattern.cpp \ posix.cpp \ + simd.cpp \ simd_avx2.cpp \ simd_avx512bw.cpp \ unicode.cpp \ @@ -51,7 +52,7 @@ libreflex_a_SOURCES = \ libreflexmin_a_CPPFLAGS = \ -I$(top_srcdir)/include \ $(SIMD_FLAGS) -libreflexmin_a_SOURCES = \ +libreflexmin_a_SOURCES = \ debug.cpp \ error.cpp \ input.cpp \ @@ -59,17 +60,18 @@ libreflexmin_a_SOURCES = \ matcher_avx2.cpp \ matcher_avx512bw.cpp \ pattern.cpp \ + simd.cpp \ simd_avx2.cpp \ simd_avx512bw.cpp \ utf8.cpp -# separately compile matcher_avx2.cpp and matcher_avx512bw (with the same content as matcher.cpp) with AVX optimizations enabled +# separately compile matcher_avx2.cpp and matcher_avx512bw with AVX2 optimizations enabled libreflex_a-matcher_avx2.$(OBJEXT) : CXXFLAGS += $(SIMD_AVX2_FLAGS) libreflex_a-matcher_avx512bw.$(OBJEXT) : CXXFLAGS += $(SIMD_AVX512BW_FLAGS) libreflexmin_a-matcher_avx2.$(OBJEXT) : CXXFLAGS += $(SIMD_AVX2_FLAGS) libreflexmin_a-matcher_avx512bw.$(OBJEXT) : CXXFLAGS += $(SIMD_AVX512BW_FLAGS) -# separately compile simd_avx2.cpp and simd_avx512bw.cpp with AVX optimizations enabled +# separately compile simd_avx2.cpp and simd_avx512bw.cpp with AVX512BW optimizations enabled libreflex_a-simd_avx2.$(OBJEXT) : CXXFLAGS += $(SIMD_AVX2_FLAGS) libreflex_a-simd_avx512bw.$(OBJEXT) : CXXFLAGS += $(SIMD_AVX512BW_FLAGS) libreflexmin_a-simd_avx2.$(OBJEXT) : CXXFLAGS += $(SIMD_AVX2_FLAGS) diff --git a/lib/Makefile.in b/lib/Makefile.in index 085808e61..cdc314b24 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -144,7 +144,7 @@ am_libreflex_a_OBJECTS = libreflex_a-convert.$(OBJEXT) \ libreflex_a-matcher_avx2.$(OBJEXT) \ libreflex_a-matcher_avx512bw.$(OBJEXT) \ libreflex_a-pattern.$(OBJEXT) libreflex_a-posix.$(OBJEXT) \ - libreflex_a-simd_avx2.$(OBJEXT) \ + libreflex_a-simd.$(OBJEXT) libreflex_a-simd_avx2.$(OBJEXT) \ libreflex_a-simd_avx512bw.$(OBJEXT) \ libreflex_a-unicode.$(OBJEXT) libreflex_a-utf8.$(OBJEXT) \ $(top_builddir)/unicode/libreflex_a-block_scripts.$(OBJEXT) \ @@ -159,7 +159,7 @@ am_libreflexmin_a_OBJECTS = libreflexmin_a-debug.$(OBJEXT) \ libreflexmin_a-matcher.$(OBJEXT) \ libreflexmin_a-matcher_avx2.$(OBJEXT) \ libreflexmin_a-matcher_avx512bw.$(OBJEXT) \ - libreflexmin_a-pattern.$(OBJEXT) \ + libreflexmin_a-pattern.$(OBJEXT) libreflexmin_a-simd.$(OBJEXT) \ libreflexmin_a-simd_avx2.$(OBJEXT) \ libreflexmin_a-simd_avx512bw.$(OBJEXT) \ libreflexmin_a-utf8.$(OBJEXT) @@ -192,6 +192,7 @@ am__depfiles_remade = $(top_builddir)/unicode/$(DEPDIR)/libreflex_a-block_script ./$(DEPDIR)/libreflex_a-matcher_avx512bw.Po \ ./$(DEPDIR)/libreflex_a-pattern.Po \ ./$(DEPDIR)/libreflex_a-posix.Po \ + ./$(DEPDIR)/libreflex_a-simd.Po \ ./$(DEPDIR)/libreflex_a-simd_avx2.Po \ ./$(DEPDIR)/libreflex_a-simd_avx512bw.Po \ ./$(DEPDIR)/libreflex_a-unicode.Po \ @@ -203,6 +204,7 @@ am__depfiles_remade = $(top_builddir)/unicode/$(DEPDIR)/libreflex_a-block_script ./$(DEPDIR)/libreflexmin_a-matcher_avx2.Po \ ./$(DEPDIR)/libreflexmin_a-matcher_avx512bw.Po \ ./$(DEPDIR)/libreflexmin_a-pattern.Po \ + ./$(DEPDIR)/libreflexmin_a-simd.Po \ ./$(DEPDIR)/libreflexmin_a-simd_avx2.Po \ ./$(DEPDIR)/libreflexmin_a-simd_avx512bw.Po \ ./$(DEPDIR)/libreflexmin_a-utf8.Po @@ -405,6 +407,7 @@ libreflex_a_SOURCES = \ matcher_avx512bw.cpp \ pattern.cpp \ posix.cpp \ + simd.cpp \ simd_avx2.cpp \ simd_avx512bw.cpp \ unicode.cpp \ @@ -426,6 +429,7 @@ libreflexmin_a_SOURCES = \ matcher_avx2.cpp \ matcher_avx512bw.cpp \ pattern.cpp \ + simd.cpp \ simd_avx2.cpp \ simd_avx512bw.cpp \ utf8.cpp @@ -543,6 +547,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libreflex_a-matcher_avx512bw.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libreflex_a-pattern.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libreflex_a-posix.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libreflex_a-simd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libreflex_a-simd_avx2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libreflex_a-simd_avx512bw.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libreflex_a-unicode.Po@am__quote@ # am--include-marker @@ -554,6 +559,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libreflexmin_a-matcher_avx2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libreflexmin_a-matcher_avx512bw.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libreflexmin_a-pattern.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libreflexmin_a-simd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libreflexmin_a-simd_avx2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libreflexmin_a-simd_avx512bw.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libreflexmin_a-utf8.Po@am__quote@ # am--include-marker @@ -706,6 +712,20 @@ libreflex_a-posix.obj: posix.cpp @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreflex_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libreflex_a-posix.obj `if test -f 'posix.cpp'; then $(CYGPATH_W) 'posix.cpp'; else $(CYGPATH_W) '$(srcdir)/posix.cpp'; fi` +libreflex_a-simd.o: simd.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreflex_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libreflex_a-simd.o -MD -MP -MF $(DEPDIR)/libreflex_a-simd.Tpo -c -o libreflex_a-simd.o `test -f 'simd.cpp' || echo '$(srcdir)/'`simd.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libreflex_a-simd.Tpo $(DEPDIR)/libreflex_a-simd.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='simd.cpp' object='libreflex_a-simd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreflex_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libreflex_a-simd.o `test -f 'simd.cpp' || echo '$(srcdir)/'`simd.cpp + +libreflex_a-simd.obj: simd.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreflex_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libreflex_a-simd.obj -MD -MP -MF $(DEPDIR)/libreflex_a-simd.Tpo -c -o libreflex_a-simd.obj `if test -f 'simd.cpp'; then $(CYGPATH_W) 'simd.cpp'; else $(CYGPATH_W) '$(srcdir)/simd.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libreflex_a-simd.Tpo $(DEPDIR)/libreflex_a-simd.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='simd.cpp' object='libreflex_a-simd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreflex_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libreflex_a-simd.obj `if test -f 'simd.cpp'; then $(CYGPATH_W) 'simd.cpp'; else $(CYGPATH_W) '$(srcdir)/simd.cpp'; fi` + libreflex_a-simd_avx2.o: simd_avx2.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreflex_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libreflex_a-simd_avx2.o -MD -MP -MF $(DEPDIR)/libreflex_a-simd_avx2.Tpo -c -o libreflex_a-simd_avx2.o `test -f 'simd_avx2.cpp' || echo '$(srcdir)/'`simd_avx2.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libreflex_a-simd_avx2.Tpo $(DEPDIR)/libreflex_a-simd_avx2.Po @@ -916,6 +936,20 @@ libreflexmin_a-pattern.obj: pattern.cpp @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreflexmin_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libreflexmin_a-pattern.obj `if test -f 'pattern.cpp'; then $(CYGPATH_W) 'pattern.cpp'; else $(CYGPATH_W) '$(srcdir)/pattern.cpp'; fi` +libreflexmin_a-simd.o: simd.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreflexmin_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libreflexmin_a-simd.o -MD -MP -MF $(DEPDIR)/libreflexmin_a-simd.Tpo -c -o libreflexmin_a-simd.o `test -f 'simd.cpp' || echo '$(srcdir)/'`simd.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libreflexmin_a-simd.Tpo $(DEPDIR)/libreflexmin_a-simd.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='simd.cpp' object='libreflexmin_a-simd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreflexmin_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libreflexmin_a-simd.o `test -f 'simd.cpp' || echo '$(srcdir)/'`simd.cpp + +libreflexmin_a-simd.obj: simd.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreflexmin_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libreflexmin_a-simd.obj -MD -MP -MF $(DEPDIR)/libreflexmin_a-simd.Tpo -c -o libreflexmin_a-simd.obj `if test -f 'simd.cpp'; then $(CYGPATH_W) 'simd.cpp'; else $(CYGPATH_W) '$(srcdir)/simd.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libreflexmin_a-simd.Tpo $(DEPDIR)/libreflexmin_a-simd.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='simd.cpp' object='libreflexmin_a-simd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreflexmin_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libreflexmin_a-simd.obj `if test -f 'simd.cpp'; then $(CYGPATH_W) 'simd.cpp'; else $(CYGPATH_W) '$(srcdir)/simd.cpp'; fi` + libreflexmin_a-simd_avx2.o: simd_avx2.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libreflexmin_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libreflexmin_a-simd_avx2.o -MD -MP -MF $(DEPDIR)/libreflexmin_a-simd_avx2.Tpo -c -o libreflexmin_a-simd_avx2.o `test -f 'simd_avx2.cpp' || echo '$(srcdir)/'`simd_avx2.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libreflexmin_a-simd_avx2.Tpo $(DEPDIR)/libreflexmin_a-simd_avx2.Po @@ -1120,6 +1154,7 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/libreflex_a-matcher_avx512bw.Po -rm -f ./$(DEPDIR)/libreflex_a-pattern.Po -rm -f ./$(DEPDIR)/libreflex_a-posix.Po + -rm -f ./$(DEPDIR)/libreflex_a-simd.Po -rm -f ./$(DEPDIR)/libreflex_a-simd_avx2.Po -rm -f ./$(DEPDIR)/libreflex_a-simd_avx512bw.Po -rm -f ./$(DEPDIR)/libreflex_a-unicode.Po @@ -1131,6 +1166,7 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/libreflexmin_a-matcher_avx2.Po -rm -f ./$(DEPDIR)/libreflexmin_a-matcher_avx512bw.Po -rm -f ./$(DEPDIR)/libreflexmin_a-pattern.Po + -rm -f ./$(DEPDIR)/libreflexmin_a-simd.Po -rm -f ./$(DEPDIR)/libreflexmin_a-simd_avx2.Po -rm -f ./$(DEPDIR)/libreflexmin_a-simd_avx512bw.Po -rm -f ./$(DEPDIR)/libreflexmin_a-utf8.Po @@ -1192,6 +1228,7 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libreflex_a-matcher_avx512bw.Po -rm -f ./$(DEPDIR)/libreflex_a-pattern.Po -rm -f ./$(DEPDIR)/libreflex_a-posix.Po + -rm -f ./$(DEPDIR)/libreflex_a-simd.Po -rm -f ./$(DEPDIR)/libreflex_a-simd_avx2.Po -rm -f ./$(DEPDIR)/libreflex_a-simd_avx512bw.Po -rm -f ./$(DEPDIR)/libreflex_a-unicode.Po @@ -1203,6 +1240,7 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libreflexmin_a-matcher_avx2.Po -rm -f ./$(DEPDIR)/libreflexmin_a-matcher_avx512bw.Po -rm -f ./$(DEPDIR)/libreflexmin_a-pattern.Po + -rm -f ./$(DEPDIR)/libreflexmin_a-simd.Po -rm -f ./$(DEPDIR)/libreflexmin_a-simd_avx2.Po -rm -f ./$(DEPDIR)/libreflexmin_a-simd_avx512bw.Po -rm -f ./$(DEPDIR)/libreflexmin_a-utf8.Po @@ -1243,13 +1281,13 @@ uninstall-am: uninstall-libLIBRARIES uninstall-reflexincludeHEADERS .PRECIOUS: Makefile -# separately compile matcher_avx2.cpp and matcher_avx512bw (with the same content as matcher.cpp) with AVX optimizations enabled +# separately compile matcher_avx2.cpp and matcher_avx512bw with AVX2 optimizations enabled libreflex_a-matcher_avx2.$(OBJEXT) : CXXFLAGS += $(SIMD_AVX2_FLAGS) libreflex_a-matcher_avx512bw.$(OBJEXT) : CXXFLAGS += $(SIMD_AVX512BW_FLAGS) libreflexmin_a-matcher_avx2.$(OBJEXT) : CXXFLAGS += $(SIMD_AVX2_FLAGS) libreflexmin_a-matcher_avx512bw.$(OBJEXT) : CXXFLAGS += $(SIMD_AVX512BW_FLAGS) -# separately compile simd_avx2.cpp and simd_avx512bw.cpp with AVX optimizations enabled +# separately compile simd_avx2.cpp and simd_avx512bw.cpp with AVX512BW optimizations enabled libreflex_a-simd_avx2.$(OBJEXT) : CXXFLAGS += $(SIMD_AVX2_FLAGS) libreflex_a-simd_avx512bw.$(OBJEXT) : CXXFLAGS += $(SIMD_AVX512BW_FLAGS) libreflexmin_a-simd_avx2.$(OBJEXT) : CXXFLAGS += $(SIMD_AVX2_FLAGS) diff --git a/lib/input.cpp b/lib/input.cpp index 01a08450f..bf33a499c 100644 --- a/lib/input.cpp +++ b/lib/input.cpp @@ -28,7 +28,7 @@ /** @file input.cpp -@brief RE/flex input character sequence class and simd.h CPUID check +@brief RE/flex input character sequence class @author Robert van Engelen - engelen@genivia.com @copyright (c) 2016-2020, Robert van Engelen, Genivia Inc. All rights reserved. @copyright (c) BSD-3 License - see LICENSE.txt @@ -1361,27 +1361,4 @@ void Input::file_encoding(unsigned short enc, const unsigned short *page) } } -#if defined(HAVE_AVX512BW) || defined(HAVE_AVX2) || defined(HAVE_SSE2) - -#include - -// simd.h get_HW() -static uint64_t get_HW() -{ - int CPUInfo1[4] = { 0, 0, 0, 0 }; - int CPUInfo7[4] = { 0, 0, 0, 0 }; - cpuidex(CPUInfo1, 0, 0); - int n = CPUInfo1[0]; - if (n <= 0) - return 0ULL; - cpuidex(CPUInfo1, 1, 0); // cpuid EAX=1 - if (n >= 7) - cpuidex(CPUInfo7, 7, 0); // cpuid EAX=7, ECX=0 - return static_cast(CPUInfo1[2]) | (static_cast(static_cast(CPUInfo7[1])) << 32); -} - -uint64_t HW = get_HW(); - -#endif - } // namespace reflex diff --git a/lib/matcher.cpp b/lib/matcher.cpp index 46e2704e7..79a1a2085 100644 --- a/lib/matcher.cpp +++ b/lib/matcher.cpp @@ -27,68 +27,21 @@ \******************************************************************************/ /** -@file matcher.cpp, matcher_avx2.cpp, matcher_avx512bw.cpp +@file matcher.cpp regex engine @brief RE/flex matcher engine @author Robert van Engelen - engelen@genivia.com -@copyright (c) 2016-2022, Robert van Engelen, Genivia Inc. All rights reserved. +@copyright (c) 2016-2024, Robert van Engelen, Genivia Inc. All rights reserved. @copyright (c) BSD-3 License - see LICENSE.txt */ -#if defined(COMPILE_AVX512BW) && !defined(HAVE_AVX512BW) - -// appease ranlib "has no symbols" -void matcher_not_compiled_with_avx512bw() { } - -#elif defined(COMPILE_AVX2) && !defined(HAVE_AVX2) && !defined(HAVE_AVX512BW) - -// appease ranlib "has no symbols" -void matcher_not_compiled_with_avx2() { } - -#else - #include namespace reflex { -/* - The simd_match_avx512bw() and simd_match_avx2() methods are AVX-optimized - versions of the match() method. To compile these methods separately with - the appropriate compilation flags, this file is copied to - matcher_avx512bw.cpp and matcher_avx2.cpp then compiled with -mavx512bw - -DCOMPILE_AVX512BW -DHAVE_AVX512BW and with -mavx2 -DCOMPILE_AVX2 - -DHAVE_AVX2, respectively. Likewise, the simd_advance_avx512bw() and - simd_advance_avx2() methods are optimized versions and separately compiled. - This approach is preferred over maintaining three separate copies of source - code files with these methods that only slightly differ. On the other hand, - combining these versions into one source file means more #if branches. - - If -DHAVE_AVX512BW is not defined, -DCOMPILE_AVX512BW has no effect. - Likewise, if -DHAVE_AVX2 is not defined, -DCOMPILE_AVX2 has no effect. -*/ - -#if defined(COMPILE_AVX512BW) -/// Compile an optimized AVX512BW version defined in matcher_avx2.cpp -size_t Matcher::simd_match_avx512bw(Method method) -{ -#elif defined(COMPILE_AVX2) -/// Compile an optimized AVX2 version defined in matcher_avx512bw.cpp -size_t Matcher::simd_match_avx2(Method method) -{ -#else /// Returns true if input matched the pattern using method Const::SCAN, Const::FIND, Const::SPLIT, or Const::MATCH. size_t Matcher::match(Method method) { DBGLOG("BEGIN Matcher::match()"); -#if defined(HAVE_AVX512BW) && (!defined(_MSC_VER) || defined(_WIN64)) - if (have_HW_AVX512BW()) - return simd_match_avx512bw(method); - if (have_HW_AVX2()) - return simd_match_avx2(method); -#elif defined(HAVE_AVX2) - if (have_HW_AVX2()) - return simd_match_avx2(method); -#endif -#endif reset_text(); len_ = 0; // split text length starts with 0 anc_ = false; // no word boundary anchor found and applied @@ -499,16 +452,26 @@ size_t Matcher::match(Method method) jump = Pattern::index_of(opcode); if (jump == 0) { - // loop back to start state w/o full match: advance to avoid backtracking, not used for lookback - if (cap_ == 0 && pos_ > cur_ && method == Const::FIND) + // loop back to start state w/o full match: advance to avoid backtracking + if (cap_ == 0 && method == Const::FIND) { - // use bit_[] to check each char in buf_[cur_+1..pos_-1] if it is a starting char, if not then increase cur_ - while (cur_ + 1 < pos_ && !pat_->fst_.test(static_cast(buf_[cur_ + 1]))) + if (cur_ + 1 == pos_) { + // matched one char in a loop, do not backtrack here ++cur_; if (retry > 0) --retry; } + else + { + // check each char in buf_[cur_+1..pos_-1] if it is a starting char, if not then increase cur_ + while (cur_ + 1 < pos_ && !pat_->fst_.test(static_cast(buf_[cur_ + 1]))) + { + ++cur_; + if (retry > 0) + --retry; + } + } } } else if (jump >= Pattern::Const::LONG) @@ -618,23 +581,15 @@ size_t Matcher::match(Method method) DBGLOG("Find: try next pos %zu", cur_); goto scan; } - // + // anchor or boundary? if (anc_) { cur_ = txt_ - buf_; // reset current to pattern start when a word boundary was encountered anc_ = false; } - if (pos_ > cur_) // if we didn't fail on META alone + if (cur_ < pos_) // if we didn't fail on META alone { - if ( -#if defined(COMPILE_AVX512BW) - simd_advance_avx512bw() -#elif defined(COMPILE_AVX2) - simd_advance_avx2() -#else - advance() -#endif - ) + if ((this->*adv_)(cur_ + 1)) { if (pat_->lbk_ > 0) { @@ -664,8 +619,8 @@ size_t Matcher::match(Method method) return cap_ = 1; } } - txt_ = buf_ + cur_; } + txt_ = buf_ + cur_; } else { @@ -693,18 +648,8 @@ size_t Matcher::match(Method method) // if we found an empty match, we keep looking for non-empty matches when "N" is off if (cap_ != 0) { - if ( -#if defined(COMPILE_AVX512BW) - simd_advance_avx512bw() -#elif defined(COMPILE_AVX2) - simd_advance_avx2() -#else - advance() -#endif - ) - { + if ((this->*adv_)(cur_ + 1)) goto scan; - } set_current(++cur_); // at end of input, no matches remain cap_ = 0; @@ -720,8 +665,8 @@ size_t Matcher::match(Method method) { // advance one char to keep searching at the next character position when we return set_current(++cur_); + DBGLOG("Accept empty match"); } - DBGLOG("Accept empty match"); } else { @@ -753,2457 +698,2746 @@ size_t Matcher::match(Method method) return cap_; } -#if defined(COMPILE_AVX512BW) -/// Compile an optimized AVX512BW version defined in matcher_avx512bw.cpp -bool Matcher::simd_advance_avx512bw() +/// Initialize specialized pattern search methods to advance the engine to a possible match +void Matcher::init_advance() { -#elif defined(COMPILE_AVX2) -/// Compile an optimized AVX2 version defined in matcher_avx2.cpp -bool Matcher::simd_advance_avx2() -{ -#else -/// advance input cursor position after mismatch to align input for the next match -bool Matcher::advance() -{ -#endif - size_t loc = cur_ + 1; - size_t min = pat_->min_; - const Pattern::Pred *pma = pat_->pma_; - const Pattern::Pred *pmh = pat_->pmh_; + adv_ = &Matcher::advance_none; + if (pat_ == NULL) + return; if (pat_->len_ == 0) { - if (min == 0) - { - // if "N" is on (non-empty pattern matches only), then there is nothing to match - if (opt_.N) - return false; - // if "N" is off, then match an empty-matching pattern as if non-empty - min = 1; - } - if (loc + min > end_) - { - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - } - // look for a needle - if (pat_->pin_ == 1) + if (pat_->min_ == 0 && opt_.N) + return; + switch (pat_->pin_) { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; -#if defined(COMPILE_AVX512BW) || defined(COMPILE_AVX2) - __m256i vlcp = _mm256_set1_epi8(chr[0]); - __m256i vlcs = _mm256_set1_epi8(chr[1]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 32) + case 1: + if (pat_->min_ < 4) + adv_ = &Matcher::advance_pattern_pin1_pma; + else + adv_ = &Matcher::advance_pattern_pin1_pmh; + break; +#if defined(HAVE_AVX512BW) || defined(HAVE_AVX2) || defined(HAVE_SSE2) || defined(HAVE_NEON) + case 2: + if (pat_->min_ == 1) + adv_ = &Matcher::advance_pattern_pin2_one; + else if (pat_->min_ < 4) + adv_ = &Matcher::advance_pattern_pin2_pma; + else + adv_ = &Matcher::advance_pattern_pin2_pmh; + break; + case 3: + if (pat_->min_ == 1) + adv_ = &Matcher::advance_pattern_pin3_one; + else if (pat_->min_ < 4) + adv_ = &Matcher::advance_pattern_pin3_pma; + else + adv_ = &Matcher::advance_pattern_pin3_pmh; + break; + case 4: + if (pat_->min_ == 1) + adv_ = &Matcher::advance_pattern_pin4_one; + else if (pat_->min_ < 4) + adv_ = &Matcher::advance_pattern_pin4_pma; + else + adv_ = &Matcher::advance_pattern_pin4_pmh; + break; + case 5: + if (pat_->min_ == 1) + adv_ = &Matcher::advance_pattern_pin5_one; + else if (pat_->min_ < 4) + adv_ = &Matcher::advance_pattern_pin5_pma; + else + adv_ = &Matcher::advance_pattern_pin5_pmh; + break; + case 6: + if (pat_->min_ == 1) + adv_ = &Matcher::advance_pattern_pin6_one; + else if (pat_->min_ < 4) + adv_ = &Matcher::advance_pattern_pin6_pma; + else + adv_ = &Matcher::advance_pattern_pin6_pmh; + break; + case 7: + if (pat_->min_ == 1) + adv_ = &Matcher::advance_pattern_pin7_one; + else if (pat_->min_ < 4) + adv_ = &Matcher::advance_pattern_pin7_pma; + else + adv_ = &Matcher::advance_pattern_pin7_pmh; + break; + case 8: + if (pat_->min_ == 1) + adv_ = &Matcher::advance_pattern_pin8_one; + else if (pat_->min_ < 4) + adv_ = &Matcher::advance_pattern_pin8_pma; + else + adv_ = &Matcher::advance_pattern_pin8_pmh; + break; +#endif + default: + if (pat_->min_ >= 4 || pat_->npy_ < 16 || (pat_->min_ >= 2 && pat_->npy_ >= 56)) { - __m256i vstrlcp = _mm256_loadu_si256(reinterpret_cast(s)); - __m256i vstrlcs = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); - __m256i veqlcp = _mm256_cmpeq_epi8(vlcp, vstrlcp); - __m256i veqlcs = _mm256_cmpeq_epi8(vlcs, vstrlcs); - uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(veqlcp, veqlcs)); - while (mask != 0) + switch (pat_->min_) { - uint32_t offset = ctz(mask); - loc = s - lcp + offset - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - mask &= mask - 1; + case 0: + case 1: + adv_ = &Matcher::advance_pattern_min1; + break; + case 2: + adv_ = &Matcher::advance_pattern_min2; + break; + case 3: + adv_ = &Matcher::advance_pattern_min3; + break; + default: + adv_ = &Matcher::advance_pattern_min4; + break; } - s += 32; } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 31 > end_) - break; - } -#elif defined(HAVE_AVX512BW) || defined(HAVE_AVX2) || defined(HAVE_SSE2) - __m128i vlcp = _mm_set1_epi8(chr[0]); - __m128i vlcs = _mm_set1_epi8(chr[1]); - while (true) + else + { + adv_ = &Matcher::advance_pattern; + } + } + } + else if (pat_->len_ == 1) + { + if (pat_->min_ == 0) + adv_ = &Matcher::advance_char; + else if (pat_->min_ < 4) + adv_ = &Matcher::advance_char_pma; + else + adv_ = &Matcher::advance_char_pmh; + } + else if (pat_->len_ == 2) + { + if (pat_->min_ == 0) + adv_ = &Matcher::advance_chars<2>; + else if (pat_->min_ < 4) + adv_ = &Matcher::advance_chars_pma<2>; + else + adv_ = &Matcher::advance_chars_pmh<2>; + } + else if (pat_->len_ == 3) + { + if (pat_->min_ == 0) + adv_ = &Matcher::advance_chars<3>; + else if (pat_->min_ < 4) + adv_ = &Matcher::advance_chars_pma<3>; + else + adv_ = &Matcher::advance_chars_pmh<3>; + } + else if (pat_->bmd_ == 0) + { +#if defined(WITH_STRING_PM) + if (pat_->min_ >= 4) + adv_ = &Matcher::advance_string_pmh; + else if (pat_->min_ > 0) + adv_ = &Matcher::advance_string_pma; + else +#endif + adv_ = &Matcher::advance_string; + } + else + { +#if defined(WITH_STRING_PM) + if (pat_->min_ >= 4) + adv_ = &Matcher::advance_string_bm_pmh; + else if (pat_->min_ > 0) + adv_ = &Matcher::advance_string_bm_pma; + else +#endif + adv_ = &Matcher::advance_string_bm; + } +#if defined(HAVE_AVX512BW) || defined(HAVE_AVX2) + // AVX2 runtime optimized function callback overrides + if (have_HW_AVX2()) + simd_init_advance_avx2(); +#endif +#if defined(HAVE_AVX512BW) && (!defined(_MSC_VER) || defined(_WIN64)) + // AVX512BW runtime optimized function callback overrides + if (have_HW_AVX512BW()) + simd_init_advance_avx512bw(); +#endif +} + +/// Default method is none (unset) +bool Matcher::advance_none(size_t) +{ + return false; +} + +/// My "needle search" method when pin=1 +bool Matcher::advance_pattern_pin1_pma(size_t loc) +{ + const Pattern::Pred *pma = pat_->pma_; + const char *chr = pat_->chr_; + size_t min = pat_->min_; + uint16_t lcp = pat_->lcp_; + uint16_t lcs = pat_->lcs_; +#if defined(HAVE_AVX512BW) || defined(HAVE_AVX2) || defined(HAVE_SSE2) + __m128i vlcp = _mm_set1_epi8(chr[0]); + __m128i vlcs = _mm_set1_epi8(chr[1]); + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - min + 1; + while (s <= e - 16) + { + __m128i vstrlcp = _mm_loadu_si128(reinterpret_cast(s)); + __m128i vstrlcs = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); + __m128i veqlcp = _mm_cmpeq_epi8(vlcp, vstrlcp); + __m128i veqlcs = _mm_cmpeq_epi8(vlcs, vstrlcs); + uint32_t mask = _mm_movemask_epi8(_mm_and_si128(veqlcp, veqlcs)); + while (mask != 0) { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 16) + uint32_t offset = ctz(mask); + loc = s - lcp + offset - buf_; + if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) { - __m128i vstrlcp = _mm_loadu_si128(reinterpret_cast(s)); - __m128i vstrlcs = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); - __m128i veqlcp = _mm_cmpeq_epi8(vlcp, vstrlcp); - __m128i veqlcs = _mm_cmpeq_epi8(vlcs, vstrlcs); - uint32_t mask = _mm_movemask_epi8(_mm_and_si128(veqlcp, veqlcs)); - while (mask != 0) - { - uint32_t offset = ctz(mask); - loc = s - lcp + offset - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - mask &= mask - 1; - } - s += 16; + set_current(loc); + return true; } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 15 > end_) - break; + mask &= mask - 1; } + s += 16; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + min > end_) + return false; + if (loc + min + 15 > end_) + break; + } #elif defined(HAVE_NEON) - uint8x16_t vlcp = vdupq_n_u8(chr[0]); - uint8x16_t vlcs = vdupq_n_u8(chr[1]); - while (true) + uint8x16_t vlcp = vdupq_n_u8(chr[0]); + uint8x16_t vlcs = vdupq_n_u8(chr[1]); + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - min + 1; + while (s <= e - 16) + { + uint8x16_t vstrlcp = vld1q_u8(reinterpret_cast(s)); + uint8x16_t vstrlcs = vld1q_u8(reinterpret_cast(s + lcs - lcp)); + uint8x16_t vmasklcp8 = vceqq_u8(vlcp, vstrlcp); + uint8x16_t vmasklcs8 = vceqq_u8(vlcs, vstrlcs); + uint64x2_t vmask64 = vreinterpretq_u64_u8(vandq_u8(vmasklcp8, vmasklcs8)); + uint64_t mask = vgetq_lane_u64(vmask64, 0); + if (mask != 0) { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 16) + for (uint16_t i = 0; i < 8; ++i) { - uint8x16_t vstrlcp = vld1q_u8(reinterpret_cast(s)); - uint8x16_t vstrlcs = vld1q_u8(reinterpret_cast(s + lcs - lcp)); - uint8x16_t vmasklcp8 = vceqq_u8(vlcp, vstrlcp); - uint8x16_t vmasklcs8 = vceqq_u8(vlcs, vstrlcs); - uint64x2_t vmask64 = vreinterpretq_u64_u8(vandq_u8(vmasklcp8, vmasklcs8)); - uint64_t mask = vgetq_lane_u64(vmask64, 0); - if (mask != 0) - { - for (int i = 0; i < 8; ++i) - { - if ((mask & 0xff)) - { - loc = s - lcp + i - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - } - mask >>= 8; - } - } - mask = vgetq_lane_u64(vmask64, 1); - if (mask != 0) + if ((mask & 0xff)) { - for (int i = 0; i < 8; ++i) + loc = s - lcp + i - buf_; + if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) { - if ((mask & 0xff)) - { - loc = s - lcp + i + 8 - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - } - mask >>= 8; + set_current(loc); + return true; } } - s += 16; + mask >>= 8; } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 15 > end_) - break; } -#else - while (true) + mask = vgetq_lane_u64(vmask64, 1); + if (mask != 0) { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_; - if (s < e && (s = static_cast(std::memchr(s, chr[0], e - s))) != NULL) - { - s -= lcp; - loc = s - buf_; - set_current(loc); - if (min >= 4) - { - if (s + min > e || (s[lcs] == chr[1] && Pattern::predict_match(pmh, s, min))) - return true; - } - else - { - if (s > e - 4 || Pattern::predict_match(pma, s) == 0) - return true; - } - ++loc; - } - else - { - loc = e - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - } - } -#endif - } -#if defined(COMPILE_AVX512BW) || defined(COMPILE_AVX2) - // look for needles - else if (pat_->pin_ == 2) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - __m256i vlcp0 = _mm256_set1_epi8(chr[0]); - __m256i vlcp1 = _mm256_set1_epi8(chr[1]); - __m256i vlcs0 = _mm256_set1_epi8(chr[2]); - __m256i vlcs1 = _mm256_set1_epi8(chr[3]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 32) + for (uint16_t i = 8; i < 16; ++i) { - __m256i vstrlcp = _mm256_loadu_si256(reinterpret_cast(s)); - __m256i vstrlcs = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); - __m256i veqlcp = _mm256_cmpeq_epi8(vlcp0, vstrlcp); - __m256i veqlcs = _mm256_cmpeq_epi8(vlcs0, vstrlcs); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp1, vstrlcp)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs1, vstrlcs)); - uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(veqlcp, veqlcs)); - while (mask != 0) + if ((mask & 0xff)) { - uint32_t offset = ctz(mask); - loc = s - lcp + offset - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else + loc = s - lcp + i - buf_; + if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; + set_current(loc); + return true; } - mask &= mask - 1; } - s += 32; + mask >>= 8; } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 31 > end_) - break; } + s += 16; } - else if (pat_->pin_ == 3) + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + min > end_) + return false; + if (loc + min + 15 > end_) + break; + } +#endif + char chr0 = chr[0]; + char chr1 = chr[1]; + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_; + if (s < e && (s = static_cast(std::memchr(s, chr0, e - s))) != NULL) { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - __m256i vlcp0 = _mm256_set1_epi8(chr[0]); - __m256i vlcp1 = _mm256_set1_epi8(chr[1]); - __m256i vlcp2 = _mm256_set1_epi8(chr[2]); - __m256i vlcs0 = _mm256_set1_epi8(chr[3]); - __m256i vlcs1 = _mm256_set1_epi8(chr[4]); - __m256i vlcs2 = _mm256_set1_epi8(chr[5]); - while (true) + s -= lcp; + loc = s - buf_; + if (s > e - 4 || (s[lcs] == chr1 && Pattern::predict_match(pma, s) == 0)) { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 32) - { - __m256i vstrlcp = _mm256_loadu_si256(reinterpret_cast(s)); - __m256i vstrlcs = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); - __m256i veqlcp = _mm256_cmpeq_epi8(vlcp0, vstrlcp); - __m256i veqlcs = _mm256_cmpeq_epi8(vlcs0, vstrlcs); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp1, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp2, vstrlcp)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs1, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs2, vstrlcs)); - uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(veqlcp, veqlcs)); - while (mask != 0) - { - uint32_t offset = ctz(mask); - loc = s - lcp + offset - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - mask &= mask - 1; - } - s += 32; - } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 31 > end_) - break; + set_current(loc); + return true; } + ++loc; } - else if (pat_->pin_ == 4) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - __m256i vlcp0 = _mm256_set1_epi8(chr[0]); - __m256i vlcp1 = _mm256_set1_epi8(chr[1]); - __m256i vlcp2 = _mm256_set1_epi8(chr[2]); - __m256i vlcp3 = _mm256_set1_epi8(chr[3]); - __m256i vlcs0 = _mm256_set1_epi8(chr[4]); - __m256i vlcs1 = _mm256_set1_epi8(chr[5]); - __m256i vlcs2 = _mm256_set1_epi8(chr[6]); - __m256i vlcs3 = _mm256_set1_epi8(chr[7]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 32) - { - __m256i vstrlcp = _mm256_loadu_si256(reinterpret_cast(s)); - __m256i vstrlcs = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); - __m256i veqlcp = _mm256_cmpeq_epi8(vlcp0, vstrlcp); - __m256i veqlcs = _mm256_cmpeq_epi8(vlcs0, vstrlcs); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp1, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp2, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp3, vstrlcp)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs1, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs2, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs3, vstrlcs)); - uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(veqlcp, veqlcs)); - while (mask != 0) - { - uint32_t offset = ctz(mask); - loc = s - lcp + offset - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - mask &= mask - 1; - } - s += 32; - } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 31 > end_) - break; - } + else + { + loc = e - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + min > end_) + return false; } - else if (pat_->pin_ == 5) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - __m256i vlcp0 = _mm256_set1_epi8(chr[0]); - __m256i vlcp1 = _mm256_set1_epi8(chr[1]); - __m256i vlcp2 = _mm256_set1_epi8(chr[2]); - __m256i vlcp3 = _mm256_set1_epi8(chr[3]); - __m256i vlcp4 = _mm256_set1_epi8(chr[4]); - __m256i vlcs0 = _mm256_set1_epi8(chr[5]); - __m256i vlcs1 = _mm256_set1_epi8(chr[6]); - __m256i vlcs2 = _mm256_set1_epi8(chr[7]); - __m256i vlcs3 = _mm256_set1_epi8(chr[8]); - __m256i vlcs4 = _mm256_set1_epi8(chr[9]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 32) + } +} + +/// My "needle search" method when pin=1 +bool Matcher::advance_pattern_pin1_pmh(size_t loc) +{ + const Pattern::Pred *pmh = pat_->pmh_; + const char *chr = pat_->chr_; + size_t min = pat_->min_; + uint16_t lcp = pat_->lcp_; + uint16_t lcs = pat_->lcs_; +#if defined(HAVE_AVX512BW) || defined(HAVE_AVX2) || defined(HAVE_SSE2) + __m128i vlcp = _mm_set1_epi8(chr[0]); + __m128i vlcs = _mm_set1_epi8(chr[1]); + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - min + 1; + while (s <= e - 16) + { + __m128i vstrlcp = _mm_loadu_si128(reinterpret_cast(s)); + __m128i vstrlcs = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); + __m128i veqlcp = _mm_cmpeq_epi8(vlcp, vstrlcp); + __m128i veqlcs = _mm_cmpeq_epi8(vlcs, vstrlcs); + uint32_t mask = _mm_movemask_epi8(_mm_and_si128(veqlcp, veqlcs)); + while (mask != 0) + { + uint32_t offset = ctz(mask); + loc = s - lcp + offset - buf_; + if (Pattern::predict_match(pmh, &buf_[loc], min)) { - __m256i vstrlcp = _mm256_loadu_si256(reinterpret_cast(s)); - __m256i vstrlcs = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); - __m256i veqlcp = _mm256_cmpeq_epi8(vlcp0, vstrlcp); - __m256i veqlcs = _mm256_cmpeq_epi8(vlcs0, vstrlcs); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp1, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp2, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp3, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp4, vstrlcp)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs1, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs2, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs3, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs4, vstrlcs)); - uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(veqlcp, veqlcs)); - while (mask != 0) - { - uint32_t offset = ctz(mask); - loc = s - lcp + offset - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - mask &= mask - 1; - } - s += 32; + set_current(loc); + return true; } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 31 > end_) - break; + mask &= mask - 1; } + s += 16; } - else if (pat_->pin_ == 6) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - __m256i vlcp0 = _mm256_set1_epi8(chr[0]); - __m256i vlcp1 = _mm256_set1_epi8(chr[1]); - __m256i vlcp2 = _mm256_set1_epi8(chr[2]); - __m256i vlcp3 = _mm256_set1_epi8(chr[3]); - __m256i vlcp4 = _mm256_set1_epi8(chr[4]); - __m256i vlcp5 = _mm256_set1_epi8(chr[5]); - __m256i vlcs0 = _mm256_set1_epi8(chr[6]); - __m256i vlcs1 = _mm256_set1_epi8(chr[7]); - __m256i vlcs2 = _mm256_set1_epi8(chr[8]); - __m256i vlcs3 = _mm256_set1_epi8(chr[9]); - __m256i vlcs4 = _mm256_set1_epi8(chr[10]); - __m256i vlcs5 = _mm256_set1_epi8(chr[11]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 32) + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + min > end_) + return false; + if (loc + min + 15 > end_) + break; + } +#elif defined(HAVE_NEON) + uint8x16_t vlcp = vdupq_n_u8(chr[0]); + uint8x16_t vlcs = vdupq_n_u8(chr[1]); + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - min + 1; + while (s <= e - 16) + { + uint8x16_t vstrlcp = vld1q_u8(reinterpret_cast(s)); + uint8x16_t vstrlcs = vld1q_u8(reinterpret_cast(s + lcs - lcp)); + uint8x16_t vmasklcp8 = vceqq_u8(vlcp, vstrlcp); + uint8x16_t vmasklcs8 = vceqq_u8(vlcs, vstrlcs); + uint64x2_t vmask64 = vreinterpretq_u64_u8(vandq_u8(vmasklcp8, vmasklcs8)); + uint64_t mask = vgetq_lane_u64(vmask64, 0); + if (mask != 0) + { + for (uint16_t i = 0; i < 8; ++i) { - __m256i vstrlcp = _mm256_loadu_si256(reinterpret_cast(s)); - __m256i vstrlcs = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); - __m256i veqlcp = _mm256_cmpeq_epi8(vlcp0, vstrlcp); - __m256i veqlcs = _mm256_cmpeq_epi8(vlcs0, vstrlcs); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp1, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp2, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp3, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp4, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp5, vstrlcp)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs1, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs2, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs3, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs4, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs5, vstrlcs)); - uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(veqlcp, veqlcs)); - while (mask != 0) + if ((mask & 0xff)) { - uint32_t offset = ctz(mask); - loc = s - lcp + offset - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else + loc = s - lcp + i - buf_; + if (Pattern::predict_match(pmh, &buf_[loc], min)) { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; + set_current(loc); + return true; } - mask &= mask - 1; } - s += 32; + mask >>= 8; } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 31 > end_) - break; } - } - else if (pat_->pin_ == 7) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - __m256i vlcp0 = _mm256_set1_epi8(chr[0]); - __m256i vlcp1 = _mm256_set1_epi8(chr[1]); - __m256i vlcp2 = _mm256_set1_epi8(chr[2]); - __m256i vlcp3 = _mm256_set1_epi8(chr[3]); - __m256i vlcp4 = _mm256_set1_epi8(chr[4]); - __m256i vlcp5 = _mm256_set1_epi8(chr[5]); - __m256i vlcp6 = _mm256_set1_epi8(chr[6]); - __m256i vlcs0 = _mm256_set1_epi8(chr[7]); - __m256i vlcs1 = _mm256_set1_epi8(chr[8]); - __m256i vlcs2 = _mm256_set1_epi8(chr[9]); - __m256i vlcs3 = _mm256_set1_epi8(chr[10]); - __m256i vlcs4 = _mm256_set1_epi8(chr[11]); - __m256i vlcs5 = _mm256_set1_epi8(chr[12]); - __m256i vlcs6 = _mm256_set1_epi8(chr[13]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 32) + mask = vgetq_lane_u64(vmask64, 1); + if (mask != 0) + { + for (uint16_t i = 8; i < 16; ++i) { - __m256i vstrlcp = _mm256_loadu_si256(reinterpret_cast(s)); - __m256i vstrlcs = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); - __m256i veqlcp = _mm256_cmpeq_epi8(vlcp0, vstrlcp); - __m256i veqlcs = _mm256_cmpeq_epi8(vlcs0, vstrlcs); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp1, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp2, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp3, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp4, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp5, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp6, vstrlcp)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs1, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs2, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs3, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs4, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs5, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs6, vstrlcs)); - uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(veqlcp, veqlcs)); - while (mask != 0) + if ((mask & 0xff)) { - uint32_t offset = ctz(mask); - loc = s - lcp + offset - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else + loc = s - lcp + i - buf_; + if (Pattern::predict_match(pmh, &buf_[loc], min)) { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; + set_current(loc); + return true; } - mask &= mask - 1; } - s += 32; + mask >>= 8; } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 31 > end_) - break; } + s += 16; } - else if (pat_->pin_ == 8) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - __m256i vlcp0 = _mm256_set1_epi8(chr[0]); - __m256i vlcp1 = _mm256_set1_epi8(chr[1]); - __m256i vlcp2 = _mm256_set1_epi8(chr[2]); - __m256i vlcp3 = _mm256_set1_epi8(chr[3]); - __m256i vlcp4 = _mm256_set1_epi8(chr[4]); - __m256i vlcp5 = _mm256_set1_epi8(chr[5]); - __m256i vlcp6 = _mm256_set1_epi8(chr[6]); - __m256i vlcp7 = _mm256_set1_epi8(chr[7]); - __m256i vlcs0 = _mm256_set1_epi8(chr[8]); - __m256i vlcs1 = _mm256_set1_epi8(chr[9]); - __m256i vlcs2 = _mm256_set1_epi8(chr[10]); - __m256i vlcs3 = _mm256_set1_epi8(chr[11]); - __m256i vlcs4 = _mm256_set1_epi8(chr[12]); - __m256i vlcs5 = _mm256_set1_epi8(chr[13]); - __m256i vlcs6 = _mm256_set1_epi8(chr[14]); - __m256i vlcs7 = _mm256_set1_epi8(chr[15]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 32) - { - __m256i vstrlcp = _mm256_loadu_si256(reinterpret_cast(s)); - __m256i vstrlcs = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); - __m256i veqlcp = _mm256_cmpeq_epi8(vlcp0, vstrlcp); - __m256i veqlcs = _mm256_cmpeq_epi8(vlcs0, vstrlcs); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp1, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp2, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp3, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp4, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp5, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp6, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp7, vstrlcp)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs1, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs2, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs3, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs4, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs5, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs6, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs7, vstrlcs)); - uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(veqlcp, veqlcs)); - while (mask != 0) - { - uint32_t offset = ctz(mask); - loc = s - lcp + offset - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - mask &= mask - 1; - } - s += 32; - } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 31 > end_) - break; + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + min > end_) + return false; + if (loc + min + 15 > end_) + break; + } +#endif + int chr0 = chr[0]; + int chr1 = chr[1]; + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_; + if (s < e && (s = static_cast(std::memchr(s, chr0, e - s))) != NULL) + { + s -= lcp; + loc = s - buf_; + if (s + min > e || (s[lcs] == chr1 && Pattern::predict_match(pmh, s, min))) + { + set_current(loc); + return true; } + ++loc; } - else if (pat_->pin_ == 16) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - __m256i vlcp0 = _mm256_set1_epi8(chr[0]); - __m256i vlcp1 = _mm256_set1_epi8(chr[1]); - __m256i vlcp2 = _mm256_set1_epi8(chr[2]); - __m256i vlcp3 = _mm256_set1_epi8(chr[3]); - __m256i vlcp4 = _mm256_set1_epi8(chr[4]); - __m256i vlcp5 = _mm256_set1_epi8(chr[5]); - __m256i vlcp6 = _mm256_set1_epi8(chr[6]); - __m256i vlcp7 = _mm256_set1_epi8(chr[7]); - __m256i vlcp8 = _mm256_set1_epi8(chr[8]); - __m256i vlcp9 = _mm256_set1_epi8(chr[9]); - __m256i vlcpa = _mm256_set1_epi8(chr[10]); - __m256i vlcpb = _mm256_set1_epi8(chr[11]); - __m256i vlcpc = _mm256_set1_epi8(chr[12]); - __m256i vlcpd = _mm256_set1_epi8(chr[13]); - __m256i vlcpe = _mm256_set1_epi8(chr[14]); - __m256i vlcpf = _mm256_set1_epi8(chr[15]); - __m256i vlcs0 = _mm256_set1_epi8(chr[16]); - __m256i vlcs1 = _mm256_set1_epi8(chr[17]); - __m256i vlcs2 = _mm256_set1_epi8(chr[18]); - __m256i vlcs3 = _mm256_set1_epi8(chr[19]); - __m256i vlcs4 = _mm256_set1_epi8(chr[20]); - __m256i vlcs5 = _mm256_set1_epi8(chr[21]); - __m256i vlcs6 = _mm256_set1_epi8(chr[22]); - __m256i vlcs7 = _mm256_set1_epi8(chr[23]); - __m256i vlcs8 = _mm256_set1_epi8(chr[24]); - __m256i vlcs9 = _mm256_set1_epi8(chr[25]); - __m256i vlcsa = _mm256_set1_epi8(chr[26]); - __m256i vlcsb = _mm256_set1_epi8(chr[27]); - __m256i vlcsc = _mm256_set1_epi8(chr[28]); - __m256i vlcsd = _mm256_set1_epi8(chr[29]); - __m256i vlcse = _mm256_set1_epi8(chr[30]); - __m256i vlcsf = _mm256_set1_epi8(chr[31]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 32) - { - __m256i vstrlcp = _mm256_loadu_si256(reinterpret_cast(s)); - __m256i vstrlcs = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); - __m256i veqlcp = _mm256_cmpeq_epi8(vlcp0, vstrlcp); - __m256i veqlcs = _mm256_cmpeq_epi8(vlcs0, vstrlcs); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp1, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp2, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp3, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp4, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp5, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp6, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp7, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp8, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp9, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcpa, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcpb, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcpc, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcpd, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcpe, vstrlcp)); - veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcpf, vstrlcp)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs1, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs2, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs3, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs4, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs5, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs6, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs7, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs8, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs9, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcsa, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcsb, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcsc, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcsd, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcse, vstrlcs)); - veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcsf, vstrlcs)); - uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(veqlcp, veqlcs)); - while (mask != 0) - { - uint32_t offset = ctz(mask); - loc = s - lcp + offset - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - mask &= mask - 1; - } - s += 32; - } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 31 > end_) - break; - } + else + { + loc = e - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + min > end_) + return false; + } + } +} + +#if defined(HAVE_AVX512BW) || defined(HAVE_AVX2) || defined(HAVE_SSE2) + +/// My "needle search" methods +#define ADV_PAT_PIN_ONE(N, INIT, COMP) \ +bool Matcher::advance_pattern_pin##N##_one(size_t loc) \ +{ \ + const Pattern::Pred *pma = pat_->pma_; \ + const char *chr = pat_->chr_; \ + INIT \ + while (true) \ + { \ + const char *s = buf_ + loc; \ + const char *e = buf_ + end_; \ + while (s <= e - 16) \ + { \ + __m128i vstr = _mm_loadu_si128(reinterpret_cast(s)); \ + __m128i veq = _mm_cmpeq_epi8(v0, vstr); \ + COMP \ + uint32_t mask = _mm_movemask_epi8(veq); \ + while (mask != 0) \ + { \ + uint32_t offset = ctz(mask); \ + loc = s + offset - buf_; \ + if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) \ + { \ + set_current(loc); \ + return true; \ + } \ + mask &= mask - 1; \ + } \ + s += 16; \ + } \ + loc = s - buf_; \ + set_current_and_peek_more(loc - 1); \ + loc = cur_ + 1; \ + if (loc + 1 > end_) \ + return false; \ + if (loc + 16 > end_) \ + break; \ + } \ + return advance_pattern(loc); \ +} + +ADV_PAT_PIN_ONE(2, \ + __m128i v0 = _mm_set1_epi8(chr[0]); \ + __m128i v1 = _mm_set1_epi8(chr[1]); \ + , \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v1, vstr)); \ + ) + +ADV_PAT_PIN_ONE(3, \ + __m128i v0 = _mm_set1_epi8(chr[0]); \ + __m128i v1 = _mm_set1_epi8(chr[1]); \ + __m128i v2 = _mm_set1_epi8(chr[2]); \ + , \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v1, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v2, vstr)); \ + ) + +ADV_PAT_PIN_ONE(4, \ + __m128i v0 = _mm_set1_epi8(chr[0]); \ + __m128i v1 = _mm_set1_epi8(chr[1]); \ + __m128i v2 = _mm_set1_epi8(chr[2]); \ + __m128i v3 = _mm_set1_epi8(chr[3]); \ + , \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v1, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v2, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v3, vstr)); \ + ) + +ADV_PAT_PIN_ONE(5, \ + __m128i v0 = _mm_set1_epi8(chr[0]); \ + __m128i v1 = _mm_set1_epi8(chr[1]); \ + __m128i v2 = _mm_set1_epi8(chr[2]); \ + __m128i v3 = _mm_set1_epi8(chr[3]); \ + __m128i v4 = _mm_set1_epi8(chr[4]); \ + , \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v1, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v2, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v3, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v4, vstr)); \ + ) + +ADV_PAT_PIN_ONE(6, \ + __m128i v0 = _mm_set1_epi8(chr[0]); \ + __m128i v1 = _mm_set1_epi8(chr[1]); \ + __m128i v2 = _mm_set1_epi8(chr[2]); \ + __m128i v3 = _mm_set1_epi8(chr[3]); \ + __m128i v4 = _mm_set1_epi8(chr[4]); \ + __m128i v5 = _mm_set1_epi8(chr[5]); \ + , \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v1, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v2, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v3, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v4, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v5, vstr)); \ + ) + +ADV_PAT_PIN_ONE(7, \ + __m128i v0 = _mm_set1_epi8(chr[0]); \ + __m128i v1 = _mm_set1_epi8(chr[1]); \ + __m128i v2 = _mm_set1_epi8(chr[2]); \ + __m128i v3 = _mm_set1_epi8(chr[3]); \ + __m128i v4 = _mm_set1_epi8(chr[4]); \ + __m128i v5 = _mm_set1_epi8(chr[5]); \ + __m128i v6 = _mm_set1_epi8(chr[6]); \ + , \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v1, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v2, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v3, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v4, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v5, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v6, vstr)); \ + ) + +ADV_PAT_PIN_ONE(8, \ + __m128i v0 = _mm_set1_epi8(chr[0]); \ + __m128i v1 = _mm_set1_epi8(chr[1]); \ + __m128i v2 = _mm_set1_epi8(chr[2]); \ + __m128i v3 = _mm_set1_epi8(chr[3]); \ + __m128i v4 = _mm_set1_epi8(chr[4]); \ + __m128i v5 = _mm_set1_epi8(chr[5]); \ + __m128i v6 = _mm_set1_epi8(chr[6]); \ + __m128i v7 = _mm_set1_epi8(chr[7]); \ + , \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v1, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v2, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v3, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v4, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v5, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v6, vstr)); \ + veq = _mm_or_si128(veq, _mm_cmpeq_epi8(v7, vstr)); \ + ) + +/// My "needle search" methods +#define ADV_PAT_PIN(N, INIT, COMP) \ +bool Matcher::advance_pattern_pin##N##_pma(size_t loc) \ +{ \ + const Pattern::Pred *pma = pat_->pma_; \ + const char *chr = pat_->chr_; \ + size_t min = pat_->min_; \ + uint16_t lcp = pat_->lcp_; \ + uint16_t lcs = pat_->lcs_; \ + INIT \ + while (true) \ + { \ + const char *s = buf_ + loc + lcp; \ + const char *e = buf_ + end_ + lcp - min + 1; \ + while (s <= e - 16) \ + { \ + __m128i vstrlcp = _mm_loadu_si128(reinterpret_cast(s)); \ + __m128i vstrlcs = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); \ + __m128i veqlcp = _mm_cmpeq_epi8(vlcp0, vstrlcp); \ + __m128i veqlcs = _mm_cmpeq_epi8(vlcs0, vstrlcs); \ + COMP \ + uint32_t mask = _mm_movemask_epi8(_mm_and_si128(veqlcp, veqlcs)); \ + while (mask != 0) \ + { \ + uint32_t offset = ctz(mask); \ + loc = s - lcp + offset - buf_; \ + if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) \ + { \ + set_current(loc); \ + return true; \ + } \ + mask &= mask - 1; \ + } \ + s += 16; \ + } \ + s -= lcp; \ + loc = s - buf_; \ + set_current_and_peek_more(loc - 1); \ + loc = cur_ + 1; \ + if (loc + min > end_) \ + return false; \ + if (loc + min + 15 > end_) \ + break; \ + } \ + return advance_pattern(loc); \ +} \ +\ +bool Matcher::advance_pattern_pin##N##_pmh(size_t loc) \ +{ \ + const Pattern::Pred *pmh = pat_->pmh_; \ + const char *chr = pat_->chr_; \ + size_t min = pat_->min_; \ + uint16_t lcp = pat_->lcp_; \ + uint16_t lcs = pat_->lcs_; \ + INIT \ + while (true) \ + { \ + const char *s = buf_ + loc + lcp; \ + const char *e = buf_ + end_ + lcp - min + 1; \ + while (s <= e - 16) \ + { \ + __m128i vstrlcp = _mm_loadu_si128(reinterpret_cast(s)); \ + __m128i vstrlcs = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); \ + __m128i veqlcp = _mm_cmpeq_epi8(vlcp0, vstrlcp); \ + __m128i veqlcs = _mm_cmpeq_epi8(vlcs0, vstrlcs); \ + COMP \ + uint32_t mask = _mm_movemask_epi8(_mm_and_si128(veqlcp, veqlcs)); \ + while (mask != 0) \ + { \ + uint32_t offset = ctz(mask); \ + loc = s - lcp + offset - buf_; \ + if (Pattern::predict_match(pmh, &buf_[loc], min)) \ + { \ + set_current(loc); \ + return true; \ + } \ + mask &= mask - 1; \ + } \ + s += 16; \ + } \ + s -= lcp; \ + loc = s - buf_; \ + set_current_and_peek_more(loc - 1); \ + loc = cur_ + 1; \ + if (loc + min > end_) \ + return false; \ + if (loc + min + 15 > end_) \ + break; \ + } \ + return advance_pattern_min4(loc); \ +} + +ADV_PAT_PIN(2, \ + __m128i vlcp0 = _mm_set1_epi8(chr[0]); \ + __m128i vlcp1 = _mm_set1_epi8(chr[1]); \ + __m128i vlcs0 = _mm_set1_epi8(chr[2]); \ + __m128i vlcs1 = _mm_set1_epi8(chr[3]); \ + , \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp1, vstrlcp)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs1, vstrlcs)); \ + ) + +ADV_PAT_PIN(3, \ + __m128i vlcp0 = _mm_set1_epi8(chr[0]); \ + __m128i vlcp1 = _mm_set1_epi8(chr[1]); \ + __m128i vlcp2 = _mm_set1_epi8(chr[2]); \ + __m128i vlcs0 = _mm_set1_epi8(chr[3]); \ + __m128i vlcs1 = _mm_set1_epi8(chr[4]); \ + __m128i vlcs2 = _mm_set1_epi8(chr[5]); \ + , \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp1, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp2, vstrlcp)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs1, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs2, vstrlcs)); \ + ) + +ADV_PAT_PIN(4, \ + __m128i vlcp0 = _mm_set1_epi8(chr[0]); \ + __m128i vlcp1 = _mm_set1_epi8(chr[1]); \ + __m128i vlcp2 = _mm_set1_epi8(chr[2]); \ + __m128i vlcp3 = _mm_set1_epi8(chr[3]); \ + __m128i vlcs0 = _mm_set1_epi8(chr[4]); \ + __m128i vlcs1 = _mm_set1_epi8(chr[5]); \ + __m128i vlcs2 = _mm_set1_epi8(chr[6]); \ + __m128i vlcs3 = _mm_set1_epi8(chr[7]); \ + , \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp1, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp2, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp3, vstrlcp)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs1, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs2, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs3, vstrlcs)); \ + ) + +ADV_PAT_PIN(5, \ + __m128i vlcp0 = _mm_set1_epi8(chr[0]); \ + __m128i vlcp1 = _mm_set1_epi8(chr[1]); \ + __m128i vlcp2 = _mm_set1_epi8(chr[2]); \ + __m128i vlcp3 = _mm_set1_epi8(chr[3]); \ + __m128i vlcp4 = _mm_set1_epi8(chr[4]); \ + __m128i vlcs0 = _mm_set1_epi8(chr[5]); \ + __m128i vlcs1 = _mm_set1_epi8(chr[6]); \ + __m128i vlcs2 = _mm_set1_epi8(chr[7]); \ + __m128i vlcs3 = _mm_set1_epi8(chr[8]); \ + __m128i vlcs4 = _mm_set1_epi8(chr[9]); \ + , \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp1, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp2, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp3, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp4, vstrlcp)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs1, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs2, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs3, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs4, vstrlcs)); \ + ) + +ADV_PAT_PIN(6, \ + __m128i vlcp0 = _mm_set1_epi8(chr[0]); \ + __m128i vlcp1 = _mm_set1_epi8(chr[1]); \ + __m128i vlcp2 = _mm_set1_epi8(chr[2]); \ + __m128i vlcp3 = _mm_set1_epi8(chr[3]); \ + __m128i vlcp4 = _mm_set1_epi8(chr[4]); \ + __m128i vlcp5 = _mm_set1_epi8(chr[5]); \ + __m128i vlcs0 = _mm_set1_epi8(chr[6]); \ + __m128i vlcs1 = _mm_set1_epi8(chr[7]); \ + __m128i vlcs2 = _mm_set1_epi8(chr[8]); \ + __m128i vlcs3 = _mm_set1_epi8(chr[9]); \ + __m128i vlcs4 = _mm_set1_epi8(chr[10]); \ + __m128i vlcs5 = _mm_set1_epi8(chr[11]); \ + , \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp1, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp2, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp3, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp4, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp5, vstrlcp)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs1, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs2, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs3, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs4, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs5, vstrlcs)); \ + ) + +ADV_PAT_PIN(7, \ + __m128i vlcp0 = _mm_set1_epi8(chr[0]); \ + __m128i vlcp1 = _mm_set1_epi8(chr[1]); \ + __m128i vlcp2 = _mm_set1_epi8(chr[2]); \ + __m128i vlcp3 = _mm_set1_epi8(chr[3]); \ + __m128i vlcp4 = _mm_set1_epi8(chr[4]); \ + __m128i vlcp5 = _mm_set1_epi8(chr[5]); \ + __m128i vlcp6 = _mm_set1_epi8(chr[6]); \ + __m128i vlcs0 = _mm_set1_epi8(chr[7]); \ + __m128i vlcs1 = _mm_set1_epi8(chr[8]); \ + __m128i vlcs2 = _mm_set1_epi8(chr[9]); \ + __m128i vlcs3 = _mm_set1_epi8(chr[10]); \ + __m128i vlcs4 = _mm_set1_epi8(chr[11]); \ + __m128i vlcs5 = _mm_set1_epi8(chr[12]); \ + __m128i vlcs6 = _mm_set1_epi8(chr[13]); \ + , \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp1, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp2, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp3, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp4, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp5, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp6, vstrlcp)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs1, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs2, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs3, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs4, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs5, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs6, vstrlcs)); \ + ) + +ADV_PAT_PIN(8, \ + __m128i vlcp0 = _mm_set1_epi8(chr[0]); \ + __m128i vlcp1 = _mm_set1_epi8(chr[1]); \ + __m128i vlcp2 = _mm_set1_epi8(chr[2]); \ + __m128i vlcp3 = _mm_set1_epi8(chr[3]); \ + __m128i vlcp4 = _mm_set1_epi8(chr[4]); \ + __m128i vlcp5 = _mm_set1_epi8(chr[5]); \ + __m128i vlcp6 = _mm_set1_epi8(chr[6]); \ + __m128i vlcp7 = _mm_set1_epi8(chr[7]); \ + __m128i vlcs0 = _mm_set1_epi8(chr[8]); \ + __m128i vlcs1 = _mm_set1_epi8(chr[9]); \ + __m128i vlcs2 = _mm_set1_epi8(chr[10]); \ + __m128i vlcs3 = _mm_set1_epi8(chr[11]); \ + __m128i vlcs4 = _mm_set1_epi8(chr[12]); \ + __m128i vlcs5 = _mm_set1_epi8(chr[13]); \ + __m128i vlcs6 = _mm_set1_epi8(chr[14]); \ + __m128i vlcs7 = _mm_set1_epi8(chr[15]); \ + , \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp1, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp2, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp3, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp4, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp5, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp6, vstrlcp)); \ + veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp7, vstrlcp)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs1, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs2, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs3, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs4, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs5, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs6, vstrlcs)); \ + veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs7, vstrlcs)); \ + ) + +#elif defined(HAVE_NEON) + +/// My "needle search" methods +#define ADV_PAT_PIN_ONE(N, INIT, COMP) \ +bool Matcher::advance_pattern_pin##N##_one(size_t loc) \ +{ \ + const Pattern::Pred *pma = pat_->pma_; \ + const char *chr = pat_->chr_; \ + INIT \ + while (true) \ + { \ + const char *s = buf_ + loc; \ + const char *e = buf_ + end_; \ + while (s <= e - 16) \ + { \ + uint8x16_t vstr = vld1q_u8(reinterpret_cast(s)); \ + COMP \ + uint64x2_t vmask64 = vreinterpretq_u64_u8(vmask8); \ + uint64_t mask = vgetq_lane_u64(vmask64, 0); \ + if (mask != 0) \ + { \ + for (uint16_t i = 0; i < 8; ++i) \ + { \ + if ((mask & 0xff)) \ + { \ + loc = s + i - buf_; \ + if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) \ + { \ + set_current(loc); \ + return true; \ + } \ + } \ + mask >>= 8; \ + } \ + } \ + mask = vgetq_lane_u64(vmask64, 1); \ + if (mask != 0) \ + { \ + for (uint16_t i = 8; i < 16; ++i) \ + { \ + if ((mask & 0xff)) \ + { \ + loc = s + i - buf_; \ + if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) \ + { \ + set_current(loc); \ + return true; \ + } \ + } \ + mask >>= 8; \ + } \ + } \ + s += 16; \ + } \ + loc = s - buf_; \ + set_current_and_peek_more(loc - 1); \ + loc = cur_ + 1; \ + if (loc + 1 > end_) \ + return false; \ + if (loc + 16 > end_) \ + break; \ + } \ + return advance_pattern(loc); \ +} + +ADV_PAT_PIN_ONE(2, \ + uint8x16_t v0 = vdupq_n_u8(chr[0]); \ + uint8x16_t v1 = vdupq_n_u8(chr[1]); \ + , \ + uint8x16_t vmask8 = vorrq_u8(vceqq_u8(v0, vstr), vceqq_u8(v1, vstr)); \ + ) + +ADV_PAT_PIN_ONE(3, \ + uint8x16_t v0 = vdupq_n_u8(chr[0]); \ + uint8x16_t v1 = vdupq_n_u8(chr[1]); \ + uint8x16_t v2 = vdupq_n_u8(chr[2]); \ + , \ + uint8x16_t vmask8 = \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(v0, vstr), \ + vceqq_u8(v1, vstr)), \ + vceqq_u8(v2, vstr)); \ + ) + +ADV_PAT_PIN_ONE(4, \ + uint8x16_t v0 = vdupq_n_u8(chr[0]); \ + uint8x16_t v1 = vdupq_n_u8(chr[1]); \ + uint8x16_t v2 = vdupq_n_u8(chr[2]); \ + uint8x16_t v3 = vdupq_n_u8(chr[3]); \ + , \ + uint8x16_t vmask8 = \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(v0, vstr), \ + vceqq_u8(v1, vstr)), \ + vceqq_u8(v2, vstr)), \ + vceqq_u8(v3, vstr)); \ + ) + +ADV_PAT_PIN_ONE(5, \ + uint8x16_t v0 = vdupq_n_u8(chr[0]); \ + uint8x16_t v1 = vdupq_n_u8(chr[1]); \ + uint8x16_t v2 = vdupq_n_u8(chr[2]); \ + uint8x16_t v3 = vdupq_n_u8(chr[3]); \ + uint8x16_t v4 = vdupq_n_u8(chr[4]); \ + , \ + uint8x16_t vmask8 = \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(v0, vstr), \ + vceqq_u8(v1, vstr)), \ + vceqq_u8(v2, vstr)), \ + vceqq_u8(v3, vstr)), \ + vceqq_u8(v4, vstr)); \ + ) + +ADV_PAT_PIN_ONE(6, \ + uint8x16_t v0 = vdupq_n_u8(chr[0]); \ + uint8x16_t v1 = vdupq_n_u8(chr[1]); \ + uint8x16_t v2 = vdupq_n_u8(chr[2]); \ + uint8x16_t v3 = vdupq_n_u8(chr[3]); \ + uint8x16_t v4 = vdupq_n_u8(chr[4]); \ + uint8x16_t v5 = vdupq_n_u8(chr[5]); \ + , \ + uint8x16_t vmask8 = \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(v0, vstr), \ + vceqq_u8(v1, vstr)), \ + vceqq_u8(v2, vstr)), \ + vceqq_u8(v3, vstr)), \ + vceqq_u8(v4, vstr)), \ + vceqq_u8(v5, vstr)); \ + ) + +ADV_PAT_PIN_ONE(7, \ + uint8x16_t v0 = vdupq_n_u8(chr[0]); \ + uint8x16_t v1 = vdupq_n_u8(chr[1]); \ + uint8x16_t v2 = vdupq_n_u8(chr[2]); \ + uint8x16_t v3 = vdupq_n_u8(chr[3]); \ + uint8x16_t v4 = vdupq_n_u8(chr[4]); \ + uint8x16_t v5 = vdupq_n_u8(chr[5]); \ + uint8x16_t v6 = vdupq_n_u8(chr[6]); \ + , \ + uint8x16_t vmask8 = \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(v0, vstr), \ + vceqq_u8(v1, vstr)), \ + vceqq_u8(v2, vstr)), \ + vceqq_u8(v3, vstr)), \ + vceqq_u8(v4, vstr)), \ + vceqq_u8(v5, vstr)), \ + vceqq_u8(v6, vstr)); \ + ) + +ADV_PAT_PIN_ONE(8, \ + uint8x16_t v0 = vdupq_n_u8(chr[0]); \ + uint8x16_t v1 = vdupq_n_u8(chr[1]); \ + uint8x16_t v2 = vdupq_n_u8(chr[2]); \ + uint8x16_t v3 = vdupq_n_u8(chr[3]); \ + uint8x16_t v4 = vdupq_n_u8(chr[4]); \ + uint8x16_t v5 = vdupq_n_u8(chr[5]); \ + uint8x16_t v6 = vdupq_n_u8(chr[6]); \ + uint8x16_t v7 = vdupq_n_u8(chr[7]); \ + , \ + uint8x16_t vmask8 = \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(v0, vstr), \ + vceqq_u8(v1, vstr)), \ + vceqq_u8(v2, vstr)), \ + vceqq_u8(v3, vstr)), \ + vceqq_u8(v4, vstr)), \ + vceqq_u8(v5, vstr)), \ + vceqq_u8(v6, vstr)), \ + vceqq_u8(v7, vstr)); \ + ) + +/// My "needle search" methods +#define ADV_PAT_PIN(N, INIT, COMP) \ +bool Matcher::advance_pattern_pin##N##_pma(size_t loc) \ +{ \ + const Pattern::Pred *pma = pat_->pma_; \ + const char *chr = pat_->chr_; \ + size_t min = pat_->min_; \ + uint16_t lcp = pat_->lcp_; \ + uint16_t lcs = pat_->lcs_; \ + INIT \ + while (true) \ + { \ + const char *s = buf_ + loc + lcp; \ + const char *e = buf_ + end_ + lcp - min + 1; \ + while (s <= e - 16) \ + { \ + uint8x16_t vstrlcp = vld1q_u8(reinterpret_cast(s)); \ + uint8x16_t vstrlcs = vld1q_u8(reinterpret_cast(s + lcs - lcp)); \ + COMP \ + uint64x2_t vmask64 = vreinterpretq_u64_u8(vandq_u8(vmasklcp8, vmasklcs8)); \ + uint64_t mask = vgetq_lane_u64(vmask64, 0); \ + if (mask != 0) \ + { \ + for (uint16_t i = 0; i < 8; ++i) \ + { \ + if ((mask & 0xff)) \ + { \ + loc = s - lcp + i - buf_; \ + if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) \ + { \ + set_current(loc); \ + return true; \ + } \ + } \ + mask >>= 8; \ + } \ + } \ + mask = vgetq_lane_u64(vmask64, 1); \ + if (mask != 0) \ + { \ + for (uint16_t i = 8; i < 16; ++i) \ + { \ + if ((mask & 0xff)) \ + { \ + loc = s - lcp + i - buf_; \ + if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) \ + { \ + set_current(loc); \ + return true; \ + } \ + } \ + mask >>= 8; \ + } \ + } \ + s += 16; \ + } \ + s -= lcp; \ + loc = s - buf_; \ + set_current_and_peek_more(loc - 1); \ + loc = cur_ + 1; \ + if (loc + min > end_) \ + return false; \ + if (loc + min + 15 > end_) \ + break; \ + } \ + return advance_pattern(loc); \ +} \ +\ +bool Matcher::advance_pattern_pin##N##_pmh(size_t loc) \ +{ \ + const Pattern::Pred *pmh = pat_->pmh_; \ + const char *chr = pat_->chr_; \ + size_t min = pat_->min_; \ + uint16_t lcp = pat_->lcp_; \ + uint16_t lcs = pat_->lcs_; \ + INIT \ + while (true) \ + { \ + const char *s = buf_ + loc + lcp; \ + const char *e = buf_ + end_ + lcp - min + 1; \ + while (s <= e - 16) \ + { \ + uint8x16_t vstrlcp = vld1q_u8(reinterpret_cast(s)); \ + uint8x16_t vstrlcs = vld1q_u8(reinterpret_cast(s + lcs - lcp)); \ + COMP \ + uint64x2_t vmask64 = vreinterpretq_u64_u8(vandq_u8(vmasklcp8, vmasklcs8)); \ + uint64_t mask = vgetq_lane_u64(vmask64, 0); \ + if (mask != 0) \ + { \ + for (uint16_t i = 0; i < 8; ++i) \ + { \ + if ((mask & 0xff)) \ + { \ + loc = s - lcp + i - buf_; \ + if (Pattern::predict_match(pmh, &buf_[loc], min)) \ + { \ + set_current(loc); \ + return true; \ + } \ + } \ + mask >>= 8; \ + } \ + } \ + mask = vgetq_lane_u64(vmask64, 1); \ + if (mask != 0) \ + { \ + for (uint16_t i = 8; i < 16; ++i) \ + { \ + if ((mask & 0xff)) \ + { \ + loc = s - lcp + i - buf_; \ + if (Pattern::predict_match(pmh, &buf_[loc], min)) \ + { \ + set_current(loc); \ + return true; \ + } \ + } \ + mask >>= 8; \ + } \ + } \ + s += 16; \ + } \ + s -= lcp; \ + loc = s - buf_; \ + set_current_and_peek_more(loc - 1); \ + loc = cur_ + 1; \ + if (loc + min > end_) \ + return false; \ + if (loc + min + 15 > end_) \ + break; \ + } \ + return advance_pattern_min4(loc); \ +} + +ADV_PAT_PIN(2, \ + uint8x16_t vlcp0 = vdupq_n_u8(chr[0]); \ + uint8x16_t vlcp1 = vdupq_n_u8(chr[1]); \ + uint8x16_t vlcs0 = vdupq_n_u8(chr[2]); \ + uint8x16_t vlcs1 = vdupq_n_u8(chr[3]); \ + , \ + uint8x16_t vmasklcp8 = vorrq_u8(vceqq_u8(vlcp0, vstrlcp), vceqq_u8(vlcp1, vstrlcp)); \ + uint8x16_t vmasklcs8 = vorrq_u8(vceqq_u8(vlcs0, vstrlcs), vceqq_u8(vlcs1, vstrlcs)); \ + ) + +ADV_PAT_PIN(3, \ + uint8x16_t vlcp0 = vdupq_n_u8(chr[0]); \ + uint8x16_t vlcp1 = vdupq_n_u8(chr[1]); \ + uint8x16_t vlcp2 = vdupq_n_u8(chr[2]); \ + uint8x16_t vlcs0 = vdupq_n_u8(chr[3]); \ + uint8x16_t vlcs1 = vdupq_n_u8(chr[4]); \ + uint8x16_t vlcs2 = vdupq_n_u8(chr[5]); \ + , \ + uint8x16_t vmasklcp8 = \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(vlcp0, vstrlcp), \ + vceqq_u8(vlcp1, vstrlcp)), \ + vceqq_u8(vlcp2, vstrlcp)); \ + uint8x16_t vmasklcs8 = \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(vlcs0, vstrlcs), \ + vceqq_u8(vlcs1, vstrlcs)), \ + vceqq_u8(vlcs2, vstrlcs)); \ + ) + +ADV_PAT_PIN(4, \ + uint8x16_t vlcp0 = vdupq_n_u8(chr[0]); \ + uint8x16_t vlcp1 = vdupq_n_u8(chr[1]); \ + uint8x16_t vlcp2 = vdupq_n_u8(chr[2]); \ + uint8x16_t vlcp3 = vdupq_n_u8(chr[3]); \ + uint8x16_t vlcs0 = vdupq_n_u8(chr[4]); \ + uint8x16_t vlcs1 = vdupq_n_u8(chr[5]); \ + uint8x16_t vlcs2 = vdupq_n_u8(chr[6]); \ + uint8x16_t vlcs3 = vdupq_n_u8(chr[7]); \ + , \ + uint8x16_t vmasklcp8 = \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(vlcp0, vstrlcp), \ + vceqq_u8(vlcp1, vstrlcp)), \ + vceqq_u8(vlcp2, vstrlcp)), \ + vceqq_u8(vlcp3, vstrlcp)); \ + uint8x16_t vmasklcs8 = \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(vlcs0, vstrlcs), \ + vceqq_u8(vlcs1, vstrlcs)), \ + vceqq_u8(vlcs2, vstrlcs)), \ + vceqq_u8(vlcs3, vstrlcs)); \ + ) + +ADV_PAT_PIN(5, \ + uint8x16_t vlcp0 = vdupq_n_u8(chr[0]); \ + uint8x16_t vlcp1 = vdupq_n_u8(chr[1]); \ + uint8x16_t vlcp2 = vdupq_n_u8(chr[2]); \ + uint8x16_t vlcp3 = vdupq_n_u8(chr[3]); \ + uint8x16_t vlcp4 = vdupq_n_u8(chr[4]); \ + uint8x16_t vlcs0 = vdupq_n_u8(chr[5]); \ + uint8x16_t vlcs1 = vdupq_n_u8(chr[6]); \ + uint8x16_t vlcs2 = vdupq_n_u8(chr[7]); \ + uint8x16_t vlcs3 = vdupq_n_u8(chr[8]); \ + uint8x16_t vlcs4 = vdupq_n_u8(chr[9]); \ + , \ + uint8x16_t vmasklcp8 = \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(vlcp0, vstrlcp), \ + vceqq_u8(vlcp1, vstrlcp)), \ + vceqq_u8(vlcp2, vstrlcp)), \ + vceqq_u8(vlcp3, vstrlcp)), \ + vceqq_u8(vlcp4, vstrlcp)); \ + uint8x16_t vmasklcs8 = \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(vlcs0, vstrlcs), \ + vceqq_u8(vlcs1, vstrlcs)), \ + vceqq_u8(vlcs2, vstrlcs)), \ + vceqq_u8(vlcs3, vstrlcs)), \ + vceqq_u8(vlcs4, vstrlcs)); \ + ) + +ADV_PAT_PIN(6, \ + uint8x16_t vlcp0 = vdupq_n_u8(chr[0]); \ + uint8x16_t vlcp1 = vdupq_n_u8(chr[1]); \ + uint8x16_t vlcp2 = vdupq_n_u8(chr[2]); \ + uint8x16_t vlcp3 = vdupq_n_u8(chr[3]); \ + uint8x16_t vlcp4 = vdupq_n_u8(chr[4]); \ + uint8x16_t vlcp5 = vdupq_n_u8(chr[5]); \ + uint8x16_t vlcs0 = vdupq_n_u8(chr[6]); \ + uint8x16_t vlcs1 = vdupq_n_u8(chr[7]); \ + uint8x16_t vlcs2 = vdupq_n_u8(chr[8]); \ + uint8x16_t vlcs3 = vdupq_n_u8(chr[9]); \ + uint8x16_t vlcs4 = vdupq_n_u8(chr[10]); \ + uint8x16_t vlcs5 = vdupq_n_u8(chr[11]); \ + , \ + uint8x16_t vmasklcp8 = \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(vlcp0, vstrlcp), \ + vceqq_u8(vlcp1, vstrlcp)), \ + vceqq_u8(vlcp2, vstrlcp)), \ + vceqq_u8(vlcp3, vstrlcp)), \ + vceqq_u8(vlcp4, vstrlcp)), \ + vceqq_u8(vlcp5, vstrlcp)); \ + uint8x16_t vmasklcs8 = \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(vlcs0, vstrlcs), \ + vceqq_u8(vlcs1, vstrlcs)), \ + vceqq_u8(vlcs2, vstrlcs)), \ + vceqq_u8(vlcs3, vstrlcs)), \ + vceqq_u8(vlcs4, vstrlcs)), \ + vceqq_u8(vlcs5, vstrlcs)); \ + ) + +ADV_PAT_PIN(7, \ + uint8x16_t vlcp0 = vdupq_n_u8(chr[0]); \ + uint8x16_t vlcp1 = vdupq_n_u8(chr[1]); \ + uint8x16_t vlcp2 = vdupq_n_u8(chr[2]); \ + uint8x16_t vlcp3 = vdupq_n_u8(chr[3]); \ + uint8x16_t vlcp4 = vdupq_n_u8(chr[4]); \ + uint8x16_t vlcp5 = vdupq_n_u8(chr[5]); \ + uint8x16_t vlcp6 = vdupq_n_u8(chr[6]); \ + uint8x16_t vlcs0 = vdupq_n_u8(chr[7]); \ + uint8x16_t vlcs1 = vdupq_n_u8(chr[8]); \ + uint8x16_t vlcs2 = vdupq_n_u8(chr[9]); \ + uint8x16_t vlcs3 = vdupq_n_u8(chr[10]); \ + uint8x16_t vlcs4 = vdupq_n_u8(chr[11]); \ + uint8x16_t vlcs5 = vdupq_n_u8(chr[12]); \ + uint8x16_t vlcs6 = vdupq_n_u8(chr[13]); \ + , \ + uint8x16_t vmasklcp8 = \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(vlcp0, vstrlcp), \ + vceqq_u8(vlcp1, vstrlcp)), \ + vceqq_u8(vlcp2, vstrlcp)), \ + vceqq_u8(vlcp3, vstrlcp)), \ + vceqq_u8(vlcp4, vstrlcp)), \ + vceqq_u8(vlcp5, vstrlcp)), \ + vceqq_u8(vlcp6, vstrlcp)); \ + uint8x16_t vmasklcs8 = \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(vlcs0, vstrlcs), \ + vceqq_u8(vlcs1, vstrlcs)), \ + vceqq_u8(vlcs2, vstrlcs)), \ + vceqq_u8(vlcs3, vstrlcs)), \ + vceqq_u8(vlcs4, vstrlcs)), \ + vceqq_u8(vlcs5, vstrlcs)), \ + vceqq_u8(vlcs6, vstrlcs)); \ + ) + +ADV_PAT_PIN(8, \ + uint8x16_t vlcp0 = vdupq_n_u8(chr[0]); \ + uint8x16_t vlcp1 = vdupq_n_u8(chr[1]); \ + uint8x16_t vlcp2 = vdupq_n_u8(chr[2]); \ + uint8x16_t vlcp3 = vdupq_n_u8(chr[3]); \ + uint8x16_t vlcp4 = vdupq_n_u8(chr[4]); \ + uint8x16_t vlcp5 = vdupq_n_u8(chr[5]); \ + uint8x16_t vlcp6 = vdupq_n_u8(chr[6]); \ + uint8x16_t vlcp7 = vdupq_n_u8(chr[7]); \ + uint8x16_t vlcs0 = vdupq_n_u8(chr[8]); \ + uint8x16_t vlcs1 = vdupq_n_u8(chr[9]); \ + uint8x16_t vlcs2 = vdupq_n_u8(chr[10]); \ + uint8x16_t vlcs3 = vdupq_n_u8(chr[11]); \ + uint8x16_t vlcs4 = vdupq_n_u8(chr[12]); \ + uint8x16_t vlcs5 = vdupq_n_u8(chr[13]); \ + uint8x16_t vlcs6 = vdupq_n_u8(chr[14]); \ + uint8x16_t vlcs7 = vdupq_n_u8(chr[15]); \ + , \ + uint8x16_t vmasklcp8 = \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(vlcp0, vstrlcp), \ + vceqq_u8(vlcp1, vstrlcp)), \ + vceqq_u8(vlcp2, vstrlcp)), \ + vceqq_u8(vlcp3, vstrlcp)), \ + vceqq_u8(vlcp4, vstrlcp)), \ + vceqq_u8(vlcp5, vstrlcp)), \ + vceqq_u8(vlcp6, vstrlcp)), \ + vceqq_u8(vlcp7, vstrlcp)); \ + uint8x16_t vmasklcs8 = \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vorrq_u8( \ + vceqq_u8(vlcs0, vstrlcs), \ + vceqq_u8(vlcs1, vstrlcs)), \ + vceqq_u8(vlcs2, vstrlcs)), \ + vceqq_u8(vlcs3, vstrlcs)), \ + vceqq_u8(vlcs4, vstrlcs)), \ + vceqq_u8(vlcs5, vstrlcs)), \ + vceqq_u8(vlcs6, vstrlcs)), \ + vceqq_u8(vlcs7, vstrlcs)); \ + ) + +#endif + +/// Minimal 1 char pattern using bitap and PM4 +bool Matcher::advance_pattern_min1(size_t loc) +{ + const Pattern::Pred *pma = pat_->pma_; + const Pattern::Pred *bit = pat_->bit_; + while (true) + { + const char *s = buf_ + loc; + const char *e = buf_ + end_ - 3; + bool f = true; + while (s < e && + (f = ((bit[static_cast(*s)] & 1) && + (bit[static_cast(*++s)] & 1) && + (bit[static_cast(*++s)] & 1) && + (bit[static_cast(*++s)] & 1)))) + { + ++s; } -#elif defined(HAVE_AVX512BW) || defined(HAVE_AVX2) || defined(HAVE_SSE2) - // look for needles - else if (pat_->pin_ == 2) + loc = s - buf_; + if (!f) { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - __m128i vlcp0 = _mm_set1_epi8(chr[0]); - __m128i vlcp1 = _mm_set1_epi8(chr[1]); - __m128i vlcs0 = _mm_set1_epi8(chr[2]); - __m128i vlcs1 = _mm_set1_epi8(chr[3]); - while (true) + if (s < e && Pattern::predict_match(pma, s) != 0) { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 16) - { - __m128i vstrlcp = _mm_loadu_si128(reinterpret_cast(s)); - __m128i vstrlcs = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); - __m128i veqlcp = _mm_cmpeq_epi8(vlcp0, vstrlcp); - __m128i veqlcs = _mm_cmpeq_epi8(vlcs0, vstrlcs); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp1, vstrlcp)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs1, vstrlcs)); - uint32_t mask = _mm_movemask_epi8(_mm_and_si128(veqlcp, veqlcs)); - while (mask != 0) - { - uint32_t offset = ctz(mask); - loc = s - lcp + offset - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - mask &= mask - 1; - } - s += 16; - } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 15 > end_) - break; + ++loc; + continue; } + set_current(loc); + return true; } - else if (pat_->pin_ == 3) + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + 3 >= end_) { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - __m128i vlcp0 = _mm_set1_epi8(chr[0]); - __m128i vlcp1 = _mm_set1_epi8(chr[1]); - __m128i vlcp2 = _mm_set1_epi8(chr[2]); - __m128i vlcs0 = _mm_set1_epi8(chr[3]); - __m128i vlcs1 = _mm_set1_epi8(chr[4]); - __m128i vlcs2 = _mm_set1_epi8(chr[5]); - while (true) + set_current(loc); + return loc + 1 <= end_; + } + } +} + +/// Minimal 2 char pattern using bitam and PM4 +bool Matcher::advance_pattern_min2(size_t loc) +{ + const Pattern::Pred *bit = pat_->bit_; + const Pattern::Pred *pma = pat_->pma_; + Pattern::Pred state = ~0; + while (true) + { + const char *s = buf_ + loc; + const char *e = buf_ + end_; + while (s < e) + { + state = (state << 1) | bit[static_cast(*s)]; + if ((state & 2) == 0) + break; + ++s; + } + if (s < e) + { + s -= 1; + loc = s - buf_; + if (s > e - 4 || Pattern::predict_match(pma, s) == 0) { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 16) - { - __m128i vstrlcp = _mm_loadu_si128(reinterpret_cast(s)); - __m128i vstrlcs = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); - __m128i veqlcp = _mm_cmpeq_epi8(vlcp0, vstrlcp); - __m128i veqlcs = _mm_cmpeq_epi8(vlcs0, vstrlcs); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp1, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp2, vstrlcp)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs1, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs2, vstrlcs)); - uint32_t mask = _mm_movemask_epi8(_mm_and_si128(veqlcp, veqlcs)); - while (mask != 0) - { - uint32_t offset = ctz(mask); - loc = s - lcp + offset - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - mask &= mask - 1; - } - s += 16; - } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 15 > end_) - break; + set_current(loc); + return true; } + loc += 2; } - else if (pat_->pin_ == 4) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - __m128i vlcp0 = _mm_set1_epi8(chr[0]); - __m128i vlcp1 = _mm_set1_epi8(chr[1]); - __m128i vlcp2 = _mm_set1_epi8(chr[2]); - __m128i vlcp3 = _mm_set1_epi8(chr[3]); - __m128i vlcs0 = _mm_set1_epi8(chr[4]); - __m128i vlcs1 = _mm_set1_epi8(chr[5]); - __m128i vlcs2 = _mm_set1_epi8(chr[6]); - __m128i vlcs3 = _mm_set1_epi8(chr[7]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 16) - { - __m128i vstrlcp = _mm_loadu_si128(reinterpret_cast(s)); - __m128i vstrlcs = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); - __m128i veqlcp = _mm_cmpeq_epi8(vlcp0, vstrlcp); - __m128i veqlcs = _mm_cmpeq_epi8(vlcs0, vstrlcs); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp1, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp2, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp3, vstrlcp)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs1, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs2, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs3, vstrlcs)); - uint32_t mask = _mm_movemask_epi8(_mm_and_si128(veqlcp, veqlcs)); - while (mask != 0) - { - uint32_t offset = ctz(mask); - loc = s - lcp + offset - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - mask &= mask - 1; - } - s += 16; - } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 15 > end_) - break; - } + else + { + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + 2 > end_) + return false; } - else if (pat_->pin_ == 5) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - __m128i vlcp0 = _mm_set1_epi8(chr[0]); - __m128i vlcp1 = _mm_set1_epi8(chr[1]); - __m128i vlcp2 = _mm_set1_epi8(chr[2]); - __m128i vlcp3 = _mm_set1_epi8(chr[3]); - __m128i vlcp4 = _mm_set1_epi8(chr[4]); - __m128i vlcs0 = _mm_set1_epi8(chr[5]); - __m128i vlcs1 = _mm_set1_epi8(chr[6]); - __m128i vlcs2 = _mm_set1_epi8(chr[7]); - __m128i vlcs3 = _mm_set1_epi8(chr[8]); - __m128i vlcs4 = _mm_set1_epi8(chr[9]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 16) - { - __m128i vstrlcp = _mm_loadu_si128(reinterpret_cast(s)); - __m128i vstrlcs = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); - __m128i veqlcp = _mm_cmpeq_epi8(vlcp0, vstrlcp); - __m128i veqlcs = _mm_cmpeq_epi8(vlcs0, vstrlcs); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp1, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp2, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp3, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp4, vstrlcp)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs1, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs2, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs3, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs4, vstrlcs)); - uint32_t mask = _mm_movemask_epi8(_mm_and_si128(veqlcp, veqlcs)); - while (mask != 0) - { - uint32_t offset = ctz(mask); - loc = s - lcp + offset - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - mask &= mask - 1; - } - s += 16; - } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 15 > end_) - break; - } + } +} + +/// Minimal 3 char pattern using bitam and PM4 +bool Matcher::advance_pattern_min3(size_t loc) +{ + const Pattern::Pred *bit = pat_->bit_; + const Pattern::Pred *pma = pat_->pma_; + Pattern::Pred state = ~0; + while (true) + { + const char *s = buf_ + loc; + const char *e = buf_ + end_; + while (s < e) + { + state = (state << 1) | bit[static_cast(*s)]; + if ((state & 4) == 0) + break; + ++s; } - else if (pat_->pin_ == 6) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - __m128i vlcp0 = _mm_set1_epi8(chr[0]); - __m128i vlcp1 = _mm_set1_epi8(chr[1]); - __m128i vlcp2 = _mm_set1_epi8(chr[2]); - __m128i vlcp3 = _mm_set1_epi8(chr[3]); - __m128i vlcp4 = _mm_set1_epi8(chr[4]); - __m128i vlcp5 = _mm_set1_epi8(chr[5]); - __m128i vlcs0 = _mm_set1_epi8(chr[6]); - __m128i vlcs1 = _mm_set1_epi8(chr[7]); - __m128i vlcs2 = _mm_set1_epi8(chr[8]); - __m128i vlcs3 = _mm_set1_epi8(chr[9]); - __m128i vlcs4 = _mm_set1_epi8(chr[10]); - __m128i vlcs5 = _mm_set1_epi8(chr[11]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 16) - { - __m128i vstrlcp = _mm_loadu_si128(reinterpret_cast(s)); - __m128i vstrlcs = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); - __m128i veqlcp = _mm_cmpeq_epi8(vlcp0, vstrlcp); - __m128i veqlcs = _mm_cmpeq_epi8(vlcs0, vstrlcs); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp1, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp2, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp3, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp4, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp5, vstrlcp)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs1, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs2, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs3, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs4, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs5, vstrlcs)); - uint32_t mask = _mm_movemask_epi8(_mm_and_si128(veqlcp, veqlcs)); - while (mask != 0) - { - uint32_t offset = ctz(mask); - loc = s - lcp + offset - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - mask &= mask - 1; - } - s += 16; - } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 15 > end_) - break; + if (s < e) + { + s -= 2; + loc = s - buf_; + if (s > e - 4 || Pattern::predict_match(pma, s) == 0) + { + set_current(loc); + return true; } + loc += 3; } - else if (pat_->pin_ == 7) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - __m128i vlcp0 = _mm_set1_epi8(chr[0]); - __m128i vlcp1 = _mm_set1_epi8(chr[1]); - __m128i vlcp2 = _mm_set1_epi8(chr[2]); - __m128i vlcp3 = _mm_set1_epi8(chr[3]); - __m128i vlcp4 = _mm_set1_epi8(chr[4]); - __m128i vlcp5 = _mm_set1_epi8(chr[5]); - __m128i vlcp6 = _mm_set1_epi8(chr[6]); - __m128i vlcs0 = _mm_set1_epi8(chr[7]); - __m128i vlcs1 = _mm_set1_epi8(chr[8]); - __m128i vlcs2 = _mm_set1_epi8(chr[9]); - __m128i vlcs3 = _mm_set1_epi8(chr[10]); - __m128i vlcs4 = _mm_set1_epi8(chr[11]); - __m128i vlcs5 = _mm_set1_epi8(chr[12]); - __m128i vlcs6 = _mm_set1_epi8(chr[13]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 16) - { - __m128i vstrlcp = _mm_loadu_si128(reinterpret_cast(s)); - __m128i vstrlcs = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); - __m128i veqlcp = _mm_cmpeq_epi8(vlcp0, vstrlcp); - __m128i veqlcs = _mm_cmpeq_epi8(vlcs0, vstrlcs); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp1, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp2, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp3, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp4, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp5, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp6, vstrlcp)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs1, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs2, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs3, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs4, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs5, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs6, vstrlcs)); - uint32_t mask = _mm_movemask_epi8(_mm_and_si128(veqlcp, veqlcs)); - while (mask != 0) - { - uint32_t offset = ctz(mask); - loc = s - lcp + offset - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - mask &= mask - 1; - } - s += 16; - } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 15 > end_) - break; - } + else + { + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + 3 > end_) + return false; } - else if (pat_->pin_ == 8) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - __m128i vlcp0 = _mm_set1_epi8(chr[0]); - __m128i vlcp1 = _mm_set1_epi8(chr[1]); - __m128i vlcp2 = _mm_set1_epi8(chr[2]); - __m128i vlcp3 = _mm_set1_epi8(chr[3]); - __m128i vlcp4 = _mm_set1_epi8(chr[4]); - __m128i vlcp5 = _mm_set1_epi8(chr[5]); - __m128i vlcp6 = _mm_set1_epi8(chr[6]); - __m128i vlcp7 = _mm_set1_epi8(chr[7]); - __m128i vlcs0 = _mm_set1_epi8(chr[8]); - __m128i vlcs1 = _mm_set1_epi8(chr[9]); - __m128i vlcs2 = _mm_set1_epi8(chr[10]); - __m128i vlcs3 = _mm_set1_epi8(chr[11]); - __m128i vlcs4 = _mm_set1_epi8(chr[12]); - __m128i vlcs5 = _mm_set1_epi8(chr[13]); - __m128i vlcs6 = _mm_set1_epi8(chr[14]); - __m128i vlcs7 = _mm_set1_epi8(chr[15]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 16) - { - __m128i vstrlcp = _mm_loadu_si128(reinterpret_cast(s)); - __m128i vstrlcs = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); - __m128i veqlcp = _mm_cmpeq_epi8(vlcp0, vstrlcp); - __m128i veqlcs = _mm_cmpeq_epi8(vlcs0, vstrlcs); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp1, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp2, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp3, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp4, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp5, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp6, vstrlcp)); - veqlcp = _mm_or_si128(veqlcp, _mm_cmpeq_epi8(vlcp7, vstrlcp)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs1, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs2, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs3, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs4, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs5, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs6, vstrlcs)); - veqlcs = _mm_or_si128(veqlcs, _mm_cmpeq_epi8(vlcs7, vstrlcs)); - uint32_t mask = _mm_movemask_epi8(_mm_and_si128(veqlcp, veqlcs)); - while (mask != 0) - { - uint32_t offset = ctz(mask); - loc = s - lcp + offset - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - mask &= mask - 1; - } - s += 16; - } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 15 > end_) - break; - } + } +} + +/// Minimal 4 char pattern using bitam and PM hashing +bool Matcher::advance_pattern_min4(size_t loc) +{ + const Pattern::Pred *bit = pat_->bit_; + const Pattern::Pred *pmh = pat_->pmh_; + size_t min = pat_->min_; + Pattern::Pred state1 = ~0; + Pattern::Pred state2 = ~0; + Pattern::Pred mask = (1 << (min - 1)); + while (true) + { + const char *s = buf_ + loc; + const char *e = buf_ + end_; + while (s < e - 1) + { + state2 = (state1 << 1) | bit[static_cast(*s)]; + ++s; + state1 = (state2 << 1) | bit[static_cast(*s)]; + if ((state1 & state2 & mask) == 0) + break; + ++s; } -#elif defined(HAVE_NEON) - // look for needles - else if (pat_->pin_ == 2) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - uint8x16_t vlcp0 = vdupq_n_u8(chr[0]); - uint8x16_t vlcp1 = vdupq_n_u8(chr[1]); - uint8x16_t vlcs0 = vdupq_n_u8(chr[2]); - uint8x16_t vlcs1 = vdupq_n_u8(chr[3]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 16) - { - uint8x16_t vstrlcp = vld1q_u8(reinterpret_cast(s)); - uint8x16_t vstrlcs = vld1q_u8(reinterpret_cast(s + lcs - lcp)); - uint8x16_t vmasklcp8 = vorrq_u8(vceqq_u8(vlcp0, vstrlcp), vceqq_u8(vlcp1, vstrlcp)); - uint8x16_t vmasklcs8 = vorrq_u8(vceqq_u8(vlcs0, vstrlcs), vceqq_u8(vlcs1, vstrlcs)); - uint64x2_t vmask64 = vreinterpretq_u64_u8(vandq_u8(vmasklcp8, vmasklcs8)); - uint64_t mask = vgetq_lane_u64(vmask64, 0); - if (mask != 0) - { - for (int i = 0; i < 8; ++i) - { - if ((mask & 0xff)) - { - loc = s - lcp + i - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - } - mask >>= 8; - } - } - mask = vgetq_lane_u64(vmask64, 1); - if (mask != 0) - { - for (int i = 0; i < 8; ++i) - { - if ((mask & 0xff)) - { - loc = s - lcp + i + 8 - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - } - mask >>= 8; - } - } - s += 16; - } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 15 > end_) - break; + if ((state2 & mask) == 0) + { + state1 = state2; + state2 = ~0; + --s; + } + else if ((state1 & mask) != 0 && s == e - 1) + { + state1 = (state1 << 1) | bit[static_cast(*s)]; + if ((state1 & mask) != 0) + ++s; + } + if (s < e) + { + s -= min - 1; + loc = s - buf_; + if (Pattern::predict_match(pmh, s, min)) + { + set_current(loc); + return true; } + loc += min; + } + else + { + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + min > end_) + return false; + } + } +} + +/// Minimal 1 char pattern using PM4 +bool Matcher::advance_pattern(size_t loc) +{ + const Pattern::Pred *pma = pat_->pma_; + size_t min = pat_->min_; + while (true) + { + const char *s = buf_ + loc; + const char *e = buf_ + end_ - 6; + bool f = true; + while (s < e && + (f = (Pattern::predict_match(pma, s) != 0 && + Pattern::predict_match(pma, ++s) != 0 && + Pattern::predict_match(pma, ++s) != 0 && + Pattern::predict_match(pma, ++s) != 0))) + { + ++s; + } + loc = s - buf_; + if (!f) + { + set_current(loc); + return true; + } + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + 6 >= end_) + { + set_current(loc); + return loc + min <= end_; + } + } +} + +/// One char +bool Matcher::advance_char(size_t loc) +{ + char chr0 = pat_->chr_[0]; + while (true) + { + const char *s = buf_ + loc; + const char *e = buf_ + end_; + s = static_cast(std::memchr(s, chr0, e - s)); + if (s != NULL) + { + loc = s - buf_; + set_current(loc); + return true; + } + loc = e - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + 1 > end_) + return false; + } +} + +/// One char followed by 1 to 3 minimal char pattern +bool Matcher::advance_char_pma(size_t loc) +{ + const Pattern::Pred *pma = pat_->pma_; + char chr0 = pat_->chr_[0]; + while (true) + { + const char *s = buf_ + loc; + const char *e = buf_ + end_; + s = static_cast(std::memchr(s, chr0, e - s)); + if (s != NULL) + { + loc = s - buf_; + set_current(loc); + if (s > e - 5 || Pattern::predict_match(pma, s + 1) == 0) + return true; + ++loc; } - else if (pat_->pin_ == 3) + else { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - uint8x16_t vlcp0 = vdupq_n_u8(chr[0]); - uint8x16_t vlcp1 = vdupq_n_u8(chr[1]); - uint8x16_t vlcp2 = vdupq_n_u8(chr[2]); - uint8x16_t vlcs0 = vdupq_n_u8(chr[3]); - uint8x16_t vlcs1 = vdupq_n_u8(chr[4]); - uint8x16_t vlcs2 = vdupq_n_u8(chr[5]); - while (true) + loc = e - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + 1 > end_) + return false; + } + } +} + +/// One char followed by 4 minimal char pattern +bool Matcher::advance_char_pmh(size_t loc) +{ + const Pattern::Pred *pmh = pat_->pmh_; + char chr0 = pat_->chr_[0]; + size_t min = pat_->min_; + while (true) + { + const char *s = buf_ + loc; + const char *e = buf_ + end_; + s = static_cast(std::memchr(s, chr0, e - s)); + if (s != NULL) + { + loc = s - buf_; + if (s + 1 + min > e || Pattern::predict_match(pmh, s + 1, min)) { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 16) - { - uint8x16_t vstrlcp = vld1q_u8(reinterpret_cast(s)); - uint8x16_t vstrlcs = vld1q_u8(reinterpret_cast(s + lcs - lcp)); - uint8x16_t vmasklcp8 = - vorrq_u8( - vorrq_u8( - vceqq_u8(vlcp0, vstrlcp), - vceqq_u8(vlcp1, vstrlcp)), - vceqq_u8(vlcp2, vstrlcp)); - uint8x16_t vmasklcs8 = - vorrq_u8( - vorrq_u8( - vceqq_u8(vlcs0, vstrlcs), - vceqq_u8(vlcs1, vstrlcs)), - vceqq_u8(vlcs2, vstrlcs)); - uint64x2_t vmask64 = vreinterpretq_u64_u8(vandq_u8(vmasklcp8, vmasklcs8)); - uint64_t mask = vgetq_lane_u64(vmask64, 0); - if (mask != 0) - { - for (int i = 0; i < 8; ++i) - { - if ((mask & 0xff)) - { - loc = s - lcp + i - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - } - mask >>= 8; - } - } - mask = vgetq_lane_u64(vmask64, 1); - if (mask != 0) - { - for (int i = 0; i < 8; ++i) - { - if ((mask & 0xff)) - { - loc = s - lcp + i + 8 - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - } - mask >>= 8; - } - } - s += 16; + set_current(loc); + return true; + } + ++loc; + } + else + { + loc = e - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + 1 > end_) + return false; + } + } +} + +/// Few chars +template +bool Matcher::advance_chars(size_t loc) +{ + static const uint16_t lcp = 0; + static const uint16_t lcs = LEN - 1; + const char *chr = pat_->chr_; +#if defined(HAVE_AVX512BW) || defined(HAVE_AVX2) || defined(HAVE_SSE2) + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - LEN + 1; + __m128i vlcp = _mm_set1_epi8(chr[lcp]); + __m128i vlcs = _mm_set1_epi8(chr[lcs]); + while (s <= e - 16) + { + __m128i vlcpm = _mm_loadu_si128(reinterpret_cast(s)); + __m128i vlcsm = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); + __m128i vlcpeq = _mm_cmpeq_epi8(vlcp, vlcpm); + __m128i vlcseq = _mm_cmpeq_epi8(vlcs, vlcsm); + uint32_t mask = _mm_movemask_epi8(_mm_and_si128(vlcpeq, vlcseq)); + while (mask != 0) + { + uint32_t offset = ctz(mask); + loc = s - lcp + offset - buf_; + if (LEN == 2 || + (LEN == 3 ? s[offset + 1 - lcp] == chr[1] : std::memcmp(s + 1 - lcp + offset, chr + 1, LEN - 2) == 0)) + { + set_current(loc); + return true; } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 15 > end_) - break; + mask &= mask - 1; } + s += 16; } - else if (pat_->pin_ == 4) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - uint8x16_t vlcp0 = vdupq_n_u8(chr[0]); - uint8x16_t vlcp1 = vdupq_n_u8(chr[1]); - uint8x16_t vlcp2 = vdupq_n_u8(chr[2]); - uint8x16_t vlcp3 = vdupq_n_u8(chr[3]); - uint8x16_t vlcs0 = vdupq_n_u8(chr[4]); - uint8x16_t vlcs1 = vdupq_n_u8(chr[5]); - uint8x16_t vlcs2 = vdupq_n_u8(chr[6]); - uint8x16_t vlcs3 = vdupq_n_u8(chr[7]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 16) + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + LEN > end_) + return false; + if (loc + LEN + 15 > end_) + break; + } +#elif defined(HAVE_NEON) + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - LEN + 1; + uint8x16_t vlcp = vdupq_n_u8(chr[lcp]); + uint8x16_t vlcs = vdupq_n_u8(chr[lcs]); + while (s <= e - 16) + { + uint8x16_t vlcpm = vld1q_u8(reinterpret_cast(s)); + uint8x16_t vlcsm = vld1q_u8(reinterpret_cast(s) + lcs - lcp); + uint8x16_t vlcpeq = vceqq_u8(vlcp, vlcpm); + uint8x16_t vlcseq = vceqq_u8(vlcs, vlcsm); + uint8x16_t vmask8 = vandq_u8(vlcpeq, vlcseq); + uint64x2_t vmask64 = vreinterpretq_u64_u8(vmask8); + uint64_t mask = vgetq_lane_u64(vmask64, 0); + if (mask != 0) + { + for (uint16_t i = 0; i < 8; ++i) { - uint8x16_t vstrlcp = vld1q_u8(reinterpret_cast(s)); - uint8x16_t vstrlcs = vld1q_u8(reinterpret_cast(s + lcs - lcp)); - uint8x16_t vmasklcp8 = - vorrq_u8( - vorrq_u8( - vorrq_u8( - vceqq_u8(vlcp0, vstrlcp), - vceqq_u8(vlcp1, vstrlcp)), - vceqq_u8(vlcp2, vstrlcp)), - vceqq_u8(vlcp3, vstrlcp)); - uint8x16_t vmasklcs8 = - vorrq_u8( - vorrq_u8( - vorrq_u8( - vceqq_u8(vlcs0, vstrlcs), - vceqq_u8(vlcs1, vstrlcs)), - vceqq_u8(vlcs2, vstrlcs)), - vceqq_u8(vlcs3, vstrlcs)); - uint64x2_t vmask64 = vreinterpretq_u64_u8(vandq_u8(vmasklcp8, vmasklcs8)); - uint64_t mask = vgetq_lane_u64(vmask64, 0); - if (mask != 0) + if ((mask & 0xff) && + (LEN == 2 || + (LEN == 3 ? s[i + 1 - lcp] == chr[1] : std::memcmp(s + 1 - lcp + i, chr + 1, LEN - 2) == 0))) { - for (int i = 0; i < 8; ++i) - { - if ((mask & 0xff)) - { - loc = s - lcp + i - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - } - mask >>= 8; - } + loc = s - lcp + i - buf_; + set_current(loc); + return true; } - mask = vgetq_lane_u64(vmask64, 1); - if (mask != 0) + mask >>= 8; + } + } + mask = vgetq_lane_u64(vmask64, 1); + if (mask != 0) + { + for (uint16_t i = 8; i < 16; ++i) + { + if ((mask & 0xff) && + (LEN == 2 || + (LEN == 3 ? s[i + 1 - lcp] == chr[1] : std::memcmp(s + 1 - lcp + i, chr + 1, LEN - 2) == 0))) { - for (int i = 0; i < 8; ++i) - { - if ((mask & 0xff)) - { - loc = s - lcp + i + 8 - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - } - mask >>= 8; - } + loc = s - lcp + i - buf_; + set_current(loc); + return true; } - s += 16; + mask >>= 8; } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 15 > end_) - break; } + s += 16; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + LEN > end_) + return false; + if (loc + LEN + 15 > end_) + break; + } +#endif + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - LEN + 1; + while (s < e) + { + do + s = static_cast(std::memchr(s, chr[lcp], e - s)); + while (s != NULL && s[lcs - lcp] != chr[lcs] && ++s < e); + if (s == NULL || s >= e) + { + s = e; + break; + } + if (LEN == 2 || + (LEN == 3 ? s[1 - lcp] == chr[1] : std::memcmp(s + 1 - lcp, chr + 1, LEN - 2) == 0)) + { + loc = s - lcp - buf_; + set_current(loc); + return true; + } + ++s; } - else if (pat_->pin_ == 5) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - uint8x16_t vlcp0 = vdupq_n_u8(chr[0]); - uint8x16_t vlcp1 = vdupq_n_u8(chr[1]); - uint8x16_t vlcp2 = vdupq_n_u8(chr[2]); - uint8x16_t vlcp3 = vdupq_n_u8(chr[3]); - uint8x16_t vlcp4 = vdupq_n_u8(chr[4]); - uint8x16_t vlcs0 = vdupq_n_u8(chr[5]); - uint8x16_t vlcs1 = vdupq_n_u8(chr[6]); - uint8x16_t vlcs2 = vdupq_n_u8(chr[7]); - uint8x16_t vlcs3 = vdupq_n_u8(chr[8]); - uint8x16_t vlcs4 = vdupq_n_u8(chr[9]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 16) + loc = s - lcp - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + LEN > end_) + return false; + } +} + +/// Few chars followed by 2 to 3 minimal char pattern +template +bool Matcher::advance_chars_pma(size_t loc) +{ + static const uint16_t lcp = 0; + static const uint16_t lcs = LEN - 1; + const Pattern::Pred *pma = pat_->pma_; + const char *chr = pat_->chr_; + size_t min = pat_->min_; +#if defined(HAVE_AVX512BW) || defined(HAVE_AVX2) || defined(HAVE_SSE2) + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - LEN + 1; + __m128i vlcp = _mm_set1_epi8(chr[lcp]); + __m128i vlcs = _mm_set1_epi8(chr[lcs]); + while (s <= e - 16) + { + __m128i vlcpm = _mm_loadu_si128(reinterpret_cast(s)); + __m128i vlcsm = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); + __m128i vlcpeq = _mm_cmpeq_epi8(vlcp, vlcpm); + __m128i vlcseq = _mm_cmpeq_epi8(vlcs, vlcsm); + uint32_t mask = _mm_movemask_epi8(_mm_and_si128(vlcpeq, vlcseq)); + while (mask != 0) + { + uint32_t offset = ctz(mask); + if (LEN == 2 || + (LEN == 3 ? s[offset + 1 - lcp] == chr[1] : std::memcmp(s + 1 - lcp + offset, chr + 1, LEN - 2) == 0)) { - uint8x16_t vstrlcp = vld1q_u8(reinterpret_cast(s)); - uint8x16_t vstrlcs = vld1q_u8(reinterpret_cast(s + lcs - lcp)); - uint8x16_t vmasklcp8 = - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vceqq_u8(vlcp0, vstrlcp), - vceqq_u8(vlcp1, vstrlcp)), - vceqq_u8(vlcp2, vstrlcp)), - vceqq_u8(vlcp3, vstrlcp)), - vceqq_u8(vlcp4, vstrlcp)); - uint8x16_t vmasklcs8 = - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vceqq_u8(vlcs0, vstrlcs), - vceqq_u8(vlcs1, vstrlcs)), - vceqq_u8(vlcs2, vstrlcs)), - vceqq_u8(vlcs3, vstrlcs)), - vceqq_u8(vlcs4, vstrlcs)); - uint64x2_t vmask64 = vreinterpretq_u64_u8(vandq_u8(vmasklcp8, vmasklcs8)); - uint64_t mask = vgetq_lane_u64(vmask64, 0); - if (mask != 0) - { - for (int i = 0; i < 8; ++i) - { - if ((mask & 0xff)) - { - loc = s - lcp + i - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - } - mask >>= 8; - } - } - mask = vgetq_lane_u64(vmask64, 1); - if (mask != 0) + loc = s - lcp + offset - buf_; + if (loc + LEN + 4 > end_ || Pattern::predict_match(pma, &buf_[loc + LEN]) == 0) { - for (int i = 0; i < 8; ++i) - { - if ((mask & 0xff)) - { - loc = s - lcp + i + 8 - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - } - mask >>= 8; - } + set_current(loc); + return true; } - s += 16; } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 15 > end_) - break; + mask &= mask - 1; } + s += 16; } - else if (pat_->pin_ == 6) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - uint8x16_t vlcp0 = vdupq_n_u8(chr[0]); - uint8x16_t vlcp1 = vdupq_n_u8(chr[1]); - uint8x16_t vlcp2 = vdupq_n_u8(chr[2]); - uint8x16_t vlcp3 = vdupq_n_u8(chr[3]); - uint8x16_t vlcp4 = vdupq_n_u8(chr[4]); - uint8x16_t vlcp5 = vdupq_n_u8(chr[5]); - uint8x16_t vlcs0 = vdupq_n_u8(chr[6]); - uint8x16_t vlcs1 = vdupq_n_u8(chr[7]); - uint8x16_t vlcs2 = vdupq_n_u8(chr[8]); - uint8x16_t vlcs3 = vdupq_n_u8(chr[9]); - uint8x16_t vlcs4 = vdupq_n_u8(chr[10]); - uint8x16_t vlcs5 = vdupq_n_u8(chr[11]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 16) + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + LEN + min > end_) + return false; + if (loc + LEN + min + 15 > end_) + break; + } +#elif defined(HAVE_NEON) + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - LEN + 1; + uint8x16_t vlcp = vdupq_n_u8(chr[lcp]); + uint8x16_t vlcs = vdupq_n_u8(chr[lcs]); + while (s <= e - 16) + { + uint8x16_t vlcpm = vld1q_u8(reinterpret_cast(s)); + uint8x16_t vlcsm = vld1q_u8(reinterpret_cast(s) + lcs - lcp); + uint8x16_t vlcpeq = vceqq_u8(vlcp, vlcpm); + uint8x16_t vlcseq = vceqq_u8(vlcs, vlcsm); + uint8x16_t vmask8 = vandq_u8(vlcpeq, vlcseq); + uint64x2_t vmask64 = vreinterpretq_u64_u8(vmask8); + uint64_t mask = vgetq_lane_u64(vmask64, 0); + if (mask != 0) + { + for (uint16_t i = 0; i < 8; ++i) { - uint8x16_t vstrlcp = vld1q_u8(reinterpret_cast(s)); - uint8x16_t vstrlcs = vld1q_u8(reinterpret_cast(s + lcs - lcp)); - uint8x16_t vmasklcp8 = - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vceqq_u8(vlcp0, vstrlcp), - vceqq_u8(vlcp1, vstrlcp)), - vceqq_u8(vlcp2, vstrlcp)), - vceqq_u8(vlcp3, vstrlcp)), - vceqq_u8(vlcp4, vstrlcp)), - vceqq_u8(vlcp5, vstrlcp)); - uint8x16_t vmasklcs8 = - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vceqq_u8(vlcs0, vstrlcs), - vceqq_u8(vlcs1, vstrlcs)), - vceqq_u8(vlcs2, vstrlcs)), - vceqq_u8(vlcs3, vstrlcs)), - vceqq_u8(vlcs4, vstrlcs)), - vceqq_u8(vlcs5, vstrlcs)); - uint64x2_t vmask64 = vreinterpretq_u64_u8(vandq_u8(vmasklcp8, vmasklcs8)); - uint64_t mask = vgetq_lane_u64(vmask64, 0); - if (mask != 0) + if ((mask & 0xff) && + (LEN == 2 || + (LEN == 3 ? s[i + 1 - lcp] == chr[1] : std::memcmp(s + 1 - lcp + i, chr + 1, LEN - 2) == 0))) { - for (int i = 0; i < 8; ++i) + loc = s - lcp + i - buf_; + if (loc + LEN + 4 > end_ || Pattern::predict_match(pat_->pma_, &buf_[loc + LEN]) == 0) { - if ((mask & 0xff)) - { - loc = s - lcp + i - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - } - mask >>= 8; + set_current(loc); + return true; } } - mask = vgetq_lane_u64(vmask64, 1); - if (mask != 0) + mask >>= 8; + } + } + mask = vgetq_lane_u64(vmask64, 1); + if (mask != 0) + { + for (uint16_t i = 8; i < 16; ++i) + { + if ((mask & 0xff) && + (LEN == 2 || + (LEN == 3 ? s[i + 1 - lcp] == chr[1] : std::memcmp(s + 1 - lcp + i, chr + 1, LEN - 2) == 0))) { - for (int i = 0; i < 8; ++i) + loc = s - lcp + i - buf_; + if (loc + LEN + 4 > end_ || Pattern::predict_match(pat_->pma_, &buf_[loc + LEN]) == 0) { - if ((mask & 0xff)) - { - loc = s - lcp + i + 8 - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - } - mask >>= 8; + set_current(loc); + return true; } } - s += 16; + mask >>= 8; } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 15 > end_) - break; } + s += 16; } - else if (pat_->pin_ == 7) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - uint8x16_t vlcp0 = vdupq_n_u8(chr[0]); - uint8x16_t vlcp1 = vdupq_n_u8(chr[1]); - uint8x16_t vlcp2 = vdupq_n_u8(chr[2]); - uint8x16_t vlcp3 = vdupq_n_u8(chr[3]); - uint8x16_t vlcp4 = vdupq_n_u8(chr[4]); - uint8x16_t vlcp5 = vdupq_n_u8(chr[5]); - uint8x16_t vlcp6 = vdupq_n_u8(chr[6]); - uint8x16_t vlcs0 = vdupq_n_u8(chr[7]); - uint8x16_t vlcs1 = vdupq_n_u8(chr[8]); - uint8x16_t vlcs2 = vdupq_n_u8(chr[9]); - uint8x16_t vlcs3 = vdupq_n_u8(chr[10]); - uint8x16_t vlcs4 = vdupq_n_u8(chr[11]); - uint8x16_t vlcs5 = vdupq_n_u8(chr[12]); - uint8x16_t vlcs6 = vdupq_n_u8(chr[13]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 16) + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + LEN + min > end_) + return false; + if (loc + LEN + min + 15 > end_) + break; + } +#endif + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - LEN + 1; + while (s < e) + { + do + s = static_cast(std::memchr(s, chr[lcp], e - s)); + while (s != NULL && s[lcs - lcp] != chr[lcs] && ++s < e); + if (s == NULL || s >= e) + { + s = e; + break; + } + if (LEN == 2 || + (LEN == 3 ? s[1 - lcp] == chr[1] : std::memcmp(s + 1 - lcp, chr + 1, LEN - 2) == 0)) + { + loc = s - lcp - buf_; + if (loc + LEN + 4 > end_ || Pattern::predict_match(pma, &buf_[loc + LEN]) == 0) { - uint8x16_t vstrlcp = vld1q_u8(reinterpret_cast(s)); - uint8x16_t vstrlcs = vld1q_u8(reinterpret_cast(s + lcs - lcp)); - uint8x16_t vmasklcp8 = - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vceqq_u8(vlcp0, vstrlcp), - vceqq_u8(vlcp1, vstrlcp)), - vceqq_u8(vlcp2, vstrlcp)), - vceqq_u8(vlcp3, vstrlcp)), - vceqq_u8(vlcp4, vstrlcp)), - vceqq_u8(vlcp5, vstrlcp)), - vceqq_u8(vlcp6, vstrlcp)); - uint8x16_t vmasklcs8 = - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vceqq_u8(vlcs0, vstrlcs), - vceqq_u8(vlcs1, vstrlcs)), - vceqq_u8(vlcs2, vstrlcs)), - vceqq_u8(vlcs3, vstrlcs)), - vceqq_u8(vlcs4, vstrlcs)), - vceqq_u8(vlcs5, vstrlcs)), - vceqq_u8(vlcs6, vstrlcs)); - uint64x2_t vmask64 = vreinterpretq_u64_u8(vandq_u8(vmasklcp8, vmasklcs8)); - uint64_t mask = vgetq_lane_u64(vmask64, 0); - if (mask != 0) - { - for (int i = 0; i < 8; ++i) - { - if ((mask & 0xff)) - { - loc = s - lcp + i - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - } - mask >>= 8; - } - } - mask = vgetq_lane_u64(vmask64, 1); - if (mask != 0) - { - for (int i = 0; i < 8; ++i) - { - if ((mask & 0xff)) - { - loc = s - lcp + i + 8 - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - } - mask >>= 8; - } - } - s += 16; + set_current(loc); + return true; } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 15 > end_) - break; } + ++s; } - else if (pat_->pin_ == 8) - { - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - const char *chr = pat_->chr_; - uint8x16_t vlcp0 = vdupq_n_u8(chr[0]); - uint8x16_t vlcp1 = vdupq_n_u8(chr[1]); - uint8x16_t vlcp2 = vdupq_n_u8(chr[2]); - uint8x16_t vlcp3 = vdupq_n_u8(chr[3]); - uint8x16_t vlcp4 = vdupq_n_u8(chr[4]); - uint8x16_t vlcp5 = vdupq_n_u8(chr[5]); - uint8x16_t vlcp6 = vdupq_n_u8(chr[6]); - uint8x16_t vlcp7 = vdupq_n_u8(chr[7]); - uint8x16_t vlcs0 = vdupq_n_u8(chr[8]); - uint8x16_t vlcs1 = vdupq_n_u8(chr[9]); - uint8x16_t vlcs2 = vdupq_n_u8(chr[10]); - uint8x16_t vlcs3 = vdupq_n_u8(chr[11]); - uint8x16_t vlcs4 = vdupq_n_u8(chr[12]); - uint8x16_t vlcs5 = vdupq_n_u8(chr[13]); - uint8x16_t vlcs6 = vdupq_n_u8(chr[14]); - uint8x16_t vlcs7 = vdupq_n_u8(chr[15]); - while (true) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - min + 1; - while (s <= e - 16) + loc = s - lcp - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + LEN + min > end_) + return false; + } +} + +/// Few chars followed by 4 minimal char pattern +template +bool Matcher::advance_chars_pmh(size_t loc) +{ + static const uint16_t lcp = 0; + static const uint16_t lcs = LEN - 1; + const Pattern::Pred *pmh = pat_->pmh_; + const char *chr = pat_->chr_; + size_t min = pat_->min_; +#if defined(HAVE_AVX512BW) || defined(HAVE_AVX2) || defined(HAVE_SSE2) + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - LEN + 1; + __m128i vlcp = _mm_set1_epi8(chr[lcp]); + __m128i vlcs = _mm_set1_epi8(chr[lcs]); + while (s <= e - 16) + { + __m128i vlcpm = _mm_loadu_si128(reinterpret_cast(s)); + __m128i vlcsm = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); + __m128i vlcpeq = _mm_cmpeq_epi8(vlcp, vlcpm); + __m128i vlcseq = _mm_cmpeq_epi8(vlcs, vlcsm); + uint32_t mask = _mm_movemask_epi8(_mm_and_si128(vlcpeq, vlcseq)); + while (mask != 0) + { + uint32_t offset = ctz(mask); + if (LEN == 2 || + (LEN == 3 ? s[offset + 1 - lcp] == chr[1] : std::memcmp(s + 1 - lcp + offset, chr + 1, LEN - 2) == 0)) { - uint8x16_t vstrlcp = vld1q_u8(reinterpret_cast(s)); - uint8x16_t vstrlcs = vld1q_u8(reinterpret_cast(s + lcs - lcp)); - uint8x16_t vmasklcp8 = - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vceqq_u8(vlcp0, vstrlcp), - vceqq_u8(vlcp1, vstrlcp)), - vceqq_u8(vlcp2, vstrlcp)), - vceqq_u8(vlcp3, vstrlcp)), - vceqq_u8(vlcp4, vstrlcp)), - vceqq_u8(vlcp5, vstrlcp)), - vceqq_u8(vlcp6, vstrlcp)), - vceqq_u8(vlcp7, vstrlcp)); - uint8x16_t vmasklcs8 = - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vorrq_u8( - vceqq_u8(vlcs0, vstrlcs), - vceqq_u8(vlcs1, vstrlcs)), - vceqq_u8(vlcs2, vstrlcs)), - vceqq_u8(vlcs3, vstrlcs)), - vceqq_u8(vlcs4, vstrlcs)), - vceqq_u8(vlcs5, vstrlcs)), - vceqq_u8(vlcs6, vstrlcs)), - vceqq_u8(vlcs7, vstrlcs)); - uint64x2_t vmask64 = vreinterpretq_u64_u8(vandq_u8(vmasklcp8, vmasklcs8)); - uint64_t mask = vgetq_lane_u64(vmask64, 0); - if (mask != 0) - { - for (int i = 0; i < 8; ++i) - { - if ((mask & 0xff)) - { - loc = s - lcp + i - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - } - mask >>= 8; - } - } - mask = vgetq_lane_u64(vmask64, 1); - if (mask != 0) + loc = s - lcp + offset - buf_; + if (loc + LEN + min > end_ || Pattern::predict_match(pmh, &buf_[loc + LEN], min)) { - for (int i = 0; i < 8; ++i) - { - if ((mask & 0xff)) - { - loc = s - lcp + i + 8 - buf_; - set_current(loc); - if (min >= 4) - { - if (Pattern::predict_match(pmh, &buf_[loc], min)) - return true; - } - else - { - if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) - return true; - } - } - mask >>= 8; - } + set_current(loc); + return true; } - s += 16; } - s -= lcp; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + min > end_) - return false; - if (loc + min + 15 > end_) - break; + mask &= mask - 1; } + s += 16; } -#endif - if (min >= 4 || pat_->npy_ < 16 || (min >= 2 && pat_->npy_ >= 56)) + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + LEN + min > end_) + return false; + if (loc + LEN + min + 15 > end_) + break; + } +#elif defined(HAVE_NEON) + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - LEN + 1; + uint8x16_t vlcp = vdupq_n_u8(chr[lcp]); + uint8x16_t vlcs = vdupq_n_u8(chr[lcs]); + while (s <= e - 16) { - if (min >= 4) + uint8x16_t vlcpm = vld1q_u8(reinterpret_cast(s)); + uint8x16_t vlcsm = vld1q_u8(reinterpret_cast(s) + lcs - lcp); + uint8x16_t vlcpeq = vceqq_u8(vlcp, vlcpm); + uint8x16_t vlcseq = vceqq_u8(vlcs, vlcsm); + uint8x16_t vmask8 = vandq_u8(vlcpeq, vlcseq); + uint64x2_t vmask64 = vreinterpretq_u64_u8(vmask8); + uint64_t mask = vgetq_lane_u64(vmask64, 0); + if (mask != 0) { - const Pattern::Pred *bit = pat_->bit_; - Pattern::Pred state1 = ~0; - Pattern::Pred state2 = ~0; - Pattern::Pred mask = (1 << (min - 1)); - while (true) + for (uint16_t i = 0; i < 8; ++i) { - const char *s = buf_ + loc; - const char *e = buf_ + end_; - while (s < e - 1) - { - state2 = (state1 << 1) | bit[static_cast(*s)]; - ++s; - state1 = (state2 << 1) | bit[static_cast(*s)]; - if ((state1 & state2 & mask) == 0) - break; - ++s; - } - if ((state2 & mask) == 0) - { - state1 = state2; - state2 = ~0; - --s; - } - else if ((state1 & mask) != 0 && s == e - 1) - { - state1 = (state1 << 1) | bit[static_cast(*s)]; - if ((state1 & mask) != 0) - ++s; - } - if (s < e) + if ((mask & 0xff) && + (LEN == 2 || + (LEN == 3 ? s[i + 1 - lcp] == chr[1] : std::memcmp(s + 1 - lcp + i, chr + 1, LEN - 2) == 0))) { - s -= min - 1; - loc = s - buf_; - if (Pattern::predict_match(pmh, s, min)) + size_t loc = s - lcp + i - buf_; + if (loc + LEN + min > end_ || Pattern::predict_match(pat_->pmh_, &buf_[loc + LEN], min)) { set_current(loc); return true; } - loc += min; - } - else - { - loc = s - buf_; - set_current_and_peek_more(loc - min); - loc = cur_ + min; - if (loc >= end_) - return false; } + mask >>= 8; } } - if (min == 3) + mask = vgetq_lane_u64(vmask64, 1); + if (mask != 0) { - const Pattern::Pred *bit = pat_->bit_; - Pattern::Pred state = ~0; - while (true) + for (uint16_t i = 8; i < 16; ++i) { - const char *s = buf_ + loc; - const char *e = buf_ + end_; - while (s < e) - { - state = (state << 1) | bit[static_cast(*s)]; - if ((state & 4) == 0) - break; - ++s; - } - if (s < e) + if ((mask & 0xff) && + (LEN == 2 || + (LEN == 3 ? s[i + 1 - lcp] == chr[1] : std::memcmp(s + 1 - lcp + i, chr + 1, LEN - 2) == 0))) { - s -= 2; - loc = s - buf_; - if (s > e - 4 || Pattern::predict_match(pma, s) == 0) + size_t loc = s - lcp + i - buf_; + if (loc + LEN + min > end_ || Pattern::predict_match(pat_->pmh_, &buf_[loc + LEN], min)) { set_current(loc); return true; } - loc += 3; - } - else - { - loc = s - buf_; - set_current_and_peek_more(loc - 3); - loc = cur_ + 3; - if (loc >= end_) - return false; } + mask >>= 8; } } - if (min == 2) + s += 16; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + LEN + min > end_) + return false; + if (loc + LEN + min + 15 > end_) + break; + } +#endif + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - LEN + 1; + while (s < e) + { + do + s = static_cast(std::memchr(s, chr[lcp], e - s)); + while (s != NULL && s[lcs - lcp] != chr[lcs] && ++s < e); + if (s == NULL || s >= e) + { + s = e; + break; + } + if (LEN == 2 || + (LEN == 3 ? s[1 - lcp] == chr[1] : std::memcmp(s + 1 - lcp, chr + 1, LEN - 2) == 0)) { - const Pattern::Pred *bit = pat_->bit_; - Pattern::Pred state = ~0; - while (true) + loc = s - lcp - buf_; + if (loc + LEN + min > end_ || Pattern::predict_match(pmh, &buf_[loc + LEN], min)) { - const char *s = buf_ + loc; - const char *e = buf_ + end_; - while (s < e) - { - state = (state << 1) | bit[static_cast(*s)]; - if ((state & 2) == 0) - break; - ++s; - } - if (s < e) - { - s -= 1; - loc = s - buf_; - if (s > e - 4 || Pattern::predict_match(pma, s) == 0) - { - set_current(loc); - return true; - } - loc += 2; - } - else + set_current(loc); + return true; + } + } + ++s; + } + loc = s - lcp - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + LEN + min > end_) + return false; + } +} + +/// String +bool Matcher::advance_string(size_t loc) +{ + const char *chr = pat_->chr_; + size_t len = pat_->len_; + uint16_t lcp = pat_->lcp_; + uint16_t lcs = pat_->lcs_; +#if defined(HAVE_AVX512BW) || defined(HAVE_AVX2) || defined(HAVE_SSE2) + // implements SSE2 string search scheme based on http://0x80.pl/articles/simd-friendly-karp-rabin.html + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - len + 1; + __m128i vlcp = _mm_set1_epi8(chr[lcp]); + __m128i vlcs = _mm_set1_epi8(chr[lcs]); + while (s <= e - 16) + { + __m128i vlcpm = _mm_loadu_si128(reinterpret_cast(s)); + __m128i vlcsm = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); + __m128i vlcpeq = _mm_cmpeq_epi8(vlcp, vlcpm); + __m128i vlcseq = _mm_cmpeq_epi8(vlcs, vlcsm); + uint32_t mask = _mm_movemask_epi8(_mm_and_si128(vlcpeq, vlcseq)); + while (mask != 0) + { + uint32_t offset = ctz(mask); + if (std::memcmp(s - lcp + offset, chr, len) == 0) + { + loc = s - lcp + offset - buf_; + set_current(loc); + return true; + } + mask &= mask - 1; + } + s += 16; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len > end_) + return false; + if (loc + len + 15 > end_) + break; + } +#elif defined(HAVE_NEON) + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - len + 1; + if (simd_advance_string_neon(s, e)) + return true; + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len > end_) + return false; + if (loc + len + 15 > end_) + break; + } +#endif + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - len + 1; + while (s < e) + { + do + s = static_cast(std::memchr(s, chr[lcp], e - s)); + while (s != NULL && s[lcs - lcp] != chr[lcs] && ++s < e); + if (s == NULL || s >= e) + { + s = e; + break; + } + if (std::memcmp(s - lcp, chr, len) == 0) + { + loc = s - lcp - buf_; + set_current(loc); + return true; + } + ++s; + } + loc = s - lcp - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len > end_) + return false; + } +} + +#if defined(WITH_STRING_PM) + +/// String followed by 1 to 3 minimal char pattern +bool Matcher::advance_string_pma(size_t loc) +{ + const Pattern::Pred *pma = pat_->pma_; + const char *chr = pat_->chr_; + size_t len = pat_->len_; + size_t min = pat_->min_; + uint16_t lcp = pat_->lcp_; + uint16_t lcs = pat_->lcs_; +#if defined(HAVE_AVX512BW) || defined(HAVE_AVX2) || defined(HAVE_SSE2) + // implements SSE2 string search scheme based on http://0x80.pl/articles/simd-friendly-karp-rabin.html + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - len + 1; + __m128i vlcp = _mm_set1_epi8(chr[lcp]); + __m128i vlcs = _mm_set1_epi8(chr[lcs]); + while (s <= e - 16) + { + __m128i vlcpm = _mm_loadu_si128(reinterpret_cast(s)); + __m128i vlcsm = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); + __m128i vlcpeq = _mm_cmpeq_epi8(vlcp, vlcpm); + __m128i vlcseq = _mm_cmpeq_epi8(vlcs, vlcsm); + uint32_t mask = _mm_movemask_epi8(_mm_and_si128(vlcpeq, vlcseq)); + while (mask != 0) + { + uint32_t offset = ctz(mask); + if (std::memcmp(s - lcp + offset, chr, len) == 0) + { + loc = s - lcp + offset - buf_; + if (loc + len + 4 > end_ || Pattern::predict_match(pma, &buf_[loc + len]) == 0) { - loc = s - buf_; - set_current_and_peek_more(loc - 2); - loc = cur_ + 2; - if (loc >= end_) - return false; + set_current(loc); + return true; } } + mask &= mask - 1; } - const Pattern::Pred *bit = pat_->bit_; - while (true) - { - const char *s = buf_ + loc; - const char *e = buf_ + end_ - 3; - bool f = true; - while (s < e && - (f = ((bit[static_cast(*s)] & 1) && - (bit[static_cast(*++s)] & 1) && - (bit[static_cast(*++s)] & 1) && - (bit[static_cast(*++s)] & 1)))) - { - ++s; - } - loc = s - buf_; - if (!f) + s += 16; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len + min > end_) + return false; + if (loc + len + min + 15 > end_) + break; + } +#elif defined(HAVE_NEON) + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - len + 1; + if (simd_advance_string_pma_neon(s, e)) + return true; + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len + min > end_) + return false; + if (loc + len + min + 15 > end_) + break; + } +#endif + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - len + 1; + while (s < e) + { + do + s = static_cast(std::memchr(s, chr[lcp], e - s)); + while (s != NULL && s[lcs - lcp] != chr[lcs] && ++s < e); + if (s == NULL || s >= e) + { + s = e; + break; + } + if (std::memcmp(s - lcp, chr, len) == 0) + { + loc = s - lcp - buf_; + if (loc + len + 4 > end_ || Pattern::predict_match(pma, &buf_[loc + len]) == 0) { - if (s < e && Pattern::predict_match(pma, s)) - { - ++loc; - continue; - } set_current(loc); return true; } - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + 3 >= end_) - { - set_current(loc); - return loc + min <= end_; - } } + ++s; } - while (true) + loc = s - lcp - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len + min > end_) + return false; + } +} + +/// String followed by 4 minimal char pattern +bool Matcher::advance_string_pmh(size_t loc) +{ + const Pattern::Pred *pmh = pat_->pmh_; + const char *chr = pat_->chr_; + size_t len = pat_->len_; + size_t min = pat_->min_; + uint16_t lcp = pat_->lcp_; + uint16_t lcs = pat_->lcs_; +#if defined(HAVE_AVX512BW) || defined(HAVE_AVX2) || defined(HAVE_SSE2) + // implements SSE2 string search scheme based on http://0x80.pl/articles/simd-friendly-karp-rabin.html + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - len + 1; + __m128i vlcp = _mm_set1_epi8(chr[lcp]); + __m128i vlcs = _mm_set1_epi8(chr[lcs]); + while (s <= e - 16) { - const char *s = buf_ + loc; - const char *e = buf_ + end_ - 6; - bool f = true; - while (s < e && - (f = (Pattern::predict_match(pma, s) && - Pattern::predict_match(pma, ++s) && - Pattern::predict_match(pma, ++s) && - Pattern::predict_match(pma, ++s)))) + __m128i vlcpm = _mm_loadu_si128(reinterpret_cast(s)); + __m128i vlcsm = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); + __m128i vlcpeq = _mm_cmpeq_epi8(vlcp, vlcpm); + __m128i vlcseq = _mm_cmpeq_epi8(vlcs, vlcsm); + uint32_t mask = _mm_movemask_epi8(_mm_and_si128(vlcpeq, vlcseq)); + while (mask != 0) { - ++s; + uint32_t offset = ctz(mask); + if (std::memcmp(s - lcp + offset, chr, len) == 0) + { + loc = s - lcp + offset - buf_; + if (loc + len + min > end_ || Pattern::predict_match(pmh, &buf_[loc + len], min)) + { + set_current(loc); + return true; + } + } + mask &= mask - 1; } - loc = s - buf_; - if (!f) + s += 16; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len + min > end_) + return false; + if (loc + len + min + 15 > end_) + break; + } +#elif defined(HAVE_NEON) + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - len + 1; + if (simd_advance_string_pmh_neon(s, e)) + return true; + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len + min > end_) + return false; + if (loc + len + min + 15 > end_) + break; + } +#endif + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - len + 1; + while (s < e) + { + do + s = static_cast(std::memchr(s, chr[lcp], e - s)); + while (s != NULL && s[lcs - lcp] != chr[lcs] && ++s < e); + if (s == NULL || s >= e) { - set_current(loc); - return true; + s = e; + break; } - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + 6 >= end_) + if (std::memcmp(s - lcp, chr, len) == 0) { - set_current(loc); - return loc + min <= end_; + loc = s - lcp - buf_; + if (loc + len + min > end_ || Pattern::predict_match(pmh, &buf_[loc + len], min)) + { + set_current(loc); + return true; + } } + ++s; } + loc = s - lcp - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len + min > end_) + return false; } +} + +#endif // WITH_STRING_PM + +#if defined(HAVE_NEON) + +// Implements NEON/AArch64 string search scheme based on http://0x80.pl/articles/simd-friendly-karp-rabin.html 64 bit optimized +bool Matcher::simd_advance_string_neon(const char *&s, const char *e) +{ + uint16_t lcp = pat_->lcp_; + uint16_t lcs = pat_->lcs_; + size_t len = pat_->len_; const char *chr = pat_->chr_; - size_t len = pat_->len_; // actually never more than 255 - if (len == 1) + uint8x16_t vlcp = vdupq_n_u8(chr[lcp]); + uint8x16_t vlcs = vdupq_n_u8(chr[lcs]); + while (s <= e - 16) { - while (true) + uint8x16_t vlcpm = vld1q_u8(reinterpret_cast(s)); + uint8x16_t vlcsm = vld1q_u8(reinterpret_cast(s) + lcs - lcp); + uint8x16_t vlcpeq = vceqq_u8(vlcp, vlcpm); + uint8x16_t vlcseq = vceqq_u8(vlcs, vlcsm); + uint8x16_t vmask8 = vandq_u8(vlcpeq, vlcseq); + uint64x2_t vmask64 = vreinterpretq_u64_u8(vmask8); + uint64_t mask = vgetq_lane_u64(vmask64, 0); + if (mask != 0) { - const char *s = buf_ + loc; - const char *e = buf_ + end_; - s = static_cast(std::memchr(s, *chr, e - s)); - if (s != NULL) + for (uint16_t i = 0; i < 8; ++i) { - loc = s - buf_; - set_current(loc); - if (min >= 4) - { - if (s + 1 + min > e || Pattern::predict_match(pmh, s + 1, min)) - return true; - } - else + if ((mask & 0xff) && std::memcmp(s - lcp + i, chr, len) == 0) { - if (min == 0 || s > e - 5 || Pattern::predict_match(pma, s + 1) == 0) - return true; + size_t loc = s - lcp + i - buf_; + set_current(loc); + return true; } - ++loc; + mask >>= 8; } - else + } + mask = vgetq_lane_u64(vmask64, 1); + if (mask != 0) + { + for (uint16_t i = 8; i < 16; ++i) { - loc = e - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + len > end_) - return false; + if ((mask & 0xff) && std::memcmp(s - lcp + i, chr, len) == 0) + { + size_t loc = s - lcp + i - buf_; + set_current(loc); + return true; + } + mask >>= 8; } } + s += 16; } - size_t lcp = pat_->lcp_; - size_t lcs = pat_->lcs_; - while (true) + return false; +} + +#if defined(WITH_STRING_PM) + +// Implements NEON/AArch64 string search scheme based on http://0x80.pl/articles/simd-friendly-karp-rabin.html 64 bit optimized +bool Matcher::simd_advance_string_pma_neon(const char *&s, const char *e) +{ + uint16_t lcp = pat_->lcp_; + uint16_t lcs = pat_->lcs_; + size_t len = pat_->len_; + const char *chr = pat_->chr_; + uint8x16_t vlcp = vdupq_n_u8(chr[lcp]); + uint8x16_t vlcs = vdupq_n_u8(chr[lcs]); + while (s <= e - 16) { - if (pat_->bmd_ == 0) - { - const char *s = buf_ + loc + lcp; - const char *e = buf_ + end_ + lcp - len + 1; -#if defined(COMPILE_AVX512BW) - // implements AVX512BW string search scheme based on http://0x80.pl/articles/simd-friendly-karp-rabin.html - // enhanced with least frequent character matching - __m512i vlcp = _mm512_set1_epi8(chr[lcp]); - __m512i vlcs = _mm512_set1_epi8(chr[lcs]); - while (s <= e - 64) - { - __m512i vlcpm = _mm512_loadu_si512(reinterpret_cast(s)); - __m512i vlcsm = _mm512_loadu_si512(reinterpret_cast(s + lcs - lcp)); - uint64_t mask = _mm512_cmpeq_epi8_mask(vlcp, vlcpm) & _mm512_cmpeq_epi8_mask(vlcs, vlcsm); - while (mask != 0) + uint8x16_t vlcpm = vld1q_u8(reinterpret_cast(s)); + uint8x16_t vlcsm = vld1q_u8(reinterpret_cast(s) + lcs - lcp); + uint8x16_t vlcpeq = vceqq_u8(vlcp, vlcpm); + uint8x16_t vlcseq = vceqq_u8(vlcs, vlcsm); + uint8x16_t vmask8 = vandq_u8(vlcpeq, vlcseq); + uint64x2_t vmask64 = vreinterpretq_u64_u8(vmask8); + uint64_t mask = vgetq_lane_u64(vmask64, 0); + if (mask != 0) + { + for (uint16_t i = 0; i < 8; ++i) + { + if ((mask & 0xff) && std::memcmp(s - lcp + i, chr, len) == 0) { - uint32_t offset = ctzl(mask); - if (std::memcmp(s - lcp + offset, chr, len) == 0) + size_t loc = s - lcp + i - buf_; + if (loc + len + 4 > end_ || Pattern::predict_match(pat_->pma_, &buf_[loc + len]) == 0) { - loc = s - lcp + offset - buf_; set_current(loc); - if (min >= 4) - { - if (loc + len + min > end_ || Pattern::predict_match(pmh, &buf_[loc + len], min)) - return true; - } - else - { - if (min == 0 || loc + len + 4 > end_ || Pattern::predict_match(pma, &buf_[loc + len]) == 0) - return true; - } + return true; } - mask &= mask - 1; } - s += 64; - } -#elif defined(COMPILE_AVX2) - // implements AVX2 string search scheme based on http://0x80.pl/articles/simd-friendly-karp-rabin.html - // enhanced with least frequent character matching - __m256i vlcp = _mm256_set1_epi8(chr[lcp]); - __m256i vlcs = _mm256_set1_epi8(chr[lcs]); - while (s <= e - 32) - { - __m256i vlcpm = _mm256_loadu_si256(reinterpret_cast(s)); - __m256i vlcsm = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); - __m256i vlcpeq = _mm256_cmpeq_epi8(vlcp, vlcpm); - __m256i vlcseq = _mm256_cmpeq_epi8(vlcs, vlcsm); - uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(vlcpeq, vlcseq)); - while (mask != 0) + mask >>= 8; + } + } + mask = vgetq_lane_u64(vmask64, 1); + if (mask != 0) + { + for (uint16_t i = 8; i < 16; ++i) + { + if ((mask & 0xff) && std::memcmp(s - lcp + i, chr, len) == 0) { - uint32_t offset = ctz(mask); - if (std::memcmp(s - lcp + offset, chr, len) == 0) + size_t loc = s - lcp + i - buf_; + if (loc + len + 4 > end_ || Pattern::predict_match(pat_->pma_, &buf_[loc + len]) == 0) { - loc = s - lcp + offset - buf_; set_current(loc); - if (min >= 4) - { - if (loc + len + min > end_ || Pattern::predict_match(pmh, &buf_[loc + len], min)) - return true; - } - else - { - if (min == 0 || loc + len + 4 > end_ || Pattern::predict_match(pma, &buf_[loc + len]) == 0) - return true; - } + return true; } - mask &= mask - 1; } - s += 32; - } -#elif defined(HAVE_AVX512BW) || defined(HAVE_AVX2) || defined(HAVE_SSE2) - // implements SSE2 string search scheme based on http://0x80.pl/articles/simd-friendly-karp-rabin.html - // enhanced with least frequent character matching - __m128i vlcp = _mm_set1_epi8(chr[lcp]); - __m128i vlcs = _mm_set1_epi8(chr[lcs]); - while (s <= e - 16) - { - __m128i vlcpm = _mm_loadu_si128(reinterpret_cast(s)); - __m128i vlcsm = _mm_loadu_si128(reinterpret_cast(s + lcs - lcp)); - __m128i vlcpeq = _mm_cmpeq_epi8(vlcp, vlcpm); - __m128i vlcseq = _mm_cmpeq_epi8(vlcs, vlcsm); - uint32_t mask = _mm_movemask_epi8(_mm_and_si128(vlcpeq, vlcseq)); - while (mask != 0) + mask >>= 8; + } + } + s += 16; + } + return false; +} + +// Implements NEON/AArch64 string search scheme based on http://0x80.pl/articles/simd-friendly-karp-rabin.html 64 bit optimized +bool Matcher::simd_advance_string_pmh_neon(const char *&s, const char *e) +{ + uint16_t lcp = pat_->lcp_; + uint16_t lcs = pat_->lcs_; + size_t len = pat_->len_; + size_t min = pat_->min_; // min >= 4 + const char *chr = pat_->chr_; + uint8x16_t vlcp = vdupq_n_u8(chr[lcp]); + uint8x16_t vlcs = vdupq_n_u8(chr[lcs]); + while (s <= e - 16) + { + uint8x16_t vlcpm = vld1q_u8(reinterpret_cast(s)); + uint8x16_t vlcsm = vld1q_u8(reinterpret_cast(s) + lcs - lcp); + uint8x16_t vlcpeq = vceqq_u8(vlcp, vlcpm); + uint8x16_t vlcseq = vceqq_u8(vlcs, vlcsm); + uint8x16_t vmask8 = vandq_u8(vlcpeq, vlcseq); + uint64x2_t vmask64 = vreinterpretq_u64_u8(vmask8); + uint64_t mask = vgetq_lane_u64(vmask64, 0); + if (mask != 0) + { + for (uint16_t i = 0; i < 8; ++i) + { + if ((mask & 0xff) && std::memcmp(s - lcp + i, chr, len) == 0) { - uint32_t offset = ctz(mask); - if (std::memcmp(s - lcp + offset, chr, len) == 0) + size_t loc = s - lcp + i - buf_; + if (loc + len + min > end_ || Pattern::predict_match(pat_->pmh_, &buf_[loc + len], min)) { - loc = s - lcp + offset - buf_; set_current(loc); - if (min >= 4) - { - if (loc + len + min > end_ || Pattern::predict_match(pmh, &buf_[loc + len], min)) - return true; - } - else - { - if (min == 0 || loc + len + 4 > end_ || Pattern::predict_match(pma, &buf_[loc + len]) == 0) - return true; - } + return true; } - mask &= mask - 1; } - s += 16; + mask >>= 8; } -#elif defined(HAVE_NEON) - // implements NEON/AArch64 string search scheme based on http://0x80.pl/articles/simd-friendly-karp-rabin.html 64 bit optimized - // enhanced with least frequent character matching - uint8x16_t vlcp = vdupq_n_u8(chr[lcp]); - uint8x16_t vlcs = vdupq_n_u8(chr[lcs]); - if (min >= 4) + } + mask = vgetq_lane_u64(vmask64, 1); + if (mask != 0) + { + for (uint16_t i = 8; i < 16; ++i) { - while (s <= e - 16) + if ((mask & 0xff) && std::memcmp(s - lcp + i, chr, len) == 0) { - uint8x16_t vlcpm = vld1q_u8(reinterpret_cast(s)); - uint8x16_t vlcsm = vld1q_u8(reinterpret_cast(s) + lcs - lcp); - uint8x16_t vlcpeq = vceqq_u8(vlcp, vlcpm); - uint8x16_t vlcseq = vceqq_u8(vlcs, vlcsm); - uint8x16_t vmask8 = vandq_u8(vlcpeq, vlcseq); - uint64x2_t vmask64 = vreinterpretq_u64_u8(vmask8); - uint64_t mask = vgetq_lane_u64(vmask64, 0); - if (mask != 0) - { - for (int i = 0; i < 8; ++i) - { - if ((mask & 0xff) && std::memcmp(s - lcp + i, chr, len) == 0) - { - loc = s - lcp + i - buf_; - set_current(loc); - if (loc + len + min > end_ || Pattern::predict_match(pmh, &buf_[loc + len], min)) - return true; - } - mask >>= 8; - } - } - mask = vgetq_lane_u64(vmask64, 1); - if (mask != 0) + size_t loc = s - lcp + i - buf_; + if (loc + len + min > end_ || Pattern::predict_match(pat_->pmh_, &buf_[loc + len], min)) { - for (int i = 0; i < 8; ++i) - { - if ((mask & 0xff) && std::memcmp(s - lcp + i + 8, chr, len) == 0) - { - loc = s - lcp + i + 8 - buf_; - set_current(loc); - if (loc + len + min > end_ || Pattern::predict_match(pmh, &buf_[loc + len], min)) - return true; - } - mask >>= 8; - } + set_current(loc); + return true; } - s += 16; } + mask >>= 8; + } + } + s += 16; + } + return false; +} + +#endif // WITH_STRING_PM + +#endif // HAVE_NEON + +/// My improved Boyer-Moore string search +bool Matcher::advance_string_bm(size_t loc) +{ + const char *chr = pat_->chr_; + const uint8_t *bms = pat_->bms_; + size_t len = pat_->len_; + size_t bmd = pat_->bmd_; + uint16_t lcp = pat_->lcp_; + while (true) + { + const char *s = buf_ + loc + len - 1; + const char *e = buf_ + end_; + const char *t = chr + len - 1; + while (s < e) + { + size_t k = 0; + do + s += k = bms[static_cast(*s)]; + while (k > 0 ? s < e : s[lcp - len + 1] != chr[lcp] && (s += bmd) < e); + if (s >= e) + break; + const char *p = t - 1; + const char *q = s - 1; + while (p >= chr && *p == *q) + { + --p; + --q; + } + if (p < chr) + { + loc = q - buf_ + 1; + set_current(loc); + return true; + } + if (chr + bmd >= p) + { + s += bmd; } else { - while (s <= e - 16) - { - uint8x16_t vlcpm = vld1q_u8(reinterpret_cast(s)); - uint8x16_t vlcsm = vld1q_u8(reinterpret_cast(s) + lcs - lcp); - uint8x16_t vlcpeq = vceqq_u8(vlcp, vlcpm); - uint8x16_t vlcseq = vceqq_u8(vlcs, vlcsm); - uint8x16_t vmask8 = vandq_u8(vlcpeq, vlcseq); - uint64x2_t vmask64 = vreinterpretq_u64_u8(vmask8); - uint64_t mask = vgetq_lane_u64(vmask64, 0); - if (mask != 0) - { - for (int i = 0; i < 8; ++i) - { - if ((mask & 0xff) && std::memcmp(s - lcp + i, chr, len) == 0) - { - loc = s - lcp + i - buf_; - set_current(loc); - if (min == 0 || loc + len + 4 > end_ || Pattern::predict_match(pma, &buf_[loc + len]) == 0) - return true; - } - mask >>= 8; - } - } - mask = vgetq_lane_u64(vmask64, 1); - if (mask != 0) - { - for (int i = 0; i < 8; ++i) - { - if ((mask & 0xff) && std::memcmp(s - lcp + i + 8, chr, len) == 0) - { - loc = s - lcp + i + 8 - buf_; - set_current(loc); - if (min == 0 || loc + len + 4 > end_ || Pattern::predict_match(pma, &buf_[loc + len]) == 0) - return true; - } - mask >>= 8; - } - } - s += 16; - } + size_t k = bms[static_cast(*q)]; + if (p + k > t + bmd) + s += k - (t - p); + else + s += bmd; } -#endif - while (s < e) + } + s -= len - 1; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len > end_) + return false; + } +} + +#if defined(WITH_STRING_PM) + +/// My improved Boyer-Moore string search followed by a 1 to 3 minimal char pattern, using PM4 +bool Matcher::advance_string_bm_pma(size_t loc) +{ + const char *chr = pat_->chr_; + const Pattern::Pred *pma = pat_->pma_; + const uint8_t *bms = pat_->bms_; + size_t len = pat_->len_; + size_t bmd = pat_->bmd_; + uint16_t lcp = pat_->lcp_; + while (true) + { + const char *s = buf_ + loc + len - 1; + const char *e = buf_ + end_; + const char *t = chr + len - 1; + while (s < e) + { + size_t k = 0; + do + s += k = bms[static_cast(*s)]; + while (k > 0 ? s < e : s[lcp - len + 1] != chr[lcp] && (s += bmd) < e); + if (s >= e) + break; + const char *p = t - 1; + const char *q = s - 1; + while (p >= chr && *p == *q) { - do - s = static_cast(std::memchr(s, chr[lcp], e - s)); - while (s != NULL && s[lcs - lcp] != chr[lcs] && ++s < e); - if (s == NULL || s >= e) - { - s = e; - break; - } - if (len <= 2 || memcmp(s - lcp, chr, len) == 0) + --p; + --q; + } + if (p < chr) + { + loc = q - buf_ + 1; + if (loc + len + 4 > end_ || Pattern::predict_match(pma, &buf_[loc + len]) == 0) { - loc = s - lcp - buf_; set_current(loc); - if (min == 0) - return true; - if (min >= 4) - { - if (loc + len + min > end_ || Pattern::predict_match(pmh, &buf_[loc + len], min)) - return true; - } - else - { - if (loc + len + 4 > end_ || Pattern::predict_match(pma, &buf_[loc + len]) == 0) - return true; - } + return true; } - ++s; } - loc = s - lcp - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + len > end_) - return false; + if (chr + bmd >= p) + { + s += bmd; + } + else + { + size_t k = bms[static_cast(*q)]; + if (p + k > t + bmd) + s += k - (t - p); + else + s += bmd; + } } - else + s -= len - 1; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len > end_) + return false; + } +} + +/// My improved Boyer-Moore string search followed by a 4 minimal char pattern, using PM4 +bool Matcher::advance_string_bm_pmh(size_t loc) +{ + const char *chr = pat_->chr_; + const Pattern::Pred *pmh = pat_->pmh_; + const uint8_t *bms = pat_->bms_; + size_t bmd = pat_->bmd_; + size_t len = pat_->len_; + size_t min = pat_->min_; + uint16_t lcp = pat_->lcp_; + while (true) + { + const char *s = buf_ + loc + len - 1; + const char *e = buf_ + end_; + const char *t = chr + len - 1; + while (s < e) { - // apply our improved Boyer-Moore scheme as a fallback - const char *s = buf_ + loc + len - 1; - const char *e = buf_ + end_; - const char *t = chr + len - 1; - size_t bmd = pat_->bmd_; - const uint8_t *bms = pat_->bms_; - while (s < e) - { - size_t k = 0; - do - s += k = bms[static_cast(*s)]; - while (k > 0 ? s < e : s[lcp - len + 1] != chr[lcp] && (s += bmd) < e); - if (s >= e) - break; - const char *p = t - 1; - const char *q = s - 1; - while (p >= chr && *p == *q) - { - --p; - --q; - } - if (p < chr) + size_t k = 0; + do + s += k = bms[static_cast(*s)]; + while (k > 0 ? s < e : s[lcp - len + 1] != chr[lcp] && (s += bmd) < e); + if (s >= e) + break; + const char *p = t - 1; + const char *q = s - 1; + while (p >= chr && *p == *q) + { + --p; + --q; + } + if (p < chr) + { + loc = q - buf_ + 1; + if (loc + len + min > end_ || Pattern::predict_match(pmh, &buf_[loc + len], min)) { - loc = q - buf_ + 1; set_current(loc); - if (min >= 4) - { - if (loc + len + min > end_ || Pattern::predict_match(pmh, &buf_[loc + len], min)) - return true; - } - else - { - if (min == 0 || loc + len + 4 > end_ || Pattern::predict_match(pma, &buf_[loc + len]) == 0) - return true; - } - } - if (chr + bmd >= p) - { - s += bmd; + return true; } + } + if (chr + bmd >= p) + { + s += bmd; + } + else + { + size_t k = bms[static_cast(*q)]; + if (p + k > t + bmd) + s += k - (t - p); else - { - size_t k = bms[static_cast(*q)]; - if (p + k > t + bmd) - s += k - (t - p); - else - s += bmd; - } + s += bmd; } - s -= len - 1; - loc = s - buf_; - set_current_and_peek_more(loc - 1); - loc = cur_ + 1; - if (loc + len > end_) - return false; } + s -= len - 1; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len > end_) + return false; } } -} // namespace reflex +#endif // WITH_STRING_PM -#endif +} // namespace reflex diff --git a/lib/matcher_avx2.cpp b/lib/matcher_avx2.cpp index f560af6ad..c098e6a28 100644 --- a/lib/matcher_avx2.cpp +++ b/lib/matcher_avx2.cpp @@ -27,18 +27,1004 @@ \******************************************************************************/ /** -@file matcher.cpp, matcher_avx2.cpp, matcher_avx512bw.cpp +@file matcher_avx2.cpp @brief RE/flex matcher engine @author Robert van Engelen - engelen@genivia.com -@copyright (c) 2016-2022, Robert van Engelen, Genivia Inc. All rights reserved. +@copyright (c) 2016-2024, Robert van Engelen, Genivia Inc. All rights reserved. @copyright (c) BSD-3 License - see LICENSE.txt */ -#if defined(HAVE_AVX2) -# if !defined(__AVX2__) -# error matcher_avx2.cpp must be compiled with -mavx2 or /arch:avx2. +#if defined(HAVE_AVX2) || defined(HAVE_AVX512BW) +# if !defined(__AVX2__) && !defined(__AVX512BW__) +# error simd_avx2.cpp must be compiled with -mavx2 or /arch:avx2. # endif #endif -#define COMPILE_AVX2 -#include "matcher.cpp" +#include + +namespace reflex { + +#if defined(HAVE_AVX2) || defined(HAVE_AVX512BW) + +// AVX2 runtime optimized function callback overrides +void Matcher::simd_init_advance_avx2() +{ + if (pat_->len_ == 0) + { + switch (pat_->pin_) + { + case 1: + if (pat_->min_ < 4) + adv_ = &Matcher::simd_advance_pattern_pin1_pma_avx2; + else + adv_ = &Matcher::simd_advance_pattern_pin1_pmh_avx2; + break; + case 2: + if (pat_->min_ == 1) + adv_ = &Matcher::simd_advance_pattern_pin2_one_avx2; + else if (pat_->min_ < 4) + adv_ = &Matcher::simd_advance_pattern_pin2_pma_avx2; + else + adv_ = &Matcher::simd_advance_pattern_pin2_pmh_avx2; + break; + case 3: + if (pat_->min_ == 1) + adv_ = &Matcher::simd_advance_pattern_pin3_one_avx2; + else if (pat_->min_ < 4) + adv_ = &Matcher::simd_advance_pattern_pin3_pma_avx2; + else + adv_ = &Matcher::simd_advance_pattern_pin3_pmh_avx2; + break; + case 4: + if (pat_->min_ == 1) + adv_ = &Matcher::simd_advance_pattern_pin4_one_avx2; + else if (pat_->min_ < 4) + adv_ = &Matcher::simd_advance_pattern_pin4_pma_avx2; + else + adv_ = &Matcher::simd_advance_pattern_pin4_pmh_avx2; + break; + case 5: + if (pat_->min_ == 1) + adv_ = &Matcher::simd_advance_pattern_pin5_one_avx2; + else if (pat_->min_ < 4) + adv_ = &Matcher::simd_advance_pattern_pin5_pma_avx2; + else + adv_ = &Matcher::simd_advance_pattern_pin5_pmh_avx2; + break; + case 6: + if (pat_->min_ == 1) + adv_ = &Matcher::simd_advance_pattern_pin6_one_avx2; + else if (pat_->min_ < 4) + adv_ = &Matcher::simd_advance_pattern_pin6_pma_avx2; + else + adv_ = &Matcher::simd_advance_pattern_pin6_pmh_avx2; + break; + case 7: + if (pat_->min_ == 1) + adv_ = &Matcher::simd_advance_pattern_pin7_one_avx2; + else if (pat_->min_ < 4) + adv_ = &Matcher::simd_advance_pattern_pin7_pma_avx2; + else + adv_ = &Matcher::simd_advance_pattern_pin7_pmh_avx2; + break; + case 8: + if (pat_->min_ == 1) + adv_ = &Matcher::simd_advance_pattern_pin8_one_avx2; + else if (pat_->min_ < 4) + adv_ = &Matcher::simd_advance_pattern_pin8_pma_avx2; + else + adv_ = &Matcher::simd_advance_pattern_pin8_pmh_avx2; + break; + case 16: + if (pat_->min_ == 1) + adv_ = &Matcher::simd_advance_pattern_pin16_one_avx2; + else if (pat_->min_ < 4) + adv_ = &Matcher::simd_advance_pattern_pin16_pma_avx2; + else + adv_ = &Matcher::simd_advance_pattern_pin16_pmh_avx2; + break; + } + } + else if (pat_->len_ == 1) + { + // no specialization + } + else if (pat_->len_ == 2) + { + if (pat_->min_ == 0) + adv_ = &Matcher::simd_advance_chars_avx2<2>; + else if (pat_->min_ < 4) + adv_ = &Matcher::simd_advance_chars_pma_avx2<2>; + else + adv_ = &Matcher::simd_advance_chars_pmh_avx2<2>; + } + else if (pat_->len_ == 3) + { + if (pat_->min_ == 0) + adv_ = &Matcher::simd_advance_chars_avx2<3>; + else if (pat_->min_ < 4) + adv_ = &Matcher::simd_advance_chars_pma_avx2<3>; + else + adv_ = &Matcher::simd_advance_chars_pmh_avx2<3>; + } + else if (pat_->bmd_ == 0) + { +#if defined(WITH_STRING_PM) + if (pat_->min_ >= 4) + adv_ = &Matcher::simd_advance_string_pmh_avx2; + else if (pat_->min_ > 0) + adv_ = &Matcher::simd_advance_string_pma_avx2; + else +#endif + adv_ = &Matcher::simd_advance_string_avx2; + } +} + +// My "needle search" method when pin=1 +bool Matcher::simd_advance_pattern_pin1_pma_avx2(size_t loc) +{ + const Pattern::Pred *pma = pat_->pma_; + const char *chr = pat_->chr_; + size_t min = pat_->min_; + uint16_t lcp = pat_->lcp_; + uint16_t lcs = pat_->lcs_; + __m256i vlcp = _mm256_set1_epi8(chr[0]); + __m256i vlcs = _mm256_set1_epi8(chr[1]); + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - min + 1; + while (s <= e - 32) + { + __m256i vstrlcp = _mm256_loadu_si256(reinterpret_cast(s)); + __m256i vstrlcs = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); + __m256i veqlcp = _mm256_cmpeq_epi8(vlcp, vstrlcp); + __m256i veqlcs = _mm256_cmpeq_epi8(vlcs, vstrlcs); + uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(veqlcp, veqlcs)); + while (mask != 0) + { + uint32_t offset = ctz(mask); + loc = s - lcp + offset - buf_; + set_current(loc); + if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) + return true; + mask &= mask - 1; + } + s += 32; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + min > end_) + return false; + if (loc + min + 31 > end_) + break; + } + return advance_pattern_pin1_pma(loc); +} + +// My "needle search" method when pin=1 +bool Matcher::simd_advance_pattern_pin1_pmh_avx2(size_t loc) +{ + const Pattern::Pred *pmh = pat_->pmh_; + const char *chr = pat_->chr_; + size_t min = pat_->min_; + uint16_t lcp = pat_->lcp_; + uint16_t lcs = pat_->lcs_; + __m256i vlcp = _mm256_set1_epi8(chr[0]); + __m256i vlcs = _mm256_set1_epi8(chr[1]); + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - min + 1; + while (s <= e - 32) + { + __m256i vstrlcp = _mm256_loadu_si256(reinterpret_cast(s)); + __m256i vstrlcs = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); + __m256i veqlcp = _mm256_cmpeq_epi8(vlcp, vstrlcp); + __m256i veqlcs = _mm256_cmpeq_epi8(vlcs, vstrlcs); + uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(veqlcp, veqlcs)); + while (mask != 0) + { + uint32_t offset = ctz(mask); + loc = s - lcp + offset - buf_; + set_current(loc); + if (Pattern::predict_match(pmh, &buf_[loc], min)) + return true; + mask &= mask - 1; + } + s += 32; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + min > end_) + return false; + if (loc + min + 31 > end_) + break; + } + return advance_pattern_pin1_pmh(loc); +} + +// My "needle search" methods +#define ADV_PAT_PIN_ONE(N, INIT, COMP) \ +bool Matcher::simd_advance_pattern_pin##N##_one_avx2(size_t loc) \ +{ \ + const Pattern::Pred *pma = pat_->pma_; \ + const char *chr = pat_->chr_; \ + INIT \ + while (true) \ + { \ + const char *s = buf_ + loc; \ + const char *e = buf_ + end_; \ + while (s <= e - 32) \ + { \ + __m256i vstr = _mm256_loadu_si256(reinterpret_cast(s)); \ + __m256i veq = _mm256_cmpeq_epi8(v0, vstr); \ + COMP \ + uint32_t mask = _mm256_movemask_epi8(veq); \ + while (mask != 0) \ + { \ + uint32_t offset = ctz(mask); \ + loc = s + offset - buf_; \ + if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) \ + { \ + set_current(loc); \ + return true; \ + } \ + mask &= mask - 1; \ + } \ + s += 32; \ + } \ + loc = s - buf_; \ + set_current_and_peek_more(loc - 1); \ + loc = cur_ + 1; \ + if (loc + 1 > end_) \ + return false; \ + if (loc + 32 > end_) \ + break; \ + } \ + return advance_pattern(loc); \ +} + +ADV_PAT_PIN_ONE(2, \ + __m256i v0 = _mm256_set1_epi8(chr[0]); \ + __m256i v1 = _mm256_set1_epi8(chr[1]); \ + , \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v1, vstr)); \ + ) + +ADV_PAT_PIN_ONE(3, \ + __m256i v0 = _mm256_set1_epi8(chr[0]); \ + __m256i v1 = _mm256_set1_epi8(chr[1]); \ + __m256i v2 = _mm256_set1_epi8(chr[2]); \ + , \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v1, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v2, vstr)); \ + ) + +ADV_PAT_PIN_ONE(4, \ + __m256i v0 = _mm256_set1_epi8(chr[0]); \ + __m256i v1 = _mm256_set1_epi8(chr[1]); \ + __m256i v2 = _mm256_set1_epi8(chr[2]); \ + __m256i v3 = _mm256_set1_epi8(chr[3]); \ + , \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v1, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v2, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v3, vstr)); \ + ) + +ADV_PAT_PIN_ONE(5, \ + __m256i v0 = _mm256_set1_epi8(chr[0]); \ + __m256i v1 = _mm256_set1_epi8(chr[1]); \ + __m256i v2 = _mm256_set1_epi8(chr[2]); \ + __m256i v3 = _mm256_set1_epi8(chr[3]); \ + __m256i v4 = _mm256_set1_epi8(chr[4]); \ + , \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v1, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v2, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v3, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v4, vstr)); \ + ) + +ADV_PAT_PIN_ONE(6, \ + __m256i v0 = _mm256_set1_epi8(chr[0]); \ + __m256i v1 = _mm256_set1_epi8(chr[1]); \ + __m256i v2 = _mm256_set1_epi8(chr[2]); \ + __m256i v3 = _mm256_set1_epi8(chr[3]); \ + __m256i v4 = _mm256_set1_epi8(chr[4]); \ + __m256i v5 = _mm256_set1_epi8(chr[5]); \ + , \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v1, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v2, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v3, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v4, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v5, vstr)); \ + ) + +ADV_PAT_PIN_ONE(7, \ + __m256i v0 = _mm256_set1_epi8(chr[0]); \ + __m256i v1 = _mm256_set1_epi8(chr[1]); \ + __m256i v2 = _mm256_set1_epi8(chr[2]); \ + __m256i v3 = _mm256_set1_epi8(chr[3]); \ + __m256i v4 = _mm256_set1_epi8(chr[4]); \ + __m256i v5 = _mm256_set1_epi8(chr[5]); \ + __m256i v6 = _mm256_set1_epi8(chr[6]); \ + , \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v1, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v2, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v3, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v4, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v5, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v6, vstr)); \ + ) + +ADV_PAT_PIN_ONE(8, \ + __m256i v0 = _mm256_set1_epi8(chr[0]); \ + __m256i v1 = _mm256_set1_epi8(chr[1]); \ + __m256i v2 = _mm256_set1_epi8(chr[2]); \ + __m256i v3 = _mm256_set1_epi8(chr[3]); \ + __m256i v4 = _mm256_set1_epi8(chr[4]); \ + __m256i v5 = _mm256_set1_epi8(chr[5]); \ + __m256i v6 = _mm256_set1_epi8(chr[6]); \ + __m256i v7 = _mm256_set1_epi8(chr[7]); \ + , \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v1, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v2, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v3, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v4, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v5, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v6, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v7, vstr)); \ + ) + +ADV_PAT_PIN_ONE(16, \ + __m256i v0 = _mm256_set1_epi8(chr[0]); \ + __m256i v1 = _mm256_set1_epi8(chr[1]); \ + __m256i v2 = _mm256_set1_epi8(chr[2]); \ + __m256i v3 = _mm256_set1_epi8(chr[3]); \ + __m256i v4 = _mm256_set1_epi8(chr[4]); \ + __m256i v5 = _mm256_set1_epi8(chr[5]); \ + __m256i v6 = _mm256_set1_epi8(chr[6]); \ + __m256i v7 = _mm256_set1_epi8(chr[7]); \ + __m256i v8 = _mm256_set1_epi8(chr[8]); \ + __m256i v9 = _mm256_set1_epi8(chr[9]); \ + __m256i va = _mm256_set1_epi8(chr[10]); \ + __m256i vb = _mm256_set1_epi8(chr[11]); \ + __m256i vc = _mm256_set1_epi8(chr[12]); \ + __m256i vd = _mm256_set1_epi8(chr[13]); \ + __m256i ve = _mm256_set1_epi8(chr[14]); \ + __m256i vf = _mm256_set1_epi8(chr[15]); \ + , \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v1, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v2, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v3, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v4, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v5, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v6, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v7, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v8, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(v9, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(va, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(vb, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(vc, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(vd, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(ve, vstr)); \ + veq = _mm256_or_si256(veq, _mm256_cmpeq_epi8(vf, vstr)); \ + ) + +// My "needle search" methods +#define ADV_PAT_PIN(N, INIT, COMP) \ +bool Matcher::simd_advance_pattern_pin##N##_pma_avx2(size_t loc) \ +{ \ + const Pattern::Pred *pma = pat_->pma_; \ + const char *chr = pat_->chr_; \ + size_t min = pat_->min_; \ + uint16_t lcp = pat_->lcp_; \ + uint16_t lcs = pat_->lcs_; \ + INIT \ + while (true) \ + { \ + const char *s = buf_ + loc + lcp; \ + const char *e = buf_ + end_ + lcp - min + 1; \ + while (s <= e - 32) \ + { \ + __m256i vstrlcp = _mm256_loadu_si256(reinterpret_cast(s)); \ + __m256i vstrlcs = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); \ + __m256i veqlcp = _mm256_cmpeq_epi8(vlcp0, vstrlcp); \ + __m256i veqlcs = _mm256_cmpeq_epi8(vlcs0, vstrlcs); \ + COMP \ + uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(veqlcp, veqlcs)); \ + while (mask != 0) \ + { \ + uint32_t offset = ctz(mask); \ + loc = s - lcp + offset - buf_; \ + if (loc + 4 > end_ || Pattern::predict_match(pma, &buf_[loc]) == 0) \ + { \ + set_current(loc); \ + return true; \ + } \ + mask &= mask - 1; \ + } \ + s += 32; \ + } \ + s -= lcp; \ + loc = s - buf_; \ + set_current_and_peek_more(loc - 1); \ + loc = cur_ + 1; \ + if (loc + min > end_) \ + return false; \ + if (loc + min + 31 > end_) \ + break; \ + } \ + return advance_pattern(loc); \ +} \ +\ +bool Matcher::simd_advance_pattern_pin##N##_pmh_avx2(size_t loc) \ +{ \ + const Pattern::Pred *pmh = pat_->pmh_; \ + const char *chr = pat_->chr_; \ + size_t min = pat_->min_; \ + uint16_t lcp = pat_->lcp_; \ + uint16_t lcs = pat_->lcs_; \ + INIT \ + while (true) \ + { \ + const char *s = buf_ + loc + lcp; \ + const char *e = buf_ + end_ + lcp - min + 1; \ + while (s <= e - 32) \ + { \ + __m256i vstrlcp = _mm256_loadu_si256(reinterpret_cast(s)); \ + __m256i vstrlcs = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); \ + __m256i veqlcp = _mm256_cmpeq_epi8(vlcp0, vstrlcp); \ + __m256i veqlcs = _mm256_cmpeq_epi8(vlcs0, vstrlcs); \ + COMP \ + uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(veqlcp, veqlcs)); \ + while (mask != 0) \ + { \ + uint32_t offset = ctz(mask); \ + loc = s - lcp + offset - buf_; \ + if (Pattern::predict_match(pmh, &buf_[loc], min)) \ + { \ + set_current(loc); \ + return true; \ + } \ + mask &= mask - 1; \ + } \ + s += 32; \ + } \ + s -= lcp; \ + loc = s - buf_; \ + set_current_and_peek_more(loc - 1); \ + loc = cur_ + 1; \ + if (loc + min > end_) \ + return false; \ + if (loc + min + 31 > end_) \ + break; \ + } \ + return advance_pattern_min4(loc); \ +} + +ADV_PAT_PIN(2, \ + __m256i vlcp0 = _mm256_set1_epi8(chr[0]); \ + __m256i vlcp1 = _mm256_set1_epi8(chr[1]); \ + __m256i vlcs0 = _mm256_set1_epi8(chr[2]); \ + __m256i vlcs1 = _mm256_set1_epi8(chr[3]); \ + , \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp1, vstrlcp)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs1, vstrlcs)); \ + ) + +ADV_PAT_PIN(3, \ + __m256i vlcp0 = _mm256_set1_epi8(chr[0]); \ + __m256i vlcp1 = _mm256_set1_epi8(chr[1]); \ + __m256i vlcp2 = _mm256_set1_epi8(chr[2]); \ + __m256i vlcs0 = _mm256_set1_epi8(chr[3]); \ + __m256i vlcs1 = _mm256_set1_epi8(chr[4]); \ + __m256i vlcs2 = _mm256_set1_epi8(chr[5]); \ + , \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp1, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp2, vstrlcp)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs1, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs2, vstrlcs)); \ + ) + +ADV_PAT_PIN(4, \ + __m256i vlcp0 = _mm256_set1_epi8(chr[0]); \ + __m256i vlcp1 = _mm256_set1_epi8(chr[1]); \ + __m256i vlcp2 = _mm256_set1_epi8(chr[2]); \ + __m256i vlcp3 = _mm256_set1_epi8(chr[3]); \ + __m256i vlcs0 = _mm256_set1_epi8(chr[4]); \ + __m256i vlcs1 = _mm256_set1_epi8(chr[5]); \ + __m256i vlcs2 = _mm256_set1_epi8(chr[6]); \ + __m256i vlcs3 = _mm256_set1_epi8(chr[7]); \ + , \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp1, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp2, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp3, vstrlcp)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs1, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs2, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs3, vstrlcs)); \ + ) + +ADV_PAT_PIN(5, \ + __m256i vlcp0 = _mm256_set1_epi8(chr[0]); \ + __m256i vlcp1 = _mm256_set1_epi8(chr[1]); \ + __m256i vlcp2 = _mm256_set1_epi8(chr[2]); \ + __m256i vlcp3 = _mm256_set1_epi8(chr[3]); \ + __m256i vlcp4 = _mm256_set1_epi8(chr[4]); \ + __m256i vlcs0 = _mm256_set1_epi8(chr[5]); \ + __m256i vlcs1 = _mm256_set1_epi8(chr[6]); \ + __m256i vlcs2 = _mm256_set1_epi8(chr[7]); \ + __m256i vlcs3 = _mm256_set1_epi8(chr[8]); \ + __m256i vlcs4 = _mm256_set1_epi8(chr[9]); \ + , \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp1, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp2, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp3, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp4, vstrlcp)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs1, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs2, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs3, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs4, vstrlcs)); \ + ) + +ADV_PAT_PIN(6, \ + __m256i vlcp0 = _mm256_set1_epi8(chr[0]); \ + __m256i vlcp1 = _mm256_set1_epi8(chr[1]); \ + __m256i vlcp2 = _mm256_set1_epi8(chr[2]); \ + __m256i vlcp3 = _mm256_set1_epi8(chr[3]); \ + __m256i vlcp4 = _mm256_set1_epi8(chr[4]); \ + __m256i vlcp5 = _mm256_set1_epi8(chr[5]); \ + __m256i vlcs0 = _mm256_set1_epi8(chr[6]); \ + __m256i vlcs1 = _mm256_set1_epi8(chr[7]); \ + __m256i vlcs2 = _mm256_set1_epi8(chr[8]); \ + __m256i vlcs3 = _mm256_set1_epi8(chr[9]); \ + __m256i vlcs4 = _mm256_set1_epi8(chr[10]); \ + __m256i vlcs5 = _mm256_set1_epi8(chr[11]); \ + , \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp1, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp2, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp3, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp4, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp5, vstrlcp)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs1, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs2, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs3, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs4, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs5, vstrlcs)); \ + ) + +ADV_PAT_PIN(7, \ + __m256i vlcp0 = _mm256_set1_epi8(chr[0]); \ + __m256i vlcp1 = _mm256_set1_epi8(chr[1]); \ + __m256i vlcp2 = _mm256_set1_epi8(chr[2]); \ + __m256i vlcp3 = _mm256_set1_epi8(chr[3]); \ + __m256i vlcp4 = _mm256_set1_epi8(chr[4]); \ + __m256i vlcp5 = _mm256_set1_epi8(chr[5]); \ + __m256i vlcp6 = _mm256_set1_epi8(chr[6]); \ + __m256i vlcs0 = _mm256_set1_epi8(chr[7]); \ + __m256i vlcs1 = _mm256_set1_epi8(chr[8]); \ + __m256i vlcs2 = _mm256_set1_epi8(chr[9]); \ + __m256i vlcs3 = _mm256_set1_epi8(chr[10]); \ + __m256i vlcs4 = _mm256_set1_epi8(chr[11]); \ + __m256i vlcs5 = _mm256_set1_epi8(chr[12]); \ + __m256i vlcs6 = _mm256_set1_epi8(chr[13]); \ + , \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp1, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp2, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp3, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp4, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp5, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp6, vstrlcp)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs1, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs2, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs3, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs4, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs5, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs6, vstrlcs)); \ + ) + +ADV_PAT_PIN(8, \ + __m256i vlcp0 = _mm256_set1_epi8(chr[0]); \ + __m256i vlcp1 = _mm256_set1_epi8(chr[1]); \ + __m256i vlcp2 = _mm256_set1_epi8(chr[2]); \ + __m256i vlcp3 = _mm256_set1_epi8(chr[3]); \ + __m256i vlcp4 = _mm256_set1_epi8(chr[4]); \ + __m256i vlcp5 = _mm256_set1_epi8(chr[5]); \ + __m256i vlcp6 = _mm256_set1_epi8(chr[6]); \ + __m256i vlcp7 = _mm256_set1_epi8(chr[7]); \ + __m256i vlcs0 = _mm256_set1_epi8(chr[8]); \ + __m256i vlcs1 = _mm256_set1_epi8(chr[9]); \ + __m256i vlcs2 = _mm256_set1_epi8(chr[10]); \ + __m256i vlcs3 = _mm256_set1_epi8(chr[11]); \ + __m256i vlcs4 = _mm256_set1_epi8(chr[12]); \ + __m256i vlcs5 = _mm256_set1_epi8(chr[13]); \ + __m256i vlcs6 = _mm256_set1_epi8(chr[14]); \ + __m256i vlcs7 = _mm256_set1_epi8(chr[15]); \ + , \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp1, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp2, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp3, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp4, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp5, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp6, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp7, vstrlcp)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs1, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs2, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs3, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs4, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs5, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs6, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs7, vstrlcs)); \ + ) + +ADV_PAT_PIN(16, \ + __m256i vlcp0 = _mm256_set1_epi8(chr[0]); \ + __m256i vlcp1 = _mm256_set1_epi8(chr[1]); \ + __m256i vlcp2 = _mm256_set1_epi8(chr[2]); \ + __m256i vlcp3 = _mm256_set1_epi8(chr[3]); \ + __m256i vlcp4 = _mm256_set1_epi8(chr[4]); \ + __m256i vlcp5 = _mm256_set1_epi8(chr[5]); \ + __m256i vlcp6 = _mm256_set1_epi8(chr[6]); \ + __m256i vlcp7 = _mm256_set1_epi8(chr[7]); \ + __m256i vlcp8 = _mm256_set1_epi8(chr[8]); \ + __m256i vlcp9 = _mm256_set1_epi8(chr[9]); \ + __m256i vlcpa = _mm256_set1_epi8(chr[10]); \ + __m256i vlcpb = _mm256_set1_epi8(chr[11]); \ + __m256i vlcpc = _mm256_set1_epi8(chr[12]); \ + __m256i vlcpd = _mm256_set1_epi8(chr[13]); \ + __m256i vlcpe = _mm256_set1_epi8(chr[14]); \ + __m256i vlcpf = _mm256_set1_epi8(chr[15]); \ + __m256i vlcs0 = _mm256_set1_epi8(chr[16]); \ + __m256i vlcs1 = _mm256_set1_epi8(chr[17]); \ + __m256i vlcs2 = _mm256_set1_epi8(chr[18]); \ + __m256i vlcs3 = _mm256_set1_epi8(chr[19]); \ + __m256i vlcs4 = _mm256_set1_epi8(chr[20]); \ + __m256i vlcs5 = _mm256_set1_epi8(chr[21]); \ + __m256i vlcs6 = _mm256_set1_epi8(chr[22]); \ + __m256i vlcs7 = _mm256_set1_epi8(chr[23]); \ + __m256i vlcs8 = _mm256_set1_epi8(chr[24]); \ + __m256i vlcs9 = _mm256_set1_epi8(chr[25]); \ + __m256i vlcsa = _mm256_set1_epi8(chr[26]); \ + __m256i vlcsb = _mm256_set1_epi8(chr[27]); \ + __m256i vlcsc = _mm256_set1_epi8(chr[28]); \ + __m256i vlcsd = _mm256_set1_epi8(chr[29]); \ + __m256i vlcse = _mm256_set1_epi8(chr[30]); \ + __m256i vlcsf = _mm256_set1_epi8(chr[31]); \ + , \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp1, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp2, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp3, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp4, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp5, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp6, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp7, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp8, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcp9, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcpa, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcpb, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcpc, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcpd, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcpe, vstrlcp)); \ + veqlcp = _mm256_or_si256(veqlcp, _mm256_cmpeq_epi8(vlcpf, vstrlcp)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs1, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs2, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs3, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs4, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs5, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs6, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs7, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs8, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcs9, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcsa, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcsb, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcsc, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcsd, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcse, vstrlcs)); \ + veqlcs = _mm256_or_si256(veqlcs, _mm256_cmpeq_epi8(vlcsf, vstrlcs)); \ + ) + +/// Few chars +template +bool Matcher::simd_advance_chars_avx2(size_t loc) +{ + static const uint16_t lcp = 0; + static const uint16_t lcs = LEN - 1; + const char *chr = pat_->chr_; + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - LEN + 1; + __m256i vlcp = _mm256_set1_epi8(chr[lcp]); + __m256i vlcs = _mm256_set1_epi8(chr[lcs]); + while (s <= e - 32) + { + __m256i vlcpm = _mm256_loadu_si256(reinterpret_cast(s)); + __m256i vlcsm = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); + __m256i vlcpeq = _mm256_cmpeq_epi8(vlcp, vlcpm); + __m256i vlcseq = _mm256_cmpeq_epi8(vlcs, vlcsm); + uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(vlcpeq, vlcseq)); + while (mask != 0) + { + uint32_t offset = ctz(mask); + if (LEN == 2 || + (LEN == 3 ? s[offset - lcp + 1] == chr[1] : std::memcmp(s - lcp + offset, chr, LEN) == 0)) + { + loc = s - lcp + offset - buf_; + set_current(loc); + return true; + } + mask &= mask - 1; + } + s += 32; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + LEN > end_) + return false; + if (loc + LEN + 31 > end_) + break; + } + return advance_chars(loc); +} + +/// Few chars followed by 2 to 3 minimal char pattern +template +bool Matcher::simd_advance_chars_pma_avx2(size_t loc) +{ + static const uint16_t lcp = 0; + static const uint16_t lcs = LEN - 1; + const Pattern::Pred *pma = pat_->pma_; + const char *chr = pat_->chr_; + size_t min = pat_->min_; + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - LEN + 1; + __m256i vlcp = _mm256_set1_epi8(chr[lcp]); + __m256i vlcs = _mm256_set1_epi8(chr[lcs]); + while (s <= e - 32) + { + __m256i vlcpm = _mm256_loadu_si256(reinterpret_cast(s)); + __m256i vlcsm = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); + __m256i vlcpeq = _mm256_cmpeq_epi8(vlcp, vlcpm); + __m256i vlcseq = _mm256_cmpeq_epi8(vlcs, vlcsm); + uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(vlcpeq, vlcseq)); + while (mask != 0) + { + uint32_t offset = ctz(mask); + if (LEN == 2 || + (LEN == 3 ? s[offset - lcp + 1] : std::memcmp(s - lcp + offset, chr, LEN) == 0)) + { + loc = s - lcp + offset - buf_; + if (loc + LEN + 4 > end_ || Pattern::predict_match(pma, &buf_[loc + LEN]) == 0) + { + set_current(loc); + return true; + } + } + mask &= mask - 1; + } + s += 32; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + LEN + min > end_) + return false; + if (loc + LEN + min + 31 > end_) + break; + } + return advance_chars_pma(loc); +} + +/// Few chars followed by 4 minimal char pattern +template +bool Matcher::simd_advance_chars_pmh_avx2(size_t loc) +{ + static const uint16_t lcp = 0; + static const uint16_t lcs = LEN - 1; + const Pattern::Pred *pmh = pat_->pmh_; + const char *chr = pat_->chr_; + size_t min = pat_->min_; + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - LEN + 1; + __m256i vlcp = _mm256_set1_epi8(chr[lcp]); + __m256i vlcs = _mm256_set1_epi8(chr[lcs]); + while (s <= e - 32) + { + __m256i vlcpm = _mm256_loadu_si256(reinterpret_cast(s)); + __m256i vlcsm = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); + __m256i vlcpeq = _mm256_cmpeq_epi8(vlcp, vlcpm); + __m256i vlcseq = _mm256_cmpeq_epi8(vlcs, vlcsm); + uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(vlcpeq, vlcseq)); + while (mask != 0) + { + uint32_t offset = ctz(mask); + if (LEN == 2 || + (LEN == 3 ? s[offset - lcp + 1] == chr[1] : std::memcmp(s - lcp + offset, chr, LEN) == 0)) + { + loc = s - lcp + offset - buf_; + set_current(loc); + if (loc + LEN + min > end_ || Pattern::predict_match(pmh, &buf_[loc + LEN], min)) + return true; + } + mask &= mask - 1; + } + s += 32; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + LEN + min > end_) + return false; + if (loc + LEN + min + 31 > end_) + break; + } + return advance_chars_pmh(loc); +} + +/// Implements AVX2 string search scheme based on http://0x80.pl/articles/simd-friendly-karp-rabin.html +bool Matcher::simd_advance_string_avx2(size_t loc) +{ + const char *chr = pat_->chr_; + size_t len = pat_->len_; + uint16_t lcp = pat_->lcp_; + uint16_t lcs = pat_->lcs_; + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - len + 1; + __m256i vlcp = _mm256_set1_epi8(chr[lcp]); + __m256i vlcs = _mm256_set1_epi8(chr[lcs]); + while (s <= e - 32) + { + __m256i vlcpm = _mm256_loadu_si256(reinterpret_cast(s)); + __m256i vlcsm = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); + __m256i vlcpeq = _mm256_cmpeq_epi8(vlcp, vlcpm); + __m256i vlcseq = _mm256_cmpeq_epi8(vlcs, vlcsm); + uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(vlcpeq, vlcseq)); + while (mask != 0) + { + uint32_t offset = ctz(mask); + if (std::memcmp(s - lcp + offset, chr, len) == 0) + { + loc = s - lcp + offset - buf_; + set_current(loc); + return true; + } + mask &= mask - 1; + } + s += 32; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len > end_) + return false; + if (loc + len + 31 > end_) + break; + } + return advance_string(loc); +} + +#if defined(WITH_STRING_PM) + +/// Implements AVX2 string search scheme based on http://0x80.pl/articles/simd-friendly-karp-rabin.html +bool Matcher::simd_advance_string_pma_avx2(size_t loc) +{ + const Pattern::Pred *pma = pat_->pma_; + const char *chr = pat_->chr_; + size_t len = pat_->len_; + size_t min = pat_->min_; + uint16_t lcp = pat_->lcp_; + uint16_t lcs = pat_->lcs_; + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - len + 1; + __m256i vlcp = _mm256_set1_epi8(chr[lcp]); + __m256i vlcs = _mm256_set1_epi8(chr[lcs]); + while (s <= e - 32) + { + __m256i vlcpm = _mm256_loadu_si256(reinterpret_cast(s)); + __m256i vlcsm = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); + __m256i vlcpeq = _mm256_cmpeq_epi8(vlcp, vlcpm); + __m256i vlcseq = _mm256_cmpeq_epi8(vlcs, vlcsm); + uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(vlcpeq, vlcseq)); + while (mask != 0) + { + uint32_t offset = ctz(mask); + if (std::memcmp(s - lcp + offset, chr, len) == 0) + { + loc = s - lcp + offset - buf_; + if (loc + len + 4 > end_ || Pattern::predict_match(pma, &buf_[loc + len]) == 0) + { + set_current(loc); + return true; + } + } + mask &= mask - 1; + } + s += 32; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len + min > end_) + return false; + if (loc + len + min + 31 > end_) + break; + } + return advance_string_pma(loc); +} + +/// Implements AVX2 string search scheme based on http://0x80.pl/articles/simd-friendly-karp-rabin.html +bool Matcher::simd_advance_string_pmh_avx2(size_t loc) +{ + const Pattern::Pred *pmh = pat_->pmh_; + const char *chr = pat_->chr_; + size_t len = pat_->len_; + size_t min = pat_->min_; + uint16_t lcp = pat_->lcp_; + uint16_t lcs = pat_->lcs_; + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - len + 1; + __m256i vlcp = _mm256_set1_epi8(chr[lcp]); + __m256i vlcs = _mm256_set1_epi8(chr[lcs]); + while (s <= e - 32) + { + __m256i vlcpm = _mm256_loadu_si256(reinterpret_cast(s)); + __m256i vlcsm = _mm256_loadu_si256(reinterpret_cast(s + lcs - lcp)); + __m256i vlcpeq = _mm256_cmpeq_epi8(vlcp, vlcpm); + __m256i vlcseq = _mm256_cmpeq_epi8(vlcs, vlcsm); + uint32_t mask = _mm256_movemask_epi8(_mm256_and_si256(vlcpeq, vlcseq)); + while (mask != 0) + { + uint32_t offset = ctz(mask); + if (std::memcmp(s - lcp + offset, chr, len) == 0) + { + loc = s - lcp + offset - buf_; + set_current(loc); + if (loc + len + min > end_ || Pattern::predict_match(pmh, &buf_[loc + len], min)) + return true; + } + mask &= mask - 1; + } + s += 32; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len + min > end_) + return false; + if (loc + len + min + 31 > end_) + break; + } + return advance_string_pmh(loc); +} + +#endif // WITH_STRING_PM + +#else + +// appease ranlib "has no symbols" +void matcher_not_compiled_with_avx2() { } + +#endif + +} // namespace reflex diff --git a/lib/matcher_avx512bw.cpp b/lib/matcher_avx512bw.cpp index 35e46a70b..aa24f982e 100644 --- a/lib/matcher_avx512bw.cpp +++ b/lib/matcher_avx512bw.cpp @@ -27,10 +27,10 @@ \******************************************************************************/ /** -@file matcher.cpp, matcher_avx2.cpp, matcher_avx512bw.cpp +@file matcher_avx512bw.cpp @brief RE/flex matcher engine @author Robert van Engelen - engelen@genivia.com -@copyright (c) 2016-2022, Robert van Engelen, Genivia Inc. All rights reserved. +@copyright (c) 2016-2024, Robert van Engelen, Genivia Inc. All rights reserved. @copyright (c) BSD-3 License - see LICENSE.txt */ @@ -40,5 +40,344 @@ # endif #endif -#define COMPILE_AVX512BW -#include "matcher.cpp" +#include + +namespace reflex { + +#if defined(HAVE_AVX512BW) && (!defined(_MSC_VER) || defined(_WIN64)) + +// AVX512BW runtime optimized function callback overrides +void Matcher::simd_init_advance_avx512bw() +{ + if (pat_->len_ == 0) + { + // no specialization + } + else if (pat_->len_ == 1) + { + // no specialization + } + else if (pat_->len_ == 2) + { + if (pat_->min_ == 0) + adv_ = &Matcher::simd_advance_chars_avx512bw<2>; + else if (pat_->min_ < 4) + adv_ = &Matcher::simd_advance_chars_pma_avx512bw<2>; + else + adv_ = &Matcher::simd_advance_chars_pmh_avx512bw<2>; + } + else if (pat_->len_ == 3) + { + if (pat_->min_ == 0) + adv_ = &Matcher::simd_advance_chars_avx512bw<3>; + else if (pat_->min_ < 4) + adv_ = &Matcher::simd_advance_chars_pma_avx512bw<3>; + else + adv_ = &Matcher::simd_advance_chars_pmh_avx512bw<3>; + } + else if (pat_->bmd_ == 0) + { +#if defined(WITH_STRING_PM) + if (pat_->min_ >= 4) + adv_ = &Matcher::simd_advance_string_pmh_avx512bw; + else if (pat_->min_ > 0) + adv_ = &Matcher::simd_advance_string_pma_avx512bw; + else +#endif + adv_ = &Matcher::simd_advance_string_avx512bw; + } +} + +/// Few chars +template +bool Matcher::simd_advance_chars_avx512bw(size_t loc) +{ + static const uint16_t lcp = 0; + static const uint16_t lcs = LEN - 1; + const char *chr = pat_->chr_; + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - LEN + 1; + __m512i vlcp = _mm512_set1_epi8(chr[lcp]); + __m512i vlcs = _mm512_set1_epi8(chr[lcs]); + while (s <= e - 64) + { + __m512i vlcpm = _mm512_loadu_si512(reinterpret_cast(s)); + __m512i vlcsm = _mm512_loadu_si512(reinterpret_cast(s + lcs - lcp)); + uint64_t mask = _mm512_cmpeq_epi8_mask(vlcp, vlcpm) & _mm512_cmpeq_epi8_mask(vlcs, vlcsm); + while (mask != 0) + { + uint32_t offset = ctzl(mask); + if (LEN == 2 || + (LEN == 3 ? s[offset - lcp + 1] == chr[1] : std::memcmp(s - lcp + offset, chr, LEN) == 0)) + { + loc = s - lcp + offset - buf_; + set_current(loc); + return true; + } + mask &= mask - 1; + } + s += 64; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + LEN > end_) + return false; + if (loc + LEN + 63 > end_) + break; + } + return advance_chars(loc); +} + +/// Few chars followed by 2 to 3 minimal char pattern +template +bool Matcher::simd_advance_chars_pma_avx512bw(size_t loc) +{ + static const uint16_t lcp = 0; + static const uint16_t lcs = LEN - 1; + const Pattern::Pred *pma = pat_->pma_; + const char *chr = pat_->chr_; + size_t min = pat_->min_; + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - LEN + 1; + __m512i vlcp = _mm512_set1_epi8(chr[lcp]); + __m512i vlcs = _mm512_set1_epi8(chr[lcs]); + while (s <= e - 64) + { + __m512i vlcpm = _mm512_loadu_si512(reinterpret_cast(s)); + __m512i vlcsm = _mm512_loadu_si512(reinterpret_cast(s + lcs - lcp)); + uint64_t mask = _mm512_cmpeq_epi8_mask(vlcp, vlcpm) & _mm512_cmpeq_epi8_mask(vlcs, vlcsm); + while (mask != 0) + { + uint32_t offset = ctzl(mask); + if (LEN == 2 || + (LEN == 3 ? s[offset - lcp + 1] == chr[1] : std::memcmp(s - lcp + offset, chr, LEN) == 0)) + { + loc = s - lcp + offset - buf_; + if (loc + LEN + 4 > end_ || Pattern::predict_match(pma, &buf_[loc + LEN]) == 0) + { + set_current(loc); + return true; + } + } + mask &= mask - 1; + } + s += 64; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + LEN + min > end_) + return false; + if (loc + LEN + min + 63 > end_) + break; + } + return advance_chars_pma(loc); +} + +/// Few chars followed by 4 minimal char pattern +template +bool Matcher::simd_advance_chars_pmh_avx512bw(size_t loc) +{ + static const uint16_t lcp = 0; + static const uint16_t lcs = LEN - 1; + const Pattern::Pred *pmh = pat_->pmh_; + const char *chr = pat_->chr_; + size_t min = pat_->min_; + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - LEN + 1; + __m512i vlcp = _mm512_set1_epi8(chr[lcp]); + __m512i vlcs = _mm512_set1_epi8(chr[lcs]); + while (s <= e - 64) + { + __m512i vlcpm = _mm512_loadu_si512(reinterpret_cast(s)); + __m512i vlcsm = _mm512_loadu_si512(reinterpret_cast(s + lcs - lcp)); + uint64_t mask = _mm512_cmpeq_epi8_mask(vlcp, vlcpm) & _mm512_cmpeq_epi8_mask(vlcs, vlcsm); + while (mask != 0) + { + uint32_t offset = ctzl(mask); + if (LEN == 2 || + (LEN == 3 ? s[offset - lcp + 1] == chr[1] : std::memcmp(s - lcp + offset, chr, LEN) == 0)) + { + loc = s - lcp + offset - buf_; + if (loc + LEN + min > end_ || Pattern::predict_match(pmh, &buf_[loc + LEN], min)) + { + set_current(loc); + return true; + } + } + mask &= mask - 1; + } + s += 64; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + LEN + min > end_) + return false; + if (loc + LEN + min + 63 > end_) + break; + } + return advance_chars_pmh(loc); +} + +/// Implements AVX512BW string search scheme based on http://0x80.pl/articles/simd-friendly-karp-rabin.html +bool Matcher::simd_advance_string_avx512bw(size_t loc) +{ + const char *chr = pat_->chr_; + size_t len = pat_->len_; + uint16_t lcp = pat_->lcp_; + uint16_t lcs = pat_->lcs_; + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - len + 1; + __m512i vlcp = _mm512_set1_epi8(chr[lcp]); + __m512i vlcs = _mm512_set1_epi8(chr[lcs]); + while (s <= e - 64) + { + __m512i vlcpm = _mm512_loadu_si512(reinterpret_cast(s)); + __m512i vlcsm = _mm512_loadu_si512(reinterpret_cast(s + lcs - lcp)); + uint64_t mask = _mm512_cmpeq_epi8_mask(vlcp, vlcpm) & _mm512_cmpeq_epi8_mask(vlcs, vlcsm); + while (mask != 0) + { + uint32_t offset = ctzl(mask); + if (std::memcmp(s - lcp + offset, chr, len) == 0) + { + loc = s - lcp + offset - buf_; + set_current(loc); + return true; + } + mask &= mask - 1; + } + s += 64; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len > end_) + return false; + if (loc + len + 63 > end_) + break; + } + return advance_string(loc); +} + +#if defined(WITH_STRING_PM) + +/// Implements AVX512BW string search scheme based on http://0x80.pl/articles/simd-friendly-karp-rabin.html +bool Matcher::simd_advance_string_pma_avx512bw(size_t loc) +{ + const Pattern::Pred *pma = pat_->pma_; + const char *chr = pat_->chr_; + size_t len = pat_->len_; + size_t min = pat_->min_; + uint16_t lcp = pat_->lcp_; + uint16_t lcs = pat_->lcs_; + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - len + 1; + __m512i vlcp = _mm512_set1_epi8(chr[lcp]); + __m512i vlcs = _mm512_set1_epi8(chr[lcs]); + while (s <= e - 64) + { + __m512i vlcpm = _mm512_loadu_si512(reinterpret_cast(s)); + __m512i vlcsm = _mm512_loadu_si512(reinterpret_cast(s + lcs - lcp)); + uint64_t mask = _mm512_cmpeq_epi8_mask(vlcp, vlcpm) & _mm512_cmpeq_epi8_mask(vlcs, vlcsm); + while (mask != 0) + { + uint32_t offset = ctzl(mask); + if (std::memcmp(s - lcp + offset, chr, len) == 0) + { + loc = s - lcp + offset - buf_; + if (loc + len + 4 > end_ || Pattern::predict_match(pma, &buf_[loc + len]) == 0) + { + set_current(loc); + return true; + } + } + mask &= mask - 1; + } + s += 64; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len + min > end_) + return false; + if (loc + len + min + 63 > end_) + break; + } + return advance_string_pma(loc); +} + +/// Implements AVX512BW string search scheme based on http://0x80.pl/articles/simd-friendly-karp-rabin.html +bool Matcher::simd_advance_string_pmh_avx512bw(size_t loc) +{ + const Pattern::Pred *pmh = pat_->pmh_; + const char *chr = pat_->chr_; + size_t len = pat_->len_; + size_t min = pat_->min_; + uint16_t lcp = pat_->lcp_; + uint16_t lcs = pat_->lcs_; + while (true) + { + const char *s = buf_ + loc + lcp; + const char *e = buf_ + end_ + lcp - len + 1; + __m512i vlcp = _mm512_set1_epi8(chr[lcp]); + __m512i vlcs = _mm512_set1_epi8(chr[lcs]); + while (s <= e - 64) + { + __m512i vlcpm = _mm512_loadu_si512(reinterpret_cast(s)); + __m512i vlcsm = _mm512_loadu_si512(reinterpret_cast(s + lcs - lcp)); + uint64_t mask = _mm512_cmpeq_epi8_mask(vlcp, vlcpm) & _mm512_cmpeq_epi8_mask(vlcs, vlcsm); + while (mask != 0) + { + uint32_t offset = ctzl(mask); + if (std::memcmp(s - lcp + offset, chr, len) == 0) + { + loc = s - lcp + offset - buf_; + if (loc + len + min > end_ || Pattern::predict_match(pmh, &buf_[loc + len], min)) + { + set_current(loc); + return true; + } + } + mask &= mask - 1; + } + s += 64; + } + s -= lcp; + loc = s - buf_; + set_current_and_peek_more(loc - 1); + loc = cur_ + 1; + if (loc + len + min > end_) + return false; + if (loc + len + min + 63 > end_) + break; + } + return advance_string_pmh(loc); +} + +#endif // WITH_STRING_PM + +#else + +// appease ranlib "has no symbols" +void matcher_not_compiled_with_avx512bw() { } + +#endif + +} // namespace reflex diff --git a/lib/pattern.cpp b/lib/pattern.cpp index c2f7fc69e..9be218724 100644 --- a/lib/pattern.cpp +++ b/lib/pattern.cpp @@ -198,35 +198,41 @@ void Pattern::init(const char *options, const uint8_t *pred) min_ = pred[1] & 0x0f; one_ = pred[1] & 0x10; memcpy(chr_, pred + 2, len_); - size_t n = len_ + 2; + size_t n = 2 + len_; if (len_ == 0) { + // get bitap bit_[] parameters for (size_t i = 0; i < 256; ++i) bit_[i] = ~pred[i + n]; n += 256; } - if (min_ >= 4) + if (min_ < 4) { + // get predict match PM4 pma_[] parameters for (size_t i = 0; i < Const::HASH; ++i) - pmh_[i] = ~pred[i + n]; + pma_[i] = ~pred[i + n]; } else { + // get predict match hash pmh_[] parameters for (size_t i = 0; i < Const::HASH; ++i) - pma_[i] = ~pred[i + n]; + pmh_[i] = ~pred[i + n]; } + n += Const::HASH; if ((pred[1] & 0x20) != 0) { - n += Const::HASH; + // get lookback parameters lbk_ lbm_ and cbk_[] after s-t cut and first s-t cut pattern characters fst_[] lbk_ = pred[n + 0] | (pred[n + 1] << 8); lbm_ = pred[n + 2] | (pred[n + 3] << 8); for (size_t i = 0; i < 256; ++i) cbk_.set(i, pred[n + 4 + (i >> 3)] & (1 << (i & 7))); for (size_t i = 0; i < 256; ++i) - fst_.set(i, pred[n + 32 + 4 + (i >> 3)] & (1 << (i & 7))); + fst_.set(i, pred[n + 4 + 32 + (i >> 3)] & (1 << (i & 7))); + n += 4 + 32 + 32; } else { + // get first pattern characters fst_[] from bitap for (size_t i = 0; i < 256; ++i) fst_.set(i, (bit_[i] & 1) == 0); } @@ -311,8 +317,7 @@ void Pattern::init(const char *options, const uint8_t *pred) } // needle count and frequency thresholds to enable needle-based search uint16_t pinmax = 8; - uint8_t freqmax1 = 91; // one position - uint8_t freqmax2 = 251; // two positions + uint8_t freqmax = 251; #if defined(HAVE_AVX512BW) || defined(HAVE_AVX2) || defined(HAVE_SSE2) if (have_HW_AVX512BW() || have_HW_AVX2()) pinmax = 16; @@ -331,7 +336,6 @@ void Pattern::init(const char *options, const uint8_t *pred) lcs_ = 0; uint16_t nlcp = 65535; // max and undefined uint16_t nlcs = 65535; // max and undefined - uint16_t freqsum = 0; uint8_t freqlcp = 255; // max uint8_t freqlcs = 255; // max size_t min = (min_ == 0 ? 1 : min_); @@ -339,7 +343,6 @@ void Pattern::init(const char *options, const uint8_t *pred) { Pred mask = 1 << k; uint16_t n = 0; - uint16_t sum = 0; uint8_t max = 0; // at position k count the matching characters and find the max character frequency for (uint16_t i = 0; i < 256; ++i) @@ -348,14 +351,13 @@ void Pattern::init(const char *options, const uint8_t *pred) { ++n; uint8_t freq = frequency(static_cast(i)); - sum += freq; if (freq > max) max = freq; } } if (n <= pinmax) { - // pick the fewest and rarest (least frequently occurring) needles to search + // pick the fewest and rarest (less frequently occurring) needles to search if (max < freqlcp || (n < nlcp && max == freqlcp)) { lcs_ = lcp_; @@ -363,7 +365,6 @@ void Pattern::init(const char *options, const uint8_t *pred) freqlcs = freqlcp; lcp_ = static_cast(k); nlcp = n; - freqsum = sum; freqlcp = max; } else if (n < nlcs || @@ -377,8 +378,8 @@ void Pattern::init(const char *options, const uint8_t *pred) } } } - // one position to pin: make lcp and lcs equal (compared and optimized later) - if (min == 1 || ((freqsum <= freqlcp || nlcs == 65535) && freqsum <= freqmax1)) + // one position to pin: make lcp and lcs equal to 0 (only one position at 0) + if (min == 1 || nlcs == 65535) { nlcs = nlcp; lcs_ = lcp_; @@ -387,7 +388,7 @@ void Pattern::init(const char *options, const uint8_t *pred) uint16_t n = nlcp > nlcs ? nlcp : nlcs; DBGLOG("min=%zu lcp=%hu(%hu) pin=%hu nlcp=%hu(%hu) freq=%hu(%hu) freqsum=%hu npy=%zu", min, lcp_, lcs_, n, nlcp, nlcs, freqlcp, freqlcs, freqsum, npy_); // determine if a needle-based search is worthwhile, below or meeting the thresholds - if (n <= pinmax && freqlcp <= freqmax2) + if (n <= pinmax && freqlcp <= freqmax) { // bridge the gap from 9 to 16 to handle 9 to 16 combined if (n > 8) @@ -412,7 +413,7 @@ void Pattern::init(const char *options, const uint8_t *pred) } else if (len_ > 1) { - // Boyer-Moore preprocessing of the given string pattern pat of length len, generates bmd_ > 0 and bms_[] shifts + // produce lcp and lcs positions and Boyer-Moore bms_[] shifts when bmd_ > 0 uint8_t n = static_cast(len_); // okay to cast: actually never more than 255 uint16_t i; for (i = 0; i < 256; ++i) @@ -433,7 +434,9 @@ void Pattern::init(const char *options, const uint8_t *pred) lcs_ = lcp_; lcp_ = i; } - else if (lcpch != pch && frequency(lcsch) > freqpch) + else if (frequency(lcsch) > freqpch || + (frequency(lcsch) == freqpch && + abs(static_cast(lcp_) - static_cast(lcs_)) < abs(static_cast(lcp_) - static_cast(i)))) { lcs_ = i; } @@ -469,7 +472,33 @@ void Pattern::init(const char *options, const uint8_t *pred) #endif #endif if (lcs_ < 0xffff) - bmd_ = 0; // do not use B-M + { + // do not use B-M + bmd_ = 0; + // spread lcp and lcs apart if lcp and lcs are adjacent (chars are possibly correlated) + if (len_ == 3 && (lcp_ == 1 || lcs_ == 1)) + { + lcp_ = 0; + lcs_ = 2; + } + else if (len_ > 3 && (lcp_ + 1 == lcs_ || lcs_ + 1 == lcp_)) + { + uint8_t freqlcs = 255; + for (i = 0; i < n; ++i) + { + if (i > lcp_ + 1 || i + 1 < lcp_) + { + uint8_t pch = static_cast(chr_[i]); + uint8_t freqpch = frequency(pch); + if (freqlcs > freqpch) + { + lcs_ = i; + freqlcs = freqpch; + } + } + } + } + } } } @@ -4561,25 +4590,30 @@ void Pattern::write_predictor(FILE *file) const { ::fprintf(file, "extern const reflex::Pattern::Pred reflex_pred_%s[%zu] = {", opt_.n.empty() ? "FSM" : opt_.n.c_str(), 2 + len_ + (len_ == 0) * 256 + Const::HASH + (lbk_ > 0) * 68); ::fprintf(file, "\n %3hhu,%3hhu,", static_cast(len_), (static_cast(min_ | (one_ << 4) | ((lbk_ > 0) << 5)))); + // save match characters chr_[0..len_-1] for (size_t i = 0; i < len_; ++i) ::fprintf(file, "%s%3hhu,", ((i + 2) & 0xF) ? "" : "\n ", static_cast(chr_[i])); if (len_ == 0) { + // save bitap bit_[] parameters for (Char i = 0; i < 256; ++i) ::fprintf(file, "%s%3hhu,", (i & 0xF) ? "" : "\n ", static_cast(~bit_[i])); } - if (min_ >= 4) + if (min_ < 4) { + // save predict match PM4 pma_[] parameters for (Hash i = 0; i < Const::HASH; ++i) - ::fprintf(file, "%s%3hhu,", (i & 0xF) ? "" : "\n ", static_cast(~pmh_[i])); + ::fprintf(file, "%s%3hhu,", (i & 0xF) ? "" : "\n ", static_cast(~pma_[i])); } else { + // save predict match hash pmh_[] parameters for (Hash i = 0; i < Const::HASH; ++i) - ::fprintf(file, "%s%3hhu,", (i & 0xF) ? "" : "\n ", static_cast(~pma_[i])); + ::fprintf(file, "%s%3hhu,", (i & 0xF) ? "" : "\n ", static_cast(~pmh_[i])); } if (lbk_ > 0) { + // save lookback parameters lbk_ lbm_ cbk_[] after s-t cut and first s-t cut pattern characters fst_[] ::fprintf(file, "\n %3hhu,%3hhu,%3hhu,%3hhu,", static_cast(lbk_ & 0xff), static_cast(lbk_ >> 8), static_cast(lbm_ & 0xff), static_cast(lbm_ >> 8)); for (size_t i = 0; i < 256; i += 8) { diff --git a/lib/simd.cpp b/lib/simd.cpp new file mode 100644 index 000000000..766776a4f --- /dev/null +++ b/lib/simd.cpp @@ -0,0 +1,157 @@ +/******************************************************************************\ +* Copyright (c) 2016, Robert van Engelen, Genivia Inc. All rights reserved. * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are met: * +* * +* (1) Redistributions of source code must retain the above copyright notice, * +* this list of conditions and the following disclaimer. * +* * +* (2) Redistributions in binary form must reproduce the above copyright * +* notice, this list of conditions and the following disclaimer in the * +* documentation and/or other materials provided with the distribution. * +* * +* (3) The name of the author may not be used to endorse or promote products * +* derived from this software without specific prior written permission. * +* * +* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * +* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * +* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * +* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * +* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * +* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * +* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +\******************************************************************************/ + +/** +@file simd.cpp +@brief RE/flex SIMD primitives +@author Robert van Engelen - engelen@genivia.com +@copyright (c) 2016-2024, Robert van Engelen, Genivia Inc. All rights reserved. +@copyright (c) BSD-3 License - see LICENSE.txt +*/ + +#include + +namespace reflex { + +#if defined(HAVE_AVX512BW) || defined(HAVE_AVX2) || defined(HAVE_SSE2) + +// simd.h get_HW() +static uint64_t get_HW() +{ + int CPUInfo1[4] = { 0, 0, 0, 0 }; + int CPUInfo7[4] = { 0, 0, 0, 0 }; + cpuidex(CPUInfo1, 0, 0); + int n = CPUInfo1[0]; + if (n <= 0) + return 0ULL; + cpuidex(CPUInfo1, 1, 0); // cpuid EAX=1 + if (n >= 7) + cpuidex(CPUInfo7, 7, 0); // cpuid EAX=7, ECX=0 + return static_cast(CPUInfo1[2]) | (static_cast(static_cast(CPUInfo7[1])) << 32); +} + +uint64_t HW = get_HW(); + +#endif + +size_t nlcount(const char *s, const char *t) +{ + size_t n = 0; + if (s <= t - 256) + { +#if defined(HAVE_AVX512BW) && (!defined(_MSC_VER) || defined(_WIN64)) + if (have_HW_AVX512BW()) + n = simd_nlcount_avx512bw(s, t); + else if (have_HW_AVX2()) + n = simd_nlcount_avx2(s, t); + else +#elif defined(HAVE_AVX512BW) || defined(HAVE_AVX2) + if (have_HW_AVX2()) + n = simd_nlcount_avx2(s, t); + else +#endif +#if defined(HAVE_AVX512BW) || defined(HAVE_AVX2) || defined(HAVE_SSE2) + { + const char *e = t - 64; + // align on 16 bytes + while ((reinterpret_cast(s) & 0x0f) != 0) + n += (*s++ == '\n'); + __m128i vlcn = _mm_set1_epi8('\n'); + while (s <= e) + { + __m128i vlcm1 = _mm_loadu_si128(reinterpret_cast(s)); + __m128i vlcm2 = _mm_loadu_si128(reinterpret_cast(s + 16)); + __m128i vlcm3 = _mm_loadu_si128(reinterpret_cast(s + 32)); + __m128i vlcm4 = _mm_loadu_si128(reinterpret_cast(s + 48)); + __m128i vlceq1 = _mm_cmpeq_epi8(vlcm1, vlcn); + __m128i vlceq2 = _mm_cmpeq_epi8(vlcm2, vlcn); + __m128i vlceq3 = _mm_cmpeq_epi8(vlcm3, vlcn); + __m128i vlceq4 = _mm_cmpeq_epi8(vlcm4, vlcn); + n += popcount(_mm_movemask_epi8(vlceq1)) + + popcount(_mm_movemask_epi8(vlceq2)) + + popcount(_mm_movemask_epi8(vlceq3)) + + popcount(_mm_movemask_epi8(vlceq4)); + s += 64; + } + } +#elif defined(HAVE_NEON) + const char *e = t - 64; + uint8x16_t vlcn = vdupq_n_u8('\n'); + while (s <= e) + { + uint8x16_t vlcm0 = vld1q_u8(reinterpret_cast(s)); + uint8x16_t vleq0 = vceqq_u8(vlcm0, vlcn); + s += 16; + uint8x16_t vlcm1 = vld1q_u8(reinterpret_cast(s)); + uint8x16_t vleq1 = vceqq_u8(vlcm1, vlcn); + s += 16; + uint8x16_t vlcm2 = vld1q_u8(reinterpret_cast(s)); + uint8x16_t vleq2 = vceqq_u8(vlcm2, vlcn); + s += 16; + uint8x16_t vlcm3 = vld1q_u8(reinterpret_cast(s)); + uint8x16_t vleq3 = vceqq_u8(vlcm3, vlcn); + s += 16; +#if defined(__aarch64__) + n += vaddvq_s8(vqabsq_s8(vreinterpretq_s8_u8(vaddq_u8(vleq0, vaddq_u8(vleq1, vaddq_u8(vleq2, vleq3)))))); +#else + // my homebrew horizontal sum (we have a very limited range 0..4 to sum to a total max 4x16=64 < 256) + uint64x2_t vsum = vreinterpretq_u64_s8(vqabsq_s8(vreinterpretq_s8_u8(vaddq_u8(vleq0, vaddq_u8(vleq1, vaddq_u8(vleq2, vleq3)))))); + uint64_t sum0 = vgetq_lane_u64(vsum, 0) + vgetq_lane_u64(vsum, 1); + uint32_t sum1 = static_cast(sum0) + (sum0 >> 32); + uint16_t sum2 = static_cast(sum1) + (sum1 >> 16); + n += static_cast(sum2) + (sum2 >> 8); +#endif + } +#endif + } + // 4-way auto-vectorizable loop + uint32_t n0 = 0, n1 = 0, n2 = 0, n3 = 0; + while (s < t - 3) + { + n0 += s[0] == '\n'; + n1 += s[1] == '\n'; + n2 += s[2] == '\n'; + n3 += s[3] == '\n'; + s += 4; + } + n += n0 + n1 + n2 + n3; + // epilogue + if (s < t) + { + n += *s == '\n'; + if (++s < t) + { + n += *s == '\n'; + if (++s < t) + n += *s == '\n'; + } + } + return n; +} + +} // namespace reflex diff --git a/lib/simd_avx2.cpp b/lib/simd_avx2.cpp index d12809929..47c6751e8 100644 --- a/lib/simd_avx2.cpp +++ b/lib/simd_avx2.cpp @@ -34,15 +34,20 @@ @copyright (c) BSD-3 License - see LICENSE.txt */ -#include -#include +#if defined(HAVE_AVX2) || defined(HAVE_AVX512BW) +# if !defined(__AVX2__) && !defined(__AVX512BW__) +# error simd_avx2.cpp must be compiled with -mavx2 or /arch:avx2. +# endif +#endif + +#include namespace reflex { -// Partially count newlines in string b up to and including position e in b, updates b close to e with uncounted part +// Partially count newlines in string b up to e, updates b close to e with uncounted part size_t simd_nlcount_avx2(const char*& b, const char *e) { -#if defined(HAVE_AVX2) +#if defined(HAVE_AVX2) || defined(HAVE_AVX512BW) const char *s = b; e -= 128; if (s > e) @@ -73,42 +78,4 @@ size_t simd_nlcount_avx2(const char*& b, const char *e) #endif } -// Partially count newlines in string b up to and including position e in b, updates b close to e with uncounted part -size_t simd_nlcount_sse2(const char*& b, const char *e) -{ -#if defined(HAVE_SSE2) - const char *s = b; - e -= 64; - if (s > e) - return 0; - size_t n = 0; - // align on 16 bytes - while ((reinterpret_cast(s) & 0x0f) != 0) - n += (*s++ == '\n'); - __m128i vlcn = _mm_set1_epi8('\n'); - while (s <= e) - { - __m128i vlcm1 = _mm_loadu_si128(reinterpret_cast(s)); - __m128i vlcm2 = _mm_loadu_si128(reinterpret_cast(s + 16)); - __m128i vlcm3 = _mm_loadu_si128(reinterpret_cast(s + 32)); - __m128i vlcm4 = _mm_loadu_si128(reinterpret_cast(s + 48)); - __m128i vlceq1 = _mm_cmpeq_epi8(vlcm1, vlcn); - __m128i vlceq2 = _mm_cmpeq_epi8(vlcm2, vlcn); - __m128i vlceq3 = _mm_cmpeq_epi8(vlcm3, vlcn); - __m128i vlceq4 = _mm_cmpeq_epi8(vlcm4, vlcn); - n += popcount(_mm_movemask_epi8(vlceq1)) - + popcount(_mm_movemask_epi8(vlceq2)) - + popcount(_mm_movemask_epi8(vlceq3)) - + popcount(_mm_movemask_epi8(vlceq4)); - s += 64; - } - b = s; - return n; -#else - (void)b; - (void)e; - return 0; -#endif -} - } // namespace reflex diff --git a/lib/simd_avx512bw.cpp b/lib/simd_avx512bw.cpp index 1a762d856..af9a47a7f 100644 --- a/lib/simd_avx512bw.cpp +++ b/lib/simd_avx512bw.cpp @@ -34,12 +34,17 @@ @copyright (c) BSD-3 License - see LICENSE.txt */ -#include -#include +#if defined(HAVE_AVX512BW) +# if !defined(__AVX512BW__) +# error simd_avx512bw.cpp must be compiled with -mavx512bw or /arch:avx512. +# endif +#endif + +#include namespace reflex { -// Partially count newlines in string b up to and including position e in b, updates b close to e with uncounted part +// Partially count newlines in string b up to e, updates b close to e with uncounted part size_t simd_nlcount_avx512bw(const char*& b, const char *e) { #if defined(HAVE_AVX512BW) && (!defined(_MSC_VER) || defined(_WIN64)) diff --git a/reflex.pc b/reflex.pc index 950fda49a..47ac897af 100644 --- a/reflex.pc +++ b/reflex.pc @@ -5,7 +5,7 @@ includedir=${prefix}/include Name: RE/flex Description: high-performance C++ regex library and lexical analyzer generator -Version: 4.2.1 +Version: 4.3.0 Requires: Libs: -L${libdir} -lreflex -Cflags: -DHAVE_NEON -I${includedir} +Cflags: -I${includedir} diff --git a/reflex.pc.in b/reflex.pc.in index 09e07f471..9e2d13458 100644 --- a/reflex.pc.in +++ b/reflex.pc.in @@ -8,4 +8,4 @@ Description: high-performance C++ regex library and lexical analyzer generator Version: @VERSION@ Requires: Libs: -L${libdir} -lreflex -Cflags: @SIMD_FLAGS@ -I${includedir} +Cflags: -I${includedir} diff --git a/reflexmin.pc b/reflexmin.pc index d9db0fd8d..0a33fb54b 100644 --- a/reflexmin.pc +++ b/reflexmin.pc @@ -5,7 +5,7 @@ includedir=${prefix}/include Name: RE/flex Description: high-performance C++ regex library and lexical analyzer generator -Version: 4.2.1 +Version: 4.3.0 Requires: Libs: -L${libdir} -lreflexmin -Cflags: -DHAVE_NEON -I${includedir} +Cflags: -I${includedir} diff --git a/reflexmin.pc.in b/reflexmin.pc.in index 8596189e4..0798e3360 100644 --- a/reflexmin.pc.in +++ b/reflexmin.pc.in @@ -8,4 +8,4 @@ Description: high-performance C++ regex library and lexical analyzer generator Version: @VERSION@ Requires: Libs: -L${libdir} -lreflexmin -Cflags: @SIMD_FLAGS@ -I${includedir} +Cflags: -I${includedir} diff --git a/src/reflex.h b/src/reflex.h index 3b029e7ae..1e0c929b6 100644 --- a/src/reflex.h +++ b/src/reflex.h @@ -75,7 +75,7 @@ #endif // DO NOT ALTER THIS LINE: the makemake.sh script updates the version -#define REFLEX_VERSION "4.2.1" +#define REFLEX_VERSION "4.3.0" /// RE/flex scanner generator class, a variation of the classic "lex" tool to generate scanners. /**