On Monday, July 20, the release of re2c – the generator for fast lexical analyzers – was announced.
Key Changes:
Support for the Go language has been added.
(activated either via the option —lang go for re2c or as a separate program re2go).
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 revamped, which
should facilitate the support of new languages in the future.-
Attempts to port re2c to CMake have been made for a long time, but until ligfx, no one
offered a comprehensive solution.
The old build system based on Autotools continues to be supported and used,
and there are no plans in the foreseeable future to discard it (partly to avoid creating
problems for distribution developers, partly because the old build system
is more stable and concise than the new one).
Both systems are continuously tested using Travis CI. The ability to specify interface code in configurations when using a
generic API has been added. Previously, most APIs had to be defined in the form of
functions or functional macros. Now they can be defined as arbitrary
strings with named template parameters like @@{name} or simply @@ (if
there is only one parameter and no ambiguity arises). The API style is set through the configuration
re2c:api:style (the value functions sets functional style, and free-form sets arbitrary).The work of the -c, —start-conditions option has been improved, allowing the combination of multiple
interrelated lexers in a single re2c block. Now, regular blocks can be used alongside conditional ones, and several unrelated conditional
blocks can be defined in one file.
The usability of the -r, —reuse option (code reuse from one block
in other blocks) has been enhanced in conjunction with the options -c, —start-conditions and -f, —storable-state
(a lexer with a saveable state that can be interrupted at any point
and resumed later).
A bug in the recently added algorithm for processing the end of input data(EOF rule) was fixed, which in rare cases led to incorrect processing
of overlapping rules.
The bootstrap process has been simplified. Previously, the build system attempted to dynamically find an alreadycompiled re2c that could be used to rebuild itself.
a built re2c that could be used to rebuild itself.
This led to incorrect dependencies (since the dependency graph became
dynamic, which most build systems dislike).
Now, to rebuild the lexers, it is necessary to explicitly
configure the build system and set the RE2C_FOR_BUILD variable.
Thank you to everyone who participated in preparing this release!
Source: linux.org.ru
