# # spec file for package re2c # # Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: re2c Version: 4.0.2 Release: 1.3 Summary: Tool for generating C-based recognizers from regular expressions License: SUSE-Public-Domain URL: https://re2c.org/ Source: https://github.com/skvadrik/re2c/releases/download/%{version}/%{name}-%{version}.tar.xz BuildRequires: bison BuildRequires: gcc-c++ BuildRequires: python3-base >= 3.7 %description re2c is a tool for writing fast and flexible lexers. Unlike other such tools, it concentrates solely on generating efficient code for matching regular expressions. This makes it suitable for a wide variety of applications. The generated scanners approach hand-crafted ones in terms of size and speed. %prep %autosetup %build %configure %if 0%{?do_profiling} %make_build CFLAGS="%{optflags} %{cflags_profile_generate}" # do not run profiling in parallel for reproducible builds (boo#1040589 boo#1102408) %make_build CFLAGS="%{optflags} %{cflags_profile_generate}" check %make_build clean %make_build CFLAGS="%{optflags} %{cflags_profile_feedback}" %else %make_build CFLAGS="%{optflags}" %endif %install %make_install %check %make_build check %files %license README.md %doc CHANGELOG %doc examples/ %{_bindir}/re2c %{_bindir}/re2go %{_bindir}/re2rust %{_bindir}/re2d %{_bindir}/re2hs %{_bindir}/re2js %{_bindir}/re2ocaml %{_bindir}/re2py %{_bindir}/re2v %{_bindir}/re2zig %{_mandir}/man1/re2c.1%{?ext_man} %{_mandir}/man1/re2go.1%{?ext_man} %{_mandir}/man1/re2rust.1%{?ext_man} %{_mandir}/man1/re2d.1%{?ext_man} %{_mandir}/man1/re2hs.1%{?ext_man} %{_mandir}/man1/re2js.1%{?ext_man} %{_mandir}/man1/re2ocaml.1%{?ext_man} %{_mandir}/man1/re2py.1%{?ext_man} %{_mandir}/man1/re2v.1%{?ext_man} %{_mandir}/man1/re2zig.1%{?ext_man} %dir %{_datadir}/re2c %dir %{_datadir}/re2c/stdlib %{_datadir}/re2c/stdlib/* %changelog * Sat Dec 14 2024 Martin Hauke - Update to version 4.0.2 * CMake build system: fixed bug (#515) where language-specific binaries erroneously defaulted to generating code for C. * Playground: address bar now reflects navigation between examples, editors use a more high-contrast CSS theme. * Wed Dec 4 2024 Martin Pluskal - Update to version 4.0.1: * Added missing doc sources to the distribution tarball (#503) * Reworked C/C++ examples to avoid using new configuration aliases until the world has updated to re2c 4.0, made them compatible with C. * A few build system changes: increased CMake minimum required version to 3.15, added missing dependencies on doc sources in Makefile.am. * Fixed typos in docs. * Added a generic technique for describing language backends based on the idea of syntax files (#450). * Added support for new languages: D, Haskell, Java, JavaScript, OCaml, Python, V, Zig. * Added new record API for all languages (enabled with --api record, re2c:api = record) and made it the default API for Haskell and OCaml. * Renamed former “default API” to “simple API”, implemented it for all backends except Haskell and OCaml, and enabled by default API for C, D, Java, JavaScript, Python, V and Zig. * Added new code generation model - recursive functions (enabled with --recursive-functions), primarily to be used for functional languages. * Wed Aug 9 2023 Andrea Manzini - Update to 3.1: * new options --leftmost-captures option and re2c:leftmost-captures on capturing groups * new syntax (! ...) for non-capturing groups * It is also possible to flip defaults with --invert-captures option or re2c:invert_captures configuration, so that (...) is a capturing group and (! ...) is a non-capturing one * TDFA paper and removal of experimental algorithms * internal codebase , build system and CI improvements see details at https://re2c.org/releases/release_notes.html#release-3-1 * Thu Apr 28 2022 Dirk Müller - update to 3.0: - Added code generation backend for Rust: - Added options: + ``--loop-switch`` + ``--no-unsafe`` - Added configurations; + ``re2c:label:yyloop`` + ``re2c:unsafe`` - Renamed options to use common naming scheme. The old names are supported as aliases, so the change does not break existing code. Documentation has been updated to use new names. + ``--api`` is a new alias for ``--input`` + ``--ebcdic`` is a new alias for ``--ecb`` + ``--ucs2`` is a new alias for ``--wide-chars`` + ``--utf32`` is a new alias for ``--unicode`` + ``--utf16`` is a new alias for ``--utf-16`` + ``--utf8`` is a new alias for ``--utf-8`` + ``--header`` is a new alias for ``--type-header`` - Renamed configurations to use common naming scheme and support proper scoping under subcategories such as ``:define``, ``:label``, ``:variable``, etc. The old names are supported as aliases, so the change does not break existing code. Documentation has been updated to use new names. + ``re2c:api`` is a new alias for ``re2c:flags:input`` + ``re2c:bit-vectors`` is a new alias for ``re2c:flags:bit-vectors`` + ``re2c:case-insensitive`` is a new alias for ``re2c:flags:case-insensitive`` + ``re2c:case-inverted`` is a new alias for ``re2c:flags:case-inverted`` + ``re2c:case-ranges`` is a new alias for ``re2c:flags:case-ranges`` + ``re2c:cond:prefix`` is a new alias for ``re2c:condprefix`` + ``re2c:cond:enumprefix`` is a new alias for ``re2c:condenumprefix`` + ``re2c:computed-gotos`` is a new alias for ``re2c:flags:computed-gotos`` + ``re2c:computed-gotos:threshold`` is a new alias for ``re2c:cgoto:threshold`` + ``re2c:debug-output`` is a new alias for ``re2c:flags:debug-output`` + ``re2c:encoding:ebcdic`` is a new alias for ``re2c:flags:ecb`` + ``re2c:encoding:utf32`` is a new alias for ``re2c:flags:unicode`` + ``re2c:encoding:ucs2`` is a new alias for ``re2c:flags:wide-chars`` + ``re2c:encoding:utf16`` is a new alias for ``re2c:flags:utf-16`` + ``re2c:encoding:utf8`` is a new alias for ``re2c:flags:utf-8`` + ``re2c:encoding-policy`` is a new alias for ``re2c:flags:encoding-policy`` + ``re2c:empty-class`` is a new alias for ``re2c:flags:empty-class`` + ``re2c:header`` is a new alias for ``re2c:flags:type-header`` + ``re2c:label:prefix`` is a new alias for ``re2c:labelprefix`` + ``re2c:label:yyfill`` is a new alias for ``re2c:label:yyFillLabel`` + ``re2c:label:start`` is a new alias for ``re2c:startlabel`` + ``re2c:nested-ifs`` is a new alias for ``re2c:flags:nested-ifs`` + ``re2c:posix-captures`` is a new alias for ``re2c:flags:posix-captures`` + ``re2c:tags`` is a new alias for ``re2c:flags:tags`` + ``re2c:variable:yych:conversion`` is a new alias for ``re2c:yych:conversion`` + ``re2c:variable:yych:emit`` is a new alias for ``re2c:yych:emit`` + ``re2c:variable:yybm:hex`` is a new alias for ``re2c:yybm:hex`` + ``re2c:unsafe`` is a new alias for ``re2c:flags:unsafe`` - Added directive alias ``conditions:re2c`` for ``types:re2c``. - Multiple small changes in code generation, including some formatting changes that result in large diffs in the generated code: + Do not allocate indices for unused state labels (this results in a change in state enumeration), commits + Do not generate redundant ``YYPEEK`` statements, commit + Do not generate ``YYDEBUG`` statements for unused states labels, commit + C backend: change formatting of switch statements, commit + Go backend: render continuous character ranges in compact form, commit + Mark start and end of included .re files with line directives, commit - A fix to limit maximum allowed NFA and DFA size (to avoid out of memory crashes and stack overflows), - A fix to correctly compute fixed tags in trailing context, commit - A fix to generate non-overlapping names for s-tag and m-tag variables, commit - Infrastructural: added support for CMake presets. - Updated documentation. - Backwards-incompatible changes that are unlikely to affect any users: + Restrict lexical contexts where ``%%{`` is recognized as a block start, + Emit an error when repetition lower bound exceeds upper bound, commit * Fri Nov 12 2021 Dominique Leuenberger - BuildRequire python3-base instead of full python3: allow to be slimmer. * Mon Nov 8 2021 Daniel Donisa - update 2.2: - Added named blocks and block lists in directives. - Added local blocks ``/*!local:re2c ... */``. - Added in-block ``!include`` directive. - Added in-block ``!use`` directive. - Allowed reusable blocks without ``-r --reusable`` option. - Allowed customizing the generated code with configurations for directives ``max:re2c``, ``maxnmatch:re2c``, ``stags:re2c``, ``mtags:re2c`` and ``types:re2c`` (see directive descriptions for details). - Forbid arbitrary text at the end of ``max:re2c`` directive. This may break backwards compatibility, although it is unlikely that this was used by anyone. The change was necessary in order to allow customization of the generated code with configurations. - Deprecated configurations ``flags:i``, ``flags:no-debug-info`` in favour of the global options ``-i``, ``--no-debug-info``. - Reimplemented re2c test runner in Python (thanks to `Serghei Iakovlev `_). Improved integration with GitHub Actions. - Changes in the experimental libre2c library: added new algorithms that construct t-string or extract submatch on all repetitions; added TDFA benchmark written in Java by Angelo Borsotti. - Updated documentation. - Add python >= 3.7 dependency required by new tests. - Upstream added some tests written in python. The tests failed locally because the module dataclasses from python >= 3.7 were missing. On OBS the builds failed due to a timeout when trying to run those python tests. * Sun May 9 2021 Dirk Müller - update to 2.1.1: - Added missing CMakeLists.txt to release tarballs - Added GitHub Actions CI for Linux, macOS and Windows and fixed numerous build issues on those platforms - Added benchmarks for submatch extraction in lexer generators (ragel vs. kleenex vs. re2c with TDFA(0), TDFA(1) or sta-DFA algorithms). + New CMake options: ``-DRE2C_BUILD_BENCHMARKS``, ``-DRE2C_REGEN_BENCHMARKS`` + New `json2pgfplot.py - Added option ``--depfile `` to generate build dependency files - Added option ``--fixed-tags `` and improved fixed-tag optimization to work with nested tags. - Added lzip to the distribution tarballs. - Added registerless-TDFA algorithm in the experimental libre2c library. - Explicitly disallowed invalid configuration when ``-f``, ``--storable-state`` option is used, but ``YYFILL`` is disabled - Fixed bug in UTF-8 decode for 4-bytes rune - Fixed bugs in rare cases of the end-of-input rule ``$`` usage - Optimized ``--skeleton`` generation time. - Renamed internal option ``--dfa`` to ``--nested-negative-tags``. - Updated documentation for end of input handling and submatch extraction. * Fri Sep 4 2020 Dirk Mueller - update to 2.0.3: - Fix issues when building re2c as a CMake subproject - Final corrections in the SIMPA article "RE2C: A lexer generator based on lookahead-TDFA", https://doi.org/10.1016/j.simpa.2020.100027 * Thu Aug 13 2020 Paolo Stivanin - Update to version 2.0.2: * Go backend. The new Go code generation backend can be used either with a --lang go re2c option, or as a standalone re2go binary * Free-form generic API. Generic API now supports two styles * Improved reuse mode and start conditions * Backwards incompatible changes: + Generic APIs YYSHIFT/YYSHIFTSTAG/YYSHIFTMTAG have been added + Generic APIs YYSTAGPD/YYMTAGPD have been removed + The re2c:flags:type-header option now treats the header filename as relative to the output directory + Some internal labels have been renamed, in particular the yyFillLabel prefix has been replaced with yyfill * Wed Feb 5 2020 Martin Pluskal - Update to version 1.3: * Added option: ``--stadfa``. * Added warning: ``-Wsentinel-in-midrule``. * Added generic API primitives: + ``YYSTAGPD`` + ``YYMTAGPD`` * Added configurations: + ``re2c:sentinel = 0;`` + ``re2c:define:YYSTAGPD = "YYSTAGPD";`` + ``re2c:define:YYMTAGPD = "YYMTAGPD";`` * Worked on reproducible builds * Wed Aug 14 2019 Martin Pluskal - Update to version 1.2.1: * Lots of changes, see provided CHANGELOG - Drop no longer needed re2c-nogenerationdatedefault.patch - Enable profile guided optimization during build * Mon Mar 11 2019 Chris Coutinho - Update re2c to 1.1.1 * Fixed bug #211 re2c '-V' throws 'std::out_of_range' (version to vernum conversion). * Replaced Kuklewicz POSIX disambiguation algorithm with Okui algorithm. * Optimized GOR1 algorithm (computation of tagged epsilon-closure). * Added option "--conditions" (an alias for "-c" and "--start-conditions"). * Fixed bug #201 Bugs with option: 're2c:flags:no-debug-info'. * Reworked first part of TDFA paper. * Thu Mar 15 2018 mpluskal@suse.com - Modernise spec file with spec-cleaner * Thu Nov 9 2017 aavindraa@gmail.com - Update to version 1.0.3: * Fixes build failure on Mac OS X 10.5.8 with gcc 4.2.1 * Documentation fix * 2 examples removed * Mon Sep 4 2017 mpluskal@suse.com - Update to version 1.0.2: * Fixed bug #194 “Build with --enable-docs” * Updated documentation. - Changes for version 1.0.1: * Fixed bug #193 “1.0 build failure on macOS: error: calling a * private constructor of class ‘re2c::Rule’” - Changes for version 1.0: * Added several new options * Added new inplace confgurations * Added warning -Wnondeterministic-tags * Added fuzz-testing scripts * Added paper “Tagged Deterministic Finite Automata with Lookahead” * See provided CHANGELOG for full list of new features * Fixed bugs: + #121 “trailing contexts are fundamentally broken” + #135 “In installation make check give syntax error” + #137 “run_tests.sh fail when running configure script with absolute path” + #138 “website improvement” + #141 “Tests under Windows” + #142 “segvault with null terminated input” + #145 “Values for enum YYCONDTYPE are not generated when default rules with conditions are used” + #147 “Please add symbol name to “can’t find symbol” error message” + #152 “Line number in #line directive after enum YYCONDTYPE is 0-based” + #156 “Build with Visual Studio 14 2015: symbol name conflict” + #158 “Inconsistent forward declaration of struct/class vs definition” + #160 “Open text files with “wb” causes issues on Windows” + #162 “Reading files with “rb” causes issues in Windows” + #165 “Trailing context consumed if initial expression matches it” + #176 “re2c help message is too wide for most terminals” + #184 “Small documentation issue” * Sat Jan 30 2016 mpluskal@suse.com - Update to 0.16 * Fixed bug #127 "code generation error with wide chars and bitmaps (omitted 'goto' statement)" * Added DFA minimization and option '--dfa-minimization ' * Fixed bug #128 "very slow DFA construction (resulting in a very large DFA)" * Fixed bug #132 "test failure on big endian archs with 0.15.3" - Make building more verbose * Fri Jan 8 2016 tchvatal@suse.com - Version update to 0.15.3: * Syntax expansion and various updates * See CHANGELOG for in-depth details - Rebase patch to apply: * re2c-nogenerationdatedefault.patch * Mon Oct 5 2015 mpluskal@suse.com - Update to 0.14.3 * applied patch '#27 re2c crashes reading files containing %%{ %%}' * dropped distfiles for MSVC (they are broken anyway) - Changes for 0.14.2 * fixed #57 Wrong result only if another rule is present * Fri Mar 13 2015 tchvatal@suse.com - Version bump to latest 0.14.1: * Plenty of bugfixes all around * Tue Feb 3 2015 crrodriguez@opensuse.org - re2c-nogenerationdatedefault.patch: Default to - -no-generation-date to avoid build-compare problems [BNC#915937] * Thu Dec 11 2014 crrodriguez@opensuse.org - make test currently does nothing, make check however executes the test suite. * Thu Dec 11 2014 crrodriguez@opensuse.org - version 0.13.7.5 * Added UTF-8 and UTF-16 support. * fixed PHP HEREDOC problems. * Mon May 12 2014 tchvatal@suse.com - Cleanup with spec-cleaner - Sort out the %%prep finds that are no longer needed. * Sat Aug 3 2013 crrodriguez@opensuse.org - version 0.13.6 * allow Yacc-style %%{code brackets}%% * allow C++ // comments * Fixed inplace configuration in -e mode * Fixed Wrong start_label in -c mode. * Fixed Unescaped backslash in file name of #line directive * Fri Sep 9 2011 andrea.turrini@gmail.com - Fixed typo in re2c.spec * Tue Nov 23 2010 cristian.rodriguez@opensuse.org - Use smp_flags - when rebuilding the scanner use -g, to generate GCC specific code that is slightly faster. * Thu Jun 26 2008 mmarek@suse.cz - updated to version 0.13.5 * Fixed sf#1952896 Segfault in re2c::Scanner::scan. * Fixed sf#1952842 Regression. * Mon Apr 7 2008 mmarek@suse.cz - updated to version 0.13.4 * Added transparent handling of #line directives in input files. * Added re2c:yyfill:check inplace configuration. * Added re2c:define:YYSETSTATE:naked inplace configuration. * Added re2c:flags:w and re2c:flags:u inplace configurations. * Added the ability to add rules in 'use:re2c' blocks. * Changed -r flag to accept only 'rules:re2c' and 'use:re2c' blocks. * Mon Mar 17 2008 crrodriguez@suse.de - update to version 0.13.3 , required for new PHP language parser * Added -r flag to allow reuse of scanner definitions. * Added -F flag to support flex syntax in rules. * Fixed SEGV in scanner that occurs with very large blocks. * Fixed issue with unused yybm. * Partial support for flex syntax. * Changed to allow /* comments with -c switch. * Added flag -D/--emit-dot. * Mon Feb 4 2008 mmarek@suse.cz - updated to version 0.13.1 * build fixes for non-linux platforms only * Mon Jun 25 2007 dmueller@suse.de - add gcc-c++ buildrequires * Mon Jun 25 2007 dmueller@suse.de - update to versoin 0.13.0: * Fixed issue with short form of switches and parameter if not first switch. * Fixed #1708378 segfault in actions.cc. * Added -c and -t to generate scanners with (f)lex-like condition support. * Thu May 3 2007 dmueller@suse.de - update to version 0.12.0 * Sun Apr 1 2007 mrueckert@suse.de - update to version 0.11.3 * Sun Mar 4 2007 mrueckert@suse.de - update to version 0.11.2 * Tue Feb 20 2007 mrueckert@suse.de - This version fixes a warning in the generated code that some compilers issue. No other changes have been made.