re2c 4.0

On Tuesday, November 19, the release was introduced re2c – a generator for lexical analyzers (also known as a compiler for regular expressions into code in the target programming language). re2c specializes in generating fast and easily embeddable lexers. It differs from the more well-known flex by having a flexible interface, generating optimized non-table lexers, and supporting submatch extraction based on tagged deterministic finite automata (TDFA). re2c is used in projects where lexer speed is critical, such as in Ninja and PHP.

In the 4.0 release, the code generation subsystem was fundamentally redesigned, allowing support for eight new languages (D, Haskell, Java, JavaScript, OCaml, Python, V, Zig) in addition to the already supported ones (C/C++, Go, Rust), as well as a general mechanism for adding new languages through configuration files. The code generator is responsible for translating the already constructed and optimized finite automaton into code; its task is to select appropriate control structures, data types, and the overall program model for the target language, etc. Previously, all this logic was part of re2c's source code, and to change it or add a new language, one had to patch the source code and recompile re2c. Such patches were not accepted into the main repository without implementing a standard set of examples and tests, which further complicated the entire process. Now, all this logic has been transferred to syntax files – text configuration files that can be provided by the user (by default, re2c uses standard ones). The re2c source code is completely free from the specifics of any particular language and relies solely on the syntax file. The user can partially override an existing syntax file or write a new one from scratch. Full documentation with examples is available for all officially supported languages . By the way, the very idea of syntax files arose thanks to.

a comment on LOR , thanks tothe_coder re2c 4.0. The release includes many other changes aimed at simplifying the user interface, improving work with capturing groups, and an online environment for editing and compiling examples was added:.

The release includes many other changes aimed at simplifying the user interface, enhancing the functionality with capturing groups, and an online environment for editing and compiling examples has also been added: http://re2c.org/playground.

Source: linux.org.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster