Compare commits

...
212 Commits
Author SHA1 Message Date
Ulya Trofimovich 9682dcd2b2 Github Actions: try 'oracle-openjdk' as 'redhat' has no macOS support. 2026-09-06 22:07:26 +01:00
Ulya Trofimovich 745a042652 Github Actions: also fix JDK version.
Pick the most recent one supported by 'redhat' distribution: 21.
2026-09-06 21:49:30 +01:00
Ulya Trofimovich b1720e831c Github Actions: fix infra error with setup-java@v6.
Pick 'redhat' distribution that packages OpenJDK, as the previously used
'adopt' distribution is no longer supported with setup-java@v6.
2026-09-06 21:44:31 +01:00
dependabot[bot] 1022a1cb0f Actions(deps): Bump actions/setup-java from 5 to 6
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5 to 6.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-31 21:03:12 +01:00
Ulya Trofimovich e485c5d572 Release 4.6. 2026-08-29 22:26:02 +01:00
Ulya Trofimovich 957bc5359b Update CHANGELOG for release 4.6. 2026-08-29 22:15:34 +01:00
Ulya Trofimovich c117b7d1c9 Revert "Avoid new features added in 4.0 in C/C++ examples."
This reverts commit 5cea17c8fe.

Reason for revert: enough time has passed and most distributions have
updated to re2c version 4.0 or higher.

This fixes bug #507 "Update C/C++ examples".
2026-08-29 21:20:36 +01:00
Chun Pong Lam bda3544af9 Add Zig computed-continue optimization 2026-08-26 14:46:23 +01:00
dependabot[bot] dcc7411099 Actions(deps): Bump actions/setup-python from 6 to 7
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6 to 7.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-20 19:47:54 +01:00
94xhn 9baaabbf4a Fix negative char2class[] index on high-byte input in libre2c DFA matchers
lib/regexec_dfa.cc (regexec_dfa(), regparse_dfa()) and
lib/regexec_dfa_multipass.cc (forward_pass(), shared by
regexec_dfa_multipass<>, regparse_dfa_multipass<>, and
regtstring_dfa_multipass<>) read the next input character as
`*p++` into a plain `int32_t`/`chr`, then use it directly to index
`preg->char2class[]`. On platforms where `char` is signed (the
default for x86/x64), any input byte >= 0x80 sign-extends to a
negative value, so `char2class[c]` reads before the start of the
257-element `size_t` array allocated in regcomp() -- an
out-of-bounds heap read (observed to segfault in a minimal
regcomp()/regexec() reproduction with a high-byte input string).

Fix by reading the byte through `static_cast<uint8_t>(...)` before
using it as an index, matching the pattern already used for the
same purpose in the NFA matchers (regexec_nfa_leftmost.cc,
regexec_nfa_leftmost_trie.cc, regexec_nfa_posix.cc,
regexec_nfa_posix_trie.cc). The `== 0` end-of-input check is
unaffected since 0 is unchanged by the cast.

Verified: rebuilt libre2c (RE2C_BUILD_LIBS=ON) and confirmed
test_libre2c passes before and after the change; a targeted
regcomp()/regexec() check over all 254 non-newline byte values
0x01-0xFF segfaults on the pre-fix code and passes cleanly after
the fix.
2026-07-19 22:51:50 +01:00
dependabot[bot] f1a46ca73a Actions(deps): Bump actions/cache from 5 to 6
Bumps [actions/cache](https://github.com/actions/cache) from 5 to 6.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-29 21:09:51 +01:00
dependabot[bot] fccdffc979 Actions(deps): Bump actions/checkout from 6 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-24 21:49:44 +01:00
Ulya Trofimovich ae610e4ecf CMakePresets.json: update VS version.
The former VS 17 2022 version is no longer supported by Github Actions.
2026-06-23 21:17:58 +01:00
Ryan Carsten Schmidt 86137ce914 Use std::max_align_t instead of max_align_t.
Fixes build with old versions of clang.
2026-04-24 21:26:36 +01:00
Ulya Trofimovich c028cdd42b TDFA paper: apply corrections by Lisa Felidae. 2026-03-29 22:09:29 +01:00
Ulya Trofimovich 8a44906f5c Release 4.5.1. 2026-03-27 21:29:04 +00:00
Ulya Trofimovich 3122b9a415 Update CHANGELOG for release 4.5.1. 2026-03-27 21:09:25 +00:00
Ulya Trofimovich 2ab394e9d5 Docs: mention the new include files for Unicode blocks and properties. 2026-03-27 21:06:50 +00:00
Ulya Trofimovich e63ad223f5 Add missing include files to the distribution.
This fixes #573.
2026-03-27 21:01:55 +00:00
Ulya Trofimovich 3e3b91d75a Release 4.5. 2026-03-23 20:55:16 +00:00
Ulya Trofimovich 7059b54eb9 Update CHANGELOG for release 4.5. 2026-03-22 22:39:16 +00:00
Ulya Trofimovich c88a723fc4 Remove obsolete Unicode files generator. 2026-03-22 22:22:51 +00:00
Ulya Trofimovich 44d56c2804 Implement Unicode case mapping for case-insensitive string literals.
Do this for all Unicode encodings (UTF8, UTF16 and UTF32), and also for UCS2.

This addresses bug #235 "Unicode character classes".
2026-03-22 22:22:51 +00:00
Ulya Trofimovich 4685c639cd Clean up Unicode generator using tags instead of blocks. 2026-03-22 22:22:51 +00:00
Ulya Trofimovich 6a71463d6d Add derived Unicode properties to include/unicode_properties.re. 2026-03-22 22:22:51 +00:00
Ulya Trofimovich 79596e186d Generate include file for Unicode properties.
This partially addresses bug #235 "Unicode character classes".
2026-03-22 22:22:51 +00:00
Ulya Trofimovich 94d1ceb2e9 Update Unicode files to the latest standard. 2026-03-22 22:22:51 +00:00
Ulya Trofimovich e4ba9a90b2 Remove Unicode category tests for encoding policies "fail" and "substitute".
They mostly duplicate the "ignore" policy (except for the categories that
include surrogates). These policies are also covered by the Unicode block tests.
2026-03-22 22:22:50 +00:00
Ulya Trofimovich fce0e9cbd1 Implement generation of Unicode categories tests in the new generator. 2026-03-22 22:22:50 +00:00
Ulya Trofimovich 8fcbced4e4 Clean up Unicode generator code (split large functions). 2026-03-22 22:22:50 +00:00
Ulya Trofimovich 92a98bcf1e Implement generation of Unicode blocks tests in the new generator.
Tests have changed due to the changes in the Unicode standard - the old test
were generated using Haskell "Charset" library, which supports unknown version
of Blocks.txt (none of the existing version matches exactly, but Unicode 4.0 is
somewhat close). There are also other changes in the tests, mostly
simplification and cleanup of the generated code.
2026-03-22 22:22:50 +00:00
Ulya Trofimovich a76b9f592c Use uint16_t for UTF-16 code points in utf16::{lead,trail}_surr.
Previously uint32_t was used to avoid static_cast on 16-bit results of
arithmetic operations on 32-bit values.
2026-03-22 22:22:50 +00:00
Ulya Trofimovich c30687f0f1 Use uint8_t for UTF-8 code points in utf8::rune_to_bytes.
Previously uint32_t was used to avoid static_cast on 8-bit results of
arithmetic operations on 32-bit values.
2026-03-22 22:22:50 +00:00
Ulya Trofimovich dd05aab240 Implement new generator for unicode_blocks.re.
The new generator is based on the official Blocks.txt file from the unicode.org
website. The generated result has changed; it's unclear why some of the blocks
are missing in the Haskell "Charset" library - most likely the library was not
updated for Unicode 15.1.0 (although the categories' definitions correspond to
Unicode 15.1.0).

This partially addresses bug #235 "Unicode character classes".
2026-03-22 22:22:50 +00:00
Ulya Trofimovich 5b0e960177 Add Unicode include file unicode_blocks.re.
Don't use it in auto generated tests, because that creates a problem with
include paths: they are relative to the test directory, which makes the
error messages different based on the build directory (so the tests fail).

Use the old generator based on haskell "Charset" library in order to avoid
changes in the generated code - the library has some discrepancies with
https://unicode.org/Public/15.1.0/ucd/Blocks.txt.

Update test results - the changes have been verified with
test/__run_unicode_tests.sh.

This partially addresses bug #235 "Unicode character classes".
2026-03-22 22:22:50 +00:00
Ulya Trofimovich 04e7048069 Implement new generator for unicode_categories.re.
The new generator is based on the official UnicodeData.txt file from the
unicode.org website. After some experimentation, I found that the the
Unicode standard supported by the previously used Haskell "Charset" library
is 15.1.0, so this is the version used in the new generator. The generated
include file unicode_categories.re is identical to the old one, which
verifies correctness of the new generator.

This partially addresses bug #235 "Unicode character classes".
2026-03-22 22:22:50 +00:00
Ulya Trofimovich a92dad12d8 Render characters compactly in Unicode header and tests.
Previously edge cases like 0xFF were rendered as \u0ff rather than \xff.

The difference in the generated files was verified with:
  `git diff --word-diff=color --word-diff-regex='-?\\[a-zA-Z0-9]+'`
2026-03-22 22:22:50 +00:00
Ulya Trofimovich 0011cab9f9 Render one-character ranges compactly in Unicode header and tests.
Previously even if lower and upper characters were the same, the range
would still be rendered with a dash rather than a single character.
This commit removes useless duplication.

The difference in the generated files was verified with:
  `git diff --word-diff=color --word-diff-regex='-?\\[a-zA-Z0-9]+'`
2026-03-22 22:22:50 +00:00
Ulya Trofimovich f1694c513f Regenerate Unicode tests and include header to support a newer standard.
Regenerate files using haskell script test/encodings/unicode_groups.hs
that is based on Data.Charset library (charser-0.3.12 package). The
script generates tests in test/unicode directory inplace and include
file unicode_categories.re.inc that needs to be copied to
include/unicode_categories.re.

Update test results. As there are substantial changes in the standard,
updates are also nontrivial. They have been verified with
test/__run_unicode_tests.sh.

The example for C was werified with examples/c/__run_all.sh scripts.
2026-03-22 22:22:50 +00:00
dependabot[bot] 55802e3b40 Actions(deps): Bump actions/upload-artifact from 6 to 7
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 11:13:01 +00:00
Ulya Trofimovich 18fc5091b9 Add tests for #571. 2026-02-03 21:48:21 +00:00
Ulya Trofimovich febeb97793 Fix null pointer dereference when actions are used without rules.
Null pointer dereference happened because the root TNFA state was null:
there were no rules for a block, but determinization still happened.

In this case re2c should emit an error and never even attempt
determinization. It was properly handled for blocks with start
conditions, but not for normal blocks.

This addresses #571 "[Bug] Segmentation Fault (NULL Dereference) in
re2c::closure_leftmost_dfs during determinization".
2026-02-03 21:33:11 +00:00
Ulya Trofimovich 04f1424210 TDFA paper: apply corrections by https://github.com/Raekye. 2026-01-16 21:50:29 +00:00
Ulya Trofimovich 1f8d826558 TDFA paper: apply corrections by Lisa Felidae. 2026-01-16 21:50:29 +00:00
Ulya Trofimovich 1dc02f7b70 Dot: use "dashed" style for non-consuming states.
This addresses bug #569 "Invalid DFA in -D output".
2025-12-28 14:12:10 +00:00
Gui Andrade 37350f906c [re2c.bzl] Always pass --no-generation-date
This prevents non-deterministic file generation which can cause a lot of issues in Bazel.
2025-12-23 21:00:53 +00:00
Ulya Trofimovich 8c758c7649 Release 4.4. 2025-12-20 20:36:43 +00:00
Ulya Trofimovich d46322fb89 Update CHANGELOG for release 4.4. 2025-12-20 13:14:52 +00:00
Ulya Trofimovich 5811f5ad65 Docs: add description of YYEND, code:yyend and .yyfill.enable. 2025-12-17 22:56:50 +00:00
Ulya Trofimovich ee0b1f6daf Docs: regenerate following recent changes in examples. 2025-12-17 21:53:03 +00:00
Ulya Trofimovich 82915e38ba Add tests for generalized $.
Note: for Haskell and monadic lexers in general I considered adding `yyend`
variable in order to allow monadic YYEND (similar to the existing `yyfill`
variable). However, this is not yet useful even for Haskell, because it's always
easy to store the end in a record field and define YYEND as a simple non-monadic
comparison expression. It won't be late to add `yyend` variable later in a
backwards compatible way (if the variable is empty, generate code the old way,
otherwise do it the new way), therefore I decided to postpone `yyend`addition
until such time when it's needed.
2025-12-17 21:44:14 +00:00
Ulya Trofimovich 67f50f6907 Allow tags after $ in regular expressions.
This is necessary in order to accommodate negative tags, which are added at the
end of the other alternative (the one that doesn't have tags). During TNFA
construction $ is moved past negative tags and placed immediately before the
final TNFA state. This ensures that there are no tags on the $-transition and we
don't have to append tag operations to incoming transitions when getting rid of
the $-transitions in TDFA.
2025-12-17 21:44:14 +00:00
Ulya Trofimovich bc5c3022d1 Rework detection of shadowed end-of-input rules.
Do it right after TDFA construction. This is only strictly necessary for
self-shadowed rules, but it's better to handle all end-of-input rules
together (especially since the previous analysis was still a hack in
the reversed-TDFA structure).
2025-12-17 21:44:14 +00:00
Ulya Trofimovich 827682202e Fix handling of self-shadowed end-of-input rules.
Also, add tests for generalized end-of-input symbol $ and tags.
2025-12-17 21:44:14 +00:00
Ulya Trofimovich 6fcfa14e15 Fix YYEND generation for "bounds checks with padding" method.
Generate YYEND before YYFILL. This order is makes sense because YYEND should be
faster than YYFILL. In fact, it is the only possible order, as YYFILL may not
return if it's impossible to supply enough input characters.

Don't generate YYEND on transition in the case of "sentinel with bounds checks"
method; instead, generate it in state. This doesn't make any difference on the
tests because YYEND is only needed in the "end" states that have a single
transition.
2025-12-17 21:44:14 +00:00
Ulya Trofimovich 0b5185c03a Allow $ to be used with any end-of-input handling method.
Prevously end-of-input symbol $ was only allowed with "sentinel with
bounds check" method (when `re2c:eof` configuration is set to a
nonnegative value). This commit removes the above restriction and
enables YYEND checks for all end-of-input handling methods. Code
generation is not quite right yet, as in some of the cases YYEND checks
are emitted after YYFILL, while they should go before it.

Internally the main challengege was adding $-transitions in TDFA for all
end-of-input handling methods, and to hide them when necessary depending
on the method. E.g. -Wunreachable-rules analysis must ignore them except
for the $-final states, unless "sentinel with bounds checks" method is
used.
2025-12-17 21:44:14 +00:00
Ulya Trofimovich 07d6f5f7f5 Initial implementation of YYEND check.
For the moment, YYEND is only supported for the "bounds checks with sentinel"
end-of-input handling method (the case of `re2c:eof` configuration). In this
case states that have transitions on symbos do not need YYEND check, as they
have the sentinel transition with YYLESSTHAN / YYFILL pair.
2025-12-17 21:44:14 +00:00
Ulya Trofimovich ab2d4b2504 Change default implementation of YYEND to be like YYLESSTHAN.
Namely, use `YYLIMIT <= YYCURSOR` rather than `YYLIMIT == YYCURSOR`.

The goal is to bridge the gap between YYEND and YYLESSTHAN in the case
of `re2c:eof`. $-final states that have outgoing transitions defer the
end of input check until matching `re2c:eof` symbol range on transition
(and then use YYLESSTHAN in the same way as non-$-final state would do).
But $-final states that are terminal (have no outgoing transitions on
symbols) use YYEND.

We can only bridge this gap in simple / record (not generic) API, and
only if YYFILL is disabled. Otherwise it has to be YYEND and YYLESSTHAN
as macros, and the distinction remains.

This commit does not compromise correctness of the generated code, as
YYCURSOR cannot read past YYLIMIT in a correct lexer, so if it was
correct before this commit it will be as correct after it.
2025-12-17 21:44:14 +00:00
Ulya Trofimovich 299bfc7fe0 Add a new API primitive YYEND.
Also, add the corresponding syntax file configuration `code:yyend` and
syntax file conditional `.yyfill.enable`.

The new API primitive will be used in the implementation of generalized
$ (the end of input symbol). If YYFILL is disabled, and the API used is
either simple or record (not generic API), then YYEND defaults to a
comparison `YYCURSOR == YYLIMIT`, otherwise it remains a macro to be
defined by the user.

We don't use a combination of YYLESSTHAN and YYFILL instead of the new
primitive for a number of reasons:

  - Using YYEND allows us to unify all codegen cases instead of having
    many different implementations based on YYFILL, storable state,
    generic API, etc.

  - Involving YYFILL would add runtime overhead: a possible function
    call instead of a simple inplace check, useless reiteration via
    YYFILL label (which is currently not even generated in these states)
2025-12-17 21:44:14 +00:00
Ulya Trofimovich 2ad0561e4f Move re2c:yyfill config in syntax files closer to the yyfill group. 2025-12-17 21:44:14 +00:00
Ulya Trofimovich 59677b5eb4 Change precedence for conflicting end of input rules.
This change breaks backwards compatibility. This is intentional, following
a period when -Wdeprecate-eof-rule has been a warning by default, now the
default is an error (-Werror-deprecate-eof-rule).

There are code generation changes: end of input rule is now handled as a
normal rue with positional precedence / inheritance order (it is no longer
a special rule like the default rule *). The changes in the code can be
observed with -Wno-error-deprecate-eof-rule (applied to the tests).
2025-12-17 21:44:14 +00:00
dependabot[bot] 82bfcce637 Actions(deps): Bump actions/cache from 4 to 5
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 20:52:09 +00:00
dependabot[bot] 6eb9718a67 Actions(deps): Bump actions/upload-artifact from 5 to 6
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 09:54:01 +00:00
Ulya Trofimovich 5513aff4c0 Revert "Go backend: add test for signed YYCTYPE."
This reverts commit b0d740994c.

Reason for revert: don't keep signed YYCTYPE examples for languages
that don't allow the user to do the incorrect thing (Go, Swift forbid
comparison of signed 8-bit type to literals that overflow it, like 0xFF;
Python, JS, OCaml don't even have a signed 8-bit type).
2025-12-09 21:55:02 +00:00
Ulya Trofimovich 43c7512c31 V backend: add test for signed YYCTYPE.
There's no need to fix examples, as they use `u8` and `u32`.

This addresses bug #561 "Incorrectness with ASCII signedness and range
(in C/C++)".
2025-12-08 21:40:40 +00:00
Ulya Trofimovich 28cca31af9 V backend: more updates in the examples/tests for the new version of V. 2025-12-08 21:21:11 +00:00
Ulya Trofimovich e98dbd359a V backend: specify type in variable initializer.
The code without exact types in variable initializers used to compile
in older versions of V, but not anymore.
2025-12-08 20:39:53 +00:00
Ulya Trofimovich eece38b1e6 Zig backend: add test for signed YYCTYPE.
There's no need to fix examples, as they use `u8` and `u32`.

This addresses bug #561 "Incorrectness with ASCII signedness and range
(in C/C++)".
2025-12-07 13:51:57 +00:00
Ulya Trofimovich 7553c68cb4 Zig backend: port one remaining test to ZIg 0.15. 2025-12-07 13:38:06 +00:00
Ulya Trofimovich 69ffc41706 Zig backend: port examples to Zig 0.15.
This fixes bug #565 "Migrate Zig examples to Zig 0.15".
2025-12-06 22:48:16 +00:00
Ulya Trofimovich 1a26160b69 Java backend: make YYCTYPE/YYPEEK work correctly with signed bytes.
Use `int` instead of `byte` for `YYCTYPE`, as `byte` is signed and therefore
incapable of holding the full range of literals generated by re2c (e.g. 0xFF).

use `Byte.toUnsignedInt` in YYPEEK in order to convert correctly from signed
bytes to `yych` of type `int`. Add a test that demonstrates the need for this.

Using `char` is fine, as it is 2-byte in Java and thus capable of holding
ASCII and UTF-8 range used in the examples.

This addresses bug #561 "Incorrectness with ASCII signedness and range
(in C/C++)".
2025-12-03 22:17:28 +00:00
Ulya Trofimovich 0b7572c30d Haskell backend: use unsigned YYCTYPE in examples. Add a test.
Only one example required fixing `Int` -> `Word`, others use `Word8`.

This addresses bug #561 "Incorrectness with ASCII signedness and range
(in C/C++)".
2025-12-02 22:14:51 +00:00
Ulya Trofimovich 5393573711 Rust backend: add test for signed YYCTYPE.
The generated code compiles only with `#[allow(overflowing_literals)]`,
and it requires `re2c:yych:conversion = 1`.

There's no need to fix examples, as they use `u8` and `u32`.

This addresses bug #561 "Incorrectness with ASCII signedness and range
(in C/C++)".
2025-12-02 21:32:45 +00:00
Ulya Trofimovich b0d740994c Go backend: add test for signed YYCTYPE.
The generated code for the test does not compile - Go rejects it:
    signed_yyctype.go:34:9: cannot use yyinput[yycursor] (value of type byte)
                            as int8 value in assignment
    signed_yyctype.go:35:14: 0xFF (untyped int constant 255) overflows int8

There's no need to fix examples, as they use `byte` (which is unsigned
8-bit type) or `uint32`.

This addresses bug #561 "Incorrectness with ASCII signedness and range
(in C/C++)".
2025-12-02 21:28:17 +00:00
Ulya Trofimovich e2ee1bfa9d D backend: add test for signed YYCTYPE.
There's no need to fix examples, as they use `char` (which is unsigned
8-bit type according to https://dlang.org/spec/type.html#basic-data-types)
or `uint8_t`/`uint32_t`.

This addresses bug #561 "Incorrectness with ASCII signedness and range
(in C/C++)".
2025-12-02 21:23:30 +00:00
Ulya Trofimovich 600717ad6a Fix CHANGELOG formatting. 2025-12-01 22:59:46 +00:00
Ulya Trofimovich af13e1d896 Release 4.3.1. 2025-12-01 22:53:31 +00:00
Ulya Trofimovich f760dccc55 Update CHANGELOG for release 4.3.1. 2025-12-01 22:28:01 +00:00
Ulya Trofimovich 9d76662c22 Regenerate docs. 2025-12-01 22:15:42 +00:00
Ulya Trofimovich 5ed46a79a1 release.sh: Add option --ignore-examples.
This is needed as a last resort to allow releasing re2c on a system where some
of the language toolchains are broken (as it becomes excessively hard to keep
them all working and to keep the examples up to date for languages that don't
care about backwards compatibility, such as Zig).
2025-12-01 22:13:08 +00:00
Ulya Trofimovich dcf934fb33 Allow tags after $ in regular expressions.
This addresses bug #564 "End of input ($) rule deemed invalid when Posix
captures enabled". It is needed t allow implicit capture tags after $ in a
regexp, which was inadvertently forbidden in release 4.3.

It will also be necessary in order to accommodate negative tags added at the
end of alternatives that don't have tags.

During TNFA construction $ is moved past negative tags and placed immediately
before the final TNFA state. This ensures that there are no tags on the
$-transition and we don't have to append tag operations to incoming transitions
when getting rid of the $-transitions in TDFA.
2025-12-01 21:07:53 +00:00
Ulya Trofimovich 55487d4ab8 Fix YYCTYPE to be unsigned in the examples for C/C++. Add a test.
This addresses bug #561 "Incorrectness with ASCII signedness and range
(in C/C++)".
2025-11-26 22:47:09 +00:00
dependabot[bot] 59de285996 Actions(deps): Bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-24 10:57:38 +00:00
Ulya Trofimovich da7d8fe924 Use ptrdiff_t instead of non-standard ssize_t.
This fixes the build on windows.
2025-11-20 22:04:41 +00:00
Ulya Trofimovich 325db7adfd Rework handling of conditions that have no rules.
This addresses bug #560 'Illformed C/C++ code due to missing "final"
conditions in generated enumeration'.

After much discussion (see the bug) it was decided that aborting in the initial
state dispatch for conditions without rules doesn't play well with the existing
configuration `re2c:cond:abort`. Some language backends (notably, C/C++ backend)
have it disabled by default, so the general-case default (no abort) would be at
odds with the special-case default for empty conditionss (abort).

This commit takes a different approach: always raise an error on conditions
without rules, but before doing that check if there are any `<*>` rules that
can be merged to them.
2025-11-20 21:21:25 +00:00
Ulya Trofimovich ccb1d45431 Revert "Always explicitly initialize condition enum members."
This reverts commit 34f6e5269f.

Reason for revert: to make sure we don't break existing code, e.g. if
the numeric constants are incompatible with the user-defined enum type.
2025-11-17 22:48:43 +00:00
Ulya Trofimovich deaabdd4ca Fix check for conditions with the same name in goto/label mode.
This check should not compare condition numbers in goto/label mode,
as conditions get renumbered anyway. Previously it used to work because
all numbers were set to zero in goto/label mode, but it was broken by
a recent commit 8a4e4ebd54.

This addresses bug #560 'Illformed C/C++ code due to missing "final"
conditions in generated enumeration'.
2025-11-15 22:37:48 +00:00
Ulya Trofimovich 550451d8b4 Check for conditions that have no rules.
Check that all conditions referenced by `=>` and `:=>` exist (have rules).
In the case of `:=>`, raise an error on non-existent conditions (because
the autogenerated semantic action would go to a nonexistent condition start
label). In the case of `=>` add the nonexistent condition to condition enum
(the user may want to set condition variable and return from the lexer to
handle it in user code), but make the initial dispatch abort on it (in case
it was a typo).

This addresses bug #560 'Illformed C/C++ code due to missing "final"
conditions in generated enumeration'.
2025-11-13 22:51:24 +00:00
Ulya Trofimovich 34f6e5269f Always explicitly initialize condition enum members.
Historically in goto/label mode conditions weren't assigned explicit
numeric identifiers - the numbers were assigned implicitly based on
position in the condition enumeration. This affected language backends
for C/C++, D, Go, V (those supporting goto/label model).

In loop/switch and rec/func modes condition numbers correspond to TDFA
state indices, so they are not consecutive and require explicit
initializers.

This commit makes the enumeration always have explcit initializers
regardless of the code model. The generated initializers are backwards
compatible (identical to the implicitly assigned ones).
2025-11-12 22:32:02 +00:00
Ulya Trofimovich 8a4e4ebd54 Unify handling of numeric condition identifiers across code models.
Historically in goto/label mode conditions aren't assigned explicit
numeric identifiers - the numbers are assigned implicitly based on
position in the condition enumeration. However, this correlation is
erroneous: there's no guarantee that the languages that support `goto`
also have enums with implicit numbers.

For now, keep the erroneous correlation (to avoid changing the generated
code), but move it from re2c code to syntax file definitions.
2025-11-12 21:10:34 +00:00
dependabot[bot] 79831797ff Actions(deps): Bump actions/upload-artifact from 4 to 5
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 12:32:46 +00:00
dependabot[bot] 0bfddb867b Actions(deps): Bump actions/setup-python from 5 to 6
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 11:35:27 +01:00
Alexey Abramov 7563ecaec0 Use maximum alignment to ensure compatibility across all architectures. 2025-08-31 12:22:56 +01:00
dependabot[bot] e74cef8655 Actions(deps): Bump actions/setup-java from 4 to 5
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4 to 5.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-25 21:00:13 +01:00
dependabot[bot] 26f01b60ee Actions(deps): Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-18 15:46:44 +01:00
Stefan A. Haubenthal 6662452bde Fixed minor typos 2025-08-04 06:19:13 +01:00
Ulya Trofimovich ffdc69dc2e Release 4.3. 2025-06-30 14:17:05 +01:00
Ulya Trofimovich 8bc53228ff Update changelog for release 4.3. 2025-06-30 07:02:33 +01:00
Ulya Trofimovich 2a64e74ff7 Docs: add description of -Wdeprecated-eof-rule warning. 2025-06-30 07:02:33 +01:00
Ulya Trofimovich 76e14817fb Allow to use $ in a regexp.
Previously $ was a special end-of-input rule with precedence and
inheritance order similar to the special default rule *.

Now $ can be used in a regexp as part of a normal rule with normal
position-based precedence and inheritance order. However, this change would
break backwards compatibility in some cases, so for now there's a workaround
that enforces the old order and gives a warning. In the future the warning
will be turned to error, and the old order will no longer be enforced.

New options that control this behavior:

    -Wdeprecated-eof-rule          (turn on warning, on by default)
    -Wno-deprecated-eof-rule       (turn off warning)
    -Werror-deprecated-eof-rule    (turn on error, off by default for now)
    -Wno-error-deprecated-eof-rule (turn off error)

The case when $ is in the middle of a regexp (like `[a] $ [b]`) are forbidden
and raise an error. The case when $ is at the end but not standalone (like
`[a] $ | [b]`) are forbidden at the moment, as they are not handled properly in
codegen, but they will be allowed later. For now, only the old-style standalone
rule `$` is handled properly.

This is the first part of the work needed for issue
https://github.com/skvadrik/re2c/issues/525.
2025-06-29 06:45:13 +01:00
Ulya Trofimovich e89281382f Store rules (not rule locations) in the shadow set.
This will be used later to check if a shadowing rule is an end-of-input rule.
2025-06-29 06:45:13 +01:00
Ulya Trofimovich 83b1f8769a Fix analysis that determines if default state is needed with re2c:eof.
Use fallthrough states, not fallback states.

The added test used to SIGSEGV before the change.
2025-06-29 06:45:13 +01:00
Ulya Trofimovich 325c102712 Use correct union member.
The code happened to work correctly because the two union members had
identical layout.
2025-06-29 06:45:13 +01:00
Ulya Trofimovich f15465cd60 Do not emit -Wunreachable-rules for <*> if a rule is alive in some conditions. 2025-06-29 06:45:13 +01:00
Ulya Trofimovich 9cfdb736c6 Fix incorrect comment in the test and add another test case.
The comment was initially consistent with the generated code, but it got
inconsistent after commit 277f0295fc which
fixed code generation.
2025-06-29 06:45:13 +01:00
Ulya Trofimovich 9601d30173 Don't forget to add fallback tags with end-of-input rule $.
If end-of-input rule `$` is used, re2c takes a different approach and
uses a different set of subroutines to find unreachable rules.
Previously these lacked "fallthough" analysis that is normally performed
without the `$` rule. As a result, some code was generated incorrectly
(as can be seen on the updated tests and the newly added test).
2025-06-29 06:45:13 +01:00
Peter Kokot ffefa3914d CMake: Add CheckPIESupported
The CMAKE_POSITION_INDEPENDENT_CODE variable enables PIC when building
objects, and the CheckPIESupported module provides a
check_pie_supported() command, which enables position independent code
for executables (PIE) at the link step. Without this module, for
example, building at the link step in some cases might fail. For
example, on Haiku.
2025-06-26 06:31:33 +01:00
Ulya Trofimovich d528489324 Unify clos_t with conf_t from libre2c.
After a recent rework of `clos_t` it has become identical to `conf_t`, so
there's no need for using a different type in libre2c.
2025-05-16 22:41:09 +01:00
Ulya Trofimovich 862eee4570 Speed up core determinization algorithm by another ~42%.
Avoid popping/pushing on-stack closure items and patch them in place if
possible. Note that using `emplace` instead of `push_back` method on
`std::vector` instead of this change is not nearly as much helpful: it adds
only a ~6% speedup compared to the ~42% speedup caused by this change.

It only affects leftmost greedy closure construction (which is the default).

This addresses bug https://github.com/skvadrik/re2c/discussions/544
"Unicode characters in UTF8 and generation performance".

The 42% speedup was measured on examples/c/unicode_identifier.re modified as
suggested in the comment
https://github.com/skvadrik/re2c/discussions/544#discussioncomment-13011740.
2025-05-16 17:24:49 +01:00
Ulya Trofimovich 3734d5bdd7 Speed up core determinization algorithm by ~10%.
Make closure items smaller - don't store transition tags and tag versions
in them, as they can be retrieved from the origin kernel using origin TNFA
state for each closure item. Making the items smaller reduces the amount
of copying during closure construction.

Also, avoid extra copy between the main and auxiliary closure vectors;
construct the new TDFA state kernel right from the main vector. This required
a lot of changes in the code, as the kernel stores information as a struct of
arrays (this allows fast comparison and hashing of only the relevant parts of
the kernel), while the closure is an array of structs (this is more convenient
for closure construction and sorting).

Also, make the conditional in the kenel hashing function compile-time rather
than run-time.

There are no algorithmic changes; only the way information is organized and
propagated.

This addresses bug https://github.com/skvadrik/re2c/discussions/544
"Unicode characters in UTF8 and generation performance".

The 10% speedup was measured on examples/c/unicode_identifier.re modified as
suggested in the comment
https://github.com/skvadrik/re2c/discussions/544#discussioncomment-13011740.
2025-05-16 17:19:24 +01:00
Ulya Trofimovich e461e348b1 Disable Swift in builds configs that are used for bootstrap and need only C. 2025-04-23 22:32:06 +01:00
Ulya Trofimovich 7bc7c1980a Release 4.2. 2025-04-23 11:26:04 +01:00
Ulya Trofimovich d5484f0443 Update changelog for release 4.2. 2025-04-23 11:16:07 +01:00
Ulya Trofimovich 74be826d3a Update docs: add code:type_yyctable description. 2025-04-23 11:11:07 +01:00
Ulya Trofimovich 49c1417d12 Make build directory name explicit in the instructions.
This is to avoid confusion as in
https://github.com/skvadrik/re2c/issues/541#issuecomment-2816606364
2025-04-21 06:46:12 +01:00
Ulya Trofimovich 17905e7bf5 GitHub Actions: update Java version 11 -> 24. 2025-04-21 06:46:12 +01:00
Ulya Trofimovich 4c7c00c9d2 Update docs: add description of YYFN throw specs in syntax files.
Also, fix a small formatting issue from the previous commit.
2025-04-18 16:04:54 +01:00
Ulya Trofimovich cf8788cc18 Rework syntax file templates for computed goto (again).
Replace `code:cgoto_target` (which was the target expression in the computed
`goto` statement) with `code:cgoto` (which is the full statement).

Rename `code:cgoto_init` to `code:cgoto_data`.

Add `code:yytarget_filter` (similar to existing `code:yybm_filter`).
2025-04-17 06:38:07 +01:00
Ulya Trofimovich 9ab6a13cb3 Update docs for computed goto options / configurations. 2025-04-14 16:23:58 +01:00
Ulya Trofimovich a37a530555 Fix -Wreorder warning. 2025-04-14 16:23:36 +01:00
Ulya Trofimovich 420a976fdb Fix stack-use-after-scope error found by AddressSanitizer.
Local varaible of type `const char*` was passed as `const std::string&`
constructor parameter (so a temporary `std::string` had to be created)
and stored in a class. Fixed by storing the `const char*` pointer directly.
2025-04-13 16:45:10 +01:00
Ulya Trofimovich 52fa88db7b Rework syntax file templates for computed goto.
Previously we had `code:yytarget_goto`, `code:yyctable_goto` for computed
`goto` target expression, and  `code:yytarget_elem`, `code:yyctable_elem`
for table initializers. The defintions for `yytarget` and `yyctable` were
almost identical, and the decision to keep them separate was taken only
so that each set of code templates could specify a different underlying
type for table elements. It was impossible to pass the type using
`code:type_yyctarget`, `code:type_yyctable` because these configurations
included type qualifiers like `static const`.

For the full discussion see this thread:
https://github.com/skvadrik/re2c/pull/537#issuecomment-2693462138

Now that we've got rid of type qualifiers in commit
a94d39b112, it has become possible to merge
code templates for `yytarget` and `yyctable` and avoid the duplication.
2025-04-12 22:52:25 +01:00
Ulya Trofimovich 9498443133 Update docs for syntax file conditional .const. 2025-04-09 17:10:53 +01:00
Ulya Trofimovich a94d39b112 Add syntax file conditional .const to array definitions.
Code templates `code:array_local` and `code:array_global` can now use local
conditional `.const`, which is true if the array is immutable.

This also has the side-effect that type qualifiers such as `static const` in
C/C++ have been removed from type definitions `code:type_yybm`,
`code:type_yytarget` and `code:type_yyctable` (where they did not belong in
the first place).

Also, rename `yybm` to `YYBM` in Rust by default (this is an inner variable,
so changing default definition should not break backwards compatibility).

Rust and Java have been affected by this change, as their bitmap definitions
have been constified (which is reflected by the updated tests). Other language
backends either have used constant bitmaps already, or they don't have a notion
of immutable arrays.
2025-04-09 17:09:04 +01:00
Ulya Trofimovich a66644dad3 Docs: add configuration description for relative computed goto.
Configurations `re2c:computed-gotos:relative`, `re2c:cgoto:relative`.
2025-04-06 16:43:06 +01:00
Ulya Trofimovich 1b24830363 Add re2c:yyfn:throw to the all-config test, update docs.
While at it, fix description of `re2c:yyfn:sep` in the docs.

Regenerate bootstrap manpages and help (incorporates some earlier updates
for Java manpage that were omitted by mistake in commit
47afb07f90 that updated manpages for other
languages).
2025-04-06 16:27:59 +01:00
Ulya Trofimovich cac9f0e75e Swift: make examples compile with Swift 5.8.
Temporarily drop `@retroactive` attribute that was added in Swift 6.
2025-04-05 06:58:11 +01:00
Ulya Trofimovich 58b687e527 Zig: support yyfn:throw configuration.
This is useful for --recursive-functions code model, as it's necessary to use
different syntax for function calls with an additional `try` keyword before the
call expression (which would be impossible to do before this change).

The test/codegen/zig/recursive_functions/basic.re test has been updated to
demonstrate the new functionality.
2025-03-24 16:56:39 +00:00
Ulya Trofimovich 7f624d2a42 Clean up some minor formatting issues in Swift syntax file. 2025-03-24 16:30:14 +00:00
a dinosaur ac37222644 swift: Support yyfn:throw
Adds support for yyfn:throw to the Swift syntax, allowing the user to throw
types that conform to the Error protocol within functions generated by the
recursive-functions code model. Non-empty settings of the `re2c:yyfn:throw`
property are appended to generated function definitions between parameters
and the return type, and generated function calls are prefixed with "try ".

The 'test/codegen/swift/recursive_functions/advanced.re' test has been updated
to test the new functionality as well as demonstrate practical use of throwing
functions in the recursive-functions model for handling runtime errors.
2025-03-23 21:36:12 +00:00
Ulya Trofimovich 73636c66c5 Add configuration re2c:yyfn:throw.
Also, add syntax variable `throw` and conditional `.yyfn.throw` to be used by
code templates for function definitions and function calls.
2025-03-22 23:05:12 +00:00
Ulya Trofimovich e536d7129f Revert "Add syntax variable attrs for code:fndecl and code:fndef configurations."
This reverts commit 85d9384b2f.

Reason for revert: the main motivation for this change was to support Swift
`throw` annotations. However, it turns out that attributes are unfit for the
purpose, since functions that throw also require slightly different call
expressions (they need to be prefixed with `try`). Although attributes may be
useful, let's remove them until we find a real-world use case.

For details, see the full conversation:
https://github.com/skvadrik/re2c/pull/538#discussion_r2008079095
2025-03-22 16:41:03 +00:00
Ulya Trofimovich 85d9384b2f Add syntax variable attrs for code:fndecl and code:fndef configurations.
Use it for C/C++ fuction attributes as an example.

The main motivation for doing this was discussed in
https://github.com/skvadrik/re2c/pull/538#discussion_r2005503221.
2025-03-21 17:10:05 +00:00
a dinosaur f60219b6e1 Add support for Swift 2025-03-20 22:32:00 +01:00
a dinosaur 47afb07f90 Regenerate bootstrap from master 2025-03-20 22:32:00 +01:00
Ulya Trofimovich 8f9c628201 Benchmarks(C/C++): use the same benchmark names as filename infixes.
run.py depends on it when it generates .json report, as it uses filenames for
binary size measurements and symbolic names for CPU time measurements.
2025-03-18 16:50:44 +00:00
Tai Chi Minh Ralph Eastwood 2cf658310c Add code:yytarget_elem, code:yytarget_goto to syntax files.
code:yytarget_elem specifies the how the table elements for computed
goto tables are generated.  If cgoto:relative = 1, then the table
entries contain an offset from a calculated base address.
code:yytarget_goto specifies the computed goto tables are generated.

code:yyctable_elem and code:yyctable_goto are used for the
corresponding computed gotos for conditions.

Bootstrap code has been regenerated.
2025-03-15 23:00:09 +00:00
Ulya Trofimovich feb94108f3 Benchmarks(C/C++): add a few benchmarks without submatch. 2025-03-02 16:25:13 +00:00
Tai Chi Minh Ralph Eastwood afabf6e416 Generalize the computed-gotos code generation for C/C++ backend
Previously the code-generation did similar table generation across
the normal states, accept states and condtional variables.
This refactor introduces some utility functions that provides the same
logic across the different tables.
2025-02-27 06:32:55 +00:00
Tai Chi Minh Ralph Eastwood f505631d46 Regenerate bootstrap for relative computed gotos. 2025-02-25 19:48:55 +00:00
Tai Chi Minh Ralph Eastwood 25fe63beb6 Update the docs about cgoto:relative and --computed-gotos-relative 2025-02-25 19:48:55 +00:00
Tai Chi Minh Ralph Eastwood 1f60bcf49f Add cgoto:relative to enable generating relative offset tables
Instead of using absolute pointers are used in the cgoto tables,
we generate relative offsets from the earliest label offset
within the code.  This offset type is hardcoded as `int' currently.
2025-02-25 19:48:55 +00:00
Ulya Trofimovich 8baaca5774 Release 4.1. 2025-02-16 16:49:48 +00:00
Ulya Trofimovich bdf3e8958a Update Zig examples for newer compiler version. 2025-02-16 16:41:00 +00:00
Ulya Trofimovich ee033adfb6 Update CHANGELOG for release 4.1 (plus a small fix in the manual). 2025-02-15 22:35:14 +00:00
Ulya Trofimovich d3db8a17a5 Update docs (add description of actions). 2025-02-15 10:19:36 +00:00
Ulya Trofimovich 28cb6b8572 Benchmarks(C/C++): use pkg-config in CMake to link with google benchmark. 2025-02-10 08:29:01 +00:00
Ulya Trofimovich 5d4b79275b Benchmarks(C/C++): fix linkage with google benchmark. 2025-02-07 22:20:32 +00:00
Ulya Trofimovich bbf1cb2604 Benchmakrs(C/C++): fix CMake build system.
This was necessary following the rewrite using google-benchmark.
2025-02-05 22:36:56 +00:00
Ulya Trofimovich 6b67aac3e9 Benchmarks(C/C++): update benchmark results. 2025-02-05 22:36:56 +00:00
Ulya Trofimovich cca3ca4151 Benchmarks(C/C++): don't use bit vectors for re2c.
This is because bit vectors are not suppotred with.end of input rule $,
to make the comparison fair between re2c variants.
2025-02-05 22:36:56 +00:00
Ulya Trofimovich de8bf67c32 Benchmarks(C/C++): add simple variants without buffer refill. 2025-02-05 22:36:56 +00:00
Ulya Trofimovich ca18e43710 Benchmarks (C/C++): rewrite using google-benchmark.
This way we can have more reliable measurements for the future benchmarks that
read input from a string rather than a file, and so run much faster and are
more affected by measurement errors.
2025-02-05 22:36:56 +00:00
Ulya Trofimovich 17d7d8c618 Benchmarks (C/C++): remove Kleenex benchmarks.
They are interesting from the academic standoint (to compare DSST vs. TDFA),
but Kleenex is not flexible enough: it assumes fixed program template. The
generated code cannot be adapted to google-benchmark, which it important to
get precise time measurements.

Kleenex benchmarks results are available in the paper by Borsotti and
Trafimovich "A Closer Look at TDFA" (https://arxiv.org/abs/2206.01398).
2025-02-05 22:36:56 +00:00
Ulya Trofimovich ec64527e36 Benchmarks (C/C++): limit Kleenex benchmarks to submatch-only. 2025-02-05 22:36:56 +00:00
Ulya Trofimovich 7e25fb759f Benchmarks (C/C++): remove deprecated TDFA(0) and StaDFA algorithms.
For anyone interested, see the paper by Borsotti and Trafimovich
"A Closer Look at TDFA" (https://arxiv.org/abs/2206.01398). It has benchmark
results that cover the removed algorithms.
2025-02-05 22:36:56 +00:00
Ulya Trofimovich ba31855356 Zig backend: use const for yych declaration in rec/func mode.
Previously re2zig generated `var`, but `yych` is not modified in this mode and
newer Zig versions fail with `error: local variable is never mutated`.
2025-02-05 16:13:48 +00:00
Ulya Trofimovich 6c0d89a238 Allow escaped double quote in the generic lexer rules for char literals.
Some languages have special escape `\"` in character literals, so re2c should
recognize it as well.

This addresses bug #529 "[Rust] Escaped double-quotes in character literal
results in EOF error".
2025-02-04 22:48:10 +00:00
Gregg Reynolds 705a029b8f delete bazel lock file 2025-02-03 09:23:33 +00:00
Gregg Reynolds 7c5eac5982 support WORKSPACE; use lastest skylib
* tested with Bazel 8.0.1 and 7.0.0 on linux and macos
2025-02-03 09:23:33 +00:00
Gregg Reynolds f2e6668e9a migrate to Bazel 8 using bzlmod 2025-02-03 09:23:33 +00:00
Ulya Trofimovich 0e97d4917b Add !pre_rule and !post_rule actions. Add tests for actions.
!pre_rule action is emitted immediately *before* any semantic action in the
current block / condition (it can be useful to have some common initialization
code). !post_rule action is the same, except that it is emitted *after* every
semantic action (it can be useful e.g. to emit unreachability checks).

