Add Swift support
Requested in https://www.linux.org.ru/news/development/17798640?cid=17800037
By the way, is there a use case for support of such high-level languages? For instance, wouldn't it be better to use ANTLR? It is amazing that re2c generates a static state machine without any memory allocation. I can use it on a microcontroller. But when it comes to languages like Java, does it matter?
Perhaps there is a use case, since people request it. For Swift in particular, let's ask @data-man .
For some high-level languages like OCaml and Haskell re2c may be a performance benefit (e.g. Haskell is famous for its parser combinators, but they are not as fast as a combination of lexer generator and LALR parser). For languages like JS or Python my expectation is that decent performance can only be achieved with C/C++/Rust libraries that have high-level bindings, so re2js/re2py cannot compete there. But some users still want re2c for its syntax, as in case of JavaScript: https://github.com/skvadrik/re2c/issues/420.
Completed in https://github.com/skvadrik/re2c/pull/538.