re2c 2.0

On Monday, July 20, the release of re2c, a fast lexical analyzer generator, was released.
Major changes:

  • Added support for Go language
    (enabled either with the --lang go option for re2c, or as a standalone re2go program).
    The documentation for C and Go is generated from the same text, but with different
    code examples. The code generation subsystem in re2c has been completely redesigned, which
    should make it easier to support new languages ​​in the future.

  • Added alternative build system on CMake (thanks ligfx!).
    Attempts to translate re2c to CMake have been made for a long time, but before ligfx no one
    offered a complete solution.
    The old build system on Autotools continues to be supported and used,
    and in the foreseeable future there are no plans to abandon it (partly so as not to create
    problems for distribution developers, partly because the old build system
    more stable and concise than the new one).
    Both systems are equally continuously tested using Travis CI.

  • Added the ability to set the interface code in configurations when using
    generic API (generic API). Previously, most APIs had to be specified in the form
    functions or function macros. Now they can be set in the form of arbitrary
    strings with named template parameters of the form @@{name} or just @@ (if
    there is only one parameter and there is no ambiguity). API style is configurable
    re2c:api:style (the functions value specifies the functional style, while the free-form value is arbitrary).

  • Improved operation of the -c, --start-conditions option, which allows you to combine several
    interconnected lexers in one re2c block. Now you can use
    ordinary blocks on a par with conditional ones and set several unrelated conditional
    blocks in one file.
    Improved -r, --reuse options (reuse of code from one block
    in other blocks) in combination with the -c, --start-conditions and -f, --storable-state options
    (a stateful lexer that can be interrupted at an arbitrary location
    and continue execution later).

  • Fixed a bug in the newly added algorithm for handling the end of input data
    (EOF rule), which in rare cases led to incorrect processing
    overlapping rules.

  • Simplified bootstrap process. Previously, the build system tried to dynamically find already
    built re2c that could be used to rebuild itself.
    This led to incorrect dependencies (because the dependency graph turned out
    dynamic, which most build systems don't like).
    Now, in order to rebuild lexers, it is required explicitly
    configure the build system and set the RE2C_FOR_BUILD variable.

Thanks to everyone who contributed to this release!

Source: linux.org.ru

Add a comment