This addresses bug #521 "Add special entry/exit rules".
2025-01-24 16:28:13 +00:00
Ulya Trofimovich 5a9be34734 BUILD.md: add a list of prebuilt packages on Repology.
This addresses bug #526 "[doc]: Add other install methods on official webpage".
2025-01-21 17:01:11 +00:00
Ulya Trofimovich 71517f1bf9 Change syntax for the entry action: use !entry instead of ^.
This way it is possible to add new named special actions without having
to worry about exhausting all special symbols. Also, if we add mid-rule
actions in the future, this syntax can be used for them as well.
2025-01-20 22:37:58 +00:00
Ulya Trofimovich 787a7a306a Rename "initial" state to "start" state.
Rename `initial_state` to `start_state` and `initial_label` to
`custom_start_label` (so that it's clear that it is a special case).
Update comments.
2025-01-19 16:10:45 +00:00
Ulya Trofimovich e2a2eca01b Rename class field for clarity. 2025-01-18 16:10:12 +00:00
Ulya Trofimovich 596c3d9484 Clean up code that sets default state.
Remove incorrect assignment of default state to default rule state; it was
overwritten later, so it had no effect at all. Rule state should be kept
separate, as default state may be used for different things (e.g. it may be
used as the accept state that has `yyaccept` dispatch).

No changes in the generated code.
2025-01-18 10:35:23 +00:00
Ulya Trofimovich a65419d89a Simplify handling of state actions. Set initial state for all code models.
Previously initial state was marked using special initial action, which was set
only in rec/func mode. Now we explicitly store a pointer to initial state and
set it for all code models.
2025-01-18 07:03:31 +00:00
Ulya Trofimovich f52b642f8e Swap YYBACKUP and YYFILL in the initial state to unify it with other states.
The order of these operations doesn't matter, provided that YYFILL is correct.
2025-01-16 21:43:06 +00:00
Ulya Trofimovich b8406137d6 Tweak precondition for marking used labels with end-of-input rule $.
It's unclear where the previous condition came from; the intention seems to be
to exclude final states that have no outgoing transitions on symbols. With the
end-of-input rule `$` even if all characters fall into the same range as in
`[^]`, a separate range is split for the sentinel symbol, so the previous
condition could not capture any match states.
2025-01-15 16:04:10 +00:00
Ulya Trofimovich 4fedb068c1 When using end-of-input rule $, mark targets of rematch transitions as used.
This is only needed in loop/switch and rec/func modes, as goto/label mode uses
special YYFILL labels, not the state labels. And most of the states were already
marked as used due to other transitions going into them. So the bug was not
revealed until the recent addition of the entry rule.

This addresses bug #521 "Add special entry/exit rules".
2025-01-15 10:54:40 +00:00
Ulya Trofimovich c1537de331 Check that tags on all transitions going to bitmap state are the same.
Previously we only checked that tags are parwise equal between two mapped
transitions, not between all transitions going to the bitmap state. This was a
regression caused by optimization 98f2a41393.

This fixes #523 "Possible regression with bit-vector optimizations between 3.x
and 4.x".
2025-01-14 17:00:39 +00:00
Ulya Trofimovich f3dc6fe0e9 Don't pass invalid location to error reporting function.
When all rules were inherited from other blocks, re2c failed to find correct
rule location and passed an invalid location, which caused a SIGSEGV in the
error reporting function.

This fixes bug #522 "Segfault when !use is present in a block with conditions".
2025-01-14 10:07:32 +00:00
Ulya Trofimovich 19d771fd3d Don't lose jump to the initial state when the entry rule is used.
In goto/label mode, if there is a loop via initial state, YYSKIP must be
bypassed when entering the DFA (visiting initial state for the first time).
Other modes generate YYSKIP on transitions, so they were not affected.

The bug was found by skeleton tests.

This addresses bug #521 "Add special entry/exit rules".
2025-01-12 23:05:07 +00:00
Ulya Trofimovich 4afd9776dc Add entry rule ^ that allows one to execute code at lexer entry.
Also, rename "setup" to "exit action" to match the added "entry action"
(and also because it makes more sense).

This addresses bug #521 "Add special entry/exit rules".

Drop some not very useful debug checks.
2025-01-12 16:40:00 +00:00
Ulya Trofimovich 41411f5c8a Don't write null for missing YYFN type, as it makes output truncated. 2025-01-12 16:39:48 +00:00
Ulya Trofimovich 543aaab356 A few clean-ups.
- remove obsolete `if` branch
- make assertins more precise
- factor out codegen function for semantic actions
- rename variables
2025-01-10 22:07:21 +00:00
Ulya Trofimovich 814a544eff Don't use YYGETCOND() for yystate initialization in non-conditional blocks. 2025-01-10 15:55:27 +00:00
Ulya Trofimovich 5fa1dbd576 Clean up code that handles zero condition <>. 2024-12-30 10:10:46 +00:00
Ulya Trofimovich 90bd3158e1 Don't fail when zero condition <> has no end-of-inpt rule $.
Previously re2c failed with an error in the case when end-of-input rule `$` was
enabled and the special zero condition `<>` was used. Now it no longer fails and
generates code withot end-of-input check for the zero condition (which is
handled in a special way by the code, bypassing some of the transformations that
rely on the presence of end-of-input rule).
2024-12-28 10:25:49 +00:00
Ulya Trofimovich 2b80343e4d Don't try to generate names for fictive tags.
With captvars (either leftmost or POSIX ones) we need to generate names for the
variables that correspond to capturing parentheses. The difference between
leftmost and POSIX cases is that POSIX disambiguation algorithm is more complex
and it requres additional imlicit tags inserted in the regular expression.
These so-called "fictive" tags don't have valid submatch group indices, so
trying to use them caused integer overflow and a very long loop.

This is a fix for issue #519 "re2c hangs if posix-captvars is used".
2024-12-27 16:15:32 +00:00
Ulya Trofimovich 972d7874e2 Add a test for condition with the end-of-input rule $.
Currently re2c fails with error, as the special zero condition `<>` has no
end-of-inpt rule `$`.
2024-12-27 11:09:48 +00:00
Ulya Trofimovich 83b135699f Allow using lookahead operator with captures.
This is a fix for #518.
2024-12-27 10:18:00 +00:00
Ulya Trofimovich 2ecbbce7d9 Fix error message for the case when standalone tags are mixed with captures.
We now have many options for captures, so we cannot assume that the
--posix-captures option is the one causing conflicts.

This partially addresses issue #518.
2024-12-27 09:54:16 +00:00
Ulya Trofimovich e2d249f839 OCaml: use unsafe_get instead of get as the default YYPEEK implementation.
The generated code already handles the end of input, so it should use
`unsafe_get` to avoid redundant bounds checks. If the user wants to use `get`,
they can always do so by overriding YYPEEK.

Update all examples and remove '\x00' character at the end of string literals,
as they are already NULL-terminated.
2024-12-25 16:42:26 +00:00
Ulya Trofimovich 54d0eaa4b5 Generate correct escape sequences for each language.
Previously C escape sequences were used for all languages, which resulted in
incorrect escapes generated for some languages, e.g. `\f` in OCaml is not a
valid escape, while in C it is.

This commit adds syntax configuration `special_escapes` to all syntax files.
Its value is a string of all special characters that require escaping.

This is a fix for #516 "re2ocaml can generate invalid escape sequences".
2024-12-24 16:56:15 +00:00
Ulya Trofimovich cf302ed2bd Add a test for raw newlines in syntax files. 2024-12-23 16:40:16 +00:00
Ulya Trofimovich 32e11d9904 Do not consider space characters printable.
0x20 (space ' ') is printable, but others like '\f' are not. And 0x20 is already
covered by the `is_print` part of the check.

This patch does not change existing behavior, as the code handled all
non-printable space characters as escape sequences before the check, so they
were printed correctly.
2024-12-22 16:42:11 +00:00
Ulya Trofimovich 2fc1f0b0bc Release 4.0.2. 2024-12-11 15:56:41 +00:00
Ulya Trofimovich 4d5f6d6722 Restructure benchmark layout (prepare to add new benchmarks).
Update pre-generated benchmark files (trivial line directive changes).

Disable regeneration of Kleenex files, as Kleenex is not actively maintained and
fails to build with the recent cabal and Haskell ecosystem.
2024-12-11 07:38:40 +00:00
Ulya Trofimovich bec027b7ae build/__distcheck.sh: add missing -j $(nproc) to some build commands. 2024-12-11 07:21:27 +00:00
Ulya Trofimovich a780025238 Update changelog. 2024-12-11 07:20:14 +00:00
Ulya Trofimovich 05298b1210 Makefile.am: don't forget to clean up autogenerated syntax files. 2024-12-10 22:01:45 +00:00
Ulya Trofimovich 70409e3966 Makefile.am: remove non-syntax headers from BUILT_SOURCES.
Only syntax headers have rules that autogenerate them.
2024-12-10 18:12:00 +00:00
Ulya Trofimovich c65b9766ac Update changelog for 4.0.2. 2024-12-10 18:01:01 +00:00
Ulya Trofimovich 6aa98843c7 Automake.am: use headers instead of source files for default syntax configs.
This is a follow-up on the change needed to fix CMake (bug #511).
2024-12-10 18:00:41 +00:00
Ulya Trofimovich 0b7be55aec CMake: pick correct default syntax config for language specific binaries.
2nd attempt to fix issue #515 "version 4.0.1 re2rust default generate C code".
This time, instead of trying to split the object library, the code that needs
the split has been moved out of the problematic library.

Also there are some small improvements in the way default syntax strings are
declared (added `static constexpr`) and linked (moved them to header files).
Generation script has been fixed to generate correct string names.
2024-12-10 18:00:34 +00:00
Ulya Trofimovich 436a6cbeaa Revert "CMake: split object library by language, pass correct options to each."
This reverts commit 9cfb87edaf.

Reason for revert: it's no good trying to build multiple object libraries for
different languages in parallel, as they all try to copy files to the same
bootstrap directory, causing conflicts and build errors. Avoiding such conflicts
was the reason the object library got added in the first place (so that
autogenerated sources could be built once before all other sources).
2024-12-10 16:49:50 +00:00
Ulya Trofimovich 9cfb87edaf CMake: split object library by language, pass correct options to each.
Previously target compile definitions weren't properly added to the
autogenerated sources, as they were built into a separate object library
(to ensure that they are built before the rest of the sources). Now the
object library is built separately for each language with proper options.

This addresses issue #515 "version 4.0.1 re2rust default generate C code".
2024-12-10 16:18:28 +00:00
Ulya Trofimovich 170ffa39b8 Restructured benchmark layout (preparing to add new benchmarks). 2024-12-03 17:21:47 +00:00
Ulya Trofimovich e5cb9a1ebd Release 4.0.1. 2024-11-25 07:20:45 +00:00
Ulya Trofimovich 1357b3c3d9 Update CHANGELOG for release 4.0.1. 2024-11-25 06:56:34 +00:00
Ulya Trofimovich 61c88fbf5a Rebuild syntax files when checking the distribution. 2024-11-24 16:30:29 +00:00
PolarGoose 162b9c5a8b Increase the Cmake minimum version to allow using CMAKE_MSVC_RUNTIME_LIBRARY flag 2024-11-24 06:42:14 +00:00
Ulya Trofimovich 5eb464f8e8 Docs: update contributors list. 2024-11-23 17:21:04 +00:00
Ulya Trofimovich e1148b4a7b Makefile.am: add dependency on RST sources and custom build scripts.
The added rule has no command part, so it does not conflict with existing
suffix rules that build docs.
2024-11-23 17:19:17 +00:00
Ulya Trofimovich 3a40b3d4bb Make most of the C/C++ examples truly C compatible.
Some of the examples use C++ data structures like `std::ifstream`, `std::vector`
etc. Leave them as is for now.

Update docs.

This addresses bug #484 "Example is not C".
2024-11-23 11:39:57 +00:00
Ulya Trofimovich a75eb2b3fd Avoid C++ templates in some examples to make them work in C.
This addresses bug #484 "Example is not C".
2024-11-22 16:17:54 +00:00
Ulya Trofimovich 5cea17c8fe Avoid new features added in 4.0 in C/C++ examples.
Keep examples compatible with older re2c versions until most of the world has
updated to re2c-4.0 or later. When it happens, this commit should be reverted.
2024-11-22 07:17:01 +00:00
Ulya Trofimovich b4dc9f69b1 Regenerate docs with typo fixes.
This picks up typo fixes in commit 92c3ae5a99.
2024-11-22 07:16:35 +00:00
jcfp 92c3ae5a99 fix typos 2024-11-21 17:22:38 +00:00
Ulya Trofimovich a1c42047da Makefile.am: add some missing doc sources to distribution tarball.
This fixes bug #503 "[4.0] build failure with --enable-docs".
2024-11-21 17:14:00 +00:00
2304 changed files with 927049 additions and 1409165 deletions
+15 -12
View File
@@ -33,18 +33,20 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@v7
with:
python-version: '3.8'
- name: Setup Java
uses: actions/setup-java@v4
uses: actions/setup-java@v6
with:
distribution: 'adopt'
java-version: '11'
# One of the distributions that packages OpenJDK, see
# https://github.com/marketplace/actions/setup-java-jdk#supported-distributions
distribution: 'oracle-openjdk'
java-version: '26'
- name: Setup Common Prerequisites
run: |
@@ -79,6 +81,7 @@ jobs:
-DRE2C_BUILD_RE2OCAML=OFF \
-DRE2C_BUILD_RE2PY=OFF \
-DRE2C_BUILD_RE2RUST=OFF \
-DRE2C_BUILD_RE2SWIFT=OFF \
-DRE2C_BUILD_RE2V=OFF \
-DRE2C_BUILD_RE2ZIG=OFF \
-DRE2C_BUILD_BENCHMARKS=ON \
@@ -88,20 +91,20 @@ jobs:
run: cmake --build .build
- name: Run submatch DFA AOT benchmark
working-directory: .build/benchmarks/submatch_dfa_aot
working-directory: .build/benchmarks/c
run: |
./run.py --quickverify \
&& ./run.py --repetitions 5 --output results.json \
./run.py --verify \
&& ./run.py --output results.json \
&& cat results.json
- name: Run submatch DFA JIT benchmark
working-directory: .build/benchmarks/submatch_dfa_jit
run: ./bench_submatch_dfa_jit
working-directory: .build/benchmarks/c/libre2c/jit
run: ./bench_submatch_jit
- name: Run submatch Java benchmark (ReTdfa)
working-directory: .build/benchmarks/submatch_java
working-directory: .build/benchmarks/c/libre2c/java
run: ./run.py
- name: Run submatch NFA benchmark
working-directory: .build/benchmarks/submatch_nfa
working-directory: .build/benchmarks/c/libre2c/nfa
run: ./bench_submatch_nfa
+13 -4
View File
@@ -36,11 +36,11 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Setup apt cache (Linux)
if: startsWith(runner.os, 'Linux')
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: /var/cache/apt
key: ${{ runner.os }}-apt-cache-${{ matrix.os }}-${{ github.sha }}
@@ -69,7 +69,7 @@ jobs:
esac
- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@v7
with:
python-version: 3.x
architecture: x64
@@ -85,8 +85,17 @@ jobs:
- name: Fast Configure
run: |
./configure \
--disable-dlang \
--disable-golang \
--disable-haskell \
--disable-java \
--disable-js \
--disable-ocaml \
--disable-python \
--disable-rust \
--disable-swift \
--disable-vlang \
--disable-zig \
--prefix=$PWD/install
- name: Fast Build
@@ -146,7 +155,7 @@ jobs:
- name: Archive test artifacts
# Run this step only if tests failed (otherwise there is nothing to upload).
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
# To ensure that jobs don't overwrite existing artifacts,
# use a different name per job.
+5 -5
View File
@@ -62,11 +62,11 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Setup chocolatey Cache (Windows)
if: startsWith(runner.os, 'Windows')
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
key: ${{ runner.os }}-chocolatey-${{ matrix.os }}-${{ github.sha }}
@@ -76,7 +76,7 @@ jobs:
- name: Setup apt cache (Linux)
if: startsWith(runner.os, 'Linux')
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: /var/cache/apt
key: ${{ runner.os }}-apt-cache-${{ matrix.os }}-${{ github.sha }}
@@ -105,7 +105,7 @@ jobs:
esac
- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@v7
with:
python-version: 3.x
architecture: x64
@@ -165,7 +165,7 @@ jobs:
- name: Archive test artifacts
# Run this step only if tests failed (otherwise there is nothing to upload).
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
# To ensure that jobs don't overwrite existing artifacts,
# use a different name per job.
+2 -2
View File
@@ -1,3 +1,3 @@
[submodule "benchmarks/submatch_java/REgen"]
path = benchmarks/submatch_java/REgen
[submodule "benchmarks/c/libre2c/java/REgen"]
path = benchmarks/c/libre2c/java/REgen
url = https://github.com/skvadrik/REgen.git
+2 -1
View File
@@ -1,4 +1,5 @@
package(default_visibility = ["//visibility:private"])
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
genrule(
name = "re2c_config",
@@ -31,7 +32,7 @@ cc_library(
srcs = glob([
"bootstrap/src/**/*.cc",
"src/**/*.cc",
]),
], exclude = ["src/test/**/*.cc"]),
deps = [
"re2c_config_cc", # Needed for 're2c_config_cc' data files
],
+26 -4
View File
@@ -1,5 +1,10 @@
How to build
============
Build & install
===============
If you want to install re2c from a prebuilt package, skip to the bottom of the
page for a list of all packages available on different systems. Below is a guide
how to build re2c from source code.
Dependencies
@@ -34,7 +39,8 @@ An in-tree build (objects are generated side by side with sources):
```
$ ./configure && make && make install
```
An out-of-tree build (objects are generated in a separate directory):
An out-of-tree build (objects are generated in a separate directory
named `.build`):
```
$ mkdir .build && cd .build && ../configure && make && make install
```
@@ -69,6 +75,9 @@ The configure script has many options (to see them all, run
* `--enable-rust`
Build re2rust (identical to `re2c --lang rust`). This is on by default.
* `--enable-swift`
Build re2swift (identical to `re2c --lang swift`). This is on by default.
* `--enable-vlang`
Build re2v (identical to `re2c --lang v`). This is on by default.
@@ -168,7 +177,8 @@ The following modes are supported:
the code with Undefined Behavior Sanitizer to check for undefined behavior
errors.
A simple build (objects are generated in a separate build directory):
A simple build (objects are generated in a separate build directory named
`.build`):
```
$ mkdir .build && cd .build && cmake .. && cmake --build .
```
@@ -205,6 +215,10 @@ specific to re2c:
Build re2rust executable (an alias to `re2c --lang rust`). Enabled by
default.
* `-DRE2C_BUILD_RE2SWIFT=yes`
Build re2swift executable (an alias to `re2c --lang swift`). Enabled by
default.
* `-DRE2C_BUILD_RE2V=yes`
Build re2v executable (an alias to `re2c --lang v`). Enabled by default.
@@ -284,3 +298,11 @@ fuzz-testing Haskell scripts in the *fuzz* subdirectory; they are based on the
QuickCheck library and can be easily modified to fuzz-test various aspects of
re2c by comparing current re2c version against older versions or against other
regular expression libraries.
Packages
--------
[Repology](https://repology.org/project/re2c/versions)
has a list of re2c packages for different systems:
![re2c](https://repology.org/badge/vertical-allrepos/re2c.svg)
+184 -63
View File
@@ -2,9 +2,189 @@ Changelog
=========
----
4.0x
----
4.6 (2026-08-29)
~~~~~~~~~~~~~~~~
- Added support for Zig labeled continue optimization.
(`#580 <https://github.com/skvadrik/re2c/pull/580>`_).
- Updated C/C++ examples to use re2c features available in version 4.0 or higher.
4.5.1 (2026-03-27)
~~~~~~~~~~~~~~~~~~
- Added missing include files to the distribution
(`#573 <https://github.com/skvadrik/re2c/issues/573>`_).
- Updated the documentation to mention the new include files.
4.5 (2026-03-23)
~~~~~~~~~~~~~~~~
- Migrated include files to Unicode 17.0.0 standard.
- Added Unicode include files:
+ `include/unicode_blocks.re <https://github.com/skvadrik/re2c/blob/master/include/unicode_blocks.re>`_
+ `include/unicode_properties.re <https://github.com/skvadrik/re2c/blob/master/include/unicode_properties.re>`_
- Implemented Unicode case mapping for case-insensitive string literals
(`#235 <https://github.com/skvadrik/re2c/issues/235>`_).
- Fixed `#571 <https://github.com/skvadrik/re2c/issues/571>`_
(segmentation fault on erroneous input during determinization).
- Updated paper `A closer look at TDFA <https://arxiv.org/abs/2206.01398>`_
(applied corrections by Lisa Felidae).
4.4 (2025-12-20)
~~~~~~~~~~~~~~~~
- Added generalized end-of-input symbol ``$``
(`#525 <https://github.com/skvadrik/re2c/issues/525>`_).
This change may break old code with conflicitng end-of-input rules,
as they now have position-based precedence. The broken cases were
reported with ``-Wdeprecated-eof-rule`` since version 4.3.
4.3.1 (2025-12-01)
~~~~~~~~~~~~~~~~~~
- Fixed bugs:
+ `#560 <https://github.com/skvadrik/re2c/issues/560>`_
(allow conditions that have no rules except for default rule)
+ `#561 <https://github.com/skvadrik/re2c/issues/561>`_
(use unsigned character type in C/C++ examples)
+ `#564 <https://github.com/skvadrik/re2c/issues/564>`_
(fix broken end of input rule $ with captures)
4.3 (2025-06-30)
~~~~~~~~~~~~~~~~
- Added warning ``-Wdeprecated-eof-rule``, this will be turned to error in the
future (`#525 <https://github.com/skvadrik/re2c/issues/525>`_).
- Improved re2c performance (made determinization faster,
`#544 <https://github.com/skvadrik/re2c/discussions/544>`_).
4.2 (2025-04-23)
~~~~~~~~~~~~~~~~
- Added Swift backend
(`#506 <https://github.com/skvadrik/re2c/issues/506>`_).
- Added options:
+ ``--lang swift``
+ ``--computed-gotos-relative``
- Added configurations:
+ ``re2c:cgoto:relative``, ``re2c:computed-gotos:relative``
+ ``re2c:yyfn:throw``
- Added syntax file code templates:
+ ``code:cgoto``
+ ``code:cgoto_data``
+ ``code:yytarget_filter``
+ ``code:type_yyctable``
- Added syntax file conditionals:
+ ``.cgoto.relative``
+ ``.yyfn.throw``
- Added some C++ benchmarks without submatch extraction.
4.1 (2025-02-16)
~~~~~~~~~~~~~~~~
- Added new syntax for actions
(`#521 <https://github.com/skvadrik/re2c/issues/521>`_).
- Added entry, pre-rule and post-rule actions
(`#521 <https://github.com/skvadrik/re2c/issues/521>`_):
+ ``!entry`` action binds code at the start of the current finite state machine
+ ``!pre_rule`` action prepernds code to semantic actions of all rules in the
current block or condiiton.
+ ``!post_rule`` action appernds code to semantic actions of all rules in the
current block or condiiton.
- Added syntax file option ``special_escapes`` that describes allowed escape
sequences (`#516 <https://github.com/skvadrik/re2c/issues/516>`_).
- Fixed bugs:
+ `#518 <https://github.com/skvadrik/re2c/issues/518>`_
(allow using lookahead operator with captures).
+ `#519 <https://github.com/skvadrik/re2c/issues/519>`_
(integer overflow caused a very long loop when generating tag names).
+ `#522 <https://github.com/skvadrik/re2c/issues/522>`_
(segfault on ``!use`` directive in a block with conditions).
+ `#523 <https://github.com/skvadrik/re2c/issues/523>`_
(regression with bit-vector optimization).
+ `#529 <https://github.com/skvadrik/re2c/issues/529>`_
(failure to recognize escaped double quotes in character literals).
- OCaml backend now uses ``unsafe_get`` instead of ``get`` as the default ``YYPEEK``
implementation.
- Zig backend now uses ``const`` for ``yych`` declaration in
``--recursive-functions`` mode.
- Benchmarks (C/C++):
+ Reimplemented benchmarks using google-benchmark library.
+ Added simple variants without buffer refill.
+ Removed Kleenex benchmarks.
+ Removed deprecated TDFA(0) and StaDFA algorithms.
+ Updated benchmark results.
- Build system:
+ Migrated to Bazel 8 using bzlmod.
4.0.2 (2024-12-11)
~~~~~~~~~~~~~~~~~~
- CMake build system: fixed bug
`#515 <https://github.com/skvadrik/re2c/issues/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.
4.0.1 (2024-11-25)
~~~~~~~~~~~~~~~~~~
- Added missing doc sources to the distribution tarball
(`#503 <https://github.com/skvadrik/re2c/issues/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.
4.0 (2024-11-19)
~~~~~~~~~~~~~~~~
@@ -231,10 +411,6 @@ Changelog
- Infra work on Github Actions CI.
----
3.0x
----
3.1 (2023-07-19)
~~~~~~~~~~~~~~~~
@@ -440,10 +616,6 @@ Changelog
`039c1894 <https://github.com/skvadrik/re2c/commit/039c1894>`_.
----
2.2x
----
2.2 (2021-08-01)
~~~~~~~~~~~~~~~~
@@ -479,9 +651,6 @@ Changelog
- Updated documentation.
----
2.1x
----
2.1.1 (2021-03-27)
~~~~~~~~~~~~~~~~~~
@@ -537,9 +706,6 @@ Changelog
- Updated documentation for end of input handling and submatch extraction.
----
2.0x
----
2.0.3 (2020-08-22)
~~~~~~~~~~~~~~~~~~
@@ -647,9 +813,6 @@ Changelog
- Major revision of the paper "Efficient POSIX submatch extraction on NFA".
----
1.3x
----
1.3 (2019-12-14)
~~~~~~~~~~~~~~~~
@@ -673,9 +836,6 @@ Changelog
(`#258 <https://github.com/skvadrik/re2c/pull/258>`_:
Make the build reproducible).
----
1.2x
----
1.2.1 (2019-08-11)
~~~~~~~~~~~~~~~~~~
@@ -857,9 +1017,6 @@ Changelog
- Updated documentation and website.
----
1.1x
----
1.1.1 (2018-08-30)
~~~~~~~~~~~~~~~~~~
@@ -877,9 +1034,6 @@ Changelog
Bugs with option: ``re2c:flags:no-debug-info``.
- Reworked first part of TDFA paper.
----
1.0x
----
1.0.3 (2017-11-08)
~~~~~~~~~~~~~~~~~~
@@ -1045,10 +1199,6 @@ Changelog
Makefile.am: create target directory before writing into it
-----
0.16x
-----
0.16 (2016-01-21)
~~~~~~~~~~~~~~~~~
@@ -1061,10 +1211,6 @@ Changelog
test failure on big endian archs with 0.15.3
-----
0.15x
-----
0.15.3 (2015-12-02)
~~~~~~~~~~~~~~~~~~~
@@ -1188,10 +1334,6 @@ Changelog
keep a mirror on sourceforge.
-----
0.14x
-----
0.14.3 (2015-05-20)
~~~~~~~~~~~~~~~~~~~
@@ -1225,10 +1367,6 @@ Changelog
Dot output label escaped characters
-----
0.13x
-----
0.13.7.5 (2014-08-22)
~~~~~~~~~~~~~~~~~~~~~
@@ -1339,10 +1477,6 @@ Changelog
- Fixed #1708378 segfault ``in actions.cc``.
-----
0.12x
-----
0.12.3 (2007-08-24)
~~~~~~~~~~~~~~~~~~~
@@ -1394,10 +1528,6 @@ Changelog
+ aCC: HP C/aC++ B3910B A.06.15 [Mar 28 2007] (HP-UX IA64)
-----
0.11x
-----
0.11.3 (2007-04-01)
~~~~~~~~~~~~~~~~~~~
@@ -1424,10 +1554,6 @@ Changelog
- Added ``-u`` switch to support unicode.
-----
0.10x
-----
0.10.8 (2007-04-01)
~~~~~~~~~~~~~~~~~~~
@@ -1558,10 +1684,6 @@ Changelog
- Applied #1307467 Unicode patch for 0.9.7.
----
0.9x
----
0.9.12 (2005-12-28)
~~~~~~~~~~~~~~~~~~~
@@ -1655,9 +1777,8 @@ Changelog
- Removed rcs comments in source files.
-------------------------
re2c adopted (2003-12-09)
-------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~
- Version 0.9.1 README::
+58 -29
View File
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.12)
project(re2c VERSION 4.0 HOMEPAGE_URL "https://re2c.org/")
cmake_minimum_required(VERSION 3.15)
project(re2c VERSION 4.6 HOMEPAGE_URL "https://re2c.org/")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@@ -42,6 +42,7 @@ option(RE2C_BUILD_RE2JS "Build re2js executable (an alias for `re2c --lang js`)"
option(RE2C_BUILD_RE2OCAML "Build re2ocaml executable (an alias for `re2c --lang ocaml`)" ON)
option(RE2C_BUILD_RE2PY "Build re2py executable (an alias for `re2c --lang python`)" ON)
option(RE2C_BUILD_RE2RUST "Build re2rust executable (an alias for `re2c --lang rust`)" ON)
option(RE2C_BUILD_RE2SWIFT "Build re2swift executable (an alias for `re2c --lang swift`)" ON)
option(RE2C_BUILD_RE2V "Build re2v executable (an alias for `re2c --lang v`)" ON)
option(RE2C_BUILD_RE2ZIG "Build re2zig executable (an alias for `re2c --lang zig`)" ON)
@@ -72,7 +73,11 @@ endif()
# Cygwin and NetBSD.
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON) # fail if the C++ compiler does not support this standard
set(CMAKE_POSITION_INDEPENDENT_CODE ON) # make sure object libraries work with shared libraries
# make sure object libraries work with shared libraries
include(CheckPIESupported)
check_pie_supported()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# needed for POSIX file API
ac_check_headers("sys/types.h")
@@ -94,6 +99,7 @@ set(re2c_manpage_js "${CMAKE_CURRENT_BINARY_DIR}/doc/re2js.1")
set(re2c_manpage_ocaml "${CMAKE_CURRENT_BINARY_DIR}/doc/re2ocaml.1")
set(re2c_manpage_python "${CMAKE_CURRENT_BINARY_DIR}/doc/re2py.1")
set(re2c_manpage_rust "${CMAKE_CURRENT_BINARY_DIR}/doc/re2rust.1")
set(re2c_manpage_swift "${CMAKE_CURRENT_BINARY_DIR}/doc/re2swift.1")
set(re2c_manpage_v "${CMAKE_CURRENT_BINARY_DIR}/doc/re2v.1")
set(re2c_manpage_zig "${CMAKE_CURRENT_BINARY_DIR}/doc/re2zig.1")
set(re2c_help_c "${CMAKE_CURRENT_BINARY_DIR}/src/msg/help_re2c.cc")
@@ -105,6 +111,7 @@ set(re2c_help_js "${CMAKE_CURRENT_BINARY_DIR}/src/msg/help_re2js.cc")
set(re2c_help_ocaml "${CMAKE_CURRENT_BINARY_DIR}/src/msg/help_re2ocaml.cc")
set(re2c_help_python "${CMAKE_CURRENT_BINARY_DIR}/src/msg/help_re2py.cc")
set(re2c_help_rust "${CMAKE_CURRENT_BINARY_DIR}/src/msg/help_re2rust.cc")
set(re2c_help_swift "${CMAKE_CURRENT_BINARY_DIR}/src/msg/help_re2swift.cc")
set(re2c_help_v "${CMAKE_CURRENT_BINARY_DIR}/src/msg/help_re2v.cc")
set(re2c_help_zig "${CMAKE_CURRENT_BINARY_DIR}/src/msg/help_re2zig.cc")
set(re2c_rst2man "${CMAKE_CURRENT_SOURCE_DIR}/build/rst2man.py")
@@ -120,6 +127,7 @@ set(re2c_docs
"$<$<BOOL:${RE2C_BUILD_RE2OCAML}>:${re2c_manpage_ocaml}>"
"$<$<BOOL:${RE2C_BUILD_RE2PY}>:${re2c_manpage_python}>"
"$<$<BOOL:${RE2C_BUILD_RE2RUST}>:${re2c_manpage_rust}>"
"$<$<BOOL:${RE2C_BUILD_RE2SWIFT}>:${re2c_manpage_swift}>"
"$<$<BOOL:${RE2C_BUILD_RE2V}>:${re2c_manpage_v}>"
"$<$<BOOL:${RE2C_BUILD_RE2ZIG}>:${re2c_manpage_zig}>"
)
@@ -165,17 +173,18 @@ add_library(re2c_objects_autogen OBJECT
"${CMAKE_CURRENT_BINARY_DIR}/src/parse/conf_lexer.cc"
"${CMAKE_CURRENT_BINARY_DIR}/src/parse/conf_parser.cc"
"${CMAKE_CURRENT_BINARY_DIR}/src/parse/conf_parser.h"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_c.cc"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_d.cc"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_go.cc"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_haskell.cc"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_java.cc"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_js.cc"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_ocaml.cc"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_python.cc"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_rust.cc"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_v.cc"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_zig.cc"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_c.h"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_d.h"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_go.h"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_haskell.h"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_java.h"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_js.h"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_ocaml.h"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_python.h"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_rust.h"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_swift.h"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_v.h"
"${CMAKE_CURRENT_BINARY_DIR}/src/default_syntax_zig.h"
"${re2c_docs}"
)
add_library(re2c_objects_autogen_ver_to_vernum OBJECT
@@ -221,6 +230,7 @@ set(re2c_sources
src/encoding/ebcdic.cc
src/encoding/enc.cc
src/encoding/range_suffix.cc
src/encoding/unicode_casemap.cc
src/encoding/utf8.cc
src/encoding/utf16.cc
src/msg/msg.cc
@@ -253,17 +263,18 @@ re2c_bootstrap_parser("src/parse/parser.ypp" "src/parse/parser.cc" "src/parse/pa
re2c_bootstrap_lexer("src/parse/conf_lexer.re" "src/parse/conf_lexer.cc")
re2c_bootstrap_parser("src/parse/conf_parser.ypp" "src/parse/conf_parser.cc" "src/parse/conf_parser.h")
re2c_bootstrap_syntax("include/syntax/c" "src/default_syntax_c.cc")
re2c_bootstrap_syntax("include/syntax/d" "src/default_syntax_d.cc")
re2c_bootstrap_syntax("include/syntax/go" "src/default_syntax_go.cc")
re2c_bootstrap_syntax("include/syntax/haskell" "src/default_syntax_haskell.cc")
re2c_bootstrap_syntax("include/syntax/java" "src/default_syntax_java.cc")
re2c_bootstrap_syntax("include/syntax/js" "src/default_syntax_js.cc")
re2c_bootstrap_syntax("include/syntax/ocaml" "src/default_syntax_ocaml.cc")
re2c_bootstrap_syntax("include/syntax/python" "src/default_syntax_python.cc")
re2c_bootstrap_syntax("include/syntax/rust" "src/default_syntax_rust.cc")
re2c_bootstrap_syntax("include/syntax/v" "src/default_syntax_v.cc")
re2c_bootstrap_syntax("include/syntax/zig" "src/default_syntax_zig.cc")
re2c_bootstrap_syntax("include/syntax/c" "src/default_syntax_c.h")
re2c_bootstrap_syntax("include/syntax/d" "src/default_syntax_d.h")
re2c_bootstrap_syntax("include/syntax/go" "src/default_syntax_go.h")
re2c_bootstrap_syntax("include/syntax/haskell" "src/default_syntax_haskell.h")
re2c_bootstrap_syntax("include/syntax/java" "src/default_syntax_java.h")
re2c_bootstrap_syntax("include/syntax/js" "src/default_syntax_js.h")
re2c_bootstrap_syntax("include/syntax/ocaml" "src/default_syntax_ocaml.h")
re2c_bootstrap_syntax("include/syntax/python" "src/default_syntax_python.h")
re2c_bootstrap_syntax("include/syntax/rust" "src/default_syntax_rust.h")
re2c_bootstrap_syntax("include/syntax/swift" "src/default_syntax_swift.h")
re2c_bootstrap_syntax("include/syntax/v" "src/default_syntax_v.h")
re2c_bootstrap_syntax("include/syntax/zig" "src/default_syntax_zig.h")
# docs
file(GLOB_RECURSE re2c_docs_sources CONFIGURE_DEPENDS
@@ -366,6 +377,16 @@ if (RE2C_BUILD_RE2RUST)
)
endif()
if (RE2C_BUILD_RE2SWIFT)
re2c_gen_help("${re2c_help_source}" "${re2c_help_swift}")
re2c_gen_manpage("${re2c_manpage_source}" "${re2c_manpage_swift}")
add_executable(re2swift ${re2c_sources} "${re2c_help_swift}")
target_compile_definitions(re2swift PUBLIC
"RE2C_LANG=Lang::SWIFT"
"RE2C_PROG=\"re2swift\""
)
endif()
# re2v
if (RE2C_BUILD_RE2V)
re2c_gen_help("${re2c_help_source}" "${re2c_help_v}")
@@ -425,6 +446,10 @@ if(RE2C_IS_ROOT_PROJECT)
install(TARGETS re2rust RUNTIME DESTINATION bin)
install(FILES "${re2c_manpage_rust}" DESTINATION "share/man/man1")
endif()
if(RE2C_BUILD_RE2SWIFT)
install(TARGETS re2swift RUNTIME DESTINATION bin)
install(FILES "${re2c_manpage_swift}" DESTINATION "share/man/man1")
endif()
if(RE2C_BUILD_RE2V)
install(TARGETS re2v RUNTIME DESTINATION bin)
install(FILES "${re2c_manpage_v}" DESTINATION "share/man/man1")
@@ -443,9 +468,12 @@ if(RE2C_IS_ROOT_PROJECT)
include/syntax/ocaml
include/syntax/python
include/syntax/rust
include/syntax/swift
include/syntax/v
include/syntax/zig
include/unicode_blocks.re
include/unicode_categories.re
include/unicode_properties.re
DESTINATION "${RE2C_STDLIB_DIR}")
# rebuild all re2c sources using newly built re2c
@@ -573,6 +601,7 @@ if (RE2C_BUILD_LIBS)
src/nfa/re_to_nfa.cc
src/encoding/enc.cc
src/encoding/range_suffix.cc
src/encoding/unicode_casemap.cc
src/encoding/ebcdic.cc
src/encoding/utf16.cc
src/encoding/utf8.cc
@@ -633,9 +662,9 @@ if (RE2C_BUILD_LIBS)
endif()
if(RE2C_BUILD_BENCHMARKS)
add_subdirectory(benchmarks/submatch_nfa)
add_subdirectory(benchmarks/submatch_dfa_jit)
add_subdirectory(benchmarks/submatch_java)
add_subdirectory(benchmarks/c/libre2c/nfa)
add_subdirectory(benchmarks/c/libre2c/jit)
add_subdirectory(benchmarks/c/libre2c/java)
endif()
else()
# empty check target
@@ -645,7 +674,7 @@ else()
endif()
if(RE2C_BUILD_BENCHMARKS)
add_subdirectory(benchmarks/submatch_dfa_aot)
add_subdirectory(benchmarks/c)
endif()
if(RE2C_BUILD_TESTS)
+13 -1
View File
@@ -19,6 +19,7 @@
"RE2C_BUILD_RE2OCAML": true,
"RE2C_BUILD_RE2PY": true,
"RE2C_BUILD_RE2RUST": true,
"RE2C_BUILD_RE2SWIFT": true,
"RE2C_BUILD_RE2V": true,
"RE2C_BUILD_RE2ZIG": true,
"RE2C_BUILD_LIBS": true,
@@ -64,6 +65,7 @@
"RE2C_BUILD_RE2OCAML": false,
"RE2C_BUILD_RE2PY": false,
"RE2C_BUILD_RE2RUST": false,
"RE2C_BUILD_RE2SWIFT": false,
"RE2C_BUILD_RE2V": false,
"RE2C_BUILD_RE2ZIG": false
}
@@ -91,6 +93,7 @@
"RE2C_BUILD_RE2OCAML": false,
"RE2C_BUILD_RE2PY": false,
"RE2C_BUILD_RE2RUST": false,
"RE2C_BUILD_RE2SWIFT": false,
"RE2C_BUILD_RE2V": false,
"RE2C_BUILD_RE2ZIG": false
}
@@ -118,6 +121,7 @@
"RE2C_BUILD_RE2OCAML": false,
"RE2C_BUILD_RE2PY": false,
"RE2C_BUILD_RE2RUST": false,
"RE2C_BUILD_RE2SWIFT": false,
"RE2C_BUILD_RE2V": false,
"RE2C_BUILD_RE2ZIG": false
}
@@ -151,6 +155,7 @@
"RE2C_BUILD_RE2OCAML": false,
"RE2C_BUILD_RE2PY": false,
"RE2C_BUILD_RE2RUST": false,
"RE2C_BUILD_RE2SWIFT": false,
"RE2C_BUILD_RE2V": false,
"RE2C_BUILD_RE2ZIG": false
}
@@ -176,6 +181,7 @@
"RE2C_BUILD_RE2OCAML": false,
"RE2C_BUILD_RE2PY": false,
"RE2C_BUILD_RE2RUST": false,
"RE2C_BUILD_RE2SWIFT": false,
"RE2C_BUILD_RE2V": false,
"RE2C_BUILD_RE2ZIG": false
}
@@ -233,6 +239,7 @@
"RE2C_BUILD_RE2OCAML": false,
"RE2C_BUILD_RE2PY": false,
"RE2C_BUILD_RE2RUST": false,
"RE2C_BUILD_RE2SWIFT": false,
"RE2C_BUILD_RE2V": false,
"RE2C_BUILD_RE2ZIG": false
}
@@ -260,6 +267,7 @@
"RE2C_BUILD_RE2OCAML": false,
"RE2C_BUILD_RE2PY": false,
"RE2C_BUILD_RE2RUST": false,
"RE2C_BUILD_RE2SWIFT": false,
"RE2C_BUILD_RE2V": false,
"RE2C_BUILD_RE2ZIG": false
}
@@ -285,6 +293,7 @@
"RE2C_BUILD_RE2OCAML": false,
"RE2C_BUILD_RE2PY": false,
"RE2C_BUILD_RE2RUST": false,
"RE2C_BUILD_RE2SWIFT": false,
"RE2C_BUILD_RE2V": false,
"RE2C_BUILD_RE2ZIG": false
}
@@ -299,7 +308,7 @@
{
"name": "windows-config-base",
"hidden": true,
"generator": "Visual Studio 17 2022",
"generator": "Visual Studio 18 2026",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
@@ -330,6 +339,7 @@
"RE2C_BUILD_RE2OCAML": false,
"RE2C_BUILD_RE2PY": false,
"RE2C_BUILD_RE2RUST": false,
"RE2C_BUILD_RE2SWIFT": false,
"RE2C_BUILD_RE2V": false,
"RE2C_BUILD_RE2ZIG": false
}
@@ -355,6 +365,7 @@
"RE2C_BUILD_RE2OCAML": false,
"RE2C_BUILD_RE2PY": false,
"RE2C_BUILD_RE2RUST": false,
"RE2C_BUILD_RE2SWIFT": false,
"RE2C_BUILD_RE2V": false,
"RE2C_BUILD_RE2ZIG": false
}
@@ -380,6 +391,7 @@
"RE2C_BUILD_RE2OCAML": false,
"RE2C_BUILD_RE2PY": false,
"RE2C_BUILD_RE2RUST": false,
"RE2C_BUILD_RE2SWIFT": false,
"RE2C_BUILD_RE2V": false,
"RE2C_BUILD_RE2ZIG": false
}
+9
View File
@@ -0,0 +1,9 @@
module(
name = "re2c",
version = "4.0.2",
compatibility_level = 4,
bazel_compatibility = [">=7.0.0"]
)
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_cc", version = "0.0.17")
+87 -30
View File
@@ -104,6 +104,7 @@ re2c_SRC = \
src/encoding/ebcdic.cc \
src/encoding/enc.cc \
src/encoding/range_suffix.cc \
src/encoding/unicode_casemap.cc \
src/encoding/utf8.cc \
src/encoding/utf16.cc \
src/msg/msg.cc \
@@ -131,17 +132,6 @@ re2c_SOURCES = \
# autogenerated sources
re2c_GEN_SRC = \
src/default_syntax_c.cc \
src/default_syntax_d.cc \
src/default_syntax_go.cc \
src/default_syntax_haskell.cc \
src/default_syntax_java.cc \
src/default_syntax_js.cc \
src/default_syntax_ocaml.cc \
src/default_syntax_python.cc \
src/default_syntax_rust.cc \
src/default_syntax_v.cc \
src/default_syntax_zig.cc \
src/msg/ver_to_vernum.cc \
src/options/parse_opts.cc \
src/parse/lexer.cc \
@@ -152,15 +142,29 @@ re2c_GEN_HDR = \
src/parse/parser.h \
src/parse/conf_parser.h \
src/parse/lexer.h
re2c_GEN_STX = \
src/default_syntax_c.h \
src/default_syntax_d.h \
src/default_syntax_go.h \
src/default_syntax_haskell.h \
src/default_syntax_java.h \
src/default_syntax_js.h \
src/default_syntax_ocaml.h \
src/default_syntax_python.h \
src/default_syntax_rust.h \
src/default_syntax_swift.h \
src/default_syntax_v.h \
src/default_syntax_zig.h
re2c_GEN = \
$(re2c_GEN_SRC) \
$(re2c_GEN_HDR)
$(re2c_GEN_HDR) \
$(re2c_GEN_STX)
nodist_re2c_SOURCES = \
$(re2c_GEN) \
src/msg/help_re2c.cc
# custom rules create headers and must go before normal rules
BUILT_SOURCES = $(re2c_GEN_SRC)
BUILT_SOURCES = $(re2c_GEN_SRC) $(re2c_GEN_STX)
# bootstrap sources
re2c_BOOT = \
@@ -173,19 +177,21 @@ re2c_BOOT = \
bootstrap/doc/re2ocaml.1 \
bootstrap/doc/re2py.1 \
bootstrap/doc/re2rust.1 \
bootstrap/doc/re2swift.1 \
bootstrap/doc/re2v.1 \
bootstrap/doc/re2zig.1 \
bootstrap/src/default_syntax_c.cc \
bootstrap/src/default_syntax_d.cc \
bootstrap/src/default_syntax_go.cc \
bootstrap/src/default_syntax_haskell.cc \
bootstrap/src/default_syntax_java.cc \
bootstrap/src/default_syntax_js.cc \
bootstrap/src/default_syntax_ocaml.cc \
bootstrap/src/default_syntax_python.cc \
bootstrap/src/default_syntax_rust.cc \
bootstrap/src/default_syntax_v.cc \
bootstrap/src/default_syntax_zig.cc \
bootstrap/src/default_syntax_c.h \
bootstrap/src/default_syntax_d.h \
bootstrap/src/default_syntax_go.h \
bootstrap/src/default_syntax_haskell.h \
bootstrap/src/default_syntax_java.h \
bootstrap/src/default_syntax_js.h \
bootstrap/src/default_syntax_ocaml.h \
bootstrap/src/default_syntax_python.h \
bootstrap/src/default_syntax_rust.h \
bootstrap/src/default_syntax_swift.h \
bootstrap/src/default_syntax_v.h \
bootstrap/src/default_syntax_zig.h \
bootstrap/src/msg/help_re2c.cc \
bootstrap/src/msg/help_re2d.cc \
bootstrap/src/msg/help_re2go.cc \
@@ -195,6 +201,7 @@ re2c_BOOT = \
bootstrap/src/msg/help_re2ocaml.cc \
bootstrap/src/msg/help_re2py.cc \
bootstrap/src/msg/help_re2rust.cc \
bootstrap/src/msg/help_re2swift.cc \
bootstrap/src/msg/help_re2v.cc \
bootstrap/src/msg/help_re2zig.cc \
bootstrap/src/msg/ver_to_vernum.cc \
@@ -222,9 +229,19 @@ re2c_CUSTOM = \
re2c_SRC_DOC_EXT = \
doc/manual/basics/api/api1.rst_ \
doc/manual/basics/api/api2_c.rst_ \
doc/manual/basics/api/api2_d.rst_ \
doc/manual/basics/api/api2_go.rst_ \
doc/manual/basics/api/api2_haskell.rst_ \
doc/manual/basics/api/api2_java.rst_ \
doc/manual/basics/api/api2_js.rst_ \
doc/manual/basics/api/api2_ocaml.rst_ \
doc/manual/basics/api/api2_python.rst_ \
doc/manual/basics/api/api2_rust.rst_ \
doc/manual/basics/api/api2_swift.rst_ \
doc/manual/basics/api/api2_v.rst_ \
doc/manual/basics/api/api2_zig.rst_ \
doc/manual/basics/api/api3.rst_ \
doc/manual/basics/actions.rst_ \
doc/manual/basics/blocks.rst_ \
doc/manual/basics/directives.rst_ \
doc/manual/basics/configurations.rst_ \
@@ -477,6 +494,30 @@ re2c_SRC_DOC_EXT = \
examples/rust/submatch/02_mtags.re \
examples/rust/submatch/03_captures.re \
examples/rust/submatch/04_posix_captures.re \
examples/swift/01_basic.re \
examples/swift/01_basic.swift \
examples/swift/conditions/parse_u32_blocks.re \
examples/swift/conditions/parse_u32_conditions.re \
examples/swift/encodings/unicode_identifier.re \
examples/swift/eof/01_sentinel.re \
examples/swift/eof/02_bounds_checking.re \
examples/swift/eof/03_eof_rule.re \
examples/swift/eof/04_fake_sentinel.re \
examples/swift/eof/05_fake_sentinel_eof_rule.re \
examples/swift/fill/01_fill.re \
examples/swift/fill/02_fill.re \
examples/swift/headers/header.re \
examples/swift/headers/lexer/state.swift \
examples/swift/includes/definitions.swift \
examples/swift/includes/include.re \
examples/swift/reuse/reuse.re \
examples/swift/reuse/usedir.re \
examples/swift/state/push.re \
examples/swift/submatch/01_stags.re \
examples/swift/submatch/01_stags_fill.re \
examples/swift/submatch/02_mtags.re \
examples/swift/submatch/03_captures.re \
examples/swift/submatch/04_posix_captures.re \
examples/v/01_basic.re \
examples/v/01_basic.v \
examples/v/conditions/parse_u32_blocks.re \
@@ -558,6 +599,10 @@ if WITH_RUST
DOCS += doc/re2rust.1
HELP += src/msg/help_re2rust.cc
endif
if WITH_SWIFT
DOCS += doc/re2swift.1
HELP += src/msg/help_re2swift.cc
endif
if WITH_VLANG
DOCS += doc/re2v.1
HELP += src/msg/help_re2v.cc
@@ -581,9 +626,12 @@ dist_stdlib_DATA = \
include/syntax/ocaml \
include/syntax/python \
include/syntax/rust \
include/syntax/swift \
include/syntax/v \
include/syntax/zig \
include/unicode_categories.re
include/unicode_blocks.re \
include/unicode_categories.re \
include/unicode_properties.re
BAZELFILES := \
BUILD.bazel \
@@ -623,13 +671,13 @@ CLEANFILES = \
if REBUILD_SYNTAX
STX2CPP = $(top_srcdir)/build/stx2cpp.py
# generate C++ sources from syntax configs and update bootstrap files
.stx.cc:
.stx.h:
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_GEN)$(PYTHON) $(STX2CPP) $< $@
$(AM_V_GEN)cp -f $@ $(top_srcdir)/bootstrap/$@
else
# copy bootstrap files
.stx.cc:
.stx.h:
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_GEN)cp $(top_srcdir)/bootstrap/$@ $(@D)
$(AM_V_at)echo "Reconfigure with --enable-syntax to regenerate $@"
@@ -678,7 +726,8 @@ if REBUILD_DOCS
RST2TXT = $(top_srcdir)/build/rst2txt.py
RST2MAN = $(top_srcdir)/build/rst2man.py
SPLITMAN = $(top_srcdir)/build/split_man.py
docs: $(DOCS) $(HELP) $(SPLITMAN) $(RST2MAN) $(RST2TXT)
docs: $(DOCS) $(HELP)
$(DOCS) $(HELP) : $(re2c_SRC_DOC_EXT) $(SPLITMAN) $(RST2MAN) $(RST2TXT)
# generate manpage
.rst.1:
$(AM_V_at)$(MKDIR_P) $(@D)
@@ -752,8 +801,8 @@ TESTS = \
# benchmarks
if WITH_BENCHMARKS
SUBDIRS += benchmarks/submatch_dfa_aot
EXTRA_DIST += benchmarks/submatch_dfa_aot
SUBDIRS += benchmarks/c
EXTRA_DIST += benchmarks/c
endif
# libre2c
@@ -827,6 +876,14 @@ re2rust_SOURCES = $(re2c_SOURCES)
nodist_re2rust_SOURCES = $(re2c_GEN) src/msg/help_re2rust.cc
endif
# re2swift
if WITH_SWIFT
bin_PROGRAMS += re2swift
re2swift_CXXFLAGS = $(AM_CXXFLAGS) -DRE2C_LANG=Lang::SWIFT -DRE2C_PROG=\"re2swift\"
re2swift_SOURCES = $(re2c_SOURCES)
nodist_re2swift_SOURCES = $(re2c_GEN) src/msg/help_re2swift.cc
endif
# re2v
if WITH_VLANG
bin_PROGRAMS += re2v
+7 -6
View File
@@ -99,6 +99,7 @@ libre2c_la_SRC = \
src/nfa/re_to_nfa.cc \
src/encoding/enc.cc \
src/encoding/range_suffix.cc \
src/encoding/unicode_casemap.cc \
src/encoding/ebcdic.cc \
src/encoding/utf16.cc \
src/encoding/utf8.cc \
@@ -169,12 +170,12 @@ check_PROGRAMS += test_libre2c
# benchmarks
if WITH_BENCHMARKS
SUBDIRS += benchmarks/submatch_nfa
SUBDIRS += benchmarks/submatch_dfa_jit
EXTRA_DIST += benchmarks/submatch_nfa
EXTRA_DIST += benchmarks/submatch_dfa_jit
SUBDIRS += benchmarks/c/libre2c/nfa
SUBDIRS += benchmarks/c/libre2c/jit
EXTRA_DIST += benchmarks/c/libre2c/nfa
EXTRA_DIST += benchmarks/c/libre2c/jit
if WITH_JAVA
SUBDIRS += benchmarks/submatch_java
EXTRA_DIST += benchmarks/submatch_java
SUBDIRS += benchmarks/c/libre2c/java
EXTRA_DIST += benchmarks/c/libre2c/java
endif # WITH_JAVA
endif # WITH_BENCHMARKS
+5 -3
View File
@@ -4,11 +4,13 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "bazel_skylib",
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
],
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()
View File
+1 -1
View File
@@ -23,7 +23,7 @@ def _re2c_impl(ctx):
tools = [ctx.executable._re2c_tool],
inputs = ctx.files.srcs + ctx.files.data,
command = """
"{re2c}" "{src}" -o "{out}" {re2c_args} {includes}
"{re2c}" --no-generation-date "{src}" -o "{out}" {re2c_args} {includes}
""".format(
re2c = ctx.executable._re2c_tool.path,
src = srcs[0].path,
@@ -2,8 +2,8 @@
import os
# 100 megabytes
LIMIT = 1024 * 1024 * 100
# 16 megabytes
LIMIT = 1024 * 1024 * 16
# read the small sample
with open('small', 'rb') as f:
+20
View File
@@ -0,0 +1,20 @@
1
12
123
1234
12345
123456
1234567
12345678
123456789
1234567890
12345678901
123456789012
1234567890123
12345678901234
123456789012345
1234567890123456
12345678901234567
123456789012345678
1234567890123456789
12345678901234567890
+97
View File
@@ -0,0 +1,97 @@
0b1
0b10
0b101
0b1010
0b10101
0b101010
0b1011010
0b10101010
0b101010101
0b1010101010
0b10101010101
0b101010101010
0b1010101010101
0b10101010101010
0b101010101010101
0b1010101010101010
0B1
0B10
0B111
0B1000
0B11111
0B100000
0B1111111
0B10000000
0B111111111
0B1000000000
0B11111111111
0B100000000000
0B1111111111111
0B10000000000000
0B111111111111111
0B1000000000000000
0
01
012
0123
01234
012345
0123456
01234567
012345670
1
12
123
1234
12345
123456
1234567
12345678
123456789
1234567890
0x1
0x12
0x123
0x1234
0x12345
0x123456
0x1234567
0x12345678
0x123456789
0x123456789a
0x123456789ab
0x123456789abc
0x123456789abcd
0x123456789abcde
0x123456789abcdef
0x123456789abcdef0
1.1e+1
12.12e-12
123.123e+123
1234.1234e-1234
12345.12345e+12345
123456.123456e-123456
1234567.1234567e+1234567
12345678.12345678e-12345678
123456789.123456789e+123456789
1234567890.1234567890e-1234567890
0.1
0.01
0.001
0.0001
0.00001
0.000001
0.0000001
0.00000001
0.000000001
0.0000000001
0.00000000001
0.000000000001
0.0000000000001
0.00000000000001
0.000000000000001
0.0000000000000001
0.00000000000000001
0.000000000000000001
0.0000000000000000001
0.00000000000000000001
+7
View File
@@ -0,0 +1,7 @@
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
+196
View File
@@ -0,0 +1,196 @@
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua and Barbuda
Argentina
Armenia
Australia
Austria
Azerbaijan
The Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belgium
Belize
Benin
Bhutan
Bolivia
Bosnia and Herzegovina
Botswana
Brazil
Brunei
Bulgaria
Burkina Faso
Burundi
Cabo Verde
Cambodia
Cameroon
Canada
Central African Republic
Chad
Chile
China
Colombia
Comoros
Congo, Democratic Republic of the
Congo, Republic of the
Costa Rica
Cote d'Ivoire
Croatia
Cuba
Cyprus
Czech Republic
Denmark
Djibouti
Dominica
Dominican Republic
East Timor (Timor-Leste)
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Eswatini
Ethiopia
Fiji
Finland
France
Gabon
The Gambia
Georgia
Germany
Ghana
Greece
Grenada
Guatemala
Guinea
Guinea-Bissau
Guyana
Haiti
Honduras
Hungary
Iceland
India
Indonesia
Iran
Iraq
Ireland
Israel
Italy
Jamaica
Japan
Jordan
Kazakhstan
Kenya
Kiribati
Korea, North
Korea, South
Kosovo
Kuwait
Kyrgyzstan
Laos
Latvia
Lebanon
Lesotho
Liberia
Libya
Liechtenstein
Lithuania
Luxembourg
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Mauritania
Mauritius
Mexico
Micronesia, Federated States of
Moldova
Monaco
Mongolia
Montenegro
Morocco
Mozambique
Myanmar (Burma)
Namibia
Nauru
Nepal
Netherlands
New Zealand
Nicaragua
Niger
Nigeria
North Macedonia
Norway
Oman
Pakistan
Palau
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Poland
Portugal
Qatar
Romania
Russia
Rwanda
Saint Kitts and Nevis
Saint Lucia
Saint Vincent and the Grenadines
Samoa
San Marino
Sao Tome and Principe
Saudi Arabia
Senegal
Serbia
Seychelles
Sierra Leone
Singapore
Slovakia
Slovenia
Solomon Islands
Somalia
South Africa
Spain
Sri Lanka
Sudan
Sudan, South
Suriname
Sweden
Switzerland
Syria
Taiwan
Tajikistan
Tanzania
Thailand
Togo
Tonga
Trinidad and Tobago
Tunisia
Turkey
Turkmenistan
Tuvalu
Uganda
Ukraine
United Arab Emirates
United Kingdom
United States
Uruguay
Uzbekistan
Vanuatu
Vatican City
Venezuela
Vietnam
Yemen
Zambia
Zimbabwe
File diff suppressed because it is too large Load Diff
@@ -117,7 +117,7 @@ plot_end = """
"""
VARIANTS = ['dfa_aot', 'dfa_jit', 'nfa']
VARIANTS = ['aot', 'jit', 'nfa']
def parse_args():
@@ -183,7 +183,7 @@ def index_of_algo(group, stem):
def time_format(time):
order = math.floor(math.log(time, 10))
if order > 0:
return '%.0lf'
return '%.1lf'
else:
return '%%.%dlf' % (-order + 1)
@@ -192,10 +192,10 @@ class Params:
def __init__(self, args):
self.barwidth = 0.08
if args.variant == 'dfa_aot':
self.override_params_dfa_aot()
elif args.variant == 'dfa_jit':
self.override_params_dfa_jit()
if args.variant == 'aot':
self.override_params_aot()
elif args.variant == 'jit':
self.override_params_jit()
elif args.variant == 'nfa':
self.override_params_nfa()
@@ -210,7 +210,7 @@ class Params:
if args.relative_to: # override only if set
self.relative_to = args.relative_to
def override_params_dfa_aot(self):
def override_params_aot(self):
self.plotwidth = 1.5
self.xshift = 2 * self.plotwidth
self.header = """
@@ -225,7 +225,7 @@ class Params:
self.global_styles = ""
self.local_styles = plot_labels_and_title % 'left'
def override_params_dfa_jit(self):
def override_params_jit(self):
self.plotwidth = 2.7
self.xshift = self.plotwidth
self.header = """
@@ -322,7 +322,7 @@ def group_benchmarks(benchmarks, params):
avgtime /= nbench
avgsize /= nbench
factor = 10 if params.relative_to != None else 3
factor = 10 if params.relative_to != None else 5
maxtime = min(maxtime, factor * avgtime)
maxsize = min(maxsize, factor * avgsize)
+196
View File
@@ -0,0 +1,196 @@
find_package(PkgConfig REQUIRED)
pkg_check_modules(GBENCHMARK REQUIRED benchmark)
set(BENCHMARKS
"lex_00__numbers1"
"lex_01__numbers2"
"lex_02__words1"
"lex_03__words2"
"lex_04__words3"
"submatch_00__http_rfc7230"
"submatch_01__http_simple"
"submatch_02__uri_rfc3986"
"submatch_03__uri_simple"
"submatch_04__apache_log"
"submatch_05__datetime"
"submatch_06__email"
"submatch_07__ipv4"
"submatch_10__alt1_2"
"submatch_11__alt1_4"
"submatch_12__alt1_8"
"submatch_13__alt2_2"
"submatch_14__alt2_4"
"submatch_15__alt2_8"
"submatch_16__alt4_2"
"submatch_17__alt4_4"
"submatch_18__alt4_8"
"submatch_20__cat2_0"
"submatch_21__cat2_4"
"submatch_22__cat2_8"
"submatch_23__cat4_0"
"submatch_24__cat4_2"
"submatch_25__cat4_4"
"submatch_26__cat8_0"
"submatch_27__cat8_1"
"submatch_28__cat8_2"
"submatch_30__rep_cat_5_3_2"
"submatch_31__rep_cat_13_11_7"
"submatch_32__rep_cat_23_19_17"
"submatch_33__rep_alt_5_3_2"
"submatch_34__rep_alt_13_11_7"
"submatch_35__rep_alt_23_19_17"
"submatch_36__rep_5_rep_3_rep_2"
"submatch_37__rep_13_rep_11_rep_7"
"submatch_38__rep_23_rep_19_rep_17"
)
set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(ENG_DIR "${CMAKE_CURRENT_BINARY_DIR}/engines")
set(GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/gen")
set(PREGEN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/pregen")
set(GEN "")
# ragel
file(MAKE_DIRECTORY "${ENG_DIR}/ragel/")
file(MAKE_DIRECTORY "${GEN_DIR}/ragel/")
set(RAGEL "${ENG_DIR}/ragel/ragel7")
add_custom_command(
OUTPUT "${RAGEL}"
COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/../_engines/ragel/getragel7.sh"
WORKING_DIRECTORY "${ENG_DIR}/ragel/"
)
foreach(bench ${BENCHMARKS})
set(src_file "${SRC_DIR}/ragel/${bench}.rl")
set(gen_file "${GEN_DIR}/ragel/${bench}.cc")
set(pregen_file "${PREGEN_DIR}/ragel/${bench}.cc")
# optionally regenerate ragel benchmarks if RE2C_REGEN_BENCHMARKS is set
if(RE2C_REGEN_BENCHMARKS)
file(RELATIVE_PATH rel_src_file "${CMAKE_CURRENT_BINARY_DIR}" "${src_file}")
file(RELATIVE_PATH rel_gen_file "${CMAKE_CURRENT_BINARY_DIR}" "${gen_file}")
add_custom_command(
OUTPUT "${gen_file}"
COMMAND "${RAGEL}" "-G2" "${rel_src_file}" -o "${rel_gen_file}"
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${gen_file}" "${pregen_file}"
DEPENDS "${src_file}" "${RAGEL}"
)
else()
add_custom_command(
OUTPUT "${gen_file}"
COMMAND "${CMAKE_COMMAND}" -E copy "${pregen_file}" "${gen_file}"
DEPENDS "${pregen_file}"
)
endif()
list(APPEND GEN "${gen_file}")
endforeach()
# re2c
file(MAKE_DIRECTORY "${GEN_DIR}/re2c/")
set(RE2C "${CMAKE_BINARY_DIR}/re2c")
set(RE2C_FLAGS "--reusable" "--tags" "--no-generation-date" "--no-version" "-i")
# always regenerate re2c benchmarks
foreach(bench ${BENCHMARKS})
set(src_file "${SRC_DIR}/re2c/${bench}.re")
set(gen_file "${GEN_DIR}/re2c/${bench}.cc")
set(pregen_file "${PREGEN_DIR}/re2c/${bench}.cc")
file(RELATIVE_PATH rel_src_file "${CMAKE_CURRENT_BINARY_DIR}" "${src_file}")
file(RELATIVE_PATH rel_gen_file "${CMAKE_CURRENT_BINARY_DIR}" "${gen_file}")
add_custom_command(
OUTPUT "${gen_file}"
COMMAND "${RE2C}" ${RE2C_FLAGS} "${rel_src_file}" -o "${rel_gen_file}"
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${gen_file}" "${pregen_file}"
DEPENDS "${src_file}" "${SRC_DIR}/re2c/base.re" "${RE2C}"
)
list(APPEND GEN "${gen_file}")
endforeach()
# binaries
if("${GBENCHMARK_INCLUDE_DIR}" STREQUAL "")
set(GBENCHMARK_INCLUDES "${GBENCHMARK_CFLAGS}")
else()
set(GBENCHMARK_INCLUDES "-I${GBENCHMARK_INCLUDE_DIR}")
endif()
set(RE2C_CXX_FLAGS "-O3" "-g" "-I" "${SRC_DIR}" "-Wall" "-Wno-unused-const-variable"
"${GBENCHMARK_INCLUDES}" "-std=c++11") # C++11 is needed for some google-benchmark features
list(APPEND COMPILERS "g++" "clang++")
list(APPEND COMPNAMES "gcc" "clang")
foreach(compiler IN ZIP_LISTS COMPILERS COMPNAMES)
set(objects "")
set(flags ${RE2C_CXX_FLAGS} "-DCXX=\\\"${compiler_1}\\\"")
foreach(gen_file ${GEN})
string(REGEX REPLACE
"^${GEN_DIR}(.+)\.cc$" "${GEN_DIR}\\1-${compiler_1}.o" obj_file "${gen_file}")
add_custom_command(
OUTPUT "${obj_file}"
COMMAND "${compiler_0}" ${flags} -c "${gen_file}" -o "${obj_file}"
DEPENDS "${gen_file}" "${SRC_DIR}/common.h"
)
list(APPEND objects "${obj_file}")
endforeach()
# don't use add_executable, as we need to mnually select the toolchain.
set(inputs ${objects} "${SRC_DIR}/bench.cc")
set(output "bench-${compiler_1}")
add_custom_command(
OUTPUT "${output}"
COMMAND "${compiler_0}" ${flags} ${inputs} "-o" "${output}" ${GBENCHMARK_LINK_LIBRARIES}
DEPENDS ${inputs}
)
if(compiler_1 STREQUAL "gcc") # build test only with GCC
set(test_inputs ${objects} "${SRC_DIR}/test.cc")
add_custom_command(
OUTPUT "test"
COMMAND "${compiler_0}" ${flags} ${test_inputs} "-o" "test" ${GBENCHMARK_LINK_LIBRARIES}
DEPENDS ${test_inputs}
)
endif()
endforeach()
# helper function to transform list
function(regex_replace_list regexp replace var)
set(result "")
foreach(arg ${ARGN})
string(REGEX REPLACE "${regexp}" "${replace}" x "${arg}")
list(APPEND result "${x}")
endforeach()
set(${var} "${result}" PARENT_SCOPE)
endfunction()
# input data
set(DAT)
# Some benchmarks share the same data, like submatch_03__uri_simple and submatch_02__uri_rfc3986.
regex_replace_list("^[a-z]+_[0-9]+__([^_]+).*" "\\1" INPUTS ${BENCHMARKS})
list(REMOVE_DUPLICATES INPUTS)
foreach(input ${INPUTS})
set(src_dir "${CMAKE_CURRENT_SOURCE_DIR}/../_data/${input}")
set(dst_dir "${CMAKE_CURRENT_BINARY_DIR}/data/${input}")
file(GLOB script "${CMAKE_CURRENT_SOURCE_DIR}/../_data/gen.py")
add_custom_command(
OUTPUT "${dst_dir}/small"
COMMAND "${CMAKE_COMMAND}" -E copy "${src_dir}/small" "${dst_dir}/small"
DEPENDS "${src_dir}/small"
)
add_custom_command(
OUTPUT "${dst_dir}/big"
COMMAND "${script}"
DEPENDS "${script}" "${dst_dir}/small"
WORKING_DIRECTORY "${dst_dir}"
)
list(APPEND DAT "${dst_dir}/small" "${dst_dir}/big")
endforeach()
add_custom_target(bench_submatch_aot ALL DEPENDS bench-gcc bench-clang test ${DAT})
# benchmark scripts
set(srcdir "${CMAKE_CURRENT_SOURCE_DIR}")
set(builddir ".")
configure_file(run.py.in run.py @ONLY)
# override default clean command to keep engines
set_directory_properties(PROPERTY
CLEAN_NO_CUSTOM On
ADDITIONAL_CLEAN_FILES "${GEN};${OBJ};${BIN};${DAT}"
)
+146
View File
@@ -0,0 +1,146 @@
SRC_DIR = $(srcdir)/src
ENG_DIR = engines
GEN_DIR = gen
PREGEN_DIR = $(srcdir)/pregen
DAT_DIR = data
RAGEL = $(ENG_DIR)/ragel/ragel7
RE2C = $(top_builddir)/re2c
RE2C_FLAGS = --reusable --tags --no-generation-date --no-version -i
CXXFLAGS = $(AM_CXXFLAGS) -O3 -g -I $(SRC_DIR) -Wall -Wno-unused-const-variable
LDFLAGS = -lbenchmark -lpthread
BENCHMARKS = \
lex_00__numbers1 \
lex_01__numbers2 \
lex_02__words1 \
lex_03__words2 \
lex_04__words3 \
\
submatch_00__http_rfc7230 \
submatch_01__http_simple \
submatch_02__uri_rfc3986 \
submatch_03__uri_simple \
submatch_04__apache_log \
submatch_05__datetime \
submatch_06__email \
submatch_07__ipv4 \
\
submatch_10__alt1_2 \
submatch_11__alt1_4 \
submatch_12__alt1_8 \
submatch_13__alt2_2 \
submatch_14__alt2_4 \
submatch_15__alt2_8 \
submatch_16__alt4_2 \
submatch_17__alt4_4 \
submatch_18__alt4_8 \
\
submatch_20__cat2_0 \
submatch_21__cat2_4 \
submatch_22__cat2_8 \
submatch_23__cat4_0 \
submatch_24__cat4_2 \
submatch_25__cat4_4 \
submatch_26__cat8_0 \
submatch_27__cat8_1 \
submatch_28__cat8_2 \
\
submatch_30__rep_cat_5_3_2 \
submatch_31__rep_cat_13_11_7 \
submatch_32__rep_cat_23_19_17 \
submatch_33__rep_alt_5_3_2 \
submatch_34__rep_alt_13_11_7 \
submatch_35__rep_alt_23_19_17 \
submatch_36__rep_5_rep_3_rep_2 \
submatch_37__rep_13_rep_11_rep_7 \
submatch_38__rep_23_rep_19_rep_17
COMMON_SRC = $(SRC_DIR)/common.h
COMMON_RAGEL = \
$(COMMON_SRC) \
$(SRC_DIR)/ragel/base.h
COMMON_RE2C = \
$(COMMON_SRC) \
$(SRC_DIR)/re2c/base.re \
$(SRC_DIR)/re2c/base.h
GEN_RAGEL = $(patsubst %, $(GEN_DIR)/ragel/%.cc, $(BENCHMARKS))
GEN_RE2C = $(patsubst %, $(GEN_DIR)/re2c/%.cc, $(BENCHMARKS))
GEN = $(GEN_RAGEL) $(GEN_RE2C)
SRC = $(GEN_RAGEL) $(GEN_RE2C)
OBJ_GCC = $(patsubst %.cc, %-gcc.o, $(SRC))
OBJ_CLANG = $(patsubst %.cc, %-clang.o, $(SRC))
OBJ_TEST = $(patsubst %.cc, %-test.o, $(SRC))
OBJ = $(OBJ_GCC) $(OBJ_CLANG) $(OBJ_TEST)
# Some benchmarks share the same data, like 03__uri_simple and 02__uri_rfc3986.
DAT = $(patsubst %, $(DAT_DIR)/%/big, \
$(sort $(foreach bench, $(BENCHMARKS), \
$(word 3, $(subst _, , $(bench))))))
$(DAT): $(DAT_DIR)/%/big: $(srcdir)/../_data/%/small
$(AM_V_at)mkdir -p $(@D) && cp $< $(@D)
$(AM_V_GEN)( cd $(@D) && ../../$(srcdir)/../_data/gen.py )
all-local: bench-gcc bench-clang test $(DAT)
# compile
$(OBJ_GCC): %-gcc.o: %.cc
$(AM_V_at)mkdir -p $(@D)
$(AM_V_GEN)g++ $(CXXFLAGS) -c -o $@ $<
$(OBJ_CLANG): %-clang.o: %.cc
$(AM_V_at)mkdir -p $(@D)
$(AM_V_GEN)clang++ $(CXXFLAGS) -c -o $@ $<
$(OBJ_TEST): %-test.o: %.cc
$(AM_V_at)mkdir -p $(@D)
$(AM_V_GEN)g++ $(CXXFLAGS) -DRUN_IN_TEST_MODE -c -o $@ $<
bench-gcc: src/bench.cc $(OBJ_GCC)
$(AM_V_GEN)g++ -DCXX=\"gcc\" -o $@ $^ $(CXXFLAGS) $(LDFLAGS)
bench-clang: src/bench.cc $(OBJ_CLANG)
$(AM_V_GEN)clang++ -DCXX=\"clang\" -o $@ $^ $(CXXFLAGS) $(LDFLAGS)
test: src/test.cc $(OBJ_TEST)
$(AM_V_GEN)g++ -DRUN_IN_TEST_MODE -o $@ $^ $(CXXFLAGS) $(LDFLAGS)
# always regenerate re2c benchmarks (except for deprecated algorithms)
$(GEN_RE2C): $(GEN_DIR)/%.cc: $(SRC_DIR)/%.re $(COMMON_RE2C) $(RE2C)
$(AM_V_at)mkdir -p $(@D)
$(AM_V_GEN)$(RE2C) $(RE2C_FLAGS) $< -o $@
$(AM_V_at)if ! cmp -s $@ $(PREGEN_DIR)/re2c/$(@F) ; then cp -f $@ $(PREGEN_DIR)/re2c/$(@F) ; fi
# optionally regenerate other benchmarks
if REGEN_BENCHMARKS
$(GEN_RAGEL): $(GEN_DIR)/%.cc: $(SRC_DIR)/%.rl $(COMMON_RAGEL) $(RAGEL)
$(AM_V_at)mkdir -p $(@D)
$(AM_V_GEN)$(RAGEL) -G2 $< -o $@
$(AM_V_at)if ! cmp -s $@ $(PREGEN_DIR)/ragel/$(@F) ; then cp -f $@ $(PREGEN_DIR)/ragel/$(@F) ; fi
else
$(GEN_RAGEL) $(GEN_DIR)/%: $(PREGEN_DIR)/%
$(AM_V_at)mkdir -p $(@D)
$(AM_V_GEN)cp -f $< $@
endif
# engines
$(RAGEL):
$(AM_V_at)mkdir -p $(@D) && cp $(srcdir)/../_engines/ragel/getragel7.sh $(@D)
$(AM_V_GEN)( cd $(@D) && ./getragel7.sh )
# clean
clean-local:
rm -f $(GEN) $(OBJ) $(DAT) bench-gcc bench-clang test
@@ -1,6 +1,6 @@
#include <string.h>
#include "benchmarks/common/common.h"
#include "benchmarks/c/common/common.h"
#include "lib/regex.h"
#ifdef HAVE_RE2_RE2_H
+21
View File
@@ -0,0 +1,21 @@
add_executable(bench_submatch_jit
"bench.cc"
"${CMAKE_SOURCE_DIR}/benchmarks/c/common/common.cc"
)
target_link_libraries(bench_submatch_jit libre2c)
find_package(benchmark REQUIRED)
target_link_libraries(bench_submatch_jit benchmark::benchmark)
# if present, re2 is used for benchmarks
find_path(RE2_INCLUDE_DIRECTORY "re2/re2.h")
find_library(RE2_LIBRARY re2)
if(RE2_INCLUDE_DIRECTORY AND RE2_LIBRARY)
set_target_properties(bench_submatch_jit PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON)
target_compile_definitions(bench_submatch_jit PRIVATE "HAVE_RE2_RE2_H=1")
target_include_directories(bench_submatch_jit PRIVATE "${RE2_INCLUDE_DIRECTORY}")
target_link_libraries(bench_submatch_jit "${RE2_LIBRARY}")
endif()
+17
View File
@@ -0,0 +1,17 @@
bench_submatch_jit_CXXFLAGS = $(AM_CXXFLAGS) -O3 -I $(top_srcdir)
bench_submatch_jit_LDFLAGS = $(LDFLAGS_RE2) -lbenchmark -lpthread
bench_submatch_jit_LDADD = $(top_builddir)/libre2c.la
noinst_PROGRAMS = bench_submatch_jit
bench_submatch_jit_SOURCES = bench.cc \
$(top_srcdir)/benchmarks/c/common/common.cc \
$(top_srcdir)/benchmarks/c/common/common.h \
$(top_srcdir)/benchmarks/c/common/strings_atom.h \
$(top_srcdir)/benchmarks/c/common/strings_date.h \
$(top_srcdir)/benchmarks/c/common/strings_http.h \
$(top_srcdir)/benchmarks/c/common/strings_ipv4.h \
$(top_srcdir)/benchmarks/c/common/strings_ipv6.h \
$(top_srcdir)/benchmarks/c/common/strings_uri.h
all-local: bench_submatch_jit
@@ -1,13 +1,13 @@
#include <benchmark/benchmark.h>
#include <string.h>
#include "benchmarks/common/common.h"
#include "benchmarks/common/strings_atom.h"
#include "benchmarks/common/strings_date.h"
#include "benchmarks/common/strings_http.h"
#include "benchmarks/common/strings_ipv4.h"
#include "benchmarks/common/strings_ipv6.h"
#include "benchmarks/common/strings_uri.h"
#include "benchmarks/c/common/common.h"
#include "benchmarks/c/common/strings_atom.h"
#include "benchmarks/c/common/strings_date.h"
#include "benchmarks/c/common/strings_http.h"
#include "benchmarks/c/common/strings_ipv4.h"
#include "benchmarks/c/common/strings_ipv6.h"
#include "benchmarks/c/common/strings_uri.h"
#include "lib/regex.h"
@@ -1,6 +1,6 @@
add_executable(bench_submatch_nfa
"bench.cc"
"${CMAKE_SOURCE_DIR}/benchmarks/common/common.cc"
"${CMAKE_SOURCE_DIR}/benchmarks/c/common/common.cc"
)
target_link_libraries(bench_submatch_nfa libre2c)
+17
View File
@@ -0,0 +1,17 @@
bench_submatch_nfa_CXXFLAGS = $(AM_CXXFLAGS) -O3 -I $(top_srcdir)
bench_submatch_nfa_LDFLAGS = $(LDFLAGS_RE2) -lbenchmark -lpthread
bench_submatch_nfa_LDADD = $(top_builddir)/libre2c.la
noinst_PROGRAMS = bench_submatch_nfa
bench_submatch_nfa_SOURCES = bench.cc \
$(top_srcdir)/benchmarks/c/common/common.cc \
$(top_srcdir)/benchmarks/c/common/common.h \
$(top_srcdir)/benchmarks/c/common/strings_atom.h \
$(top_srcdir)/benchmarks/c/common/strings_date.h \
$(top_srcdir)/benchmarks/c/common/strings_http.h \
$(top_srcdir)/benchmarks/c/common/strings_ipv4.h \
$(top_srcdir)/benchmarks/c/common/strings_ipv6.h \
$(top_srcdir)/benchmarks/c/common/strings_uri.h
all-local: bench_submatch_nfa
@@ -1,13 +1,13 @@
#include <benchmark/benchmark.h>
#include <string.h>
#include "benchmarks/common/common.h"
#include "benchmarks/common/strings_atom.h"
#include "benchmarks/common/strings_date.h"
#include "benchmarks/common/strings_http.h"
#include "benchmarks/common/strings_ipv4.h"
#include "benchmarks/common/strings_ipv6.h"
#include "benchmarks/common/strings_uri.h"
#include "benchmarks/c/common/common.h"
#include "benchmarks/c/common/strings_atom.h"
#include "benchmarks/c/common/strings_date.h"
#include "benchmarks/c/common/strings_http.h"
#include "benchmarks/c/common/strings_ipv4.h"
#include "benchmarks/c/common/strings_ipv6.h"
#include "benchmarks/c/common/strings_uri.h"
#include "lib/regex.h"
@@ -0,0 +1,120 @@
#line 1 "../../../benchmarks/c/src/ragel/lex_00__numbers1.rl"
#include "ragel/base.h"
namespace ragel_lex_00__numbers1 {
const char *delim = "\n";
#line 13 "../../../benchmarks/c/src/ragel/lex_00__numbers1.rl"
#line 11 "gen/ragel/lex_00__numbers1.cc"
static const int lex_numbers_start = 2;
static const int lex_numbers_first_final = 2;
static const int lex_numbers_error = 0;
static const int lex_numbers_en_main = 2;
#line 15 "../../../benchmarks/c/src/ragel/lex_00__numbers1.rl"
static int lex(Input *in, int count) {
char *p = in->p;
char *ts = in->ts;
char *te = in->te;
char *pe = in->pe;
int act = in->act;
int cs;
#line 28 "gen/ragel/lex_00__numbers1.cc"
{
cs = (int)lex_numbers_start;
ts = 0;
te = 0;
}
#line 25 "../../../benchmarks/c/src/ragel/lex_00__numbers1.rl"
#line 35 "gen/ragel/lex_00__numbers1.cc"
{
switch ( cs ) {
case 2:
goto st_case_2;
case 0:
goto st_case_0;
case 1:
goto st_case_1;
}
_ctr2:
{
#line 12 "../../../benchmarks/c/src/ragel/lex_00__numbers1.rl"
{te = p+1;{
#line 12 "../../../benchmarks/c/src/ragel/lex_00__numbers1.rl"
OUTS(ts, te); }
}}
#line 52 "gen/ragel/lex_00__numbers1.cc"
goto _st2;
_st2:
{
#line 1 "NONE"
{ts = 0;}}
#line 59 "gen/ragel/lex_00__numbers1.cc"
p+= 1;
st_case_2:
if ( p == pe )
goto _out2;
{
#line 1 "NONE"
{ts = p;}}
#line 68 "gen/ragel/lex_00__numbers1.cc"
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st1;
}
goto _st0;
_st0:
st_case_0:
goto _out0;
_st1:
p+= 1;
st_case_1:
if ( p == pe )
goto _out1;
if ( ( (*( p))) == 10 ) {
goto _ctr2;
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st1;
}
goto _st0;
_out2: cs = 2; goto _out;
_out0: cs = 0; goto _out;
_out1: cs = 1; goto _out;
_out: {}
}
#line 26 "../../../benchmarks/c/src/ragel/lex_00__numbers1.rl"
in->p = p;
in->ts = ts;
in->te = te;
in->pe = pe;
in->act = act;
return count;
}
RAGEL_BENCH_AND_TEST()
} // namespace ragel_lex_00__numbers1
@@ -0,0 +1,410 @@
#line 1 "../../../benchmarks/c/src/ragel/lex_01__numbers2.rl"
#include "ragel/base.h"
namespace ragel_lex_01__numbers2 {
const char *delim = "\n";
#line 24 "../../../benchmarks/c/src/ragel/lex_01__numbers2.rl"
#line 11 "gen/ragel/lex_01__numbers2.cc"
static const int lex_numbers_start = 14;
static const int lex_numbers_first_final = 14;
static const int lex_numbers_error = 0;
static const int lex_numbers_en_main = 14;
#line 26 "../../../benchmarks/c/src/ragel/lex_01__numbers2.rl"
static int lex(Input *in, int count) {
char *p = in->p;
char *ts = in->ts;
char *te = in->te;
char *pe = in->pe;
int act = in->act;
int cs;
#line 28 "gen/ragel/lex_01__numbers2.cc"
{
cs = (int)lex_numbers_start;
ts = 0;
te = 0;
}
#line 36 "../../../benchmarks/c/src/ragel/lex_01__numbers2.rl"
#line 35 "gen/ragel/lex_01__numbers2.cc"
{
switch ( cs ) {
case 14:
goto st_case_14;
case 0:
goto st_case_0;
case 1:
goto st_case_1;
case 2:
goto st_case_2;
case 3:
goto st_case_3;
case 4:
goto st_case_4;
case 5:
goto st_case_5;
case 6:
goto st_case_6;
case 7:
goto st_case_7;
case 8:
goto st_case_8;
case 9:
goto st_case_9;
case 10:
goto st_case_10;
case 11:
goto st_case_11;
case 12:
goto st_case_12;
case 13:
goto st_case_13;
}
_ctr3:
{
#line 22 "../../../benchmarks/c/src/ragel/lex_01__numbers2.rl"
{te = p+1;{
#line 22 "../../../benchmarks/c/src/ragel/lex_01__numbers2.rl"
OUTX(ts, te, 1); }
}}
#line 76 "gen/ragel/lex_01__numbers2.cc"
goto _st14;
_ctr8:
{
#line 19 "../../../benchmarks/c/src/ragel/lex_01__numbers2.rl"
{te = p+1;{
#line 19 "../../../benchmarks/c/src/ragel/lex_01__numbers2.rl"
OUTX(ts, te, 8); }
}}
#line 86 "gen/ragel/lex_01__numbers2.cc"
goto _st14;
_ctr14:
{
#line 18 "../../../benchmarks/c/src/ragel/lex_01__numbers2.rl"
{te = p+1;{
#line 18 "../../../benchmarks/c/src/ragel/lex_01__numbers2.rl"
OUTX(ts, te, 2); }
}}
#line 96 "gen/ragel/lex_01__numbers2.cc"
goto _st14;
_ctr16:
{
#line 21 "../../../benchmarks/c/src/ragel/lex_01__numbers2.rl"
{te = p+1;{
#line 21 "../../../benchmarks/c/src/ragel/lex_01__numbers2.rl"
OUTX(ts, te, 16); }
}}
#line 106 "gen/ragel/lex_01__numbers2.cc"
goto _st14;
_ctr18:
{
#line 20 "../../../benchmarks/c/src/ragel/lex_01__numbers2.rl"
{te = p+1;{
#line 20 "../../../benchmarks/c/src/ragel/lex_01__numbers2.rl"
OUTX(ts, te, 10); }
}}
#line 116 "gen/ragel/lex_01__numbers2.cc"
goto _st14;
_st14:
{
#line 1 "NONE"
{ts = 0;}}
#line 123 "gen/ragel/lex_01__numbers2.cc"
p+= 1;
st_case_14:
if ( p == pe )
goto _out14;
{
#line 1 "NONE"
{ts = p;}}
#line 132 "gen/ragel/lex_01__numbers2.cc"
switch( ( (*( p))) ) {
case 46: {
goto _st1;
}
case 48: {
goto _st6;
}
}
if ( 49 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st13;
}
goto _st0;
_st0:
st_case_0:
goto _out0;
_st1:
p+= 1;
st_case_1:
if ( p == pe )
goto _out1;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st2;
}
goto _st0;
_st2:
p+= 1;
st_case_2:
if ( p == pe )
goto _out2;
switch( ( (*( p))) ) {
case 10: {
goto _ctr3;
}
case 69: {
goto _st3;
}
case 101: {
goto _st3;
}
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st2;
}
goto _st0;
_st3:
p+= 1;
st_case_3:
if ( p == pe )
goto _out3;
switch( ( (*( p))) ) {
case 43: {
goto _st4;
}
case 45: {
goto _st4;
}
}
if ( 49 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st5;
}
goto _st0;
_st4:
p+= 1;
st_case_4:
if ( p == pe )
goto _out4;
if ( 49 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st5;
}
goto _st0;
_st5:
p+= 1;
st_case_5:
if ( p == pe )
goto _out5;
if ( ( (*( p))) == 10 ) {
goto _ctr3;
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st5;
}
goto _st0;
_st6:
p+= 1;
st_case_6:
if ( p == pe )
goto _out6;
switch( ( (*( p))) ) {
case 10: {
goto _ctr8;
}
case 46: {
goto _st1;
}
case 66: {
goto _st9;
}
case 88: {
goto _st11;
}
case 98: {
goto _st9;
}
case 120: {
goto _st11;
}
}
if ( ( (*( p))) > 55 ) {
if ( ( (*( p))) <= 57 ) {
goto _st8;
}
} else if ( ( (*( p))) >= 48 ) {
goto _st7;
}
goto _st0;
_st7:
p+= 1;
st_case_7:
if ( p == pe )
goto _out7;
switch( ( (*( p))) ) {
case 10: {
goto _ctr8;
}
case 46: {
goto _st1;
}
}
if ( ( (*( p))) > 55 ) {
if ( ( (*( p))) <= 57 ) {
goto _st8;
}
} else if ( ( (*( p))) >= 48 ) {
goto _st7;
}
goto _st0;
_st8:
p+= 1;
st_case_8:
if ( p == pe )
goto _out8;
if ( ( (*( p))) == 46 ) {
goto _st1;
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st8;
}
goto _st0;
_st9:
p+= 1;
st_case_9:
if ( p == pe )
goto _out9;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 49 ) {
goto _st10;
}
goto _st0;
_st10:
p+= 1;
st_case_10:
if ( p == pe )
goto _out10;
if ( ( (*( p))) == 10 ) {
goto _ctr14;
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 49 ) {
goto _st10;
}
goto _st0;
_st11:
p+= 1;
st_case_11:
if ( p == pe )
goto _out11;
if ( ( (*( p))) < 65 ) {
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st12;
}
} else if ( ( (*( p))) > 70 ) {
if ( 97 <= ( (*( p))) && ( (*( p))) <= 102 ) {
goto _st12;
}
} else {
goto _st12;
}
goto _st0;
_st12:
p+= 1;
st_case_12:
if ( p == pe )
goto _out12;
if ( ( (*( p))) == 10 ) {
goto _ctr16;
}
if ( ( (*( p))) < 65 ) {
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st12;
}
} else if ( ( (*( p))) > 70 ) {
if ( 97 <= ( (*( p))) && ( (*( p))) <= 102 ) {
goto _st12;
}
} else {
goto _st12;
}
goto _st0;
_st13:
p+= 1;
st_case_13:
if ( p == pe )
goto _out13;
switch( ( (*( p))) ) {
case 10: {
goto _ctr18;
}
case 46: {
goto _st1;
}
case 69: {
goto _st3;
}
case 101: {
goto _st3;
}
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st13;
}
goto _st0;
_out14: cs = 14; goto _out;
_out0: cs = 0; goto _out;
_out1: cs = 1; goto _out;
_out2: cs = 2; goto _out;
_out3: cs = 3; goto _out;
_out4: cs = 4; goto _out;
_out5: cs = 5; goto _out;
_out6: cs = 6; goto _out;
_out7: cs = 7; goto _out;
_out8: cs = 8; goto _out;
_out9: cs = 9; goto _out;
_out10: cs = 10; goto _out;
_out11: cs = 11; goto _out;
_out12: cs = 12; goto _out;
_out13: cs = 13; goto _out;
_out: {}
}
#line 37 "../../../benchmarks/c/src/ragel/lex_01__numbers2.rl"
in->p = p;
in->ts = ts;
in->te = te;
in->pe = pe;
in->act = act;
return count;
}
RAGEL_BENCH_AND_TEST()
} // namespace ragel_lex_01__numbers2
+369
View File
@@ -0,0 +1,369 @@
#line 1 "../../../benchmarks/c/src/ragel/lex_02__words1.rl"
#include "ragel/base.h"
namespace ragel_lex_02__words1 {
const char *delim = "\n";
#line 20 "../../../benchmarks/c/src/ragel/lex_02__words1.rl"
#line 11 "gen/ragel/lex_02__words1.cc"
static const int lex_words_start = 21;
static const int lex_words_first_final = 21;
static const int lex_words_error = 0;
static const int lex_words_en_main = 21;
#line 22 "../../../benchmarks/c/src/ragel/lex_02__words1.rl"
static int lex(Input *in, int count) {
char *p = in->p;
char *ts = in->ts;
char *te = in->te;
char *pe = in->pe;
int act = in->act;
int cs;
#line 28 "gen/ragel/lex_02__words1.cc"
{
cs = (int)lex_words_start;
ts = 0;
te = 0;
}
#line 32 "../../../benchmarks/c/src/ragel/lex_02__words1.rl"
#line 35 "gen/ragel/lex_02__words1.cc"
{
switch ( cs ) {
case 21:
goto st_case_21;
case 0:
goto st_case_0;
case 1:
goto st_case_1;
case 2:
goto st_case_2;
case 3:
goto st_case_3;
case 4:
goto st_case_4;
case 5:
goto st_case_5;
case 6:
goto st_case_6;
case 7:
goto st_case_7;
case 8:
goto st_case_8;
case 9:
goto st_case_9;
case 10:
goto st_case_10;
case 11:
goto st_case_11;
case 12:
goto st_case_12;
case 13:
goto st_case_13;
case 14:
goto st_case_14;
case 15:
goto st_case_15;
case 16:
goto st_case_16;
case 17:
goto st_case_17;
case 18:
goto st_case_18;
case 19:
goto st_case_19;
case 20:
goto st_case_20;
}
_ctr7:
{
#line 19 "../../../benchmarks/c/src/ragel/lex_02__words1.rl"
{te = p+1;{
#line 19 "../../../benchmarks/c/src/ragel/lex_02__words1.rl"
OUTS(ts, te); }
}}
#line 90 "gen/ragel/lex_02__words1.cc"
goto _st21;
_st21:
{
#line 1 "NONE"
{ts = 0;}}
#line 97 "gen/ragel/lex_02__words1.cc"
p+= 1;
st_case_21:
if ( p == pe )
goto _out21;
{
#line 1 "NONE"
{ts = p;}}
#line 106 "gen/ragel/lex_02__words1.cc"
switch( ( (*( p))) ) {
case 70: {
goto _st1;
}
case 77: {
goto _st7;
}
case 83: {
goto _st9;
}
case 84: {
goto _st13;
}
case 87: {
goto _st18;
}
}
goto _st0;
_st0:
st_case_0:
goto _out0;
_st1:
p+= 1;
st_case_1:
if ( p == pe )
goto _out1;
if ( ( (*( p))) == 114 ) {
goto _st2;
}
goto _st0;
_st2:
p+= 1;
st_case_2:
if ( p == pe )
goto _out2;
if ( ( (*( p))) == 105 ) {
goto _st3;
}
goto _st0;
_st3:
p+= 1;
st_case_3:
if ( p == pe )
goto _out3;
if ( ( (*( p))) == 100 ) {
goto _st4;
}
goto _st0;
_st4:
p+= 1;
st_case_4:
if ( p == pe )
goto _out4;
if ( ( (*( p))) == 97 ) {
goto _st5;
}
goto _st0;
_st5:
p+= 1;
st_case_5:
if ( p == pe )
goto _out5;
if ( ( (*( p))) == 121 ) {
goto _st6;
}
goto _st0;
_st6:
p+= 1;
st_case_6:
if ( p == pe )
goto _out6;
if ( ( (*( p))) == 10 ) {
goto _ctr7;
}
goto _st0;
_st7:
p+= 1;
st_case_7:
if ( p == pe )
goto _out7;
if ( ( (*( p))) == 111 ) {
goto _st8;
}
goto _st0;
_st8:
p+= 1;
st_case_8:
if ( p == pe )
goto _out8;
if ( ( (*( p))) == 110 ) {
goto _st3;
}
goto _st0;
_st9:
p+= 1;
st_case_9:
if ( p == pe )
goto _out9;
switch( ( (*( p))) ) {
case 97: {
goto _st10;
}
case 117: {
goto _st8;
}
}
goto _st0;
_st10:
p+= 1;
st_case_10:
if ( p == pe )
goto _out10;
if ( ( (*( p))) == 116 ) {
goto _st11;
}
goto _st0;
_st11:
p+= 1;
st_case_11:
if ( p == pe )
goto _out11;
if ( ( (*( p))) == 117 ) {
goto _st12;
}
goto _st0;
_st12:
p+= 1;
st_case_12:
if ( p == pe )
goto _out12;
if ( ( (*( p))) == 114 ) {
goto _st3;
}
goto _st0;
_st13:
p+= 1;
st_case_13:
if ( p == pe )
goto _out13;
switch( ( (*( p))) ) {
case 104: {
goto _st14;
}
case 117: {
goto _st17;
}
}
goto _st0;
_st14:
p+= 1;
st_case_14:
if ( p == pe )
goto _out14;
if ( ( (*( p))) == 117 ) {
goto _st15;
}
goto _st0;
_st15:
p+= 1;
st_case_15:
if ( p == pe )
goto _out15;
if ( ( (*( p))) == 114 ) {
goto _st16;
}
goto _st0;
_st16:
p+= 1;
st_case_16:
if ( p == pe )
goto _out16;
if ( ( (*( p))) == 115 ) {
goto _st3;
}
goto _st0;
_st17:
p+= 1;
st_case_17:
if ( p == pe )
goto _out17;
if ( ( (*( p))) == 101 ) {
goto _st16;
}
goto _st0;
_st18:
p+= 1;
st_case_18:
if ( p == pe )
goto _out18;
if ( ( (*( p))) == 101 ) {
goto _st19;
}
goto _st0;
_st19:
p+= 1;
st_case_19:
if ( p == pe )
goto _out19;
if ( ( (*( p))) == 100 ) {
goto _st20;
}
goto _st0;
_st20:
p+= 1;
st_case_20:
if ( p == pe )
goto _out20;
if ( ( (*( p))) == 110 ) {
goto _st17;
}
goto _st0;
_out21: cs = 21; goto _out;
_out0: cs = 0; goto _out;
_out1: cs = 1; goto _out;
_out2: cs = 2; goto _out;
_out3: cs = 3; goto _out;
_out4: cs = 4; goto _out;
_out5: cs = 5; goto _out;
_out6: cs = 6; goto _out;
_out7: cs = 7; goto _out;
_out8: cs = 8; goto _out;
_out9: cs = 9; goto _out;
_out10: cs = 10; goto _out;
_out11: cs = 11; goto _out;
_out12: cs = 12; goto _out;
_out13: cs = 13; goto _out;
_out14: cs = 14; goto _out;
_out15: cs = 15; goto _out;
_out16: cs = 16; goto _out;
_out17: cs = 17; goto _out;
_out18: cs = 18; goto _out;
_out19: cs = 19; goto _out;
_out20: cs = 20; goto _out;
_out: {}
}
#line 33 "../../../benchmarks/c/src/ragel/lex_02__words1.rl"
in->p = p;
in->ts = ts;
in->te = te;
in->pe = pe;
in->act = act;
return count;
}
RAGEL_BENCH_AND_TEST()
} // namespace ragel_lex_02__words1
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,709 @@
#line 1 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
#include "ragel/base.h"
namespace ragel_submatch_04__apache_log {
const char *delim = "\n";
#line 44 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
#line 11 "gen/ragel/submatch_04__apache_log.cc"
static const int apache_log_start = 25;
static const int apache_log_first_final = 25;
static const int apache_log_error = 0;
static const int apache_log_en_main = 25;
#line 46 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
static int lex(Input *in, int count) {
char *p = in->p;
char *pe = in->pe;
const char
*h1, *i1, *a1, *d1, *r1, *s1, *z1, *u1, *g1,
*h2, *i2, *a2, *d2, *r2, *s2, *z2, *u2, *g2;
int cs;
#line 28 "gen/ragel/submatch_04__apache_log.cc"
{
cs = (int)apache_log_start;
}
#line 56 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
#line 33 "gen/ragel/submatch_04__apache_log.cc"
{
switch ( cs ) {
case 25:
goto st_case_25;
case 0:
goto st_case_0;
case 1:
goto st_case_1;
case 2:
goto st_case_2;
case 3:
goto st_case_3;
case 4:
goto st_case_4;
case 5:
goto st_case_5;
case 6:
goto st_case_6;
case 7:
goto st_case_7;
case 8:
goto st_case_8;
case 9:
goto st_case_9;
case 10:
goto st_case_10;
case 11:
goto st_case_11;
case 12:
goto st_case_12;
case 13:
goto st_case_13;
case 14:
goto st_case_14;
case 15:
goto st_case_15;
case 16:
goto st_case_16;
case 17:
goto st_case_17;
case 18:
goto st_case_18;
case 19:
goto st_case_19;
case 20:
goto st_case_20;
case 21:
goto st_case_21;
case 22:
goto st_case_22;
case 23:
goto st_case_23;
case 24:
goto st_case_24;
}
_ctr41:
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
g2 = p; }
#line 93 "gen/ragel/submatch_04__apache_log.cc"
{
#line 30 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
OUT("host: ", h1, h2);
OUT("userid: ", i1, i2);
OUT("authuser: ", a1, a2);
OUT("date: ", d1, d2);
OUT("request: ", r1, r2);
OUT("status: ", s1, s2);
OUT("size: ", z1, z2);
OUT("url: ", u1, u2);
OUT("agent: ", g1, g2);
OUTC('\n');
}
#line 109 "gen/ragel/submatch_04__apache_log.cc"
goto _st25;
_st25:
p+= 1;
st_case_25:
if ( p == pe )
goto _out25;
if ( ( (*( p))) == 46 ) {
goto _ctr44;
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _ctr44;
}
goto _st0;
_st0:
st_case_0:
goto _out0;
_ctr44:
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
h1 = p; }
#line 131 "gen/ragel/submatch_04__apache_log.cc"
goto _st1;
_st1:
p+= 1;
st_case_1:
if ( p == pe )
goto _out1;
switch( ( (*( p))) ) {
case 9: {
goto _ctr2;
}
case 32: {
goto _ctr2;
}
case 46: {
goto _st1;
}
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st1;
}
goto _st0;
_ctr2:
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
h2 = p; }
#line 158 "gen/ragel/submatch_04__apache_log.cc"
goto _st2;
_st2:
p+= 1;
st_case_2:
if ( p == pe )
goto _out2;
switch( ( (*( p))) ) {
case 9: {
goto _st2;
}
case 32: {
goto _st2;
}
case 45: {
goto _ctr4;
}
}
goto _st0;
_ctr4:
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
i1 = p; }
#line 182 "gen/ragel/submatch_04__apache_log.cc"
goto _st3;
_st3:
p+= 1;
st_case_3:
if ( p == pe )
goto _out3;
switch( ( (*( p))) ) {
case 9: {
goto _ctr6;
}
case 32: {
goto _ctr6;
}
}
goto _st0;
_ctr6:
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
i2 = p; }
#line 203 "gen/ragel/submatch_04__apache_log.cc"
goto _st4;
_st4:
p+= 1;
st_case_4:
if ( p == pe )
goto _out4;
switch( ( (*( p))) ) {
case 9: {
goto _st4;
}
case 32: {
goto _st4;
}
case 45: {
goto _ctr8;
}
}
goto _st0;
_ctr8:
{
#line 23 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
a1 = p; }
#line 227 "gen/ragel/submatch_04__apache_log.cc"
goto _st5;
_st5:
p+= 1;
st_case_5:
if ( p == pe )
goto _out5;
switch( ( (*( p))) ) {
case 9: {
goto _ctr10;
}
case 32: {
goto _ctr10;
}
}
goto _st0;
_ctr10:
{
#line 23 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
a2 = p; }
#line 248 "gen/ragel/submatch_04__apache_log.cc"
goto _st6;
_st6:
p+= 1;
st_case_6:
if ( p == pe )
goto _out6;
switch( ( (*( p))) ) {
case 9: {
goto _st6;
}
case 32: {
goto _st6;
}
case 91: {
goto _ctr12;
}
}
goto _st0;
_ctr12:
{
#line 24 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
d1 = p; }
#line 272 "gen/ragel/submatch_04__apache_log.cc"
goto _st7;
_st7:
p+= 1;
st_case_7:
if ( p == pe )
goto _out7;
switch( ( (*( p))) ) {
case 0: {
goto _st0;
}
case 10: {
goto _st0;
}
case 93: {
goto _st0;
}
}
goto _st8;
_st8:
p+= 1;
st_case_8:
if ( p == pe )
goto _out8;
switch( ( (*( p))) ) {
case 0: {
goto _st0;
}
case 10: {
goto _st0;
}
case 93: {
goto _st9;
}
}
goto _st8;
_st9:
p+= 1;
st_case_9:
if ( p == pe )
goto _out9;
switch( ( (*( p))) ) {
case 9: {
goto _ctr16;
}
case 32: {
goto _ctr16;
}
}
goto _st0;
_ctr16:
{
#line 24 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
d2 = p; }
#line 327 "gen/ragel/submatch_04__apache_log.cc"
goto _st10;
_st10:
p+= 1;
st_case_10:
if ( p == pe )
goto _out10;
switch( ( (*( p))) ) {
case 9: {
goto _st10;
}
case 32: {
goto _st10;
}
case 34: {
goto _ctr18;
}
}
goto _st0;
_ctr18:
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
r1 = p; }
#line 351 "gen/ragel/submatch_04__apache_log.cc"
goto _st11;
_st11:
p+= 1;
st_case_11:
if ( p == pe )
goto _out11;
switch( ( (*( p))) ) {
case 0: {
goto _st0;
}
case 10: {
goto _st0;
}
case 34: {
goto _st0;
}
}
goto _st12;
_st12:
p+= 1;
st_case_12:
if ( p == pe )
goto _out12;
switch( ( (*( p))) ) {
case 0: {
goto _st0;
}
case 10: {
goto _st0;
}
case 34: {
goto _st13;
}
}
goto _st12;
_st13:
p+= 1;
st_case_13:
if ( p == pe )
goto _out13;
switch( ( (*( p))) ) {
case 9: {
goto _ctr22;
}
case 32: {
goto _ctr22;
}
}
goto _st0;
_ctr22:
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
r2 = p; }
#line 406 "gen/ragel/submatch_04__apache_log.cc"
goto _st14;
_st14:
p+= 1;
st_case_14:
if ( p == pe )
goto _out14;
switch( ( (*( p))) ) {
case 9: {
goto _st14;
}
case 32: {
goto _st14;
}
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _ctr24;
}
goto _st0;
_ctr24:
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
s1 = p; }
#line 430 "gen/ragel/submatch_04__apache_log.cc"
goto _st15;
_st15:
p+= 1;
st_case_15:
if ( p == pe )
goto _out15;
switch( ( (*( p))) ) {
case 9: {
goto _ctr26;
}
case 32: {
goto _ctr26;
}
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st15;
}
goto _st0;
_ctr26:
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
s2 = p; }
#line 454 "gen/ragel/submatch_04__apache_log.cc"
goto _st16;
_st16:
p+= 1;
st_case_16:
if ( p == pe )
goto _out16;
switch( ( (*( p))) ) {
case 9: {
goto _st16;
}
case 32: {
goto _st16;
}
case 45: {
goto _ctr28;
}
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _ctr29;
}
goto _st0;
_ctr28:
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
z1 = p; }
#line 481 "gen/ragel/submatch_04__apache_log.cc"
goto _st17;
_st17:
p+= 1;
st_case_17:
if ( p == pe )
goto _out17;
switch( ( (*( p))) ) {
case 9: {
goto _ctr31;
}
case 32: {
goto _ctr31;
}
}
goto _st0;
_ctr31:
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
z2 = p; }
#line 502 "gen/ragel/submatch_04__apache_log.cc"
goto _st18;
_st18:
p+= 1;
st_case_18:
if ( p == pe )
goto _out18;
switch( ( (*( p))) ) {
case 9: {
goto _st18;
}
case 32: {
goto _st18;
}
case 34: {
goto _ctr33;
}
}
goto _st0;
_ctr33:
{
#line 28 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
u1 = p; }
#line 526 "gen/ragel/submatch_04__apache_log.cc"
goto _st19;
_st19:
p+= 1;
st_case_19:
if ( p == pe )
goto _out19;
switch( ( (*( p))) ) {
case 0: {
goto _st0;
}
case 10: {
goto _st0;
}
case 34: {
goto _st20;
}
}
goto _st19;
_st20:
p+= 1;
st_case_20:
if ( p == pe )
goto _out20;
switch( ( (*( p))) ) {
case 9: {
goto _ctr36;
}
case 32: {
goto _ctr36;
}
}
goto _st0;
_ctr36:
{
#line 28 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
u2 = p; }
#line 564 "gen/ragel/submatch_04__apache_log.cc"
goto _st21;
_st21:
p+= 1;
st_case_21:
if ( p == pe )
goto _out21;
switch( ( (*( p))) ) {
case 9: {
goto _st21;
}
case 32: {
goto _st21;
}
case 34: {
goto _ctr38;
}
}
goto _st0;
_ctr38:
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
g1 = p; }
#line 588 "gen/ragel/submatch_04__apache_log.cc"
goto _st22;
_st22:
p+= 1;
st_case_22:
if ( p == pe )
goto _out22;
switch( ( (*( p))) ) {
case 0: {
goto _st0;
}
case 10: {
goto _st0;
}
case 34: {
goto _st23;
}
}
goto _st22;
_st23:
p+= 1;
st_case_23:
if ( p == pe )
goto _out23;
if ( ( (*( p))) == 10 ) {
goto _ctr41;
}
goto _st0;
_ctr29:
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
z1 = p; }
#line 621 "gen/ragel/submatch_04__apache_log.cc"
goto _st24;
_st24:
p+= 1;
st_case_24:
if ( p == pe )
goto _out24;
switch( ( (*( p))) ) {
case 9: {
goto _ctr31;
}
case 32: {
goto _ctr31;
}
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st24;
}
goto _st0;
_out25: cs = 25; goto _out;
_out0: cs = 0; goto _out;
_out1: cs = 1; goto _out;
_out2: cs = 2; goto _out;
_out3: cs = 3; goto _out;
_out4: cs = 4; goto _out;
_out5: cs = 5; goto _out;
_out6: cs = 6; goto _out;
_out7: cs = 7; goto _out;
_out8: cs = 8; goto _out;
_out9: cs = 9; goto _out;
_out10: cs = 10; goto _out;
_out11: cs = 11; goto _out;
_out12: cs = 12; goto _out;
_out13: cs = 13; goto _out;
_out14: cs = 14; goto _out;
_out15: cs = 15; goto _out;
_out16: cs = 16; goto _out;
_out17: cs = 17; goto _out;
_out18: cs = 18; goto _out;
_out19: cs = 19; goto _out;
_out20: cs = 20; goto _out;
_out21: cs = 21; goto _out;
_out22: cs = 22; goto _out;
_out23: cs = 23; goto _out;
_out24: cs = 24; goto _out;
_out: {}
}
#line 57 "../../../benchmarks/c/src/ragel/submatch_04__apache_log.rl"
in->p = p;
in->pe = pe;
return count;
}
RAGEL_BENCH_AND_TEST()
} // namespace ragel_submatch_04__apache_log
@@ -0,0 +1,697 @@
#line 1 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
#include "ragel/base.h"
namespace ragel_submatch_05__datetime {
const char *delim = "\n";
#line 37 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
#line 11 "gen/ragel/submatch_05__datetime.cc"
static const int datetime_start = 35;
static const int datetime_first_final = 35;
static const int datetime_error = 0;
static const int datetime_en_main = 35;
#line 39 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
static int lex(Input *in, int count) {
char *p = in->p;
char *pe = in->pe;
const char
*s1, *y1, *h1, *m1, *d1, *M1, *z1,
*s2, *y2, *h2, *m2, *d2, *M2, *z2;
int cs;
#line 28 "gen/ragel/submatch_05__datetime.cc"
{
cs = (int)datetime_start;
}
#line 49 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
#line 33 "gen/ragel/submatch_05__datetime.cc"
{
switch ( cs ) {
case 35:
goto st_case_35;
case 0:
goto st_case_0;
case 1:
goto st_case_1;
case 2:
goto st_case_2;
case 3:
goto st_case_3;
case 4:
goto st_case_4;
case 5:
goto st_case_5;
case 6:
goto st_case_6;
case 7:
goto st_case_7;
case 8:
goto st_case_8;
case 9:
goto st_case_9;
case 10:
goto st_case_10;
case 11:
goto st_case_11;
case 12:
goto st_case_12;
case 13:
goto st_case_13;
case 14:
goto st_case_14;
case 15:
goto st_case_15;
case 16:
goto st_case_16;
case 17:
goto st_case_17;
case 18:
goto st_case_18;
case 19:
goto st_case_19;
case 20:
goto st_case_20;
case 21:
goto st_case_21;
case 22:
goto st_case_22;
case 23:
goto st_case_23;
case 24:
goto st_case_24;
case 25:
goto st_case_25;
case 26:
goto st_case_26;
case 27:
goto st_case_27;
case 28:
goto st_case_28;
case 29:
goto st_case_29;
case 30:
goto st_case_30;
case 31:
goto st_case_31;
case 32:
goto st_case_32;
case 33:
goto st_case_33;
case 34:
goto st_case_34;
}
_ctr43:
{
#line 24 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
z2 = p; }
#line 113 "gen/ragel/submatch_05__datetime.cc"
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
OUT("year: ", y1, y2);
OUT("month: ", m1, m2);
OUT("day: ", d1, d2);
OUT("hours: ", h1, h2);
OUT("minutes: ", M1, M2);
OUT("seconds: ", s1, s2);
OUT("tz: ", z1, z2);
OUTC('\n');
}
#line 127 "gen/ragel/submatch_05__datetime.cc"
goto _st35;
_st35:
p+= 1;
st_case_35:
if ( p == pe )
goto _out35;
if ( ( (*( p))) == 48 ) {
goto _ctr53;
}
if ( 49 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _ctr54;
}
goto _st0;
_st0:
st_case_0:
goto _out0;
_ctr53:
{
#line 18 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
y1 = p; }
#line 149 "gen/ragel/submatch_05__datetime.cc"
goto _st1;
_st1:
p+= 1;
st_case_1:
if ( p == pe )
goto _out1;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st2;
}
goto _st0;
_st2:
p+= 1;
st_case_2:
if ( p == pe )
goto _out2;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st3;
}
goto _st0;
_st3:
p+= 1;
st_case_3:
if ( p == pe )
goto _out3;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st4;
}
goto _st0;
_st4:
p+= 1;
st_case_4:
if ( p == pe )
goto _out4;
if ( ( (*( p))) == 45 ) {
goto _ctr5;
}
goto _st0;
_ctr5:
{
#line 18 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
y2 = p; }
#line 192 "gen/ragel/submatch_05__datetime.cc"
goto _st5;
_st5:
p+= 1;
st_case_5:
if ( p == pe )
goto _out5;
switch( ( (*( p))) ) {
case 48: {
goto _ctr7;
}
case 49: {
goto _ctr8;
}
}
goto _st0;
_ctr7:
{
#line 19 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
m1 = p; }
#line 213 "gen/ragel/submatch_05__datetime.cc"
goto _st6;
_st6:
p+= 1;
st_case_6:
if ( p == pe )
goto _out6;
if ( 49 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st7;
}
goto _st0;
_st7:
p+= 1;
st_case_7:
if ( p == pe )
goto _out7;
if ( ( (*( p))) == 45 ) {
goto _ctr11;
}
goto _st0;
_ctr11:
{
#line 19 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
m2 = p; }
#line 238 "gen/ragel/submatch_05__datetime.cc"
goto _st8;
_st8:
p+= 1;
st_case_8:
if ( p == pe )
goto _out8;
switch( ( (*( p))) ) {
case 48: {
goto _ctr13;
}
case 51: {
goto _ctr15;
}
}
if ( 49 <= ( (*( p))) && ( (*( p))) <= 50 ) {
goto _ctr14;
}
goto _st0;
_ctr13:
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
d1 = p; }
#line 262 "gen/ragel/submatch_05__datetime.cc"
goto _st9;
_st9:
p+= 1;
st_case_9:
if ( p == pe )
goto _out9;
if ( 49 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st10;
}
goto _st0;
_st10:
p+= 1;
st_case_10:
if ( p == pe )
goto _out10;
if ( ( (*( p))) == 84 ) {
goto _ctr18;
}
goto _st0;
_ctr18:
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
d2 = p; }
#line 287 "gen/ragel/submatch_05__datetime.cc"
goto _st11;
_st11:
p+= 1;
st_case_11:
if ( p == pe )
goto _out11;
if ( ( (*( p))) == 50 ) {
goto _ctr21;
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 49 ) {
goto _ctr20;
}
goto _st0;
_ctr20:
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
h1 = p; }
#line 306 "gen/ragel/submatch_05__datetime.cc"
goto _st12;
_st12:
p+= 1;
st_case_12:
if ( p == pe )
goto _out12;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st13;
}
goto _st0;
_st13:
p+= 1;
st_case_13:
if ( p == pe )
goto _out13;
if ( ( (*( p))) == 58 ) {
goto _ctr24;
}
goto _st0;
_ctr24:
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
h2 = p; }
#line 331 "gen/ragel/submatch_05__datetime.cc"
goto _st14;
_st14:
p+= 1;
st_case_14:
if ( p == pe )
goto _out14;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 53 ) {
goto _ctr26;
}
goto _st0;
_ctr26:
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
M1 = p; }
#line 347 "gen/ragel/submatch_05__datetime.cc"
goto _st15;
_st15:
p+= 1;
st_case_15:
if ( p == pe )
goto _out15;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st16;
}
goto _st0;
_st16:
p+= 1;
st_case_16:
if ( p == pe )
goto _out16;
if ( ( (*( p))) == 58 ) {
goto _ctr29;
}
goto _st0;
_ctr29:
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
M2 = p; }
#line 372 "gen/ragel/submatch_05__datetime.cc"
goto _st17;
_st17:
p+= 1;
st_case_17:
if ( p == pe )
goto _out17;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 53 ) {
goto _ctr31;
}
goto _st0;
_ctr31:
{
#line 23 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
s1 = p; }
#line 388 "gen/ragel/submatch_05__datetime.cc"
goto _st18;
_st18:
p+= 1;
st_case_18:
if ( p == pe )
goto _out18;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st19;
}
goto _st0;
_st19:
p+= 1;
st_case_19:
if ( p == pe )
goto _out19;
switch( ( (*( p))) ) {
case 43: {
goto _ctr34;
}
case 45: {
goto _ctr34;
}
case 90: {
goto _ctr35;
}
}
goto _st0;
_ctr34:
{
#line 23 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
s2 = p; }
#line 421 "gen/ragel/submatch_05__datetime.cc"
{
#line 24 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
z1 = p; }
#line 426 "gen/ragel/submatch_05__datetime.cc"
goto _st20;
_st20:
p+= 1;
st_case_20:
if ( p == pe )
goto _out20;
if ( ( (*( p))) == 50 ) {
goto _st26;
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 49 ) {
goto _st21;
}
goto _st0;
_st21:
p+= 1;
st_case_21:
if ( p == pe )
goto _out21;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st22;
}
goto _st0;
_st22:
p+= 1;
st_case_22:
if ( p == pe )
goto _out22;
if ( ( (*( p))) == 58 ) {
goto _st23;
}
goto _st0;
_st23:
p+= 1;
st_case_23:
if ( p == pe )
goto _out23;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 53 ) {
goto _st24;
}
goto _st0;
_st24:
p+= 1;
st_case_24:
if ( p == pe )
goto _out24;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st25;
}
goto _st0;
_ctr35:
{
#line 23 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
s2 = p; }
#line 481 "gen/ragel/submatch_05__datetime.cc"
{
#line 24 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
z1 = p; }
#line 486 "gen/ragel/submatch_05__datetime.cc"
goto _st25;
_st25:
p+= 1;
st_case_25:
if ( p == pe )
goto _out25;
if ( ( (*( p))) == 10 ) {
goto _ctr43;
}
goto _st0;
_st26:
p+= 1;
st_case_26:
if ( p == pe )
goto _out26;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 51 ) {
goto _st22;
}
goto _st0;
_ctr21:
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
h1 = p; }
#line 511 "gen/ragel/submatch_05__datetime.cc"
goto _st27;
_st27:
p+= 1;
st_case_27:
if ( p == pe )
goto _out27;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 51 ) {
goto _st13;
}
goto _st0;
_ctr14:
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
d1 = p; }
#line 527 "gen/ragel/submatch_05__datetime.cc"
goto _st28;
_st28:
p+= 1;
st_case_28:
if ( p == pe )
goto _out28;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st10;
}
goto _st0;
_ctr15:
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
d1 = p; }
#line 543 "gen/ragel/submatch_05__datetime.cc"
goto _st29;
_st29:
p+= 1;
st_case_29:
if ( p == pe )
goto _out29;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 49 ) {
goto _st10;
}
goto _st0;
_ctr8:
{
#line 19 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
m1 = p; }
#line 559 "gen/ragel/submatch_05__datetime.cc"
goto _st30;
_st30:
p+= 1;
st_case_30:
if ( p == pe )
goto _out30;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 50 ) {
goto _st7;
}
goto _st0;
_ctr54:
{
#line 18 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
y1 = p; }
#line 575 "gen/ragel/submatch_05__datetime.cc"
goto _st31;
_st31:
p+= 1;
st_case_31:
if ( p == pe )
goto _out31;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st32;
}
goto _st0;
_st32:
p+= 1;
st_case_32:
if ( p == pe )
goto _out32;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st33;
}
goto _st0;
_st33:
p+= 1;
st_case_33:
if ( p == pe )
goto _out33;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st34;
}
goto _st0;
_st34:
p+= 1;
st_case_34:
if ( p == pe )
goto _out34;
if ( ( (*( p))) == 45 ) {
goto _ctr5;
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st34;
}
goto _st0;
_out35: cs = 35; goto _out;
_out0: cs = 0; goto _out;
_out1: cs = 1; goto _out;
_out2: cs = 2; goto _out;
_out3: cs = 3; goto _out;
_out4: cs = 4; goto _out;
_out5: cs = 5; goto _out;
_out6: cs = 6; goto _out;
_out7: cs = 7; goto _out;
_out8: cs = 8; goto _out;
_out9: cs = 9; goto _out;
_out10: cs = 10; goto _out;
_out11: cs = 11; goto _out;
_out12: cs = 12; goto _out;
_out13: cs = 13; goto _out;
_out14: cs = 14; goto _out;
_out15: cs = 15; goto _out;
_out16: cs = 16; goto _out;
_out17: cs = 17; goto _out;
_out18: cs = 18; goto _out;
_out19: cs = 19; goto _out;
_out20: cs = 20; goto _out;
_out21: cs = 21; goto _out;
_out22: cs = 22; goto _out;
_out23: cs = 23; goto _out;
_out24: cs = 24; goto _out;
_out25: cs = 25; goto _out;
_out26: cs = 26; goto _out;
_out27: cs = 27; goto _out;
_out28: cs = 28; goto _out;
_out29: cs = 29; goto _out;
_out30: cs = 30; goto _out;
_out31: cs = 31; goto _out;
_out32: cs = 32; goto _out;
_out33: cs = 33; goto _out;
_out34: cs = 34; goto _out;
_out: {}
}
#line 50 "../../../benchmarks/c/src/ragel/submatch_05__datetime.rl"
in->p = p;
in->pe = pe;
return count;
}
RAGEL_BENCH_AND_TEST()
} // namespace ragel_submatch_05__datetime
@@ -0,0 +1,407 @@
#line 1 "../../../benchmarks/c/src/ragel/submatch_06__email.rl"
#include "ragel/base.h"
namespace ragel_submatch_06__email {
const char *delim = "\n";
#line 28 "../../../benchmarks/c/src/ragel/submatch_06__email.rl"
#line 11 "gen/ragel/submatch_06__email.cc"
static const int email_start = 10;
static const int email_first_final = 10;
static const int email_error = 0;
static const int email_en_main = 10;
#line 30 "../../../benchmarks/c/src/ragel/submatch_06__email.rl"
static int lex(Input *in, int count) {
char *p = in->p;
char *pe = in->pe;
char *p1, *p2;
int cs;
#line 26 "gen/ragel/submatch_06__email.cc"
{
cs = (int)email_start;
}
#line 38 "../../../benchmarks/c/src/ragel/submatch_06__email.rl"
#line 31 "gen/ragel/submatch_06__email.cc"
{
switch ( cs ) {
case 10:
goto st_case_10;
case 1:
goto st_case_1;
case 0:
goto st_case_0;
case 2:
goto st_case_2;
case 3:
goto st_case_3;
case 4:
goto st_case_4;
case 5:
goto st_case_5;
case 6:
goto st_case_6;
case 7:
goto st_case_7;
case 8:
goto st_case_8;
case 9:
goto st_case_9;
}
_ctr11:
{
#line 19 "../../../benchmarks/c/src/ragel/submatch_06__email.rl"
OUTC(' ');
OUTS(p1, p2 - 1);
OUTC(' ');
OUTS(p2, p);
OUTC('\n');
}
#line 67 "gen/ragel/submatch_06__email.cc"
goto _st10;
_st10:
p+= 1;
st_case_10:
if ( p == pe )
goto _out10;
switch( ( (*( p))) ) {
case 0: {
goto _st0;
}
case 10: {
goto _st10;
}
case 33: {
goto _ctr13;
}
case 45: {
goto _ctr13;
}
case 61: {
goto _ctr13;
}
case 63: {
goto _ctr13;
}
}
if ( ( (*( p))) < 42 ) {
if ( 35 <= ( (*( p))) && ( (*( p))) <= 39 ) {
goto _ctr13;
}
} else if ( ( (*( p))) > 43 ) {
if ( ( (*( p))) > 57 ) {
if ( 94 <= ( (*( p))) && ( (*( p))) <= 126 ) {
goto _ctr13;
}
} else if ( ( (*( p))) >= 47 ) {
goto _ctr13;
}
} else {
goto _ctr13;
}
goto _st1;
_st1:
p+= 1;
st_case_1:
if ( p == pe )
goto _out1;
switch( ( (*( p))) ) {
case 0: {
goto _st0;
}
case 10: {
goto _st10;
}
}
goto _st1;
_st0:
st_case_0:
goto _out0;
_ctr13:
{
#line 17 "../../../benchmarks/c/src/ragel/submatch_06__email.rl"
p1 = p; }
#line 132 "gen/ragel/submatch_06__email.cc"
goto _st2;
_st2:
p+= 1;
st_case_2:
if ( p == pe )
goto _out2;
switch( ( (*( p))) ) {
case 0: {
goto _st0;
}
case 10: {
goto _st10;
}
case 33: {
goto _st2;
}
case 46: {
goto _st3;
}
case 61: {
goto _st2;
}
case 63: {
goto _st2;
}
case 64: {
goto _st4;
}
}
if ( ( (*( p))) < 42 ) {
if ( 35 <= ( (*( p))) && ( (*( p))) <= 39 ) {
goto _st2;
}
} else if ( ( (*( p))) > 43 ) {
if ( ( (*( p))) > 57 ) {
if ( 94 <= ( (*( p))) && ( (*( p))) <= 126 ) {
goto _st2;
}
} else if ( ( (*( p))) >= 45 ) {
goto _st2;
}
} else {
goto _st2;
}
goto _st1;
_st3:
p+= 1;
st_case_3:
if ( p == pe )
goto _out3;
switch( ( (*( p))) ) {
case 0: {
goto _st0;
}
case 10: {
goto _st10;
}
case 33: {
goto _st2;
}
case 45: {
goto _st2;
}
case 61: {
goto _st2;
}
case 63: {
goto _st2;
}
}
if ( ( (*( p))) < 42 ) {
if ( 35 <= ( (*( p))) && ( (*( p))) <= 39 ) {
goto _st2;
}
} else if ( ( (*( p))) > 43 ) {
if ( ( (*( p))) > 57 ) {
if ( 94 <= ( (*( p))) && ( (*( p))) <= 126 ) {
goto _st2;
}
} else if ( ( (*( p))) >= 47 ) {
goto _st2;
}
} else {
goto _st2;
}
goto _st1;
_st4:
p+= 1;
st_case_4:
if ( p == pe )
goto _out4;
switch( ( (*( p))) ) {
case 0: {
goto _st0;
}
case 10: {
goto _st10;
}
}
if ( ( (*( p))) > 57 ) {
if ( 97 <= ( (*( p))) && ( (*( p))) <= 122 ) {
goto _ctr6;
}
} else if ( ( (*( p))) >= 48 ) {
goto _ctr6;
}
goto _st1;
_ctr6:
{
#line 18 "../../../benchmarks/c/src/ragel/submatch_06__email.rl"
p2 = p; }
#line 245 "gen/ragel/submatch_06__email.cc"
goto _st5;
_st5:
p+= 1;
st_case_5:
if ( p == pe )
goto _out5;
switch( ( (*( p))) ) {
case 0: {
goto _st0;
}
case 10: {
goto _st10;
}
case 45: {
goto _st6;
}
case 46: {
goto _st7;
}
}
if ( ( (*( p))) > 57 ) {
if ( 97 <= ( (*( p))) && ( (*( p))) <= 122 ) {
goto _st5;
}
} else if ( ( (*( p))) >= 48 ) {
goto _st5;
}
goto _st1;
_st6:
p+= 1;
st_case_6:
if ( p == pe )
goto _out6;
switch( ( (*( p))) ) {
case 0: {
goto _st0;
}
case 10: {
goto _st10;
}
case 45: {
goto _st6;
}
}
if ( ( (*( p))) > 57 ) {
if ( 97 <= ( (*( p))) && ( (*( p))) <= 122 ) {
goto _st5;
}
} else if ( ( (*( p))) >= 48 ) {
goto _st5;
}
goto _st1;
_st7:
p+= 1;
st_case_7:
if ( p == pe )
goto _out7;
switch( ( (*( p))) ) {
case 0: {
goto _st0;
}
case 10: {
goto _st10;
}
}
if ( ( (*( p))) > 57 ) {
if ( 97 <= ( (*( p))) && ( (*( p))) <= 122 ) {
goto _st8;
}
} else if ( ( (*( p))) >= 48 ) {
goto _st8;
}
goto _st1;
_st8:
p+= 1;
st_case_8:
if ( p == pe )
goto _out8;
switch( ( (*( p))) ) {
case 0: {
goto _st0;
}
case 10: {
goto _ctr11;
}
case 45: {
goto _st9;
}
case 46: {
goto _st7;
}
}
if ( ( (*( p))) > 57 ) {
if ( 97 <= ( (*( p))) && ( (*( p))) <= 122 ) {
goto _st8;
}
} else if ( ( (*( p))) >= 48 ) {
goto _st8;
}
goto _st1;
_st9:
p+= 1;
st_case_9:
if ( p == pe )
goto _out9;
switch( ( (*( p))) ) {
case 0: {
goto _st0;
}
case 10: {
goto _st10;
}
case 45: {
goto _st9;
}
}
if ( ( (*( p))) > 57 ) {
if ( 97 <= ( (*( p))) && ( (*( p))) <= 122 ) {
goto _st8;
}
} else if ( ( (*( p))) >= 48 ) {
goto _st8;
}
goto _st1;
_out10: cs = 10; goto _out;
_out1: cs = 1; goto _out;
_out0: cs = 0; goto _out;
_out2: cs = 2; goto _out;
_out3: cs = 3; goto _out;
_out4: cs = 4; goto _out;
_out5: cs = 5; goto _out;
_out6: cs = 6; goto _out;
_out7: cs = 7; goto _out;
_out8: cs = 8; goto _out;
_out9: cs = 9; goto _out;
_out: {}
}
#line 39 "../../../benchmarks/c/src/ragel/submatch_06__email.rl"
in->p = p;
in->pe = pe;
return count;
}
RAGEL_BENCH_AND_TEST()
} // namespace ragel_submatch_06__email
@@ -0,0 +1,328 @@
#line 1 "../../../benchmarks/c/src/ragel/submatch_07__ipv4.rl"
#include "ragel/base.h"
namespace ragel_submatch_07__ipv4 {
const char *delim = "\n";
#line 29 "../../../benchmarks/c/src/ragel/submatch_07__ipv4.rl"
#line 11 "gen/ragel/submatch_07__ipv4.cc"
static const int ipv4_start = 16;
static const int ipv4_first_final = 16;
static const int ipv4_error = 0;
static const int ipv4_en_main = 16;
#line 31 "../../../benchmarks/c/src/ragel/submatch_07__ipv4.rl"
static int lex(Input *in, int count) {
char *p = in->p;
char *pe = in->pe;
const char *p1, *p2, *p3, *p4;
int cs;
#line 26 "gen/ragel/submatch_07__ipv4.cc"
{
cs = (int)ipv4_start;
}
#line 39 "../../../benchmarks/c/src/ragel/submatch_07__ipv4.rl"
#line 31 "gen/ragel/submatch_07__ipv4.cc"
{
switch ( cs ) {
case 16:
goto st_case_16;
case 0:
goto st_case_0;
case 1:
goto st_case_1;
case 2:
goto st_case_2;
case 3:
goto st_case_3;
case 4:
goto st_case_4;
case 5:
goto st_case_5;
case 6:
goto st_case_6;
case 7:
goto st_case_7;
case 8:
goto st_case_8;
case 9:
goto st_case_9;
case 10:
goto st_case_10;
case 11:
goto st_case_11;
case 12:
goto st_case_12;
case 13:
goto st_case_13;
case 14:
goto st_case_14;
case 15:
goto st_case_15;
}
_ctr14:
{
#line 17 "../../../benchmarks/c/src/ragel/submatch_07__ipv4.rl"
OUTS(p1, p2 - 1);
OUTC(',');
OUTS(p2, p3 - 1);
OUTC(',');
OUTS(p3, p4 - 1);
OUTC(',');
OUTS(p4, p);
OUTC('\n');
}
#line 82 "gen/ragel/submatch_07__ipv4.cc"
goto _st16;
_st16:
p+= 1;
st_case_16:
if ( p == pe )
goto _out16;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _ctr21;
}
goto _st0;
_st0:
st_case_0:
goto _out0;
_ctr21:
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_07__ipv4.rl"
p1 = p; }
#line 101 "gen/ragel/submatch_07__ipv4.cc"
goto _st1;
_st1:
p+= 1;
st_case_1:
if ( p == pe )
goto _out1;
if ( ( (*( p))) == 46 ) {
goto _st2;
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st14;
}
goto _st0;
_st2:
p+= 1;
st_case_2:
if ( p == pe )
goto _out2;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _ctr4;
}
goto _st0;
_ctr4:
{
#line 14 "../../../benchmarks/c/src/ragel/submatch_07__ipv4.rl"
p2 = p; }
#line 129 "gen/ragel/submatch_07__ipv4.cc"
goto _st3;
_st3:
p+= 1;
st_case_3:
if ( p == pe )
goto _out3;
if ( ( (*( p))) == 46 ) {
goto _st4;
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st12;
}
goto _st0;
_st4:
p+= 1;
st_case_4:
if ( p == pe )
goto _out4;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _ctr8;
}
goto _st0;
_ctr8:
{
#line 15 "../../../benchmarks/c/src/ragel/submatch_07__ipv4.rl"
p3 = p; }
#line 157 "gen/ragel/submatch_07__ipv4.cc"
goto _st5;
_st5:
p+= 1;
st_case_5:
if ( p == pe )
goto _out5;
if ( ( (*( p))) == 46 ) {
goto _st6;
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st10;
}
goto _st0;
_st6:
p+= 1;
st_case_6:
if ( p == pe )
goto _out6;
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _ctr12;
}
goto _st0;
_ctr12:
{
#line 16 "../../../benchmarks/c/src/ragel/submatch_07__ipv4.rl"
p4 = p; }
#line 185 "gen/ragel/submatch_07__ipv4.cc"
goto _st7;
_st7:
p+= 1;
st_case_7:
if ( p == pe )
goto _out7;
if ( ( (*( p))) == 10 ) {
goto _ctr14;
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st8;
}
goto _st0;
_st8:
p+= 1;
st_case_8:
if ( p == pe )
goto _out8;
if ( ( (*( p))) == 10 ) {
goto _ctr14;
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st9;
}
goto _st0;
_st9:
p+= 1;
st_case_9:
if ( p == pe )
goto _out9;
if ( ( (*( p))) == 10 ) {
goto _ctr14;
}
goto _st0;
_st10:
p+= 1;
st_case_10:
if ( p == pe )
goto _out10;
if ( ( (*( p))) == 46 ) {
goto _st6;
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st11;
}
goto _st0;
_st11:
p+= 1;
st_case_11:
if ( p == pe )
goto _out11;
if ( ( (*( p))) == 46 ) {
goto _st6;
}
goto _st0;
_st12:
p+= 1;
st_case_12:
if ( p == pe )
goto _out12;
if ( ( (*( p))) == 46 ) {
goto _st4;
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st13;
}
goto _st0;
_st13:
p+= 1;
st_case_13:
if ( p == pe )
goto _out13;
if ( ( (*( p))) == 46 ) {
goto _st4;
}
goto _st0;
_st14:
p+= 1;
st_case_14:
if ( p == pe )
goto _out14;
if ( ( (*( p))) == 46 ) {
goto _st2;
}
if ( 48 <= ( (*( p))) && ( (*( p))) <= 57 ) {
goto _st15;
}
goto _st0;
_st15:
p+= 1;
st_case_15:
if ( p == pe )
goto _out15;
if ( ( (*( p))) == 46 ) {
goto _st2;
}
goto _st0;
_out16: cs = 16; goto _out;
_out0: cs = 0; goto _out;
_out1: cs = 1; goto _out;
_out2: cs = 2; goto _out;
_out3: cs = 3; goto _out;
_out4: cs = 4; goto _out;
_out5: cs = 5; goto _out;
_out6: cs = 6; goto _out;
_out7: cs = 7; goto _out;
_out8: cs = 8; goto _out;
_out9: cs = 9; goto _out;
_out10: cs = 10; goto _out;
_out11: cs = 11; goto _out;
_out12: cs = 12; goto _out;
_out13: cs = 13; goto _out;
_out14: cs = 14; goto _out;
_out15: cs = 15; goto _out;
_out: {}
}
#line 40 "../../../benchmarks/c/src/ragel/submatch_07__ipv4.rl"
in->p = p;
in->pe = pe;
return count;
}
RAGEL_BENCH_AND_TEST()
} // namespace ragel_submatch_07__ipv4
@@ -0,0 +1,207 @@
#line 1 "../../../benchmarks/c/src/ragel/submatch_10__alt1_2.rl"
#include "ragel/base.h"
namespace ragel_submatch_10__alt1_2 {
const char *delim = "\n";
#line 23 "../../../benchmarks/c/src/ragel/submatch_10__alt1_2.rl"
#line 11 "gen/ragel/submatch_10__alt1_2.cc"
static const int m_start = 3;
static const int m_first_final = 3;
static const int m_error = 0;
static const int m_en_main = 3;
#line 25 "../../../benchmarks/c/src/ragel/submatch_10__alt1_2.rl"
static int lex(Input *in, int count) {
char *p = in->p;
char *pe = in->pe;
const char
*a1, *b1,
*a2, *b2;
int cs;
#line 28 "gen/ragel/submatch_10__alt1_2.cc"
{
cs = (int)m_start;
}
#line 35 "../../../benchmarks/c/src/ragel/submatch_10__alt1_2.rl"
#line 33 "gen/ragel/submatch_10__alt1_2.cc"
{
switch ( cs ) {
case 3:
goto st_case_3;
case 0:
goto st_case_0;
case 1:
goto st_case_1;
case 2:
goto st_case_2;
}
_ctr2:
{
#line 14 "../../../benchmarks/c/src/ragel/submatch_10__alt1_2.rl"
a2 = p; b1 = b2 = NULL; }
#line 49 "gen/ragel/submatch_10__alt1_2.cc"
{
#line 16 "../../../benchmarks/c/src/ragel/submatch_10__alt1_2.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
OUTC('\n');
}
#line 58 "gen/ragel/submatch_10__alt1_2.cc"
goto _st3;
_ctr4:
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_10__alt1_2.rl"
b2 = p; a1 = a2 = NULL; }
#line 65 "gen/ragel/submatch_10__alt1_2.cc"
{
#line 16 "../../../benchmarks/c/src/ragel/submatch_10__alt1_2.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
OUTC('\n');
}
#line 74 "gen/ragel/submatch_10__alt1_2.cc"
goto _st3;
_ctr6:
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_10__alt1_2.rl"
b1 = p; }
#line 81 "gen/ragel/submatch_10__alt1_2.cc"
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_10__alt1_2.rl"
b2 = p; a1 = a2 = NULL; }
#line 86 "gen/ragel/submatch_10__alt1_2.cc"
{
#line 14 "../../../benchmarks/c/src/ragel/submatch_10__alt1_2.rl"
a1 = p; }
#line 91 "gen/ragel/submatch_10__alt1_2.cc"
{
#line 14 "../../../benchmarks/c/src/ragel/submatch_10__alt1_2.rl"
a2 = p; b1 = b2 = NULL; }
#line 96 "gen/ragel/submatch_10__alt1_2.cc"
{
#line 16 "../../../benchmarks/c/src/ragel/submatch_10__alt1_2.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
OUTC('\n');
}
#line 105 "gen/ragel/submatch_10__alt1_2.cc"
goto _st3;
_st3:
p+= 1;
st_case_3:
if ( p == pe )
goto _out3;
switch( ( (*( p))) ) {
case 10: {
goto _ctr6;
}
case 97: {
goto _ctr7;
}
case 98: {
goto _ctr8;
}
}
goto _st0;
_st0:
st_case_0:
goto _out0;
_ctr7:
{
#line 14 "../../../benchmarks/c/src/ragel/submatch_10__alt1_2.rl"
a1 = p; }
#line 132 "gen/ragel/submatch_10__alt1_2.cc"
goto _st1;
_st1:
p+= 1;
st_case_1:
if ( p == pe )
goto _out1;
switch( ( (*( p))) ) {
case 10: {
goto _ctr2;
}
case 97: {
goto _st1;
}
}
goto _st0;
_ctr8:
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_10__alt1_2.rl"
b1 = p; }
#line 153 "gen/ragel/submatch_10__alt1_2.cc"
goto _st2;
_st2:
p+= 1;
st_case_2:
if ( p == pe )
goto _out2;
switch( ( (*( p))) ) {
case 10: {
goto _ctr4;
}
case 98: {
goto _st2;
}
}
goto _st0;
_out3: cs = 3; goto _out;
_out0: cs = 0; goto _out;
_out1: cs = 1; goto _out;
_out2: cs = 2; goto _out;
_out: {}
}
#line 36 "../../../benchmarks/c/src/ragel/submatch_10__alt1_2.rl"
in->p = p;
in->pe = pe;
return count;
}
RAGEL_BENCH_AND_TEST()
} // namespace ragel_submatch_10__alt1_2
@@ -0,0 +1,333 @@
#line 1 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
#include "ragel/base.h"
namespace ragel_submatch_11__alt1_4 {
const char *delim = "\n";
#line 27 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
#line 11 "gen/ragel/submatch_11__alt1_4.cc"
static const int m_start = 5;
static const int m_first_final = 5;
static const int m_error = 0;
static const int m_en_main = 5;
#line 29 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
static int lex(Input *in, int count) {
char *p = in->p;
char *pe = in->pe;
const char
*a1, *b1, *c1, *d1,
*a2, *b2, *c2, *d2;
int cs;
#line 28 "gen/ragel/submatch_11__alt1_4.cc"
{
cs = (int)m_start;
}
#line 39 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
#line 33 "gen/ragel/submatch_11__alt1_4.cc"
{
switch ( cs ) {
case 5:
goto st_case_5;
case 0:
goto st_case_0;
case 1:
goto st_case_1;
case 2:
goto st_case_2;
case 3:
goto st_case_3;
case 4:
goto st_case_4;
}
_ctr2:
{
#line 16 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
a2 = p; b1 = b2 = c1 = c2 = d1 = d2 = NULL; }
#line 53 "gen/ragel/submatch_11__alt1_4.cc"
{
#line 18 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
OUTC('\n');
}
#line 64 "gen/ragel/submatch_11__alt1_4.cc"
goto _st5;
_ctr4:
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
b2 = p; a1 = a2 = c1 = c2 = d1 = d2 = NULL; }
#line 71 "gen/ragel/submatch_11__alt1_4.cc"
{
#line 18 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
OUTC('\n');
}
#line 82 "gen/ragel/submatch_11__alt1_4.cc"
goto _st5;
_ctr6:
{
#line 14 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
c2 = p; a1 = a2 = b1 = b2 = d1 = d2 = NULL; }
#line 89 "gen/ragel/submatch_11__alt1_4.cc"
{
#line 18 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
OUTC('\n');
}
#line 100 "gen/ragel/submatch_11__alt1_4.cc"
goto _st5;
_ctr8:
{
#line 15 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
d2 = p; a1 = a2 = b1 = b2 = c1 = c2 = NULL; }
#line 107 "gen/ragel/submatch_11__alt1_4.cc"
{
#line 18 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
OUTC('\n');
}
#line 118 "gen/ragel/submatch_11__alt1_4.cc"
goto _st5;
_ctr10:
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
b1 = p; }
#line 125 "gen/ragel/submatch_11__alt1_4.cc"
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
b2 = p; a1 = a2 = c1 = c2 = d1 = d2 = NULL; }
#line 130 "gen/ragel/submatch_11__alt1_4.cc"
{
#line 14 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
c1 = p; }
#line 135 "gen/ragel/submatch_11__alt1_4.cc"
{
#line 14 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
c2 = p; a1 = a2 = b1 = b2 = d1 = d2 = NULL; }
#line 140 "gen/ragel/submatch_11__alt1_4.cc"
{
#line 15 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
d1 = p; }
#line 145 "gen/ragel/submatch_11__alt1_4.cc"
{
#line 15 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
d2 = p; a1 = a2 = b1 = b2 = c1 = c2 = NULL; }
#line 150 "gen/ragel/submatch_11__alt1_4.cc"
{
#line 16 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
a1 = p; }
#line 155 "gen/ragel/submatch_11__alt1_4.cc"
{
#line 16 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
a2 = p; b1 = b2 = c1 = c2 = d1 = d2 = NULL; }
#line 160 "gen/ragel/submatch_11__alt1_4.cc"
{
#line 18 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
OUTC('\n');
}
#line 171 "gen/ragel/submatch_11__alt1_4.cc"
goto _st5;
_st5:
p+= 1;
st_case_5:
if ( p == pe )
goto _out5;
switch( ( (*( p))) ) {
case 10: {
goto _ctr10;
}
case 97: {
goto _ctr11;
}
case 98: {
goto _ctr12;
}
case 99: {
goto _ctr13;
}
case 100: {
goto _ctr14;
}
}
goto _st0;
_st0:
st_case_0:
goto _out0;
_ctr11:
{
#line 16 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
a1 = p; }
#line 204 "gen/ragel/submatch_11__alt1_4.cc"
goto _st1;
_st1:
p+= 1;
st_case_1:
if ( p == pe )
goto _out1;
switch( ( (*( p))) ) {
case 10: {
goto _ctr2;
}
case 97: {
goto _st1;
}
}
goto _st0;
_ctr12:
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
b1 = p; }
#line 225 "gen/ragel/submatch_11__alt1_4.cc"
goto _st2;
_st2:
p+= 1;
st_case_2:
if ( p == pe )
goto _out2;
switch( ( (*( p))) ) {
case 10: {
goto _ctr4;
}
case 98: {
goto _st2;
}
}
goto _st0;
_ctr13:
{
#line 14 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
c1 = p; }
#line 246 "gen/ragel/submatch_11__alt1_4.cc"
goto _st3;
_st3:
p+= 1;
st_case_3:
if ( p == pe )
goto _out3;
switch( ( (*( p))) ) {
case 10: {
goto _ctr6;
}
case 99: {
goto _st3;
}
}
goto _st0;
_ctr14:
{
#line 15 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
d1 = p; }
#line 267 "gen/ragel/submatch_11__alt1_4.cc"
goto _st4;
_st4:
p+= 1;
st_case_4:
if ( p == pe )
goto _out4;
switch( ( (*( p))) ) {
case 10: {
goto _ctr8;
}
case 100: {
goto _st4;
}
}
goto _st0;
_out5: cs = 5; goto _out;
_out0: cs = 0; goto _out;
_out1: cs = 1; goto _out;
_out2: cs = 2; goto _out;
_out3: cs = 3; goto _out;
_out4: cs = 4; goto _out;
_out: {}
}
#line 40 "../../../benchmarks/c/src/ragel/submatch_11__alt1_4.rl"
in->p = p;
in->pe = pe;
return count;
}
RAGEL_BENCH_AND_TEST()
} // namespace ragel_submatch_11__alt1_4
@@ -0,0 +1,609 @@
#line 1 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
#include "ragel/base.h"
namespace ragel_submatch_12__alt1_8 {
const char *delim = "\n";
#line 35 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
#line 11 "gen/ragel/submatch_12__alt1_8.cc"
static const int m_start = 9;
static const int m_first_final = 9;
static const int m_error = 0;
static const int m_en_main = 9;
#line 37 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
static int lex(Input *in, int count) {
char *p = in->p;
char *pe = in->pe;
const char
*a1, *b1, *c1, *d1, *e1, *f1, *g1, *h1,
*a2, *b2, *c2, *d2, *e2, *f2, *g2, *h2;
int cs;
#line 28 "gen/ragel/submatch_12__alt1_8.cc"
{
cs = (int)m_start;
}
#line 47 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
#line 33 "gen/ragel/submatch_12__alt1_8.cc"
{
switch ( cs ) {
case 9:
goto st_case_9;
case 0:
goto st_case_0;
case 1:
goto st_case_1;
case 2:
goto st_case_2;
case 3:
goto st_case_3;
case 4:
goto st_case_4;
case 5:
goto st_case_5;
case 6:
goto st_case_6;
case 7:
goto st_case_7;
case 8:
goto st_case_8;
}
_ctr2:
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
a2 = p; b1 = b2 = c1 = c2 = d1 = d2 = e1 = e2 = f1 = f2 = g1 = g2 = h1 = h2 = NULL; }
#line 61 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
else if (e1) { OUTC('E'); OUTS(e1, e2); }
else if (f1) { OUTC('F'); OUTS(f1, f2); }
else if (g1) { OUTC('G'); OUTS(g1, g2); }
else if (h1) { OUTC('H'); OUTS(h1, h2); }
OUTC('\n');
}
#line 76 "gen/ragel/submatch_12__alt1_8.cc"
goto _st9;
_ctr4:
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
b2 = p; a1 = a2 = c1 = c2 = d1 = d2 = e1 = e2 = f1 = f2 = g1 = g2 = h1 = h2 = NULL; }
#line 83 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
else if (e1) { OUTC('E'); OUTS(e1, e2); }
else if (f1) { OUTC('F'); OUTS(f1, f2); }
else if (g1) { OUTC('G'); OUTS(g1, g2); }
else if (h1) { OUTC('H'); OUTS(h1, h2); }
OUTC('\n');
}
#line 98 "gen/ragel/submatch_12__alt1_8.cc"
goto _st9;
_ctr6:
{
#line 14 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
c2 = p; a1 = a2 = b1 = b2 = d1 = d2 = e1 = e2 = f1 = f2 = g1 = g2 = h1 = h2 = NULL; }
#line 105 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
else if (e1) { OUTC('E'); OUTS(e1, e2); }
else if (f1) { OUTC('F'); OUTS(f1, f2); }
else if (g1) { OUTC('G'); OUTS(g1, g2); }
else if (h1) { OUTC('H'); OUTS(h1, h2); }
OUTC('\n');
}
#line 120 "gen/ragel/submatch_12__alt1_8.cc"
goto _st9;
_ctr8:
{
#line 15 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
d2 = p; a1 = a2 = b1 = b2 = c1 = c2 = e1 = e2 = f1 = f2 = g1 = g2 = h1 = h2 = NULL; }
#line 127 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
else if (e1) { OUTC('E'); OUTS(e1, e2); }
else if (f1) { OUTC('F'); OUTS(f1, f2); }
else if (g1) { OUTC('G'); OUTS(g1, g2); }
else if (h1) { OUTC('H'); OUTS(h1, h2); }
OUTC('\n');
}
#line 142 "gen/ragel/submatch_12__alt1_8.cc"
goto _st9;
_ctr10:
{
#line 16 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
e2 = p; a1 = a2 = b1 = b2 = c1 = c2 = d1 = d2 = f1 = f2 = g1 = g2 = h1 = h2 = NULL; }
#line 149 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
else if (e1) { OUTC('E'); OUTS(e1, e2); }
else if (f1) { OUTC('F'); OUTS(f1, f2); }
else if (g1) { OUTC('G'); OUTS(g1, g2); }
else if (h1) { OUTC('H'); OUTS(h1, h2); }
OUTC('\n');
}
#line 164 "gen/ragel/submatch_12__alt1_8.cc"
goto _st9;
_ctr12:
{
#line 17 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
f2 = p; a1 = a2 = b1 = b2 = c1 = c2 = d1 = d2 = e1 = e2 = g1 = g2 = h1 = h2 = NULL; }
#line 171 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
else if (e1) { OUTC('E'); OUTS(e1, e2); }
else if (f1) { OUTC('F'); OUTS(f1, f2); }
else if (g1) { OUTC('G'); OUTS(g1, g2); }
else if (h1) { OUTC('H'); OUTS(h1, h2); }
OUTC('\n');
}
#line 186 "gen/ragel/submatch_12__alt1_8.cc"
goto _st9;
_ctr14:
{
#line 18 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
g2 = p; a1 = a2 = b1 = b2 = c1 = c2 = d1 = d2 = e1 = e2 = f1 = f2 = h1 = h2 = NULL; }
#line 193 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
else if (e1) { OUTC('E'); OUTS(e1, e2); }
else if (f1) { OUTC('F'); OUTS(f1, f2); }
else if (g1) { OUTC('G'); OUTS(g1, g2); }
else if (h1) { OUTC('H'); OUTS(h1, h2); }
OUTC('\n');
}
#line 208 "gen/ragel/submatch_12__alt1_8.cc"
goto _st9;
_ctr16:
{
#line 19 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
h2 = p; a1 = a2 = b1 = b2 = c1 = c2 = d1 = d2 = e1 = e2 = f1 = f2 = g1 = g2 = NULL; }
#line 215 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
else if (e1) { OUTC('E'); OUTS(e1, e2); }
else if (f1) { OUTC('F'); OUTS(f1, f2); }
else if (g1) { OUTC('G'); OUTS(g1, g2); }
else if (h1) { OUTC('H'); OUTS(h1, h2); }
OUTC('\n');
}
#line 230 "gen/ragel/submatch_12__alt1_8.cc"
goto _st9;
_ctr18:
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
b1 = p; }
#line 237 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
b2 = p; a1 = a2 = c1 = c2 = d1 = d2 = e1 = e2 = f1 = f2 = g1 = g2 = h1 = h2 = NULL; }
#line 242 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 14 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
c1 = p; }
#line 247 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 14 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
c2 = p; a1 = a2 = b1 = b2 = d1 = d2 = e1 = e2 = f1 = f2 = g1 = g2 = h1 = h2 = NULL; }
#line 252 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 15 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
d1 = p; }
#line 257 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 15 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
d2 = p; a1 = a2 = b1 = b2 = c1 = c2 = e1 = e2 = f1 = f2 = g1 = g2 = h1 = h2 = NULL; }
#line 262 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 16 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
e1 = p; }
#line 267 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 16 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
e2 = p; a1 = a2 = b1 = b2 = c1 = c2 = d1 = d2 = f1 = f2 = g1 = g2 = h1 = h2 = NULL; }
#line 272 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 17 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
f1 = p; }
#line 277 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 17 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
f2 = p; a1 = a2 = b1 = b2 = c1 = c2 = d1 = d2 = e1 = e2 = g1 = g2 = h1 = h2 = NULL; }
#line 282 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 18 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
g1 = p; }
#line 287 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 18 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
g2 = p; a1 = a2 = b1 = b2 = c1 = c2 = d1 = d2 = e1 = e2 = f1 = f2 = h1 = h2 = NULL; }
#line 292 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 19 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
h1 = p; }
#line 297 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 19 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
h2 = p; a1 = a2 = b1 = b2 = c1 = c2 = d1 = d2 = e1 = e2 = f1 = f2 = g1 = g2 = NULL; }
#line 302 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
a1 = p; }
#line 307 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
a2 = p; b1 = b2 = c1 = c2 = d1 = d2 = e1 = e2 = f1 = f2 = g1 = g2 = h1 = h2 = NULL; }
#line 312 "gen/ragel/submatch_12__alt1_8.cc"
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
else if (e1) { OUTC('E'); OUTS(e1, e2); }
else if (f1) { OUTC('F'); OUTS(f1, f2); }
else if (g1) { OUTC('G'); OUTS(g1, g2); }
else if (h1) { OUTC('H'); OUTS(h1, h2); }
OUTC('\n');
}
#line 327 "gen/ragel/submatch_12__alt1_8.cc"
goto _st9;
_st9:
p+= 1;
st_case_9:
if ( p == pe )
goto _out9;
switch( ( (*( p))) ) {
case 10: {
goto _ctr18;
}
case 97: {
goto _ctr19;
}
case 98: {
goto _ctr20;
}
case 99: {
goto _ctr21;
}
case 100: {
goto _ctr22;
}
case 101: {
goto _ctr23;
}
case 102: {
goto _ctr24;
}
case 103: {
goto _ctr25;
}
case 104: {
goto _ctr26;
}
}
goto _st0;
_st0:
st_case_0:
goto _out0;
_ctr19:
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
a1 = p; }
#line 372 "gen/ragel/submatch_12__alt1_8.cc"
goto _st1;
_st1:
p+= 1;
st_case_1:
if ( p == pe )
goto _out1;
switch( ( (*( p))) ) {
case 10: {
goto _ctr2;
}
case 97: {
goto _st1;
}
}
goto _st0;
_ctr20:
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
b1 = p; }
#line 393 "gen/ragel/submatch_12__alt1_8.cc"
goto _st2;
_st2:
p+= 1;
st_case_2:
if ( p == pe )
goto _out2;
switch( ( (*( p))) ) {
case 10: {
goto _ctr4;
}
case 98: {
goto _st2;
}
}
goto _st0;
_ctr21:
{
#line 14 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
c1 = p; }
#line 414 "gen/ragel/submatch_12__alt1_8.cc"
goto _st3;
_st3:
p+= 1;
st_case_3:
if ( p == pe )
goto _out3;
switch( ( (*( p))) ) {
case 10: {
goto _ctr6;
}
case 99: {
goto _st3;
}
}
goto _st0;
_ctr22:
{
#line 15 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
d1 = p; }
#line 435 "gen/ragel/submatch_12__alt1_8.cc"
goto _st4;
_st4:
p+= 1;
st_case_4:
if ( p == pe )
goto _out4;
switch( ( (*( p))) ) {
case 10: {
goto _ctr8;
}
case 100: {
goto _st4;
}
}
goto _st0;
_ctr23:
{
#line 16 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
e1 = p; }
#line 456 "gen/ragel/submatch_12__alt1_8.cc"
goto _st5;
_st5:
p+= 1;
st_case_5:
if ( p == pe )
goto _out5;
switch( ( (*( p))) ) {
case 10: {
goto _ctr10;
}
case 101: {
goto _st5;
}
}
goto _st0;
_ctr24:
{
#line 17 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
f1 = p; }
#line 477 "gen/ragel/submatch_12__alt1_8.cc"
goto _st6;
_st6:
p+= 1;
st_case_6:
if ( p == pe )
goto _out6;
switch( ( (*( p))) ) {
case 10: {
goto _ctr12;
}
case 102: {
goto _st6;
}
}
goto _st0;
_ctr25:
{
#line 18 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
g1 = p; }
#line 498 "gen/ragel/submatch_12__alt1_8.cc"
goto _st7;
_st7:
p+= 1;
st_case_7:
if ( p == pe )
goto _out7;
switch( ( (*( p))) ) {
case 10: {
goto _ctr14;
}
case 103: {
goto _st7;
}
}
goto _st0;
_ctr26:
{
#line 19 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
h1 = p; }
#line 519 "gen/ragel/submatch_12__alt1_8.cc"
goto _st8;
_st8:
p+= 1;
st_case_8:
if ( p == pe )
goto _out8;
switch( ( (*( p))) ) {
case 10: {
goto _ctr16;
}
case 104: {
goto _st8;
}
}
goto _st0;
_out9: cs = 9; goto _out;
_out0: cs = 0; goto _out;
_out1: cs = 1; goto _out;
_out2: cs = 2; goto _out;
_out3: cs = 3; goto _out;
_out4: cs = 4; goto _out;
_out5: cs = 5; goto _out;
_out6: cs = 6; goto _out;
_out7: cs = 7; goto _out;
_out8: cs = 8; goto _out;
_out: {}
}
#line 48 "../../../benchmarks/c/src/ragel/submatch_12__alt1_8.rl"
in->p = p;
in->pe = pe;
return count;
}
RAGEL_BENCH_AND_TEST()
} // namespace ragel_submatch_12__alt1_8
@@ -0,0 +1,395 @@
#line 1 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
#include "ragel/base.h"
namespace ragel_submatch_13__alt2_2 {
const char *delim = "\n";
#line 36 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
#line 11 "gen/ragel/submatch_13__alt2_2.cc"
static const int m_start = 5;
static const int m_first_final = 5;
static const int m_error = 0;
static const int m_en_main = 5;
#line 38 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
static int lex(Input *in, int count) {
char *p = in->p;
char *pe = in->pe;
const char
*a1, *b1,
*a2, *b2,
*a3, *b3,
*a4, *b4;
int cs;
#line 30 "gen/ragel/submatch_13__alt2_2.cc"
{
cs = (int)m_start;
}
#line 50 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
#line 35 "gen/ragel/submatch_13__alt2_2.cc"
{
switch ( cs ) {
case 5:
goto st_case_5;
case 0:
goto st_case_0;
case 1:
goto st_case_1;
case 2:
goto st_case_2;
case 3:
goto st_case_3;
case 4:
goto st_case_4;
}
_ctr2:
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
a2 = p; b1 = b2 = NULL; }
#line 55 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 24 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
b3 = p; }
#line 60 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 24 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
b4 = p; a3 = a4 = NULL; }
#line 65 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
a3 = p; }
#line 70 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
a4 = p; b3 = b4 = NULL; }
#line 75 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
OUTC('\n');
}
#line 86 "gen/ragel/submatch_13__alt2_2.cc"
goto _st5;
_ctr5:
{
#line 24 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
b4 = p; a3 = a4 = NULL; }
#line 93 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
OUTC('\n');
}
#line 104 "gen/ragel/submatch_13__alt2_2.cc"
goto _st5;
_ctr7:
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
b2 = p; a1 = a2 = NULL; }
#line 111 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 24 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
b3 = p; }
#line 116 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 24 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
b4 = p; a3 = a4 = NULL; }
#line 121 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
a3 = p; }
#line 126 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
a4 = p; b3 = b4 = NULL; }
#line 131 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
OUTC('\n');
}
#line 142 "gen/ragel/submatch_13__alt2_2.cc"
goto _st5;
_ctr10:
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
a4 = p; b3 = b4 = NULL; }
#line 149 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
OUTC('\n');
}
#line 160 "gen/ragel/submatch_13__alt2_2.cc"
goto _st5;
_ctr12:
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
b1 = p; }
#line 167 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
b2 = p; a1 = a2 = NULL; }
#line 172 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
a1 = p; }
#line 177 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
a2 = p; b1 = b2 = NULL; }
#line 182 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 24 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
b3 = p; }
#line 187 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 24 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
b4 = p; a3 = a4 = NULL; }
#line 192 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
a3 = p; }
#line 197 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
a4 = p; b3 = b4 = NULL; }
#line 202 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
OUTC('\n');
}
#line 213 "gen/ragel/submatch_13__alt2_2.cc"
goto _st5;
_st5:
p+= 1;
st_case_5:
if ( p == pe )
goto _out5;
switch( ( (*( p))) ) {
case 10: {
goto _ctr12;
}
case 97: {
goto _ctr13;
}
case 98: {
goto _ctr14;
}
}
goto _st0;
_st0:
st_case_0:
goto _out0;
_ctr13:
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
a1 = p; }
#line 240 "gen/ragel/submatch_13__alt2_2.cc"
goto _st1;
_st1:
p+= 1;
st_case_1:
if ( p == pe )
goto _out1;
switch( ( (*( p))) ) {
case 10: {
goto _ctr2;
}
case 97: {
goto _st1;
}
case 98: {
goto _ctr3;
}
}
goto _st0;
_ctr3:
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
a2 = p; b1 = b2 = NULL; }
#line 264 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 24 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
b3 = p; }
#line 269 "gen/ragel/submatch_13__alt2_2.cc"
goto _st2;
_st2:
p+= 1;
st_case_2:
if ( p == pe )
goto _out2;
switch( ( (*( p))) ) {
case 10: {
goto _ctr5;
}
case 98: {
goto _st2;
}
}
goto _st0;
_ctr14:
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
b1 = p; }
#line 290 "gen/ragel/submatch_13__alt2_2.cc"
goto _st3;
_st3:
p+= 1;
st_case_3:
if ( p == pe )
goto _out3;
switch( ( (*( p))) ) {
case 10: {
goto _ctr7;
}
case 97: {
goto _ctr8;
}
case 98: {
goto _st3;
}
}
goto _st0;
_ctr8:
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
b2 = p; a1 = a2 = NULL; }
#line 314 "gen/ragel/submatch_13__alt2_2.cc"
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
a3 = p; }
#line 319 "gen/ragel/submatch_13__alt2_2.cc"
goto _st4;
_st4:
p+= 1;
st_case_4:
if ( p == pe )
goto _out4;
switch( ( (*( p))) ) {
case 10: {
goto _ctr10;
}
case 97: {
goto _st4;
}
}
goto _st0;
_out5: cs = 5; goto _out;
_out0: cs = 0; goto _out;
_out1: cs = 1; goto _out;
_out2: cs = 2; goto _out;
_out3: cs = 3; goto _out;
_out4: cs = 4; goto _out;
_out: {}
}
#line 51 "../../../benchmarks/c/src/ragel/submatch_13__alt2_2.rl"
in->p = p;
in->pe = pe;
return count;
}
RAGEL_BENCH_AND_TEST()
} // namespace ragel_submatch_13__alt2_2
@@ -0,0 +1,963 @@
#line 1 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
#include "ragel/base.h"
namespace ragel_submatch_14__alt2_4 {
const char *delim = "\n";
#line 44 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
#line 11 "gen/ragel/submatch_14__alt2_4.cc"
static const int m_start = 9;
static const int m_first_final = 9;
static const int m_error = 0;
static const int m_en_main = 9;
#line 46 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
static int lex(Input *in, int count) {
char *p = in->p;
char *pe = in->pe;
const char
*a1, *b1, *c1, *d1,
*a2, *b2, *c2, *d2,
*a3, *b3, *c3, *d3,
*a4, *b4, *c4, *d4;
int cs;
#line 30 "gen/ragel/submatch_14__alt2_4.cc"
{
cs = (int)m_start;
}
#line 58 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
#line 35 "gen/ragel/submatch_14__alt2_4.cc"
{
switch ( cs ) {
case 9:
goto st_case_9;
case 0:
goto st_case_0;
case 1:
goto st_case_1;
case 2:
goto st_case_2;
case 3:
goto st_case_3;
case 4:
goto st_case_4;
case 5:
goto st_case_5;
case 6:
goto st_case_6;
case 7:
goto st_case_7;
case 8:
goto st_case_8;
}
_ctr2:
{
#line 23 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a2 = p; b1 = b2 = c1 = c2 = d1 = d2 = NULL; }
#line 63 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b3 = p; }
#line 68 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b4 = p; a3 = a4 = c3 = c4 = d3 = d4 = NULL; }
#line 73 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c3 = p; }
#line 78 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c4 = p; a3 = a4 = b3 = b4 = d3 = d4 = NULL; }
#line 83 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 28 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d3 = p; }
#line 88 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 28 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d4 = p; a3 = a4 = b3 = b4 = c3 = c4 = NULL; }
#line 93 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a3 = p; }
#line 98 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a4 = p; b3 = b4 = c3 = c4 = d3 = d4 = NULL; }
#line 103 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 31 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
else if (c3) { OUTC('C'); OUTS(c3, c4); }
else if (d3) { OUTC('D'); OUTS(d3, d4); }
OUTC('\n');
}
#line 118 "gen/ragel/submatch_14__alt2_4.cc"
goto _st9;
_ctr7:
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b4 = p; a3 = a4 = c3 = c4 = d3 = d4 = NULL; }
#line 125 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 31 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
else if (c3) { OUTC('C'); OUTS(c3, c4); }
else if (d3) { OUTC('D'); OUTS(d3, d4); }
OUTC('\n');
}
#line 140 "gen/ragel/submatch_14__alt2_4.cc"
goto _st9;
_ctr9:
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c4 = p; a3 = a4 = b3 = b4 = d3 = d4 = NULL; }
#line 147 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 31 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
else if (c3) { OUTC('C'); OUTS(c3, c4); }
else if (d3) { OUTC('D'); OUTS(d3, d4); }
OUTC('\n');
}
#line 162 "gen/ragel/submatch_14__alt2_4.cc"
goto _st9;
_ctr11:
{
#line 28 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d4 = p; a3 = a4 = b3 = b4 = c3 = c4 = NULL; }
#line 169 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 31 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
else if (c3) { OUTC('C'); OUTS(c3, c4); }
else if (d3) { OUTC('D'); OUTS(d3, d4); }
OUTC('\n');
}
#line 184 "gen/ragel/submatch_14__alt2_4.cc"
goto _st9;
_ctr13:
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b2 = p; a1 = a2 = c1 = c2 = d1 = d2 = NULL; }
#line 191 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b3 = p; }
#line 196 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b4 = p; a3 = a4 = c3 = c4 = d3 = d4 = NULL; }
#line 201 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c3 = p; }
#line 206 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c4 = p; a3 = a4 = b3 = b4 = d3 = d4 = NULL; }
#line 211 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 28 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d3 = p; }
#line 216 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 28 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d4 = p; a3 = a4 = b3 = b4 = c3 = c4 = NULL; }
#line 221 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a3 = p; }
#line 226 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a4 = p; b3 = b4 = c3 = c4 = d3 = d4 = NULL; }
#line 231 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 31 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
else if (c3) { OUTC('C'); OUTS(c3, c4); }
else if (d3) { OUTC('D'); OUTS(d3, d4); }
OUTC('\n');
}
#line 246 "gen/ragel/submatch_14__alt2_4.cc"
goto _st9;
_ctr18:
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a4 = p; b3 = b4 = c3 = c4 = d3 = d4 = NULL; }
#line 253 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 31 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
else if (c3) { OUTC('C'); OUTS(c3, c4); }
else if (d3) { OUTC('D'); OUTS(d3, d4); }
OUTC('\n');
}
#line 268 "gen/ragel/submatch_14__alt2_4.cc"
goto _st9;
_ctr20:
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c2 = p; a1 = a2 = b1 = b2 = d1 = d2 = NULL; }
#line 275 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b3 = p; }
#line 280 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b4 = p; a3 = a4 = c3 = c4 = d3 = d4 = NULL; }
#line 285 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c3 = p; }
#line 290 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c4 = p; a3 = a4 = b3 = b4 = d3 = d4 = NULL; }
#line 295 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 28 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d3 = p; }
#line 300 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 28 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d4 = p; a3 = a4 = b3 = b4 = c3 = c4 = NULL; }
#line 305 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a3 = p; }
#line 310 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a4 = p; b3 = b4 = c3 = c4 = d3 = d4 = NULL; }
#line 315 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 31 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
else if (c3) { OUTC('C'); OUTS(c3, c4); }
else if (d3) { OUTC('D'); OUTS(d3, d4); }
OUTC('\n');
}
#line 330 "gen/ragel/submatch_14__alt2_4.cc"
goto _st9;
_ctr25:
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d2 = p; a1 = a2 = b1 = b2 = c1 = c2 = NULL; }
#line 337 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b3 = p; }
#line 342 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b4 = p; a3 = a4 = c3 = c4 = d3 = d4 = NULL; }
#line 347 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c3 = p; }
#line 352 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c4 = p; a3 = a4 = b3 = b4 = d3 = d4 = NULL; }
#line 357 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 28 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d3 = p; }
#line 362 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 28 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d4 = p; a3 = a4 = b3 = b4 = c3 = c4 = NULL; }
#line 367 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a3 = p; }
#line 372 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a4 = p; b3 = b4 = c3 = c4 = d3 = d4 = NULL; }
#line 377 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 31 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
else if (c3) { OUTC('C'); OUTS(c3, c4); }
else if (d3) { OUTC('D'); OUTS(d3, d4); }
OUTC('\n');
}
#line 392 "gen/ragel/submatch_14__alt2_4.cc"
goto _st9;
_ctr30:
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b1 = p; }
#line 399 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b2 = p; a1 = a2 = c1 = c2 = d1 = d2 = NULL; }
#line 404 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c1 = p; }
#line 409 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c2 = p; a1 = a2 = b1 = b2 = d1 = d2 = NULL; }
#line 414 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d1 = p; }
#line 419 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d2 = p; a1 = a2 = b1 = b2 = c1 = c2 = NULL; }
#line 424 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 23 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a1 = p; }
#line 429 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 23 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a2 = p; b1 = b2 = c1 = c2 = d1 = d2 = NULL; }
#line 434 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b3 = p; }
#line 439 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b4 = p; a3 = a4 = c3 = c4 = d3 = d4 = NULL; }
#line 444 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c3 = p; }
#line 449 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c4 = p; a3 = a4 = b3 = b4 = d3 = d4 = NULL; }
#line 454 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 28 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d3 = p; }
#line 459 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 28 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d4 = p; a3 = a4 = b3 = b4 = c3 = c4 = NULL; }
#line 464 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a3 = p; }
#line 469 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a4 = p; b3 = b4 = c3 = c4 = d3 = d4 = NULL; }
#line 474 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 31 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
else if (c1) { OUTC('C'); OUTS(c1, c2); }
else if (d1) { OUTC('D'); OUTS(d1, d2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
else if (c3) { OUTC('C'); OUTS(c3, c4); }
else if (d3) { OUTC('D'); OUTS(d3, d4); }
OUTC('\n');
}
#line 489 "gen/ragel/submatch_14__alt2_4.cc"
goto _st9;
_st9:
p+= 1;
st_case_9:
if ( p == pe )
goto _out9;
switch( ( (*( p))) ) {
case 10: {
goto _ctr30;
}
case 97: {
goto _ctr31;
}
case 98: {
goto _ctr32;
}
case 99: {
goto _ctr33;
}
case 100: {
goto _ctr34;
}
}
goto _st0;
_st0:
st_case_0:
goto _out0;
_ctr31:
{
#line 23 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a1 = p; }
#line 522 "gen/ragel/submatch_14__alt2_4.cc"
goto _st1;
_st1:
p+= 1;
st_case_1:
if ( p == pe )
goto _out1;
switch( ( (*( p))) ) {
case 10: {
goto _ctr2;
}
case 97: {
goto _st1;
}
case 98: {
goto _ctr3;
}
case 99: {
goto _ctr4;
}
case 100: {
goto _ctr5;
}
}
goto _st0;
_ctr3:
{
#line 23 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a2 = p; b1 = b2 = c1 = c2 = d1 = d2 = NULL; }
#line 552 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b3 = p; }
#line 557 "gen/ragel/submatch_14__alt2_4.cc"
goto _st2;
_ctr22:
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c2 = p; a1 = a2 = b1 = b2 = d1 = d2 = NULL; }
#line 564 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b3 = p; }
#line 569 "gen/ragel/submatch_14__alt2_4.cc"
goto _st2;
_ctr27:
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d2 = p; a1 = a2 = b1 = b2 = c1 = c2 = NULL; }
#line 576 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b3 = p; }
#line 581 "gen/ragel/submatch_14__alt2_4.cc"
goto _st2;
_st2:
p+= 1;
st_case_2:
if ( p == pe )
goto _out2;
switch( ( (*( p))) ) {
case 10: {
goto _ctr7;
}
case 98: {
goto _st2;
}
}
goto _st0;
_ctr4:
{
#line 23 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a2 = p; b1 = b2 = c1 = c2 = d1 = d2 = NULL; }
#line 602 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c3 = p; }
#line 607 "gen/ragel/submatch_14__alt2_4.cc"
goto _st3;
_ctr15:
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b2 = p; a1 = a2 = c1 = c2 = d1 = d2 = NULL; }
#line 614 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c3 = p; }
#line 619 "gen/ragel/submatch_14__alt2_4.cc"
goto _st3;
_ctr28:
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d2 = p; a1 = a2 = b1 = b2 = c1 = c2 = NULL; }
#line 626 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 27 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c3 = p; }
#line 631 "gen/ragel/submatch_14__alt2_4.cc"
goto _st3;
_st3:
p+= 1;
st_case_3:
if ( p == pe )
goto _out3;
switch( ( (*( p))) ) {
case 10: {
goto _ctr9;
}
case 99: {
goto _st3;
}
}
goto _st0;
_ctr5:
{
#line 23 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a2 = p; b1 = b2 = c1 = c2 = d1 = d2 = NULL; }
#line 652 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 28 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d3 = p; }
#line 657 "gen/ragel/submatch_14__alt2_4.cc"
goto _st4;
_ctr16:
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b2 = p; a1 = a2 = c1 = c2 = d1 = d2 = NULL; }
#line 664 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 28 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d3 = p; }
#line 669 "gen/ragel/submatch_14__alt2_4.cc"
goto _st4;
_ctr23:
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c2 = p; a1 = a2 = b1 = b2 = d1 = d2 = NULL; }
#line 676 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 28 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d3 = p; }
#line 681 "gen/ragel/submatch_14__alt2_4.cc"
goto _st4;
_st4:
p+= 1;
st_case_4:
if ( p == pe )
goto _out4;
switch( ( (*( p))) ) {
case 10: {
goto _ctr11;
}
case 100: {
goto _st4;
}
}
goto _st0;
_ctr32:
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b1 = p; }
#line 702 "gen/ragel/submatch_14__alt2_4.cc"
goto _st5;
_st5:
p+= 1;
st_case_5:
if ( p == pe )
goto _out5;
switch( ( (*( p))) ) {
case 10: {
goto _ctr13;
}
case 97: {
goto _ctr14;
}
case 98: {
goto _st5;
}
case 99: {
goto _ctr15;
}
case 100: {
goto _ctr16;
}
}
goto _st0;
_ctr14:
{
#line 20 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
b2 = p; a1 = a2 = c1 = c2 = d1 = d2 = NULL; }
#line 732 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a3 = p; }
#line 737 "gen/ragel/submatch_14__alt2_4.cc"
goto _st6;
_ctr21:
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c2 = p; a1 = a2 = b1 = b2 = d1 = d2 = NULL; }
#line 744 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a3 = p; }
#line 749 "gen/ragel/submatch_14__alt2_4.cc"
goto _st6;
_ctr26:
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d2 = p; a1 = a2 = b1 = b2 = c1 = c2 = NULL; }
#line 756 "gen/ragel/submatch_14__alt2_4.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
a3 = p; }
#line 761 "gen/ragel/submatch_14__alt2_4.cc"
goto _st6;
_st6:
p+= 1;
st_case_6:
if ( p == pe )
goto _out6;
switch( ( (*( p))) ) {
case 10: {
goto _ctr18;
}
case 97: {
goto _st6;
}
}
goto _st0;
_ctr33:
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
c1 = p; }
#line 782 "gen/ragel/submatch_14__alt2_4.cc"
goto _st7;
_st7:
p+= 1;
st_case_7:
if ( p == pe )
goto _out7;
switch( ( (*( p))) ) {
case 10: {
goto _ctr20;
}
case 97: {
goto _ctr21;
}
case 98: {
goto _ctr22;
}
case 99: {
goto _st7;
}
case 100: {
goto _ctr23;
}
}
goto _st0;
_ctr34:
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
d1 = p; }
#line 812 "gen/ragel/submatch_14__alt2_4.cc"
goto _st8;
_st8:
p+= 1;
st_case_8:
if ( p == pe )
goto _out8;
switch( ( (*( p))) ) {
case 10: {
goto _ctr25;
}
case 97: {
goto _ctr26;
}
case 98: {
goto _ctr27;
}
case 99: {
goto _ctr28;
}
case 100: {
goto _st8;
}
}
goto _st0;
_out9: cs = 9; goto _out;
_out0: cs = 0; goto _out;
_out1: cs = 1; goto _out;
_out2: cs = 2; goto _out;
_out3: cs = 3; goto _out;
_out4: cs = 4; goto _out;
_out5: cs = 5; goto _out;
_out6: cs = 6; goto _out;
_out7: cs = 7; goto _out;
_out8: cs = 8; goto _out;
_out: {}
}
#line 59 "../../../benchmarks/c/src/ragel/submatch_14__alt2_4.rl"
in->p = p;
in->pe = pe;
return count;
}
RAGEL_BENCH_AND_TEST()
} // namespace ragel_submatch_14__alt2_4
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,939 @@
#line 1 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
#include "ragel/base.h"
namespace ragel_submatch_16__alt4_2 {
const char *delim = "\n";
#line 49 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
#line 11 "gen/ragel/submatch_16__alt4_2.cc"
static const int m_start = 9;
static const int m_first_final = 9;
static const int m_error = 0;
static const int m_en_main = 9;
#line 51 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
static int lex(Input *in, int count) {
char *p = in->p;
char *pe = in->pe;
const char
*a1, *b1,
*a2, *b2,
*a3, *b3,
*a4, *b4,
*a5, *b5,
*a6, *b6,
*a7, *b7,
*a8, *b8;
int cs;
#line 34 "gen/ragel/submatch_16__alt4_2.cc"
{
cs = (int)m_start;
}
#line 67 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
#line 39 "gen/ragel/submatch_16__alt4_2.cc"
{
switch ( cs ) {
case 9:
goto st_case_9;
case 0:
goto st_case_0;
case 1:
goto st_case_1;
case 2:
goto st_case_2;
case 3:
goto st_case_3;
case 4:
goto st_case_4;
case 5:
goto st_case_5;
case 6:
goto st_case_6;
case 7:
goto st_case_7;
case 8:
goto st_case_8;
}
_ctr2:
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a2 = p; b1 = b2 = NULL; }
#line 67 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b3 = p; }
#line 72 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b4 = p; a3 = a4 = NULL; }
#line 77 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a3 = p; }
#line 82 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a4 = p; b3 = b4 = NULL; }
#line 87 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b5 = p; }
#line 92 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b6 = p; a5 = a6 = NULL; }
#line 97 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 30 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a5 = p; }
#line 102 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 30 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a6 = p; b5 = b6 = NULL; }
#line 107 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 33 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b7 = p; }
#line 112 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 33 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b8 = p; a7 = a8 = NULL; }
#line 117 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 34 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a7 = p; }
#line 122 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 34 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a8 = p; b7 = b8 = NULL; }
#line 127 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 36 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
if (a5) { OUTC('A'); OUTS(a5, a6); }
else if (b5) { OUTC('B'); OUTS(b5, b6); }
if (a7) { OUTC('A'); OUTS(a7, a8); }
else if (b7) { OUTC('B'); OUTS(b7, b8); }
OUTC('\n');
}
#line 142 "gen/ragel/submatch_16__alt4_2.cc"
goto _st9;
_ctr5:
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b4 = p; a3 = a4 = NULL; }
#line 149 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b5 = p; }
#line 154 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b6 = p; a5 = a6 = NULL; }
#line 159 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 30 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a5 = p; }
#line 164 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 30 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a6 = p; b5 = b6 = NULL; }
#line 169 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 33 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b7 = p; }
#line 174 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 33 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b8 = p; a7 = a8 = NULL; }
#line 179 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 34 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a7 = p; }
#line 184 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 34 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a8 = p; b7 = b8 = NULL; }
#line 189 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 36 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
if (a5) { OUTC('A'); OUTS(a5, a6); }
else if (b5) { OUTC('B'); OUTS(b5, b6); }
if (a7) { OUTC('A'); OUTS(a7, a8); }
else if (b7) { OUTC('B'); OUTS(b7, b8); }
OUTC('\n');
}
#line 204 "gen/ragel/submatch_16__alt4_2.cc"
goto _st9;
_ctr8:
{
#line 30 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a6 = p; b5 = b6 = NULL; }
#line 211 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 33 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b7 = p; }
#line 216 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 33 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b8 = p; a7 = a8 = NULL; }
#line 221 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 34 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a7 = p; }
#line 226 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 34 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a8 = p; b7 = b8 = NULL; }
#line 231 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 36 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
if (a5) { OUTC('A'); OUTS(a5, a6); }
else if (b5) { OUTC('B'); OUTS(b5, b6); }
if (a7) { OUTC('A'); OUTS(a7, a8); }
else if (b7) { OUTC('B'); OUTS(b7, b8); }
OUTC('\n');
}
#line 246 "gen/ragel/submatch_16__alt4_2.cc"
goto _st9;
_ctr11:
{
#line 33 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b8 = p; a7 = a8 = NULL; }
#line 253 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 36 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
if (a5) { OUTC('A'); OUTS(a5, a6); }
else if (b5) { OUTC('B'); OUTS(b5, b6); }
if (a7) { OUTC('A'); OUTS(a7, a8); }
else if (b7) { OUTC('B'); OUTS(b7, b8); }
OUTC('\n');
}
#line 268 "gen/ragel/submatch_16__alt4_2.cc"
goto _st9;
_ctr13:
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b2 = p; a1 = a2 = NULL; }
#line 275 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b3 = p; }
#line 280 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b4 = p; a3 = a4 = NULL; }
#line 285 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a3 = p; }
#line 290 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a4 = p; b3 = b4 = NULL; }
#line 295 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b5 = p; }
#line 300 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b6 = p; a5 = a6 = NULL; }
#line 305 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 30 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a5 = p; }
#line 310 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 30 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a6 = p; b5 = b6 = NULL; }
#line 315 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 33 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b7 = p; }
#line 320 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 33 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b8 = p; a7 = a8 = NULL; }
#line 325 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 34 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a7 = p; }
#line 330 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 34 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a8 = p; b7 = b8 = NULL; }
#line 335 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 36 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
if (a5) { OUTC('A'); OUTS(a5, a6); }
else if (b5) { OUTC('B'); OUTS(b5, b6); }
if (a7) { OUTC('A'); OUTS(a7, a8); }
else if (b7) { OUTC('B'); OUTS(b7, b8); }
OUTC('\n');
}
#line 350 "gen/ragel/submatch_16__alt4_2.cc"
goto _st9;
_ctr16:
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a4 = p; b3 = b4 = NULL; }
#line 357 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b5 = p; }
#line 362 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b6 = p; a5 = a6 = NULL; }
#line 367 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 30 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a5 = p; }
#line 372 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 30 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a6 = p; b5 = b6 = NULL; }
#line 377 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 33 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b7 = p; }
#line 382 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 33 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b8 = p; a7 = a8 = NULL; }
#line 387 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 34 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a7 = p; }
#line 392 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 34 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a8 = p; b7 = b8 = NULL; }
#line 397 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 36 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
if (a5) { OUTC('A'); OUTS(a5, a6); }
else if (b5) { OUTC('B'); OUTS(b5, b6); }
if (a7) { OUTC('A'); OUTS(a7, a8); }
else if (b7) { OUTC('B'); OUTS(b7, b8); }
OUTC('\n');
}
#line 412 "gen/ragel/submatch_16__alt4_2.cc"
goto _st9;
_ctr19:
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b6 = p; a5 = a6 = NULL; }
#line 419 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 33 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b7 = p; }
#line 424 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 33 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b8 = p; a7 = a8 = NULL; }
#line 429 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 34 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a7 = p; }
#line 434 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 34 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a8 = p; b7 = b8 = NULL; }
#line 439 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 36 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
if (a5) { OUTC('A'); OUTS(a5, a6); }
else if (b5) { OUTC('B'); OUTS(b5, b6); }
if (a7) { OUTC('A'); OUTS(a7, a8); }
else if (b7) { OUTC('B'); OUTS(b7, b8); }
OUTC('\n');
}
#line 454 "gen/ragel/submatch_16__alt4_2.cc"
goto _st9;
_ctr22:
{
#line 34 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a8 = p; b7 = b8 = NULL; }
#line 461 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 36 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
if (a5) { OUTC('A'); OUTS(a5, a6); }
else if (b5) { OUTC('B'); OUTS(b5, b6); }
if (a7) { OUTC('A'); OUTS(a7, a8); }
else if (b7) { OUTC('B'); OUTS(b7, b8); }
OUTC('\n');
}
#line 476 "gen/ragel/submatch_16__alt4_2.cc"
goto _st9;
_ctr24:
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b1 = p; }
#line 483 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b2 = p; a1 = a2 = NULL; }
#line 488 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a1 = p; }
#line 493 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a2 = p; b1 = b2 = NULL; }
#line 498 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b3 = p; }
#line 503 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b4 = p; a3 = a4 = NULL; }
#line 508 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a3 = p; }
#line 513 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a4 = p; b3 = b4 = NULL; }
#line 518 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b5 = p; }
#line 523 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b6 = p; a5 = a6 = NULL; }
#line 528 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 30 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a5 = p; }
#line 533 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 30 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a6 = p; b5 = b6 = NULL; }
#line 538 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 33 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b7 = p; }
#line 543 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 33 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b8 = p; a7 = a8 = NULL; }
#line 548 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 34 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a7 = p; }
#line 553 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 34 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a8 = p; b7 = b8 = NULL; }
#line 558 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 36 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
if (a1) { OUTC('A'); OUTS(a1, a2); }
else if (b1) { OUTC('B'); OUTS(b1, b2); }
if (a3) { OUTC('A'); OUTS(a3, a4); }
else if (b3) { OUTC('B'); OUTS(b3, b4); }
if (a5) { OUTC('A'); OUTS(a5, a6); }
else if (b5) { OUTC('B'); OUTS(b5, b6); }
if (a7) { OUTC('A'); OUTS(a7, a8); }
else if (b7) { OUTC('B'); OUTS(b7, b8); }
OUTC('\n');
}
#line 573 "gen/ragel/submatch_16__alt4_2.cc"
goto _st9;
_st9:
p+= 1;
st_case_9:
if ( p == pe )
goto _out9;
switch( ( (*( p))) ) {
case 10: {
goto _ctr24;
}
case 97: {
goto _ctr25;
}
case 98: {
goto _ctr26;
}
}
goto _st0;
_st0:
st_case_0:
goto _out0;
_ctr25:
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a1 = p; }
#line 600 "gen/ragel/submatch_16__alt4_2.cc"
goto _st1;
_st1:
p+= 1;
st_case_1:
if ( p == pe )
goto _out1;
switch( ( (*( p))) ) {
case 10: {
goto _ctr2;
}
case 97: {
goto _st1;
}
case 98: {
goto _ctr3;
}
}
goto _st0;
_ctr3:
{
#line 22 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a2 = p; b1 = b2 = NULL; }
#line 624 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b3 = p; }
#line 629 "gen/ragel/submatch_16__alt4_2.cc"
goto _st2;
_st2:
p+= 1;
st_case_2:
if ( p == pe )
goto _out2;
switch( ( (*( p))) ) {
case 10: {
goto _ctr5;
}
case 97: {
goto _ctr6;
}
case 98: {
goto _st2;
}
}
goto _st0;
_ctr6:
{
#line 25 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b4 = p; a3 = a4 = NULL; }
#line 653 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 30 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a5 = p; }
#line 658 "gen/ragel/submatch_16__alt4_2.cc"
goto _st3;
_st3:
p+= 1;
st_case_3:
if ( p == pe )
goto _out3;
switch( ( (*( p))) ) {
case 10: {
goto _ctr8;
}
case 97: {
goto _st3;
}
case 98: {
goto _ctr9;
}
}
goto _st0;
_ctr9:
{
#line 30 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a6 = p; b5 = b6 = NULL; }
#line 682 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 33 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b7 = p; }
#line 687 "gen/ragel/submatch_16__alt4_2.cc"
goto _st4;
_st4:
p+= 1;
st_case_4:
if ( p == pe )
goto _out4;
switch( ( (*( p))) ) {
case 10: {
goto _ctr11;
}
case 98: {
goto _st4;
}
}
goto _st0;
_ctr26:
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b1 = p; }
#line 708 "gen/ragel/submatch_16__alt4_2.cc"
goto _st5;
_st5:
p+= 1;
st_case_5:
if ( p == pe )
goto _out5;
switch( ( (*( p))) ) {
case 10: {
goto _ctr13;
}
case 97: {
goto _ctr14;
}
case 98: {
goto _st5;
}
}
goto _st0;
_ctr14:
{
#line 21 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b2 = p; a1 = a2 = NULL; }
#line 732 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a3 = p; }
#line 737 "gen/ragel/submatch_16__alt4_2.cc"
goto _st6;
_st6:
p+= 1;
st_case_6:
if ( p == pe )
goto _out6;
switch( ( (*( p))) ) {
case 10: {
goto _ctr16;
}
case 97: {
goto _st6;
}
case 98: {
goto _ctr17;
}
}
goto _st0;
_ctr17:
{
#line 26 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a4 = p; b3 = b4 = NULL; }
#line 761 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b5 = p; }
#line 766 "gen/ragel/submatch_16__alt4_2.cc"
goto _st7;
_st7:
p+= 1;
st_case_7:
if ( p == pe )
goto _out7;
switch( ( (*( p))) ) {
case 10: {
goto _ctr19;
}
case 97: {
goto _ctr20;
}
case 98: {
goto _st7;
}
}
goto _st0;
_ctr20:
{
#line 29 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
b6 = p; a5 = a6 = NULL; }
#line 790 "gen/ragel/submatch_16__alt4_2.cc"
{
#line 34 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
a7 = p; }
#line 795 "gen/ragel/submatch_16__alt4_2.cc"
goto _st8;
_st8:
p+= 1;
st_case_8:
if ( p == pe )
goto _out8;
switch( ( (*( p))) ) {
case 10: {
goto _ctr22;
}
case 97: {
goto _st8;
}
}
goto _st0;
_out9: cs = 9; goto _out;
_out0: cs = 0; goto _out;
_out1: cs = 1; goto _out;
_out2: cs = 2; goto _out;
_out3: cs = 3; goto _out;
_out4: cs = 4; goto _out;
_out5: cs = 5; goto _out;
_out6: cs = 6; goto _out;
_out7: cs = 7; goto _out;
_out8: cs = 8; goto _out;
_out: {}
}
#line 68 "../../../benchmarks/c/src/ragel/submatch_16__alt4_2.rl"
in->p = p;
in->pe = pe;
return count;
}
RAGEL_BENCH_AND_TEST()
} // namespace ragel_submatch_16__alt4_2
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,387 @@
#line 1 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
#include "ragel/base.h"
namespace ragel_submatch_20__cat2_0 {
const char *delim = "\n";
#line 19 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
#line 11 "gen/ragel/submatch_20__cat2_0.cc"
static const int abcd_start = 5;
static const int abcd_first_final = 5;
static const int abcd_error = 0;
static const int abcd_en_main = 5;
#line 21 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
static int lex(Input *in, int count) {
char *p = in->p;
char *pe = in->pe;
const char
*a0, *a1,
*b0, *b1;
int cs;
#line 28 "gen/ragel/submatch_20__cat2_0.cc"
{
cs = (int)abcd_start;
}
#line 31 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
#line 33 "gen/ragel/submatch_20__cat2_0.cc"
{
switch ( cs ) {
case 5:
goto st_case_5;
case 0:
goto st_case_0;
case 1:
goto st_case_1;
case 2:
goto st_case_2;
case 3:
goto st_case_3;
case 4:
goto st_case_4;
}
_ctr2:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
b0 = p; }
#line 53 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
a1 = p; }
#line 58 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
b1 = p; }
#line 63 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
OUTS(a0, b0); OUTC('.'); OUTS(b0, a1); OUTC('.');
OUTS(a1, b1); OUTC('.'); OUTS(b1, p + 1);
}
#line 71 "gen/ragel/submatch_20__cat2_0.cc"
goto _st5;
_ctr6:
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
a1 = p; }
#line 78 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
b1 = p; }
#line 83 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
OUTS(a0, b0); OUTC('.'); OUTS(b0, a1); OUTC('.');
OUTS(a1, b1); OUTC('.'); OUTS(b1, p + 1);
}
#line 91 "gen/ragel/submatch_20__cat2_0.cc"
goto _st5;
_ctr10:
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
b1 = p; }
#line 98 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
OUTS(a0, b0); OUTC('.'); OUTS(b0, a1); OUTC('.');
OUTS(a1, b1); OUTC('.'); OUTS(b1, p + 1);
}
#line 106 "gen/ragel/submatch_20__cat2_0.cc"
goto _st5;
_ctr13:
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
OUTS(a0, b0); OUTC('.'); OUTS(b0, a1); OUTC('.');
OUTS(a1, b1); OUTC('.'); OUTS(b1, p + 1);
}
#line 116 "gen/ragel/submatch_20__cat2_0.cc"
goto _st5;
_ctr15:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
a0 = p; }
#line 123 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
b0 = p; }
#line 128 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
a1 = p; }
#line 133 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
b1 = p; }
#line 138 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
OUTS(a0, b0); OUTC('.'); OUTS(b0, a1); OUTC('.');
OUTS(a1, b1); OUTC('.'); OUTS(b1, p + 1);
}
#line 146 "gen/ragel/submatch_20__cat2_0.cc"
goto _st5;
_st5:
p+= 1;
st_case_5:
if ( p == pe )
goto _out5;
switch( ( (*( p))) ) {
case 10: {
goto _ctr15;
}
case 97: {
goto _ctr16;
}
case 98: {
goto _ctr17;
}
}
goto _st0;
_st0:
st_case_0:
goto _out0;
_ctr3:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
b0 = p; }
#line 173 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
a1 = p; }
#line 178 "gen/ragel/submatch_20__cat2_0.cc"
goto _st1;
_ctr16:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
a0 = p; }
#line 185 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
b0 = p; }
#line 190 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
a1 = p; }
#line 195 "gen/ragel/submatch_20__cat2_0.cc"
goto _st1;
_st1:
p+= 1;
st_case_1:
if ( p == pe )
goto _out1;
switch( ( (*( p))) ) {
case 10: {
goto _ctr2;
}
case 97: {
goto _ctr3;
}
case 98: {
goto _ctr4;
}
}
goto _st0;
_ctr4:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
b0 = p; }
#line 219 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
a1 = p; }
#line 224 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
b1 = p; }
#line 229 "gen/ragel/submatch_20__cat2_0.cc"
goto _st2;
_ctr8:
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
a1 = p; }
#line 236 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
b1 = p; }
#line 241 "gen/ragel/submatch_20__cat2_0.cc"
goto _st2;
_ctr17:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
a0 = p; }
#line 248 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
b0 = p; }
#line 253 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
a1 = p; }
#line 258 "gen/ragel/submatch_20__cat2_0.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
b1 = p; }
#line 263 "gen/ragel/submatch_20__cat2_0.cc"
goto _st2;
_st2:
p+= 1;
st_case_2:
if ( p == pe )
goto _out2;
switch( ( (*( p))) ) {
case 10: {
goto _ctr6;
}
case 97: {
goto _ctr7;
}
case 98: {
goto _ctr8;
}
}
goto _st0;
_ctr7:
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
a1 = p; }
#line 287 "gen/ragel/submatch_20__cat2_0.cc"
goto _st3;
_st3:
p+= 1;
st_case_3:
if ( p == pe )
goto _out3;
switch( ( (*( p))) ) {
case 10: {
goto _ctr10;
}
case 97: {
goto _st3;
}
case 98: {
goto _ctr11;
}
}
goto _st0;
_ctr11:
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
b1 = p; }
#line 311 "gen/ragel/submatch_20__cat2_0.cc"
goto _st4;
_st4:
p+= 1;
st_case_4:
if ( p == pe )
goto _out4;
switch( ( (*( p))) ) {
case 10: {
goto _ctr13;
}
case 98: {
goto _st4;
}
}
goto _st0;
_out5: cs = 5; goto _out;
_out0: cs = 0; goto _out;
_out1: cs = 1; goto _out;
_out2: cs = 2; goto _out;
_out3: cs = 3; goto _out;
_out4: cs = 4; goto _out;
_out: {}
}
#line 32 "../../../benchmarks/c/src/ragel/submatch_20__cat2_0.rl"
in->p = p;
in->pe = pe;
return count;
}
RAGEL_BENCH_AND_TEST()
} // namespace ragel_submatch_20__cat2_0
@@ -0,0 +1,478 @@
#line 1 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
#include "ragel/base.h"
namespace ragel_submatch_21__cat2_4 {
const char *delim = "\n";
#line 19 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
#line 11 "gen/ragel/submatch_21__cat2_4.cc"
static const int abcd_start = 16;
static const int abcd_first_final = 16;
static const int abcd_error = 0;
static const int abcd_en_main = 16;
#line 21 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
static int lex(Input *in, int count) {
char *p = in->p;
char *pe = in->pe;
const char
*a0, *a1,
*b0, *b1;
int cs;
#line 28 "gen/ragel/submatch_21__cat2_4.cc"
{
cs = (int)abcd_start;
}
#line 31 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
#line 33 "gen/ragel/submatch_21__cat2_4.cc"
{
switch ( cs ) {
case 16:
goto st_case_16;
case 0:
goto st_case_0;
case 1:
goto st_case_1;
case 2:
goto st_case_2;
case 3:
goto st_case_3;
case 4:
goto st_case_4;
case 5:
goto st_case_5;
case 6:
goto st_case_6;
case 7:
goto st_case_7;
case 8:
goto st_case_8;
case 9:
goto st_case_9;
case 10:
goto st_case_10;
case 11:
goto st_case_11;
case 12:
goto st_case_12;
case 13:
goto st_case_13;
case 14:
goto st_case_14;
case 15:
goto st_case_15;
}
_ctr17:
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
OUTS(a0, b0); OUTC('.'); OUTS(b0, a1); OUTC('.');
OUTS(a1, b1); OUTC('.'); OUTS(b1, p + 1);
}
#line 78 "gen/ragel/submatch_21__cat2_4.cc"
goto _st16;
_st16:
p+= 1;
st_case_16:
if ( p == pe )
goto _out16;
if ( ( (*( p))) == 97 ) {
goto _ctr29;
}
goto _st0;
_st0:
st_case_0:
goto _out0;
_ctr29:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
a0 = p; }
#line 97 "gen/ragel/submatch_21__cat2_4.cc"
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
b0 = p; }
#line 102 "gen/ragel/submatch_21__cat2_4.cc"
goto _st1;
_st1:
p+= 1;
st_case_1:
if ( p == pe )
goto _out1;
if ( ( (*( p))) == 97 ) {
goto _ctr2;
}
goto _st0;
_ctr2:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
b0 = p; }
#line 118 "gen/ragel/submatch_21__cat2_4.cc"
goto _st2;
_st2:
p+= 1;
st_case_2:
if ( p == pe )
goto _out2;
if ( ( (*( p))) == 97 ) {
goto _ctr4;
}
goto _st0;
_ctr4:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
b0 = p; }
#line 134 "gen/ragel/submatch_21__cat2_4.cc"
goto _st3;
_st3:
p+= 1;
st_case_3:
if ( p == pe )
goto _out3;
if ( ( (*( p))) == 97 ) {
goto _ctr6;
}
goto _st0;
_ctr6:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
b0 = p; }
#line 150 "gen/ragel/submatch_21__cat2_4.cc"
goto _st4;
_st4:
p+= 1;
st_case_4:
if ( p == pe )
goto _out4;
switch( ( (*( p))) ) {
case 97: {
goto _ctr8;
}
case 98: {
goto _st15;
}
}
goto _st0;
_ctr8:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
b0 = p; }
#line 171 "gen/ragel/submatch_21__cat2_4.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
a1 = p; }
#line 176 "gen/ragel/submatch_21__cat2_4.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
b1 = p; }
#line 181 "gen/ragel/submatch_21__cat2_4.cc"
goto _st5;
_st5:
p+= 1;
st_case_5:
if ( p == pe )
goto _out5;
switch( ( (*( p))) ) {
case 97: {
goto _ctr11;
}
case 98: {
goto _st15;
}
}
goto _st0;
_ctr11:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
b0 = p; }
#line 202 "gen/ragel/submatch_21__cat2_4.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
a1 = p; }
#line 207 "gen/ragel/submatch_21__cat2_4.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
b1 = p; }
#line 212 "gen/ragel/submatch_21__cat2_4.cc"
goto _st6;
_st6:
p+= 1;
st_case_6:
if ( p == pe )
goto _out6;
switch( ( (*( p))) ) {
case 97: {
goto _ctr13;
}
case 98: {
goto _st15;
}
}
goto _st0;
_ctr13:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
b0 = p; }
#line 233 "gen/ragel/submatch_21__cat2_4.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
a1 = p; }
#line 238 "gen/ragel/submatch_21__cat2_4.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
b1 = p; }
#line 243 "gen/ragel/submatch_21__cat2_4.cc"
goto _st7;
_st7:
p+= 1;
st_case_7:
if ( p == pe )
goto _out7;
switch( ( (*( p))) ) {
case 97: {
goto _ctr15;
}
case 98: {
goto _st15;
}
}
goto _st0;
_ctr15:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
b0 = p; }
#line 264 "gen/ragel/submatch_21__cat2_4.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
a1 = p; }
#line 269 "gen/ragel/submatch_21__cat2_4.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
b1 = p; }
#line 274 "gen/ragel/submatch_21__cat2_4.cc"
goto _st8;
_st8:
p+= 1;
st_case_8:
if ( p == pe )
goto _out8;
switch( ( (*( p))) ) {
case 10: {
goto _ctr17;
}
case 97: {
goto _ctr15;
}
case 98: {
goto _st9;
}
}
goto _st0;
_st9:
p+= 1;
st_case_9:
if ( p == pe )
goto _out9;
switch( ( (*( p))) ) {
case 10: {
goto _ctr17;
}
case 97: {
goto _ctr19;
}
case 98: {
goto _st9;
}
}
goto _st0;
_ctr19:
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
a1 = p; }
#line 315 "gen/ragel/submatch_21__cat2_4.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
b1 = p; }
#line 320 "gen/ragel/submatch_21__cat2_4.cc"
goto _st10;
_st10:
p+= 1;
st_case_10:
if ( p == pe )
goto _out10;
if ( ( (*( p))) == 97 ) {
goto _ctr21;
}
goto _st0;
_ctr21:
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
b1 = p; }
#line 336 "gen/ragel/submatch_21__cat2_4.cc"
goto _st11;
_st11:
p+= 1;
st_case_11:
if ( p == pe )
goto _out11;
if ( ( (*( p))) == 97 ) {
goto _ctr23;
}
goto _st0;
_ctr23:
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
b1 = p; }
#line 352 "gen/ragel/submatch_21__cat2_4.cc"
goto _st12;
_st12:
p+= 1;
st_case_12:
if ( p == pe )
goto _out12;
if ( ( (*( p))) == 97 ) {
goto _ctr25;
}
goto _st0;
_ctr25:
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
b1 = p; }
#line 368 "gen/ragel/submatch_21__cat2_4.cc"
goto _st13;
_st13:
p+= 1;
st_case_13:
if ( p == pe )
goto _out13;
switch( ( (*( p))) ) {
case 10: {
goto _ctr17;
}
case 97: {
goto _ctr25;
}
case 98: {
goto _st14;
}
}
goto _st0;
_st14:
p+= 1;
st_case_14:
if ( p == pe )
goto _out14;
switch( ( (*( p))) ) {
case 10: {
goto _ctr17;
}
case 98: {
goto _st14;
}
}
goto _st0;
_st15:
p+= 1;
st_case_15:
if ( p == pe )
goto _out15;
switch( ( (*( p))) ) {
case 97: {
goto _ctr19;
}
case 98: {
goto _st15;
}
}
goto _st0;
_out16: cs = 16; goto _out;
_out0: cs = 0; goto _out;
_out1: cs = 1; goto _out;
_out2: cs = 2; goto _out;
_out3: cs = 3; goto _out;
_out4: cs = 4; goto _out;
_out5: cs = 5; goto _out;
_out6: cs = 6; goto _out;
_out7: cs = 7; goto _out;
_out8: cs = 8; goto _out;
_out9: cs = 9; goto _out;
_out10: cs = 10; goto _out;
_out11: cs = 11; goto _out;
_out12: cs = 12; goto _out;
_out13: cs = 13; goto _out;
_out14: cs = 14; goto _out;
_out15: cs = 15; goto _out;
_out: {}
}
#line 32 "../../../benchmarks/c/src/ragel/submatch_21__cat2_4.rl"
in->p = p;
in->pe = pe;
return count;
}
RAGEL_BENCH_AND_TEST()
} // namespace ragel_submatch_21__cat2_4
@@ -0,0 +1,786 @@
#line 1 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
#include "ragel/base.h"
namespace ragel_submatch_22__cat2_8 {
const char *delim = "\n";
#line 19 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
#line 11 "gen/ragel/submatch_22__cat2_8.cc"
static const int abcd_start = 28;
static const int abcd_first_final = 28;
static const int abcd_error = 0;
static const int abcd_en_main = 28;
#line 21 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
static int lex(Input *in, int count) {
char *p = in->p;
char *pe = in->pe;
const char
*a0, *a1,
*b0, *b1;
int cs;
#line 28 "gen/ragel/submatch_22__cat2_8.cc"
{
cs = (int)abcd_start;
}
#line 31 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
#line 33 "gen/ragel/submatch_22__cat2_8.cc"
{
switch ( cs ) {
case 28:
goto st_case_28;
case 0:
goto st_case_0;
case 1:
goto st_case_1;
case 2:
goto st_case_2;
case 3:
goto st_case_3;
case 4:
goto st_case_4;
case 5:
goto st_case_5;
case 6:
goto st_case_6;
case 7:
goto st_case_7;
case 8:
goto st_case_8;
case 9:
goto st_case_9;
case 10:
goto st_case_10;
case 11:
goto st_case_11;
case 12:
goto st_case_12;
case 13:
goto st_case_13;
case 14:
goto st_case_14;
case 15:
goto st_case_15;
case 16:
goto st_case_16;
case 17:
goto st_case_17;
case 18:
goto st_case_18;
case 19:
goto st_case_19;
case 20:
goto st_case_20;
case 21:
goto st_case_21;
case 22:
goto st_case_22;
case 23:
goto st_case_23;
case 24:
goto st_case_24;
case 25:
goto st_case_25;
case 26:
goto st_case_26;
case 27:
goto st_case_27;
}
_ctr33:
{
#line 13 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
OUTS(a0, b0); OUTC('.'); OUTS(b0, a1); OUTC('.');
OUTS(a1, b1); OUTC('.'); OUTS(b1, p + 1);
}
#line 102 "gen/ragel/submatch_22__cat2_8.cc"
goto _st28;
_st28:
p+= 1;
st_case_28:
if ( p == pe )
goto _out28;
if ( ( (*( p))) == 97 ) {
goto _ctr53;
}
goto _st0;
_st0:
st_case_0:
goto _out0;
_ctr53:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
a0 = p; }
#line 121 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b0 = p; }
#line 126 "gen/ragel/submatch_22__cat2_8.cc"
goto _st1;
_st1:
p+= 1;
st_case_1:
if ( p == pe )
goto _out1;
if ( ( (*( p))) == 97 ) {
goto _ctr2;
}
goto _st0;
_ctr2:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b0 = p; }
#line 142 "gen/ragel/submatch_22__cat2_8.cc"
goto _st2;
_st2:
p+= 1;
st_case_2:
if ( p == pe )
goto _out2;
if ( ( (*( p))) == 97 ) {
goto _ctr4;
}
goto _st0;
_ctr4:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b0 = p; }
#line 158 "gen/ragel/submatch_22__cat2_8.cc"
goto _st3;
_st3:
p+= 1;
st_case_3:
if ( p == pe )
goto _out3;
if ( ( (*( p))) == 97 ) {
goto _ctr6;
}
goto _st0;
_ctr6:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b0 = p; }
#line 174 "gen/ragel/submatch_22__cat2_8.cc"
goto _st4;
_st4:
p+= 1;
st_case_4:
if ( p == pe )
goto _out4;
if ( ( (*( p))) == 97 ) {
goto _ctr8;
}
goto _st0;
_ctr8:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b0 = p; }
#line 190 "gen/ragel/submatch_22__cat2_8.cc"
goto _st5;
_st5:
p+= 1;
st_case_5:
if ( p == pe )
goto _out5;
if ( ( (*( p))) == 97 ) {
goto _ctr10;
}
goto _st0;
_ctr10:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b0 = p; }
#line 206 "gen/ragel/submatch_22__cat2_8.cc"
goto _st6;
_st6:
p+= 1;
st_case_6:
if ( p == pe )
goto _out6;
if ( ( (*( p))) == 97 ) {
goto _ctr12;
}
goto _st0;
_ctr12:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b0 = p; }
#line 222 "gen/ragel/submatch_22__cat2_8.cc"
goto _st7;
_st7:
p+= 1;
st_case_7:
if ( p == pe )
goto _out7;
if ( ( (*( p))) == 97 ) {
goto _ctr14;
}
goto _st0;
_ctr14:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b0 = p; }
#line 238 "gen/ragel/submatch_22__cat2_8.cc"
goto _st8;
_st8:
p+= 1;
st_case_8:
if ( p == pe )
goto _out8;
switch( ( (*( p))) ) {
case 97: {
goto _ctr16;
}
case 98: {
goto _st27;
}
}
goto _st0;
_ctr16:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b0 = p; }
#line 259 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
a1 = p; }
#line 264 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b1 = p; }
#line 269 "gen/ragel/submatch_22__cat2_8.cc"
goto _st9;
_st9:
p+= 1;
st_case_9:
if ( p == pe )
goto _out9;
switch( ( (*( p))) ) {
case 97: {
goto _ctr19;
}
case 98: {
goto _st27;
}
}
goto _st0;
_ctr19:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b0 = p; }
#line 290 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
a1 = p; }
#line 295 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b1 = p; }
#line 300 "gen/ragel/submatch_22__cat2_8.cc"
goto _st10;
_st10:
p+= 1;
st_case_10:
if ( p == pe )
goto _out10;
switch( ( (*( p))) ) {
case 97: {
goto _ctr21;
}
case 98: {
goto _st27;
}
}
goto _st0;
_ctr21:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b0 = p; }
#line 321 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
a1 = p; }
#line 326 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b1 = p; }
#line 331 "gen/ragel/submatch_22__cat2_8.cc"
goto _st11;
_st11:
p+= 1;
st_case_11:
if ( p == pe )
goto _out11;
switch( ( (*( p))) ) {
case 97: {
goto _ctr23;
}
case 98: {
goto _st27;
}
}
goto _st0;
_ctr23:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b0 = p; }
#line 352 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
a1 = p; }
#line 357 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b1 = p; }
#line 362 "gen/ragel/submatch_22__cat2_8.cc"
goto _st12;
_st12:
p+= 1;
st_case_12:
if ( p == pe )
goto _out12;
switch( ( (*( p))) ) {
case 97: {
goto _ctr25;
}
case 98: {
goto _st27;
}
}
goto _st0;
_ctr25:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b0 = p; }
#line 383 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
a1 = p; }
#line 388 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b1 = p; }
#line 393 "gen/ragel/submatch_22__cat2_8.cc"
goto _st13;
_st13:
p+= 1;
st_case_13:
if ( p == pe )
goto _out13;
switch( ( (*( p))) ) {
case 97: {
goto _ctr27;
}
case 98: {
goto _st27;
}
}
goto _st0;
_ctr27:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b0 = p; }
#line 414 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
a1 = p; }
#line 419 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b1 = p; }
#line 424 "gen/ragel/submatch_22__cat2_8.cc"
goto _st14;
_st14:
p+= 1;
st_case_14:
if ( p == pe )
goto _out14;
switch( ( (*( p))) ) {
case 97: {
goto _ctr29;
}
case 98: {
goto _st27;
}
}
goto _st0;
_ctr29:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b0 = p; }
#line 445 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
a1 = p; }
#line 450 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b1 = p; }
#line 455 "gen/ragel/submatch_22__cat2_8.cc"
goto _st15;
_st15:
p+= 1;
st_case_15:
if ( p == pe )
goto _out15;
switch( ( (*( p))) ) {
case 97: {
goto _ctr31;
}
case 98: {
goto _st27;
}
}
goto _st0;
_ctr31:
{
#line 11 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b0 = p; }
#line 476 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
a1 = p; }
#line 481 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b1 = p; }
#line 486 "gen/ragel/submatch_22__cat2_8.cc"
goto _st16;
_st16:
p+= 1;
st_case_16:
if ( p == pe )
goto _out16;
switch( ( (*( p))) ) {
case 10: {
goto _ctr33;
}
case 97: {
goto _ctr31;
}
case 98: {
goto _st17;
}
}
goto _st0;
_st17:
p+= 1;
st_case_17:
if ( p == pe )
goto _out17;
switch( ( (*( p))) ) {
case 10: {
goto _ctr33;
}
case 97: {
goto _ctr35;
}
case 98: {
goto _st17;
}
}
goto _st0;
_ctr35:
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
a1 = p; }
#line 527 "gen/ragel/submatch_22__cat2_8.cc"
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b1 = p; }
#line 532 "gen/ragel/submatch_22__cat2_8.cc"
goto _st18;
_st18:
p+= 1;
st_case_18:
if ( p == pe )
goto _out18;
if ( ( (*( p))) == 97 ) {
goto _ctr37;
}
goto _st0;
_ctr37:
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b1 = p; }
#line 548 "gen/ragel/submatch_22__cat2_8.cc"
goto _st19;
_st19:
p+= 1;
st_case_19:
if ( p == pe )
goto _out19;
if ( ( (*( p))) == 97 ) {
goto _ctr39;
}
goto _st0;
_ctr39:
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b1 = p; }
#line 564 "gen/ragel/submatch_22__cat2_8.cc"
goto _st20;
_st20:
p+= 1;
st_case_20:
if ( p == pe )
goto _out20;
if ( ( (*( p))) == 97 ) {
goto _ctr41;
}
goto _st0;
_ctr41:
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b1 = p; }
#line 580 "gen/ragel/submatch_22__cat2_8.cc"
goto _st21;
_st21:
p+= 1;
st_case_21:
if ( p == pe )
goto _out21;
if ( ( (*( p))) == 97 ) {
goto _ctr43;
}
goto _st0;
_ctr43:
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b1 = p; }
#line 596 "gen/ragel/submatch_22__cat2_8.cc"
goto _st22;
_st22:
p+= 1;
st_case_22:
if ( p == pe )
goto _out22;
if ( ( (*( p))) == 97 ) {
goto _ctr45;
}
goto _st0;
_ctr45:
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b1 = p; }
#line 612 "gen/ragel/submatch_22__cat2_8.cc"
goto _st23;
_st23:
p+= 1;
st_case_23:
if ( p == pe )
goto _out23;
if ( ( (*( p))) == 97 ) {
goto _ctr47;
}
goto _st0;
_ctr47:
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b1 = p; }
#line 628 "gen/ragel/submatch_22__cat2_8.cc"
goto _st24;
_st24:
p+= 1;
st_case_24:
if ( p == pe )
goto _out24;
if ( ( (*( p))) == 97 ) {
goto _ctr49;
}
goto _st0;
_ctr49:
{
#line 12 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
b1 = p; }
#line 644 "gen/ragel/submatch_22__cat2_8.cc"
goto _st25;
_st25:
p+= 1;
st_case_25:
if ( p == pe )
goto _out25;
switch( ( (*( p))) ) {
case 10: {
goto _ctr33;
}
case 97: {
goto _ctr49;
}
case 98: {
goto _st26;
}
}
goto _st0;
_st26:
p+= 1;
st_case_26:
if ( p == pe )
goto _out26;
switch( ( (*( p))) ) {
case 10: {
goto _ctr33;
}
case 98: {
goto _st26;
}
}
goto _st0;
_st27:
p+= 1;
st_case_27:
if ( p == pe )
goto _out27;
switch( ( (*( p))) ) {
case 97: {
goto _ctr35;
}
case 98: {
goto _st27;
}
}
goto _st0;
_out28: cs = 28; goto _out;
_out0: cs = 0; goto _out;
_out1: cs = 1; goto _out;
_out2: cs = 2; goto _out;
_out3: cs = 3; goto _out;
_out4: cs = 4; goto _out;
_out5: cs = 5; goto _out;
_out6: cs = 6; goto _out;
_out7: cs = 7; goto _out;
_out8: cs = 8; goto _out;
_out9: cs = 9; goto _out;
_out10: cs = 10; goto _out;
_out11: cs = 11; goto _out;
_out12: cs = 12; goto _out;
_out13: cs = 13; goto _out;
_out14: cs = 14; goto _out;
_out15: cs = 15; goto _out;
_out16: cs = 16; goto _out;
_out17: cs = 17; goto _out;
_out18: cs = 18; goto _out;
_out19: cs = 19; goto _out;
_out20: cs = 20; goto _out;
_out21: cs = 21; goto _out;
_out22: cs = 22; goto _out;
_out23: cs = 23; goto _out;
_out24: cs = 24; goto _out;
_out25: cs = 25; goto _out;
_out26: cs = 26; goto _out;
_out27: cs = 27; goto _out;
_out: {}
}
#line 32 "../../../benchmarks/c/src/ragel/submatch_22__cat2_8.rl"
in->p = p;
in->pe = pe;
return count;
}
RAGEL_BENCH_AND_TEST()
} // namespace ragel_submatch_22__cat2_8

Some files were not shown because too many files have changed in this diff Show More