Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a44906f5c | ||
|
|
3122b9a415 | ||
|
|
2ab394e9d5 | ||
|
|
e63ad223f5 | ||
|
|
3e3b91d75a | ||
|
|
7059b54eb9 | ||
|
|
c88a723fc4 | ||
|
|
44d56c2804 | ||
|
|
4685c639cd | ||
|
|
6a71463d6d | ||
|
|
79596e186d | ||
|
|
94d1ceb2e9 | ||
|
|
e4ba9a90b2 | ||
|
|
fce0e9cbd1 | ||
|
|
8fcbced4e4 | ||
|
|
92a98bcf1e | ||
|
|
a76b9f592c | ||
|
|
c30687f0f1 | ||
|
|
dd05aab240 | ||
|
|
5b0e960177 | ||
|
|
04e7048069 | ||
|
|
a92dad12d8 | ||
|
|
0011cab9f9 | ||
|
|
f1694c513f | ||
|
|
55802e3b40 | ||
|
|
18fc5091b9 | ||
|
|
febeb97793 | ||
|
|
04f1424210 | ||
|
|
1f8d826558 | ||
|
|
1dc02f7b70 | ||
|
|
37350f906c | ||
|
|
8c758c7649 | ||
|
|
d46322fb89 | ||
|
|
5811f5ad65 | ||
|
|
ee0b1f6daf | ||
|
|
82915e38ba | ||
|
|
67f50f6907 | ||
|
|
bc5c3022d1 | ||
|
|
827682202e | ||
|
|
6fcfa14e15 | ||
|
|
0b5185c03a | ||
|
|
07d6f5f7f5 | ||
|
|
ab2d4b2504 | ||
|
|
299bfc7fe0 | ||
|
|
2ad0561e4f | ||
|
|
59677b5eb4 | ||
|
|
82bfcce637 | ||
|
|
6eb9718a67 | ||
|
|
5513aff4c0 | ||
|
|
43c7512c31 | ||
|
|
28cca31af9 | ||
|
|
e98dbd359a | ||
|
|
eece38b1e6 | ||
|
|
7553c68cb4 | ||
|
|
69ffc41706 | ||
|
|
1a26160b69 | ||
|
|
0b7572c30d | ||
|
|
5393573711 | ||
|
|
b0d740994c | ||
|
|
e2ee1bfa9d | ||
|
|
600717ad6a | ||
|
|
af13e1d896 | ||
|
|
f760dccc55 | ||
|
|
9d76662c22 | ||
|
|
5ed46a79a1 | ||
|
|
dcf934fb33 | ||
|
|
55487d4ab8 | ||
|
|
59de285996 | ||
|
|
da7d8fe924 | ||
|
|
325db7adfd | ||
|
|
ccb1d45431 | ||
|
|
deaabdd4ca | ||
|
|
550451d8b4 | ||
|
|
34f6e5269f | ||
|
|
8a4e4ebd54 | ||
|
|
79831797ff | ||
|
|
0bfddb867b | ||
|
|
7563ecaec0 | ||
|
|
e74cef8655 | ||
|
|
26f01b60ee | ||
|
|
6662452bde | ||
|
|
ffdc69dc2e | ||
|
|
8bc53228ff | ||
|
|
2a64e74ff7 | ||
|
|
76e14817fb | ||
|
|
e89281382f | ||
|
|
83b1f8769a | ||
|
|
325c102712 | ||
|
|
f15465cd60 | ||
|
|
9cfdb736c6 | ||
|
|
9601d30173 | ||
|
|
ffefa3914d | ||
|
|
d528489324 | ||
|
|
862eee4570 | ||
|
|
3734d5bdd7 | ||
|
|
e461e348b1 | ||
|
|
7bc7c1980a | ||
|
|
d5484f0443 | ||
|
|
74be826d3a | ||
|
|
49c1417d12 | ||
|
|
17905e7bf5 | ||
|
|
4c7c00c9d2 | ||
|
|
cf8788cc18 | ||
|
|
9ab6a13cb3 | ||
|
|
a37a530555 | ||
|
|
420a976fdb | ||
|
|
52fa88db7b | ||
|
|
9498443133 | ||
|
|
a94d39b112 | ||
|
|
a66644dad3 | ||
|
|
1b24830363 | ||
|
|
cac9f0e75e | ||
|
|
58b687e527 | ||
|
|
7f624d2a42 | ||
|
|
ac37222644 | ||
|
|
73636c66c5 | ||
|
|
e536d7129f | ||
|
|
85d9384b2f | ||
|
|
f60219b6e1 | ||
|
|
47afb07f90 | ||
|
|
8f9c628201 | ||
|
|
2cf658310c | ||
|
|
feb94108f3 | ||
|
|
afabf6e416 | ||
|
|
f505631d46 | ||
|
|
25fe63beb6 | ||
|
|
1f60bcf49f | ||
|
|
8baaca5774 | ||
|
|
bdf3e8958a | ||
|
|
ee033adfb6 | ||
|
|
d3db8a17a5 | ||
|
|
28cb6b8572 | ||
|
|
5d4b79275b | ||
|
|
bbf1cb2604 | ||
|
|
6b67aac3e9 | ||
|
|
cca3ca4151 | ||
|
|
de8bf67c32 | ||
|
|
ca18e43710 | ||
|
|
17d7d8c618 | ||
|
|
ec64527e36 | ||
|
|
7e25fb759f | ||
|
|
ba31855356 | ||
|
|
6c0d89a238 | ||
|
|
705a029b8f | ||
|
|
7c5eac5982 | ||
|
|
f2e6668e9a | ||
|
|
0e97d4917b | ||
|
|
5a9be34734 | ||
|
|
71517f1bf9 | ||
|
|
787a7a306a | ||
|
|
e2a2eca01b | ||
|
|
596c3d9484 | ||
|
|
a65419d89a | ||
|
|
f52b642f8e | ||
|
|
b8406137d6 | ||
|
|
4fedb068c1 | ||
|
|
c1537de331 | ||
|
|
f3dc6fe0e9 | ||
|
|
19d771fd3d | ||
|
|
4afd9776dc | ||
|
|
41411f5c8a | ||
|
|
543aaab356 | ||
|
|
814a544eff | ||
|
|
5fa1dbd576 | ||
|
|
90bd3158e1 | ||
|
|
2b80343e4d | ||
|
|
972d7874e2 | ||
|
|
83b135699f | ||
|
|
2ecbbce7d9 | ||
|
|
e2d249f839 | ||
|
|
54d0eaa4b5 | ||
|
|
cf302ed2bd | ||
|
|
32e11d9904 | ||
|
|
2fc1f0b0bc | ||
|
|
4d5f6d6722 | ||
|
|
bec027b7ae | ||
|
|
a780025238 | ||
|
|
05298b1210 | ||
|
|
70409e3966 | ||
|
|
c65b9766ac | ||
|
|
6aa98843c7 | ||
|
|
0b7be55aec | ||
|
|
436a6cbeaa | ||
|
|
9cfb87edaf | ||
|
|
170ffa39b8 | ||
|
|
e5cb9a1ebd | ||
|
|
1357b3c3d9 | ||
|
|
61c88fbf5a | ||
|
|
162b9c5a8b | ||
|
|
5eb464f8e8 | ||
|
|
e1148b4a7b | ||
|
|
3a40b3d4bb | ||
|
|
a75eb2b3fd | ||
|
|
5cea17c8fe | ||
|
|
b4dc9f69b1 | ||
|
|
92c3ae5a99 | ||
|
|
a1c42047da | ||
|
|
b8a4cddf80 | ||
|
|
7f26edd716 | ||
|
|
cf7e2c7639 | ||
|
|
555331f6e7 | ||
|
|
efc527c2ac | ||
|
|
a5e37dcb8a | ||
|
|
bce5d21288 | ||
|
|
d85f08ac1f | ||
|
|
01b78d8db7 | ||
|
|
91f265b9f3 | ||
|
|
61c14ce5e5 | ||
|
|
c4e779cab5 | ||
|
|
a2d5361545 | ||
|
|
0dfc64d6ff | ||
|
|
59bec481e3 | ||
|
|
cffecf2bc5 | ||
|
|
04eb0ae86d | ||
|
|
2228e8f6d0 | ||
|
|
d85e7e97fd | ||
|
|
2bbd803796 | ||
|
|
1a050e0eb8 | ||
|
|
8571400c7f | ||
|
|
a73bb4cddd | ||
|
|
181bfe95cc | ||
|
|
73637f91a8 | ||
|
|
d6c2a60f88 | ||
|
|
48435b5a1b | ||
|
|
103271952c | ||
|
|
27e0855534 | ||
|
|
cec1803ac0 | ||
|
|
06c0ffa90d | ||
|
|
960cd7dee5 | ||
|
|
f3f3194a35 | ||
|
|
25b3626c38 | ||
|
|
9218113a8e | ||
|
|
f3ecbb16ae | ||
|
|
fea7f92b2a | ||
|
|
2c5c5003e8 | ||
|
|
85f7d36227 | ||
|
|
77735b9f67 | ||
|
|
d7c0cc09bc | ||
|
|
2b349129eb | ||
|
|
2027021c1a | ||
|
|
650c4bc0c2 | ||
|
|
77eb8fbaa1 | ||
|
|
ff9f27c6f7 | ||
|
|
b6803c4a88 | ||
|
|
f310f6d635 | ||
|
|
db1a4d6951 | ||
|
|
c03459572b | ||
|
|
0936b3aa72 | ||
|
|
c641280e1c | ||
|
|
a543138bd1 | ||
|
|
3f0f46ff75 | ||
|
|
c8e8ab51dd | ||
|
|
7aba30555d | ||
|
|
95dde201b8 | ||
|
|
10bd44025e | ||
|
|
5c84dfc5aa | ||
|
|
ddb1add809 | ||
|
|
dfae2f2361 | ||
|
|
08ce33838b | ||
|
|
409dcabf7d | ||
|
|
da97854a4a | ||
|
|
eac735f66d | ||
|
|
5a4afb1bfb | ||
|
|
5830f0387e | ||
|
|
da5e4c947c | ||
|
|
4103ae3737 | ||
|
|
e045138660 | ||
|
|
0d25d42c03 | ||
|
|
a0c1968ede | ||
|
|
8c3d145276 | ||
|
|
4bcbd2a60a | ||
|
|
1d8320afe2 | ||
|
|
319da16127 | ||
|
|
d885f95f23 | ||
|
|
e4566bc7ce | ||
|
|
0f79acd852 | ||
|
|
98f2a41393 | ||
|
|
11b400ac0e | ||
|
|
377758aa1e | ||
|
|
399be1f9df | ||
|
|
205ad4e098 | ||
|
|
223dbc9599 | ||
|
|
aca50bb123 | ||
|
|
d539bc3da2 | ||
|
|
5fc38030e1 | ||
|
|
6246dbde8f | ||
|
|
d360fb41e8 | ||
|
|
87a031fc85 | ||
|
|
497fedc5c9 | ||
|
|
a3f619e6ab | ||
|
|
e256f5012e | ||
|
|
ed0f2124ff | ||
|
|
1b5ae59fa5 | ||
|
|
ffb70cfa47 | ||
|
|
675e94eaf7 | ||
|
|
82e91b6646 | ||
|
|
2d773639be | ||
|
|
8e9bfda737 | ||
|
|
1fb357c20f | ||
|
|
0efd012137 | ||
|
|
9714371ecb | ||
|
|
67e2f080b0 | ||
|
|
c76135cd6b | ||
|
|
7fd5ec66fb | ||
|
|
29d5c87957 | ||
|
|
e7de8841fd | ||
|
|
da8d553052 | ||
|
|
1f644a0438 | ||
|
|
02a133fba1 | ||
|
|
13249489b2 | ||
|
|
fff50f785f | ||
|
|
39f1becb62 | ||
|
|
b609e814b3 | ||
|
|
7dfe119353 | ||
|
|
bf61e090d3 | ||
|
|
f06c17ef32 | ||
|
|
f2395c2998 | ||
|
|
d4df07f7ce | ||
|
|
1c27fd45d4 | ||
|
|
940349f50a | ||
|
|
a5e547794e | ||
|
|
dd7a7a2044 | ||
|
|
d3f727cd8c | ||
|
|
11075509c6 | ||
|
|
ba9cfabc49 | ||
|
|
f6c7f3a8e3 | ||
|
|
d3b83eb329 | ||
|
|
e64c45ba83 | ||
|
|
b2e11e1e64 | ||
|
|
7e924d6e9b | ||
|
|
8197f6d5b8 | ||
|
|
d1732352f1 | ||
|
|
8a632a3d69 | ||
|
|
7ef8e672e2 | ||
|
|
49c5388b2f | ||
|
|
a33065033d | ||
|
|
fbd5a8621e | ||
|
|
2e3a312466 | ||
|
|
7dddb5843a | ||
|
|
c5493a3e4d | ||
|
|
a3c9b1963d | ||
|
|
77503713d3 | ||
|
|
a65cde175a | ||
|
|
a44f902312 | ||
|
|
2cb7706148 | ||
|
|
9aa7766037 | ||
|
|
608910d419 | ||
|
|
ab8a5f0098 | ||
|
|
7df5fe0994 | ||
|
|
d2a7b9320b | ||
|
|
736f608e3e | ||
|
|
1d931b7a23 | ||
|
|
7d0e7a725f | ||
|
|
6b93da5c82 | ||
|
|
066e2b7d7e | ||
|
|
753ffe4622 | ||
|
|
07f7532567 | ||
|
|
7c16c52239 | ||
|
|
99c5a7a3a6 | ||
|
|
b53103c9d4 | ||
|
|
60ba7d8ec0 | ||
|
|
74e510800a | ||
|
|
457092c89a | ||
|
|
cd4e9be142 | ||
|
|
9d5091b3e3 | ||
|
|
8e3f03cdb9 | ||
|
|
8a51834851 | ||
|
|
44a091a18f | ||
|
|
a12eb0f5c6 | ||
|
|
e67b1afb2e | ||
|
|
b1b797a866 | ||
|
|
7e316e1b8a | ||
|
|
0ad6a8205c | ||
|
|
49faa46c38 | ||
|
|
b27dbc9be7 | ||
|
|
653bb7440e | ||
|
|
d1424e57bd | ||
|
|
1a1ce4bf3b | ||
|
|
a6e8bca983 | ||
|
|
9b9d762de6 | ||
|
|
60b167b710 | ||
|
|
9415c7ab1b | ||
|
|
637110ada6 | ||
|
|
2a4b846696 | ||
|
|
b0f43dec71 | ||
|
|
fb450d3054 | ||
|
|
c536ef0770 | ||
|
|
1311331e0a | ||
|
|
0bb4569f33 | ||
|
|
73fb142345 | ||
|
|
b4537dbed3 | ||
|
|
c27f521f3d | ||
|
|
197ff08f00 | ||
|
|
42b50636d3 | ||
|
|
c0721980e1 | ||
|
|
9703f0088b | ||
|
|
c5b5ed735e | ||
|
|
1da9c2eb64 | ||
|
|
c490dfda00 | ||
|
|
47527697e7 | ||
|
|
321e57917f | ||
|
|
8f1f11def4 | ||
|
|
8592b84deb | ||
|
|
ff3350e51a | ||
|
|
2703a077d6 | ||
|
|
85d8b5b560 | ||
|
|
a3b9f460ca | ||
|
|
76b3938ddc | ||
|
|
a4545f966c | ||
|
|
89d1fa1767 | ||
|
|
3d2c1c2c07 | ||
|
|
a84087bc02 | ||
|
|
5dc4461d04 | ||
|
|
5ed9d68cda | ||
|
|
aff269bc12 | ||
|
|
5ef3d700b2 | ||
|
|
c8bacb2dc0 | ||
|
|
80030878f9 | ||
|
|
07b0148337 | ||
|
|
5afd992238 | ||
|
|
283d970655 | ||
|
|
62cb5b2cdd | ||
|
|
4b149addab | ||
|
|
ebbf84f9f3 | ||
|
|
e3670059f6 | ||
|
|
04725305d2 | ||
|
|
231bc8e25a | ||
|
|
364fed920f | ||
|
|
abf813d324 | ||
|
|
c418aa1717 | ||
|
|
a3deb57658 | ||
|
|
688565f922 | ||
|
|
d015911fb7 | ||
|
|
3631e7ed3a | ||
|
|
a664f57331 | ||
|
|
52ce445326 | ||
|
|
1840d22061 | ||
|
|
8072b3acc6 | ||
|
|
751358f5cf | ||
|
|
ca01df5bde | ||
|
|
621f29c918 | ||
|
|
42fe7163cb | ||
|
|
892359a77c | ||
|
|
2d575a3907 | ||
|
|
883b7008ba | ||
|
|
ef86a22304 | ||
|
|
e0c1fffee6 | ||
|
|
b7597813e9 | ||
|
|
977b0a2c52 | ||
|
|
46882167bc | ||
|
|
8aed8322e8 | ||
|
|
3aadda2292 | ||
|
|
df692885a9 | ||
|
|
1ad3831c4d | ||
|
|
e509ed1cc7 | ||
|
|
895c3f33fe | ||
|
|
0a8629dbf0 | ||
|
|
71294d38f6 | ||
|
|
2c4e48aa4b | ||
|
|
90cc00e333 | ||
|
|
a793a3f59d | ||
|
|
0f29e41d45 | ||
|
|
739c509ac6 | ||
|
|
891b109abf | ||
|
|
ad1d82bd26 | ||
|
|
8ab63d0805 | ||
|
|
17a435e953 | ||
|
|
a522ee160f | ||
|
|
7a53cb2a73 | ||
|
|
af618f6481 | ||
|
|
5a341e25a9 | ||
|
|
bc6c23c02f | ||
|
|
163d32b6e3 | ||
|
|
fee0446b48 | ||
|
|
63c77e8528 | ||
|
|
42c93b3684 | ||
|
|
fbd146465e | ||
|
|
9a3904265f | ||
|
|
15ea590914 | ||
|
|
da4a307a96 | ||
|
|
6b16784a25 | ||
|
|
67620440d3 | ||
|
|
af410c7065 | ||
|
|
e1878caf9f | ||
|
|
01e9d8adab | ||
|
|
8013918c11 | ||
|
|
b9f9872990 | ||
|
|
e0ad5b1218 | ||
|
|
e46f998c95 | ||
|
|
c00ea29161 | ||
|
|
271746cdbe | ||
|
|
279c4e20f3 | ||
|
|
e6057e22b5 | ||
|
|
4e330457e7 | ||
|
|
82577ce06d | ||
|
|
7e43200796 | ||
|
|
b1a7a11d28 | ||
|
|
b2701c7f4c | ||
|
|
c30fe1e7b7 | ||
|
|
2aaf2b329a | ||
|
|
472373796c | ||
|
|
62afc3674d | ||
|
|
2f6c71a38c | ||
|
|
67f6680ce5 | ||
|
|
0d5fe165b3 | ||
|
|
0621b973ed | ||
|
|
762ced0a3c | ||
|
|
d6e2ca3316 | ||
|
|
4f7ad682f5 | ||
|
|
cf1b735fdb | ||
|
|
a08cdec815 | ||
|
|
39cfb282e9 | ||
|
|
7ddb79a70a | ||
|
|
539c99ea2a | ||
|
|
20ff170efb | ||
|
|
2b7945a75e | ||
|
|
776397ccb0 | ||
|
|
f013593448 | ||
|
|
02bae836a2 | ||
|
|
0872f12815 | ||
|
|
d535fee6ed | ||
|
|
1ba6cdd6a5 | ||
|
|
b51d2b67ab | ||
|
|
06f72154ef | ||
|
|
8ac61bb6d9 | ||
|
|
215ef38d7f | ||
|
|
320f319faa | ||
|
|
8428bfa82d | ||
|
|
911cfa494d | ||
|
|
91dee4a860 | ||
|
|
d51775c857 | ||
|
|
09ffa6a3ab | ||
|
|
2c70bf5da2 | ||
|
|
f83f3903e0 | ||
|
|
c3bb892add | ||
|
|
752c499714 | ||
|
|
b684f22fd0 | ||
|
|
305b0d497a | ||
|
|
0ea51ba272 | ||
|
|
994d4ae525 | ||
|
|
3e274664b8 | ||
|
|
15a5971468 | ||
|
|
f85fa16c4b | ||
|
|
3645616065 | ||
|
|
f5f559df8b | ||
|
|
bb0bfa189f | ||
|
|
a65d0ad67b | ||
|
|
9e0cf884bb | ||
|
|
a5531ecd7b | ||
|
|
7f40ae1780 | ||
|
|
bdc040e986 | ||
|
|
4812be8b9f | ||
|
|
f143b2dc1c | ||
|
|
af3c3ca319 | ||
|
|
88e2223326 | ||
|
|
8a219d3d7b | ||
|
|
ce8f4a7b5b | ||
|
|
0bb7705981 | ||
|
|
872d601c42 | ||
|
|
e027b25abd | ||
|
|
0bd9783532 | ||
|
|
5f90615f63 | ||
|
|
cac96326a3 | ||
|
|
5f8b5a443b | ||
|
|
a9988c4e46 | ||
|
|
03d110f45d | ||
|
|
e5a0fe4880 | ||
|
|
fd26a6e16b | ||
|
|
d3ffadb7bf | ||
|
|
9b3c4e3af9 | ||
|
|
0aba0ed97c | ||
|
|
cffdfd3e87 | ||
|
|
90142297ff | ||
|
|
9ccd146f79 | ||
|
|
94db280d2b | ||
|
|
88d33f439a | ||
|
|
48b05810c3 | ||
|
|
d4c186b642 | ||
|
|
1bbcf89767 | ||
|
|
6f6c0fba7b | ||
|
|
be6f7e2a23 | ||
|
|
074250e210 | ||
|
|
97fa5ad3e9 | ||
|
|
41c563c50b | ||
|
|
1ebe649de8 | ||
|
|
2fb4f360a3 | ||
|
|
66e08da942 | ||
|
|
8c24b9a09f | ||
|
|
ca2e0ce183 | ||
|
|
0cdd39e79c | ||
|
|
3885b0da1b | ||
|
|
4a05f11eb6 | ||
|
|
1dcbfee713 | ||
|
|
eebdfddb57 | ||
|
|
1b878f6682 | ||
|
|
0f27e43f24 | ||
|
|
b30bccb4d3 | ||
|
|
80e6339242 | ||
|
|
045752dc73 | ||
|
|
4e955f25aa | ||
|
|
8cc3315138 | ||
|
|
5acb29fea4 | ||
|
|
30fa370ee1 | ||
|
|
c9c3dc699e | ||
|
|
652f7e3a6d | ||
|
|
1f5ec6cad7 | ||
|
|
a760f723e7 | ||
|
|
4fbf0847dc | ||
|
|
6841306953 | ||
|
|
671fc0bc08 | ||
|
|
75fa3dbef8 | ||
|
|
08d414b8b2 | ||
|
|
0fe50b3165 | ||
|
|
15f503c97f | ||
|
|
9885ee7119 | ||
|
|
1655c7f9a3 | ||
|
|
1630149d14 | ||
|
|
bfa77bc471 | ||
|
|
0ea38276d5 | ||
|
|
22721f0b0e | ||
|
|
0b6d0b510e | ||
|
|
96104a6526 | ||
|
|
59c56044b9 | ||
|
|
3841e83f85 | ||
|
|
7d6641778c | ||
|
|
ece4bb76e3 | ||
|
|
c3f267b248 | ||
|
|
60b40d94bd | ||
|
|
5abc35226b | ||
|
|
e868cc58b9 | ||
|
|
c633d5de3e | ||
|
|
c86a8bcf5d | ||
|
|
3a98b54363 | ||
|
|
0384cffd9f | ||
|
|
a303a8500d | ||
|
|
8c2127d420 | ||
|
|
54ffc58440 | ||
|
|
00cbfe90af | ||
|
|
bb143b980c | ||
|
|
fce87b493f | ||
|
|
d87f86ed71 | ||
|
|
d7c697138a | ||
|
|
580ab173dd | ||
|
|
6e844850bb | ||
|
|
3205c867bd | ||
|
|
2dda36aa66 | ||
|
|
f807f7636e | ||
|
|
ce75619557 | ||
|
|
dedd72dd66 | ||
|
|
bf3ff8f3ab | ||
|
|
20030ff194 | ||
|
|
338806b96c | ||
|
|
6b7a437ab4 | ||
|
|
8bdc8345cd | ||
|
|
0d3eab85be | ||
|
|
bb63ccb687 | ||
|
|
1949ed2dec | ||
|
|
55de79d8f4 | ||
|
|
b813c9b481 | ||
|
|
156a947bb3 | ||
|
|
764f4e2de2 | ||
|
|
1edd25d31d | ||
|
|
f519385213 | ||
|
|
8bae0b0557 | ||
|
|
d28e5063d1 | ||
|
|
91ace6a10e | ||
|
|
d1250a2cd8 | ||
|
|
742ff817ac | ||
|
|
8a0d0a0470 | ||
|
|
8df0ed6737 | ||
|
|
8196567dac | ||
|
|
838398c918 | ||
|
|
86cb51e35b | ||
|
|
78b84cffdc | ||
|
|
fba7da441a | ||
|
|
1330e01c34 | ||
|
|
95102ca491 | ||
|
|
b8ce97337b | ||
|
|
b90bcd0a8a | ||
|
|
0799d52bfa | ||
|
|
128c8bf82f | ||
|
|
e4029874d9 | ||
|
|
bdbcb1f490 | ||
|
|
5ef4253b80 | ||
|
|
8f9c605bf6 | ||
|
|
1af943dce9 | ||
|
|
9b5bb250c5 | ||
|
|
0be4f88adc | ||
|
|
2ce67726cc | ||
|
|
c09efc1635 | ||
|
|
5633e79453 | ||
|
|
78bd2e39da | ||
|
|
5356f2e2da | ||
|
|
d676b6b3e0 | ||
|
|
c180dfc33b | ||
|
|
89fa4604d3 | ||
|
|
e4f4fac798 | ||
|
|
b605cfa3b6 | ||
|
|
71bded8e06 | ||
|
|
85ea9a0e7a | ||
|
|
1817809309 | ||
|
|
6ba82b4c80 | ||
|
|
77714fce94 | ||
|
|
79215e3bdd | ||
|
|
22cb071cb2 | ||
|
|
374b5ecc84 | ||
|
|
3a10633b8c | ||
|
|
fcdca1f411 | ||
|
|
e3ec259703 | ||
|
|
f006e75513 | ||
|
|
34753db06e | ||
|
|
130efff19c | ||
|
|
d4ba85be51 | ||
|
|
7adf8372f6 | ||
|
|
c40ebdb37f | ||
|
|
35913e09e8 | ||
|
|
dff7d0475b | ||
|
|
6cf371a5b7 | ||
|
|
4a63376a2f | ||
|
|
0365d2b03c | ||
|
|
a0f1f7f77a | ||
|
|
f7abcf9864 | ||
|
|
0ac0cc5026 | ||
|
|
08950f9701 | ||
|
|
ebf0b776e6 | ||
|
|
f811c7c6a8 | ||
|
|
e988f0ba2b | ||
|
|
dd13fe22af | ||
|
|
ff0e44d9ad | ||
|
|
51cd34470d | ||
|
|
7f9e6a78d2 | ||
|
|
96ab1a35a7 | ||
|
|
a5a1a89128 | ||
|
|
47f1979115 | ||
|
|
bb3aa1a14b | ||
|
|
6d2611d475 | ||
|
|
c5bc8667e9 | ||
|
|
0b15b1eeb0 | ||
|
|
8b8409dd31 | ||
|
|
a6d0e75d96 | ||
|
|
511a030c0c | ||
|
|
aa97b01494 | ||
|
|
27256be1ed | ||
|
|
508de1570c | ||
|
|
8161d996f0 | ||
|
|
efa2ab027b | ||
|
|
87cf19bf58 | ||
|
|
7e7c4b97af | ||
|
|
67a58414ce | ||
|
|
c18aed9f21 | ||
|
|
111ee5da7b | ||
|
|
5fffb18701 | ||
|
|
02e5d79784 | ||
|
|
a8bf479067 | ||
|
|
72a304cc28 | ||
|
|
aaf6829263 | ||
|
|
9724f16b93 | ||
|
|
6bf6a5896b | ||
|
|
643d387133 | ||
|
|
4191b0a54f | ||
|
|
46a9b4c46e | ||
|
|
bc3a1c2770 | ||
|
|
89a467908c | ||
|
|
7e00ea55ae | ||
|
|
6264787bb1 | ||
|
|
f199f3a915 | ||
|
|
1f01ceb32b | ||
|
|
8e1f7c7c8b | ||
|
|
a53062c159 | ||
|
|
5574e40171 | ||
|
|
2f28225b88 | ||
|
|
12fe914395 | ||
|
|
6aee0f1076 | ||
|
|
ae8b9b179b | ||
|
|
08797d4a89 | ||
|
|
c3995c3edb | ||
|
|
a0d8aa952c | ||
|
|
fec2a6c808 | ||
|
|
ae67b2c98a | ||
|
|
f7095954bd | ||
|
|
2b34974da4 | ||
|
|
243083b29b | ||
|
|
19595aee4d | ||
|
|
dc1adfaa9a | ||
|
|
0fcb43a7ae | ||
|
|
51c3d5f5ac | ||
|
|
badb1524a7 | ||
|
|
f2d85745cc | ||
|
|
8097795340 | ||
|
|
3a9b98a0c7 | ||
|
|
ff408ec4ce | ||
|
|
43a1a08732 | ||
|
|
81c37adbab | ||
|
|
1fef8d161a | ||
|
|
cc60dcb4f1 | ||
|
|
6e91c22dfe | ||
|
|
9e0dbd3c7c | ||
|
|
4cb1a5d567 | ||
|
|
8bb8100853 | ||
|
|
731fb70b28 | ||
|
|
3dbc2801b9 | ||
|
|
1b1326ecf0 | ||
|
|
d534094f20 | ||
|
|
265da45938 | ||
|
|
f462d48347 | ||
|
|
9535bbcaa6 | ||
|
|
fdacb97620 | ||
|
|
377fe6bf75 | ||
|
|
90856c5f0b | ||
|
|
2cebd41ed4 | ||
|
|
fbae2a09cc | ||
|
|
a6f7defb42 | ||
|
|
812f80fac9 | ||
|
|
f6888dfdbd | ||
|
|
e0e1e38db4 | ||
|
|
a8f22e1c29 | ||
|
|
b066007ca3 | ||
|
|
9040ace1a9 | ||
|
|
b83d4a5427 | ||
|
|
f84e41959a | ||
|
|
d4845e2ec2 | ||
|
|
57c79c13ca | ||
|
|
dc8f264aa7 | ||
|
|
ac5c06ccb5 | ||
|
|
ad7451a7f1 | ||
|
|
a939a6eb9e | ||
|
|
753c09148f | ||
|
|
98aa445546 | ||
|
|
0aff7b9eae | ||
|
|
b8f465ab29 | ||
|
|
0a5b271919 | ||
|
|
9e99220894 | ||
|
|
2c0f9534b7 | ||
|
|
c191626dc7 | ||
|
|
1d8d605c1c | ||
|
|
07dd1ce127 | ||
|
|
adab705372 | ||
|
|
32c8bc40c7 | ||
|
|
43efb026d2 | ||
|
|
2bac195bf8 | ||
|
|
29711e6274 | ||
|
|
8fb9f969ea | ||
|
|
fe39a5f1e7 | ||
|
|
48352fbf23 | ||
|
|
502aa69d13 | ||
|
|
12808cb1d1 | ||
|
|
04b049f8c2 | ||
|
|
9c007557e1 | ||
|
|
b1b246b4a3 | ||
|
|
d2a833a899 | ||
|
|
ce8501e27b | ||
|
|
56df6e6146 | ||
|
|
fa94d9c777 | ||
|
|
c6bf3fc356 | ||
|
|
0899f16e63 | ||
|
|
a5be4db2b3 | ||
|
|
f4b4abbe7a | ||
|
|
e9ed0c8d25 | ||
|
|
0687500e8a | ||
|
|
ea3c3ba9bc | ||
|
|
058e266ece | ||
|
|
5cd639f341 | ||
|
|
34cb2e1a5a | ||
|
|
2a078d56e9 | ||
|
|
2103838454 | ||
|
|
55673eda5c | ||
|
|
814d38f7eb | ||
|
|
d7d8e9d691 | ||
|
|
38864aa327 | ||
|
|
183d49137e | ||
|
|
31c914f982 | ||
|
|
9a143f45be | ||
|
|
3a7c3fedf2 | ||
|
|
e6cd3eaaec | ||
|
|
f18ce1b7d3 | ||
|
|
f8ea4ea47d | ||
|
|
e262466260 | ||
|
|
85dab53916 | ||
|
|
38a07a3304 | ||
|
|
039c189491 | ||
|
|
a3473fd7be | ||
|
|
aa02264d2f | ||
|
|
d9f431c9bd | ||
|
|
f3016baacb | ||
|
|
638c1db7fc | ||
|
|
37cfc0b63f | ||
|
|
c01efa343a | ||
|
|
4dc0a787ee | ||
|
|
9054e09967 | ||
|
|
ff18b2b5b4 | ||
|
|
769ecc83c7 | ||
|
|
87f0fb454b | ||
|
|
644a151070 | ||
|
|
e0c7d453e3 | ||
|
|
38226f2a6b | ||
|
|
1d515be714 | ||
|
|
b48833c5a7 | ||
|
|
ee88b9670a | ||
|
|
f8aa528686 | ||
|
|
552ba7e687 | ||
|
|
2251d3813a | ||
|
|
6df5cc4024 | ||
|
|
faffbd78a7 | ||
|
|
f60aedbf65 | ||
|
|
282fbc0791 | ||
|
|
bb27b0e6ef | ||
|
|
2d60c74d00 | ||
|
|
c05af363e6 | ||
|
|
ef05cd2bc0 | ||
|
|
58c71a9e3f | ||
|
|
3ec2e646fa | ||
|
|
cca31d2225 | ||
|
|
919570c46a | ||
|
|
82b704f693 | ||
|
|
a46f01e603 | ||
|
|
705e687028 | ||
|
|
99ff66bc23 | ||
|
|
2e7935e569 | ||
|
|
51d3808418 | ||
|
|
1d72fbe950 | ||
|
|
0fcedefbfb | ||
|
|
005cdc7b84 | ||
|
|
d191cd86ac | ||
|
|
d40ed35011 | ||
|
|
8727e11e85 | ||
|
|
32a757f84c | ||
|
|
1bd47e0244 | ||
|
|
87f335c560 | ||
|
|
dba7d055aa | ||
|
|
92c1a456ae | ||
|
|
f80c4995de | ||
|
|
0716f1d59b | ||
|
|
886b73af33 | ||
|
|
091df3ab02 | ||
|
|
ad2ddd249c | ||
|
|
45dbbe88b1 | ||
|
|
4c88da02c5 | ||
|
|
f081edd09e | ||
|
|
01a46937a0 | ||
|
|
0575cf7291 | ||
|
|
0ff77971aa | ||
|
|
c9eb8622c3 | ||
|
|
ed88e12e60 | ||
|
|
4131ae7244 | ||
|
|
48f2a0ca10 | ||
|
|
0c2dfbdd96 | ||
|
|
6715a02339 | ||
|
|
7a1d0aaf2d | ||
|
|
de5e439187 | ||
|
|
62c3c6a567 | ||
|
|
9df4c535e9 | ||
|
|
7a4b317288 | ||
|
|
297ee84733 | ||
|
|
92276e73a2 | ||
|
|
1501b4df45 | ||
|
|
9198728b43 | ||
|
|
d5bbfbd41d | ||
|
|
0c0d674e1d | ||
|
|
27b0008c56 | ||
|
|
01046e779c | ||
|
|
3c02670f0f | ||
|
|
59e3223d0d | ||
|
|
09161b1444 | ||
|
|
e7ffdc5574 | ||
|
|
4937938362 | ||
|
|
7e21423866 | ||
|
|
38f2d1fcd4 | ||
|
|
987e7e17c3 | ||
|
|
2c0dd72332 | ||
|
|
d308e4ed6f | ||
|
|
61af1763fd | ||
|
|
edf3cbbd3e | ||
|
|
06c85fb955 | ||
|
|
2d28bfea79 | ||
|
|
9d58618750 | ||
|
|
c38c965434 | ||
|
|
96cacc78c0 | ||
|
|
6f2801248c | ||
|
|
cbc33f36f5 | ||
|
|
41f503de5d | ||
|
|
64405f6f62 | ||
|
|
64961bf692 | ||
|
|
9fdd7fca0b | ||
|
|
eb30417eed | ||
|
|
a6220b8f4b | ||
|
|
bbb9dae8a3 | ||
|
|
53259db5e7 | ||
|
|
28bc929bb6 | ||
|
|
031ddb7bb8 | ||
|
|
8d219a6b27 | ||
|
|
1c244eb19b | ||
|
|
c74080e656 | ||
|
|
cba165c27b | ||
|
|
e73b93f61f | ||
|
|
8011459a1e | ||
|
|
6695fcd3af | ||
|
|
5ac98bc208 | ||
|
|
48e83fcaab | ||
|
|
7c6b5c955e |
No files matched your search
@@ -0,0 +1,3 @@
|
||||
* text=auto
|
||||
test/newlines/** -text
|
||||
test/codegen/python/indentation_sensitive_crlf.re -text
|
||||
@@ -0,0 +1,12 @@
|
||||
version: 2
|
||||
updates:
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
commit-message:
|
||||
include: "scope"
|
||||
prefix: "Actions"
|
||||
directory: "/"
|
||||
labels:
|
||||
- "enhancement"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
@@ -33,18 +33,18 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.8'
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v2
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: '11'
|
||||
java-version: '24'
|
||||
|
||||
- name: Setup Common Prerequisites
|
||||
run: |
|
||||
@@ -52,6 +52,7 @@ jobs:
|
||||
Linux*)
|
||||
echo "CC=gcc" >> $GITHUB_ENV
|
||||
echo "CXX=g++" >> $GITHUB_ENV
|
||||
sudo apt update
|
||||
sudo apt install libre2-dev libbenchmark-dev
|
||||
;;
|
||||
macOS*)
|
||||
@@ -70,7 +71,17 @@ jobs:
|
||||
cmake -S . -B .build \
|
||||
-G "Unix Makefiles" \
|
||||
-DRE2C_BUILD_LIBS=ON \
|
||||
-DRE2C_BUILD_RE2D=OFF \
|
||||
-DRE2C_BUILD_RE2GO=OFF \
|
||||
-DRE2C_BUILD_RE2HS=OFF \
|
||||
-DRE2C_BUILD_RE2JAVA=OFF \
|
||||
-DRE2C_BUILD_RE2JS=OFF \
|
||||
-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 \
|
||||
-DCMAKE_CXX_FLAGS="-O3"
|
||||
|
||||
@@ -78,20 +89,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
|
||||
@@ -0,0 +1,167 @@
|
||||
name: CI autotools
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
name: ${{ matrix.name }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
# When set to true, GitHub cancels
|
||||
# all in-progress jobs if any matrix job fails.
|
||||
fail-fast: false
|
||||
|
||||
matrix:
|
||||
|
||||
include:
|
||||
- name: linux-gcc-intree
|
||||
os: ubuntu-latest
|
||||
|
||||
- name: linux-gcc-ootree
|
||||
os: ubuntu-latest
|
||||
|
||||
# macOS
|
||||
- name: macos-clang-intree
|
||||
os: macos-latest
|
||||
|
||||
- name: macos-clang-ootree
|
||||
os: macos-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup apt cache (Linux)
|
||||
if: startsWith(runner.os, 'Linux')
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: /var/cache/apt
|
||||
key: ${{ runner.os }}-apt-cache-${{ matrix.os }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-apt-cache-${{ matrix.os }}-
|
||||
${{ runner.os }}-apt-cache-
|
||||
|
||||
- name: Setup Common Prerequisites
|
||||
run: |
|
||||
case ${{ runner.os }} in
|
||||
Linux*)
|
||||
sudo apt update
|
||||
sudo apt install autoconf automake libtool bison
|
||||
;;
|
||||
macOS*)
|
||||
sudo xcode-select -switch /Applications/Xcode.app
|
||||
echo "SDKROOT=$(xcodebuild -version -sdk macosx Path)" >> $GITHUB_ENV
|
||||
echo "$(xcodebuild -version -sdk macosx Path)" >> $GITHUB_PATH
|
||||
|
||||
brew install autoconf automake libtool bison coreutils
|
||||
# bison is not activated by default to avoid clobbering
|
||||
# already present outdated system bison. Let's prepend
|
||||
# brew's path.
|
||||
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
|
||||
;;
|
||||
esac
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: 3.x
|
||||
architecture: x64
|
||||
|
||||
- name: Install Python Dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install docutils pygments
|
||||
|
||||
- name: Generate ./configure
|
||||
run: ./autogen.sh
|
||||
|
||||
- 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
|
||||
run: make -j$(nproc)
|
||||
|
||||
- name: Fast Install
|
||||
run: make -j$(nproc) install
|
||||
|
||||
- name: Fast Clean
|
||||
run: make -j$(nproc) distclean
|
||||
|
||||
- name: Minimal Install Test
|
||||
working-directory: ./install/bin
|
||||
run: ./re2c --version
|
||||
|
||||
- name: Get build dir
|
||||
id: build-info
|
||||
run: |
|
||||
if echo "${{ matrix.name }}" | grep -q "ootree"; then
|
||||
BUILD_DIR="$(pwd)/.build/${{ matrix.name }}-full"
|
||||
mkdir -p "$BUILD_DIR"
|
||||
else
|
||||
BUILD_DIR="$(pwd)"
|
||||
fi
|
||||
echo "BUILD_DIR=$BUILD_DIR" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Full Configure
|
||||
working-directory: ${{ steps.build-info.outputs.BUILD_DIR }}
|
||||
run: |
|
||||
$GITHUB_WORKSPACE/configure \
|
||||
--prefix=$PWD/full-install \
|
||||
--enable-libs \
|
||||
--enable-parsers \
|
||||
--enable-lexers \
|
||||
--enable-docs \
|
||||
--enable-debug \
|
||||
RE2C_FOR_BUILD=$GITHUB_WORKSPACE/install/bin/re2c
|
||||
|
||||
- name: Full Build
|
||||
working-directory: ${{ steps.build-info.outputs.BUILD_DIR }}
|
||||
run: |
|
||||
find $GITHUB_WORKSPACE/src -name '*.re' | xargs touch
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Run Main Test Suite
|
||||
working-directory: ${{ steps.build-info.outputs.BUILD_DIR }}
|
||||
run: bash -c "ulimit -s 256; make check -j$(nproc)"
|
||||
|
||||
- name: Run Skeleton Tests
|
||||
working-directory: ${{ steps.build-info.outputs.BUILD_DIR }}
|
||||
run: python run_tests.py --skeleton
|
||||
|
||||
- name: Full Install
|
||||
working-directory: ${{ steps.build-info.outputs.BUILD_DIR }}
|
||||
run: make -j$(nproc) install
|
||||
|
||||
- name: Archive test artifacts
|
||||
# Run this step only if tests failed (otherwise there is nothing to upload).
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
# To ensure that jobs don't overwrite existing artifacts,
|
||||
# use a different name per job.
|
||||
name: test-${{ matrix.name }}
|
||||
# Tests run in a temporary directory that has a name test_<timestamp>.
|
||||
path: ${{ steps.build-info.outputs.BUILD_DIR }}/test_[0-9]*
|
||||
# Artifacts are retained for 90 days by default.
|
||||
# In fact, we don't need such long period.
|
||||
retention-days: 30
|
||||
@@ -0,0 +1,181 @@
|
||||
name: CI CMake
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
name: ${{ matrix.name }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
# When set to true, GitHub cancels
|
||||
# all in-progress jobs if any matrix job fails.
|
||||
fail-fast: false
|
||||
|
||||
matrix:
|
||||
|
||||
include:
|
||||
# Linux
|
||||
- name: linux-gcc-ubsan-ootree
|
||||
os: ubuntu-latest
|
||||
|
||||
- name: linux-gcc-asan-ootree
|
||||
os: ubuntu-latest
|
||||
|
||||
- name: linux-gcc-valgrind-ootree
|
||||
os: ubuntu-latest
|
||||
|
||||
- name: linux-gcc-debug-ootree-skeleton
|
||||
os: ubuntu-latest
|
||||
|
||||
- name: linux-gcc-debug-intree-m32-skeleton
|
||||
os: ubuntu-latest
|
||||
|
||||
- name: linux-gcc-release-ootree-skeleton
|
||||
os: ubuntu-latest
|
||||
|
||||
# macOS
|
||||
- name: macos-clang-debug-ootree-skeleton
|
||||
os: macos-latest
|
||||
|
||||
- name: macos-clang-debug-intree-skeleton
|
||||
os: macos-latest
|
||||
|
||||
- name: macos-clang-release-ootree-skeleton
|
||||
os: macos-latest
|
||||
|
||||
# Windows
|
||||
- name: windows-msvc-debug-ootree
|
||||
os: windows-latest
|
||||
|
||||
- name: windows-msvc-debug-intree
|
||||
os: windows-latest
|
||||
|
||||
- name: windows-msvc-release-ootree
|
||||
os: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup chocolatey Cache (Windows)
|
||||
if: startsWith(runner.os, 'Windows')
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
|
||||
key: ${{ runner.os }}-chocolatey-${{ matrix.os }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-chocolatey-${{ matrix.os }}-
|
||||
${{ runner.os }}-chocolatey-
|
||||
|
||||
- name: Setup apt cache (Linux)
|
||||
if: startsWith(runner.os, 'Linux')
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: /var/cache/apt
|
||||
key: ${{ runner.os }}-apt-cache-${{ matrix.os }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-apt-cache-${{ matrix.os }}-
|
||||
${{ runner.os }}-apt-cache-
|
||||
|
||||
- name: Setup Common Prerequisites
|
||||
run: |
|
||||
case ${{ runner.os }} in
|
||||
Linux*)
|
||||
sudo apt update
|
||||
sudo apt install gcc-multilib g++-multilib # for -m32
|
||||
sudo apt install valgrind
|
||||
;;
|
||||
macOS*)
|
||||
sudo xcode-select -switch /Applications/Xcode.app
|
||||
echo "SDKROOT=$(xcodebuild -version -sdk macosx Path)" >> $GITHUB_ENV
|
||||
echo "$(xcodebuild -version -sdk macosx Path)" >> $GITHUB_PATH
|
||||
brew install coreutils # for `nproc`
|
||||
;;
|
||||
Windows*)
|
||||
choco install --no-progress -y winflexbison3
|
||||
choco install gnuwin32-coreutils.install # for `nproc`
|
||||
;;
|
||||
esac
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: 3.x
|
||||
architecture: x64
|
||||
|
||||
- name: Install Python Dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install docutils pygments
|
||||
|
||||
- name: Check Available Configure Presets
|
||||
run: cmake --list-presets
|
||||
|
||||
- name: Fast Configure
|
||||
run: cmake --preset=${{ matrix.name }}-fast -DPython3_ROOT_DIR="${{ env.pythonLocation }}"
|
||||
|
||||
- name: Fast Build
|
||||
run: cmake --build --preset=${{ matrix.name }}-fast -j$(nproc)
|
||||
|
||||
- name: Install
|
||||
run: cmake --build --preset=${{ matrix.name }}-fast --target install
|
||||
|
||||
- name: Minimal Install Test
|
||||
working-directory: ./install/bin
|
||||
run: ./re2c --version
|
||||
|
||||
- name: Get build dir
|
||||
id: build-info
|
||||
run: |
|
||||
if echo "${{ matrix.name }}" | grep -q "ootree"; then
|
||||
BUILD_DIR="${{ github.workspace }}/.build/${{ matrix.name }}-full"
|
||||
else
|
||||
BUILD_DIR="${{ github.workspace }}"
|
||||
fi
|
||||
echo "BUILD_DIR=$BUILD_DIR" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Full Configure
|
||||
run: cmake --preset=${{ matrix.name }}-full -DPython3_ROOT_DIR="${{ env.pythonLocation }}"
|
||||
|
||||
- name: Full Build
|
||||
run: |
|
||||
find src -name '*.re' | xargs touch
|
||||
cmake --build --preset=${{ matrix.name }}-full -j$(nproc)
|
||||
|
||||
- name: Run Main Test Suite
|
||||
run: bash -c "ulimit -s 256; cmake --build --preset=${{ matrix.name }}-full --target tests -j$(nproc)"
|
||||
|
||||
- name: Run Skeleton Tests
|
||||
if: "contains(matrix.name, 'skeleton')"
|
||||
working-directory: ${{ steps.build-info.outputs.BUILD_DIR }}
|
||||
run: python run_tests.py --skeleton
|
||||
|
||||
- name: Run Valgrind Tests
|
||||
if: "contains(matrix.name, 'valgrind')"
|
||||
working-directory: ${{ steps.build-info.outputs.BUILD_DIR }}
|
||||
run: python run_tests.py --valgrind
|
||||
|
||||
- name: Archive test artifacts
|
||||
# Run this step only if tests failed (otherwise there is nothing to upload).
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
# To ensure that jobs don't overwrite existing artifacts,
|
||||
# use a different name per job.
|
||||
name: test-${{ matrix.name }}
|
||||
# Tests run in a temporary directory that has a name test_<timestamp>.
|
||||
# Provide both relative and absolute paths. Absolute path should work for all builds,
|
||||
# but it doesn't work on Windows. Relative path works for in-tree Windows builds.
|
||||
path: |
|
||||
test_[0-9]*
|
||||
${{ steps.build-info.outputs.BUILD_DIR }}/test_[0-9]*
|
||||
# Artifacts are retained for 90 days by default.
|
||||
# In fact, we don't need such long period.
|
||||
retention-days: 30
|
||||
@@ -1,160 +0,0 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
name: ${{ matrix.name }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
# When set to true, GitHub cancels
|
||||
# all in-progress jobs if any matrix job fails.
|
||||
fail-fast: false
|
||||
|
||||
matrix:
|
||||
|
||||
include:
|
||||
# Linux
|
||||
- name: linux-gcc-ubsan-ootree
|
||||
os: ubuntu-latest
|
||||
|
||||
- name: linux-gcc-asan-ootree
|
||||
os: ubuntu-latest
|
||||
|
||||
- name: linux-gcc-debug-ootree-skeleton
|
||||
os: ubuntu-latest
|
||||
|
||||
- name: linux-gcc-debug-intree-m32-skeleton
|
||||
os: ubuntu-latest
|
||||
|
||||
- name: linux-gcc-release-ootree-skeleton
|
||||
os: ubuntu-latest
|
||||
|
||||
# macOS
|
||||
- name: macos-clang-debug-ootree-skeleton
|
||||
os: macos-latest
|
||||
|
||||
- name: macos-clang-debug-intree-skeleton
|
||||
os: macos-latest
|
||||
|
||||
- name: macos-clang-release-ootree-skeleton
|
||||
os: macos-latest
|
||||
|
||||
# Windows
|
||||
- name: windows-msvc-debug-ootree
|
||||
os: windows-latest
|
||||
|
||||
- name: windows-msvc-debug-intree
|
||||
os: windows-latest
|
||||
|
||||
- name: windows-msvc-release-ootree
|
||||
os: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup chocolatey Cache (Windows)
|
||||
if: startsWith(runner.os, 'Windows')
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
|
||||
key: ${{ runner.os }}-chocolatey-${{ matrix.os }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-chocolatey-${{ matrix.os }}-
|
||||
${{ runner.os }}-chocolatey-
|
||||
|
||||
- name: Setup Common Prerequisites
|
||||
run: |
|
||||
case ${{ runner.os }} in
|
||||
Linux*)
|
||||
sudo apt install gcc-multilib g++-multilib # for -m32
|
||||
;;
|
||||
macOS*)
|
||||
sudo xcode-select -switch /Applications/Xcode.app
|
||||
echo "SDKROOT=$(xcodebuild -version -sdk macosx Path)" >> $GITHUB_ENV
|
||||
echo "$(xcodebuild -version -sdk macosx Path)" >> $GITHUB_PATH
|
||||
;;
|
||||
Windows*)
|
||||
choco install --no-progress -y winflexbison3
|
||||
;;
|
||||
esac
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.x
|
||||
architecture: x64
|
||||
|
||||
- name: Install Python Dependencies
|
||||
# Disabled until this https://github.com/skvadrik/re2c/issues/327
|
||||
# will be implemented
|
||||
if: startsWith(runner.os, 'Windows') == false
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install docutils pygments
|
||||
|
||||
- name: Check Available Configure Presets
|
||||
run: cmake --list-presets
|
||||
|
||||
- name: Fast Configure
|
||||
run: cmake --preset=${{ matrix.name }}-fast
|
||||
|
||||
- name: Fast Build
|
||||
run: cmake --build --preset=${{ matrix.name }}-fast
|
||||
|
||||
- name: Install
|
||||
run: cmake --build --preset=${{ matrix.name }}-fast --target install
|
||||
|
||||
- name: Minimal Install Test
|
||||
working-directory: ./install/bin
|
||||
run: ./re2c --version
|
||||
|
||||
- name: Full Configure
|
||||
run: cmake --preset=${{ matrix.name }}-full
|
||||
|
||||
- name: Full Build
|
||||
run: |
|
||||
find src -name '*.re' | xargs touch
|
||||
cmake --build --preset=${{ matrix.name }}-full
|
||||
|
||||
- name: Run Main Test Suite
|
||||
run: cmake --build --preset=${{ matrix.name }}-full --target tests
|
||||
|
||||
- name: Get build dir
|
||||
id: build-info
|
||||
run: |
|
||||
if echo "${{ matrix.name }}" | grep -q "ootree"; then
|
||||
BUILD_DIR="$(pwd)/.build/${{ matrix.name }}-full"
|
||||
else
|
||||
BUILD_DIR="$(pwd)"
|
||||
fi
|
||||
|
||||
echo "::set-output name=BUILD_DIR::$BUILD_DIR"
|
||||
|
||||
- name: Run Skeleton Tests
|
||||
if: "contains(matrix.name, 'skeleton')"
|
||||
# Remove the following line after fix Windows tests
|
||||
working-directory: ${{ steps.build-info.outputs.BUILD_DIR }}
|
||||
run: python run_tests.py --skeleton
|
||||
|
||||
- name: Archive test artifacts
|
||||
# Run this step only if tests failed (otherwise there is nothing to upload).
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
# To ensure that jobs don't overwrite existing artifacts,
|
||||
# use a different name per job.
|
||||
name: test-${{ matrix.name }}
|
||||
# Tests run in a temporary directory that has a name test_<timestamp>.
|
||||
path: ${{ steps.build-info.outputs.BUILD_DIR }}/test_[0-9]*
|
||||
# Artifacts are retained for 90 days by default.
|
||||
# In fact, we don't need such long period.
|
||||
retention-days: 30
|
||||
@@ -11,6 +11,7 @@
|
||||
/m4
|
||||
/test_*
|
||||
/.build*
|
||||
/bazel-*
|
||||
|
||||
# Ignore user defined CMake presets
|
||||
CMakeUserPresets.json
|
||||
|
||||
+2
-2
@@ -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
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package(default_visibility = ["//visibility:private"])
|
||||
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
|
||||
|
||||
genrule(
|
||||
name = "re2c_config",
|
||||
srcs = [
|
||||
"CMakeLists.txt",
|
||||
"//bazel:re2c_config.h",
|
||||
],
|
||||
outs = ["config.h"],
|
||||
cmd = """
|
||||
cat $(location //:CMakeLists.txt) |\\
|
||||
sed -rne 's/project\\(re2c VERSION ([^ ]+).*/#define PACKAGE_VERSION "\\1-bootstrap"/p' >> "$@"
|
||||
cat $(location //bazel:re2c_config.h) >> "$@"
|
||||
""",
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "re2c_config_cc",
|
||||
hdrs = ["config.h"],
|
||||
defines = ["""RE2C_STDLIB_DIR='"$(BINDIR)/re2c.runfiles/re2c/include"'"""],
|
||||
data = ["include/unicode_categories.re"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "re2c_bootstrap_cc",
|
||||
includes = ["bootstrap"],
|
||||
hdrs = glob([
|
||||
"bootstrap/src/**/*.h",
|
||||
"src/**/*.h",
|
||||
]),
|
||||
srcs = glob([
|
||||
"bootstrap/src/**/*.cc",
|
||||
"src/**/*.cc",
|
||||
], exclude = ["src/test/**/*.cc"]),
|
||||
deps = [
|
||||
"re2c_config_cc", # Needed for 're2c_config_cc' data files
|
||||
],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "re2c",
|
||||
srcs = ["src/main.cc"],
|
||||
deps = [":re2c_bootstrap_cc"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
@@ -1,28 +1,30 @@
|
||||
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
|
||||
------------
|
||||
|
||||
To build re2c from a release tarball one needs only a C++ compiler and
|
||||
optionally Python 3 to run the tests.
|
||||
To build re2c from a release tarball one needs only a C++ compiler (supporting
|
||||
at least C++11) and Python 3 for build-time scripts and for testing. Building on
|
||||
Windows additionally requires either CMake or a Mingw build environment.
|
||||
|
||||
To develop re2c one also needs CMake or Autotools. Re2c can be built with either
|
||||
of the two build systems, and they are both maintained and tested on CI. Other
|
||||
build dependencies include Bison (to rebuild parsers), rst2man (to rebuild
|
||||
documentation), Sphinx (to rebuild the website), and optionally Mingw and Wine
|
||||
(to run Windows tests on Linux). A few helper scripts are written in Haskell,
|
||||
but they are not essential for re2c development.
|
||||
To develop re2c one also needs CMake or Autotools (both build systems are
|
||||
maintained). Other dependencies include Bison (to rebuild parsers), Python 3
|
||||
Docutils (to rebuild documentation) and Sphinx (to rebuild the website).
|
||||
Benchmarks also use Google-benchmark, re2 and Java. A few helper scripts are
|
||||
written in Haskell, but they are not essential for re2c development.
|
||||
|
||||
Re2c is a self-hosting lexer generator, meaning that parts of its source code
|
||||
re2c is a self-hosting lexer generator, meaning that parts of its source code
|
||||
are written in re2c (namely, all the source files that have a *.re* extension).
|
||||
By default re2c builds from pregenerated bootstrap files. To regenerate these
|
||||
files it is necessary to configure re2c in a special way and provide a path to
|
||||
an existing re2c binary (see the details below). Normally this is not necessary,
|
||||
and the pregenerated files can be used as long as the *.re* files are unchanged.
|
||||
|
||||
By default re2c builds from pre-generated bootstrap files. To build from source
|
||||
*.re* files, it is necessary to reconfigure the build and provide a path to an
|
||||
existing re2c binary that will be used for bootstrap (see the details below).
|
||||
|
||||
|
||||
Build (Autotools)
|
||||
@@ -37,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
|
||||
```
|
||||
@@ -48,23 +51,61 @@ The configure script has many options (to see them all, run
|
||||
* `--enable-debug`
|
||||
Enable debug checks in the re2c source code. Also enables debug options.
|
||||
|
||||
* `--enable-dlang`
|
||||
Build re2d (identical to `re2c --lang d`). This is on by default.
|
||||
|
||||
* `--enable-golang`
|
||||
Build re2go (identical to `re2c --lang go`). This is on by default.
|
||||
|
||||
* `--enable-haskell`
|
||||
Build re2hs (identical to `re2c --lang haskell`). This is on by default.
|
||||
|
||||
* `--enable-java`
|
||||
Build re2java (identical to `re2c --lang java`). This is on by default.
|
||||
|
||||
* `--enable-js`
|
||||
Build re2js (identical to `re2c --lang js`). This is on by default.
|
||||
|
||||
* `--enable-ocaml`
|
||||
Build re2ocaml (identical to `re2c --lang ocaml`). This is on by default.
|
||||
|
||||
* `--enable-python`
|
||||
Build re2py (identical to `re2c --lang python`). This is on by default.
|
||||
|
||||
* `--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.
|
||||
|
||||
* `--enable-zig`
|
||||
Build re2zig (identical to `re2c --lang zig`). This is on by default.
|
||||
|
||||
* `--enable-lexers`
|
||||
Enable regeneration of *.re* files (as opposed to using bootstrap files).
|
||||
This requires setting `RE2C_FOR_BUILD` to an existing re2c executable
|
||||
path.
|
||||
Enable regeneration of lexers from *.re* files (as opposed to using
|
||||
pre-generated bootstrap files). This requires setting `RE2C_FOR_BUILD` to
|
||||
an existing re2c executable path.
|
||||
|
||||
* `--enable-parsers`
|
||||
Enable regeneration of parsers from *.ypp* files with bison (as opposed to
|
||||
using pre-generated bootstrap files).
|
||||
|
||||
* `--enable-syntax`
|
||||
Enable regeneration of default syntax files from the ones provided in
|
||||
include/ directory (as opposed to using pre-generated bootstrap files).
|
||||
|
||||
* `--enable-docs`
|
||||
Enable regeneration of documentation (requires rst2man).
|
||||
Enable regeneration of documentation (requires Python 3 Docutils).
|
||||
|
||||
* `--enable-benchmarks`
|
||||
Build benchmarks (requires google benchmarks library).
|
||||
Build benchmarks (requires Google benchmarks library).
|
||||
|
||||
* `--enable-benchmarks-regenerate`
|
||||
Regenerate C code for Ragel and Kleenex benchmarks (this will download and
|
||||
build Ragel and Kleenex). Re2c benchmarks are always regenerated.
|
||||
build Ragel and Kleenex). re2c benchmarks are always regenerated.
|
||||
|
||||
* `--enable-libs`
|
||||
Build the experimental libre2c library that provides POSIX
|
||||
@@ -82,10 +123,27 @@ There is a bunch of build scripts for specialized builds with Asan, Ubsan,
|
||||
GLIBCXX_DEBUG, etc. in the ``build`` subdirectory.
|
||||
|
||||
|
||||
|
||||
Build (CMake)
|
||||
-------------
|
||||
|
||||
re2c includes CMake presets for Linux, MacOS, and Windows. Use `cmake
|
||||
--list-presets` to see them.
|
||||
|
||||
* The `-fast` presets have minimal dependencies and build re2c using
|
||||
pre-generated manpages, lexers, and parsers.
|
||||
* The `-full` presets have additional prerequisites (Docutils, Bison, and a
|
||||
pre-existing re2c binary) and re-generate the manpages, lexers, and parsers.
|
||||
|
||||
If you just want to build re2c, use the `-release-ootree-fast` preset. The
|
||||
other presets are primarily of interest to developers.
|
||||
|
||||
For example, to build the `windows-msvc-release-ootree-fast` preset:
|
||||
|
||||
* CD to the root of the re2c folder (the folder containing this README).
|
||||
* Configure: `cmake --preset=windows-msvc-release-ootree-fast`
|
||||
* Build: `cmake --build --preset=windows-msvc-release-ootree-fast`
|
||||
* The binary will be in the `.build/<preset-name>` folder.
|
||||
|
||||
CMake supports different build modes, which can be further customized with
|
||||
individual options. By default re2c builds with `-O2 -g` and does not set any
|
||||
particular mode to allow the user complete freedom in overriding the build
|
||||
@@ -119,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 .
|
||||
```
|
||||
@@ -127,23 +186,67 @@ A simple build (objects are generated in a separate build directory):
|
||||
CMake supports a lot of configuration options. Here is the list of options
|
||||
specific to re2c:
|
||||
|
||||
* `-DRE2C_BUILD_RE2D=yes`
|
||||
Build re2d executable (an alias to `re2c --lang d`). Enabled by default.
|
||||
|
||||
* `-DRE2C_BUILD_RE2GO=yes`
|
||||
Build re2go executable (an alias to `re2c --lang go`). Enabled by default.
|
||||
|
||||
* `-DRE2C_BUILD_RE2HS=yes`
|
||||
Build re2hs executable (an alias to `re2c --lang haskell`). Enabled by
|
||||
default.
|
||||
|
||||
* `-DRE2C_BUILD_RE2JAVA=yes`
|
||||
Build re2java executable (an alias to `re2c --lang java`). Enabled by
|
||||
default.
|
||||
|
||||
* `-DRE2C_BUILD_RE2JS=yes`
|
||||
Build re2js executable (an alias to `re2c --lang js`). Enabled by default.
|
||||
|
||||
* `-DRE2C_BUILD_RE2OCAML=yes`
|
||||
Build re2ocaml executable (an alias to `re2c --lang ocaml`). Enabled by
|
||||
default.
|
||||
|
||||
* `-DRE2C_BUILD_RE2PY=yes`
|
||||
Build re2py executable (an alias to `re2c --lang python`). Enabled by
|
||||
default.
|
||||
|
||||
* `-DRE2C_BUILD_RE2RUST=yes`
|
||||
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.
|
||||
|
||||
* `-DRE2C_BUILD_RE2ZIG=yes`
|
||||
Build re2zig executable (an alias to `re2c --lang zig`). Enabled by default.
|
||||
|
||||
* `-DRE2C_REBUILD_LEXERS=yes`
|
||||
Enable regeneration of *.re* files (as opposed to using bootstrap files).
|
||||
This requires setting `-DRE2C_FOR_BUILD` to an existing re2c executable
|
||||
path.
|
||||
Enable regeneration of lexers from *.re* files (as opposed to using
|
||||
pre-generated bootstrap files). This requires setting `-DRE2C_FOR_BUILD` to
|
||||
an existing re2c executable path.
|
||||
|
||||
* `-DRE2C_REBUILD_PARSERS=yes`
|
||||
Enable regeneration of parsers from *.ypp* files with bison (as opposed to
|
||||
using pre-generated bootstrap files).
|
||||
|
||||
* `-DRE2C_REBUILD_SYNTAX=yes`
|
||||
Enable regeneration of default syntax files from the ones provided in
|
||||
include/ directory (as opposed to using pre-generated bootstrap files).
|
||||
|
||||
* `-DRE2C_REBUILD_DOCS=yes`
|
||||
Enable regeneration of documentation (requires rst2man).
|
||||
Enable regeneration of documentation (requires Python 3 Docutils).
|
||||
|
||||
* `-DRE2C_BUILD_BENCHMARKS=yes`
|
||||
Build benchmarks (requires google benchmarks library).
|
||||
Build benchmarks (requires Google benchmarks library).
|
||||
|
||||
* `-DRE2C_REGEN_BENCHMARKS=yes`
|
||||
Regenerate C code for Ragel and Kleenex benchmarks (this will download and
|
||||
build Ragel and Kleenex). Re2c benchmarks are always regenerated.
|
||||
build Ragel and Kleenex). re2c benchmarks are always regenerated.
|
||||
|
||||
* `-DRE2C_BUILD_LIBS=yes`
|
||||
Build the experimental libre2c library that provides POSIX
|
||||
@@ -161,11 +264,10 @@ There is a bunch of build scripts for specialized builds with Asan, Ubsan,
|
||||
GLIBCXX_DEBUG, etc. in the ``build`` subdirectory.
|
||||
|
||||
|
||||
|
||||
Test
|
||||
----
|
||||
|
||||
Re2c has a main test suite and a number of unit tests. Run them all:
|
||||
re2c has a main test suite and a number of unit tests. Run them all:
|
||||
```
|
||||
$ make check
|
||||
```
|
||||
@@ -190,9 +292,17 @@ Check the distribution (works with Autotools):
|
||||
$ make distcheck
|
||||
```
|
||||
|
||||
Re2c provides a helper script `build/__alltest.sh` that builds and tests
|
||||
various re2c build flavours with Asan, Ubsan, GLIBCXX_DEBUG, etc. There is a
|
||||
couple of 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.
|
||||
re2c provides a helper script `build/__alltest.sh` that builds and tests various
|
||||
re2c build flavours with Asan, Ubsan, GLIBCXX_DEBUG, etc. There is a couple of
|
||||
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:
|
||||
|
||||

|
||||
@@ -1,9 +1,611 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
----
|
||||
2.2x
|
||||
----
|
||||
|
||||
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)
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
- Added a generic technique for describing language backends based on the idea
|
||||
of syntax files (`#450 <https://github.com/skvadrik/re2c/issues/450>`_).
|
||||
|
||||
- Added support for new languages: D, Haskell, Java, JavaScript, OCaml, Python,
|
||||
V, Zig.
|
||||
|
||||
- Added new record API for all languages (enabled with ``--api record``,
|
||||
``re2c:api = record``) and made it the default API for Haskell and OCaml.
|
||||
|
||||
- Renamed former "default API" to "simple API", implemented it for all backends
|
||||
except Haskell and OCaml, and enabled by default API for C, D, Java,
|
||||
JavaScript, Python, V and Zig.
|
||||
|
||||
- Added new code generation model - recursive functions (enabled with
|
||||
``--recursive-functions``), primarily to be used for functional languages.
|
||||
|
||||
- Added options:
|
||||
|
||||
+ ``--syntax <file>``
|
||||
+ ``--api simple``
|
||||
+ ``--api generic``
|
||||
+ ``--api record``
|
||||
+ ``--goto-label``
|
||||
+ ``--recursive-functions``
|
||||
+ ``--lang none``
|
||||
+ ``--lang d``
|
||||
+ ``--lang haskell``
|
||||
+ ``--lang java``
|
||||
+ ``--lang js``
|
||||
+ ``--lang ocaml``
|
||||
+ ``--lang python``
|
||||
+ ``--lang v``
|
||||
+ ``--lang zig``
|
||||
+ ``--leftmost-captvars``
|
||||
+ ``--posix-captvars``
|
||||
+ ``--captvars`` (alias for ``--leftmost-captvars``)
|
||||
+ ``--captures`` (alias for ``--leftmost-captures``)
|
||||
|
||||
- Added configurations:
|
||||
|
||||
+ ``re2c:api = simple`` (alias for ``re2c:api = default``)
|
||||
+ ``re2c:api = generic`` (alias for ``re2c:api = custom``)
|
||||
+ ``re2c:api = record``
|
||||
+ ``re2c:computed-gotos`` (alias for ``re2c:cgoto``)
|
||||
+ ``re2c:cond:abort``
|
||||
+ ``re2c:tags:negative``
|
||||
+ ``re2c:leftmost-captvars``
|
||||
+ ``re2c:posix-captvars``
|
||||
+ ``re2c:captvars`` (alias for ``re2c:leftmost-captvars``)
|
||||
+ ``re2c:captures`` (alias for ``re2c:leftmost-captures``)
|
||||
+ ``re2c:monadic``
|
||||
+ ``re2c:fn:sep``
|
||||
+ ``re2c:[define:]YYFN``
|
||||
+ ``re2c:[define:]YYINPUT``
|
||||
+ ``re2c:[define:]YYGETACCEPT``
|
||||
+ ``re2c:[define:]YYSETACCEPT``
|
||||
+ ``re2c:[define:]YYCOPYSTAG``
|
||||
+ ``re2c:[define:]YYCOPYMTAG``
|
||||
+ ``re2c:[define:]YYGETCOND`` (alias for ``re2c:[define:]YYGETCONDITION``)
|
||||
+ ``re2c:[define:]YYSETCOND`` (alias for ``re2c:[define:]YYSETCONDITION``)
|
||||
+ ``re2c:[variable:]yyfill``
|
||||
+ ``re2c:[variable:]yynmatch``
|
||||
+ ``re2c:[variable:]yypmatch``
|
||||
+ ``re2c:[variable:]yych:literals``
|
||||
|
||||
- All configurations that have ``define:`` or ``variable:`` part in their name
|
||||
now have an alias without this part.
|
||||
|
||||
- Added new block types:
|
||||
|
||||
+ ``/*!svars:re2c ... */``
|
||||
+ ``/*!mvars:re2c ... */``
|
||||
|
||||
- Flex-style opening/closing braces ``%{`` and ``%}`` for block start/end
|
||||
markers now work for all block types.
|
||||
|
||||
- Added syntax file feature lists:
|
||||
|
||||
+ ``supported_apis`` with values from the list:
|
||||
``simple``, ``generic``, ``record``
|
||||
|
||||
+ ``supported_api_styles`` with values from the list:
|
||||
``free-form``, ``functions``
|
||||
|
||||
+ ``supported_code_models`` with values from the list:
|
||||
``goto-label``, ``loop-switch``, ``recursive-functions``
|
||||
|
||||
+ ``supported_targets`` with values from the list:
|
||||
``code``, ``dot``, ``skeleton``
|
||||
|
||||
+ ``supported_features`` with values from the list:
|
||||
``nested-ifs``, ``bitmaps``, ``computed-gotos``, ``case-ranges``,
|
||||
``tags``, ``captures``, ``captvars``, ``monadic``, ``unsafe``
|
||||
|
||||
- Added syntax file language-specific options:
|
||||
|
||||
+ ``semicolons``
|
||||
+ ``backtick_quoted_strings``
|
||||
+ ``single_quoted_strings``
|
||||
+ ``indentation_sensitive``
|
||||
+ ``wrap_blocks_in_braces``
|
||||
|
||||
- Added syntax file code templates:
|
||||
|
||||
+ ``code:var_local``
|
||||
+ ``code:var_global``
|
||||
+ ``code:const_local``
|
||||
+ ``code:const_global``
|
||||
+ ``code:array_local``
|
||||
+ ``code:array_global``
|
||||
+ ``code:array_elem``
|
||||
+ ``code:enum``
|
||||
+ ``code:enum_elem``
|
||||
+ ``code:assign``
|
||||
+ ``code:type_int``
|
||||
+ ``code:type_uint``
|
||||
+ ``code:type_cond_enum``
|
||||
+ ``code:type_yybm``
|
||||
+ ``code:type_yytarget``
|
||||
+ ``code:cmp_eq``
|
||||
+ ``code:cmp_ne``
|
||||
+ ``code:cmp_lt``
|
||||
+ ``code:cmp_gt``
|
||||
+ ``code:cmp_le``
|
||||
+ ``code:cmp_ge``
|
||||
+ ``code:if_then_else``
|
||||
+ ``code:if_then_else_oneline``
|
||||
+ ``code:switch``
|
||||
+ ``code:switch_cases``
|
||||
+ ``code:switch_cases_oneline``
|
||||
+ ``code:switch_case_range``
|
||||
+ ``code:switch_case_default``
|
||||
+ ``code:loop``
|
||||
+ ``code:continue``
|
||||
+ ``code:goto``
|
||||
+ ``code:fndecl``
|
||||
+ ``code:fndef``
|
||||
+ ``code:fncall``
|
||||
+ ``code:tailcall``
|
||||
+ ``code:recursive_functions``
|
||||
+ ``code:fingerprint``
|
||||
+ ``code:line_info``
|
||||
+ ``code:abort``
|
||||
+ ``code:yydebug``
|
||||
+ ``code:yypeek``
|
||||
+ ``code:yyskip``
|
||||
+ ``code:yybackup``
|
||||
+ ``code:yybackupctx``
|
||||
+ ``code:yyskip_yypeek``
|
||||
+ ``code:yypeek_yyskip``
|
||||
+ ``code:yyskip_yybackup``
|
||||
+ ``code:yybackup_yyskip``
|
||||
+ ``code:yybackup_yypeek``
|
||||
+ ``code:yyskip_yybackup_yypeek``
|
||||
+ ``code:yybackup_yypeek_yyskip``
|
||||
+ ``code:yyrestore``
|
||||
+ ``code:yyrestorectx``
|
||||
+ ``code:yyrestoretag``
|
||||
+ ``code:yyshift``
|
||||
+ ``code:yyshiftstag``
|
||||
+ ``code:yyshiftmtag``
|
||||
+ ``code:yystagp``
|
||||
+ ``code:yymtagp``
|
||||
+ ``code:yystagn``
|
||||
+ ``code:yymtagn``
|
||||
+ ``code:yycopystag``
|
||||
+ ``code:yycopymtag``
|
||||
+ ``code:yygetaccept``
|
||||
+ ``code:yysetaccept``
|
||||
+ ``code:yygetcond``
|
||||
+ ``code:yysetcond``
|
||||
+ ``code:yygetstate``
|
||||
+ ``code:yysetstate``
|
||||
+ ``code:yylessthan``
|
||||
+ ``code:yybm_filter``
|
||||
+ ``code:yybm_match``
|
||||
|
||||
- Added global variables in syntax files:
|
||||
|
||||
+ ``nl``
|
||||
+ ``indent``
|
||||
+ ``dedent``
|
||||
+ ``topindent``
|
||||
|
||||
- Added global conditionals in syntax files:
|
||||
|
||||
+ ``.api.simple``
|
||||
+ ``.api.generic``
|
||||
+ ``.api.record``
|
||||
+ ``.api_style.functions``
|
||||
+ ``.api_style.freeform``
|
||||
+ ``.case_ranges``
|
||||
+ ``.code_model.goto_label``
|
||||
+ ``.code_model.loop_switch``
|
||||
+ ``.code_model.recursive_functions``
|
||||
+ ``.date``
|
||||
+ ``.loop_label``
|
||||
+ ``.monadic``
|
||||
+ ``.start_conditions``
|
||||
+ ``.storable_state``
|
||||
+ ``.unsafe``
|
||||
+ ``.version``
|
||||
|
||||
- Added warning ``-Wundefined-syntax-config``.
|
||||
|
||||
- Warnings that indicate serious issues are now turned on by default
|
||||
(and can be disabled with ``-Wno-<warning>`` options.
|
||||
|
||||
- Added configure options:
|
||||
|
||||
+ ``--enable-syntax`` (Autoconf)
|
||||
+ ``RE2C_REBUILD_SYNTAX`` (CMake)
|
||||
|
||||
- Dropped support for function-like API style for Rust.
|
||||
(it was hard to use, if at all possible)
|
||||
|
||||
- Added online playground that allows one to run re2c in a web browser:
|
||||
https://re2c.org/playground.
|
||||
|
||||
- Infra work on Github Actions CI.
|
||||
|
||||
|
||||
3.1 (2023-07-19)
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
- Added capturing groups with leftmost greedy semantics:
|
||||
|
||||
+ Enabled with ``--leftmost-captures`` option or ``re2c:leftmost_captures``
|
||||
configuration
|
||||
(`55de79d8 <https://github.com/skvadrik/re2c/commit/55de79d8>`_,
|
||||
`3a98b543 <https://github.com/skvadrik/re2c/commit/3a98b543>`_).
|
||||
|
||||
- Added non-capturing groups:
|
||||
|
||||
+ Added new syntax ``(! ...)`` for non-capturing groups
|
||||
(`1edd25d3 <https://github.com/skvadrik/re2c/commit/1edd25d3>`_,
|
||||
`b813c9b4 <https://github.com/skvadrik/re2c/commit/b813c9b4>`_,
|
||||
`338806b9 <https://github.com/skvadrik/re2c/commit/338806b9>`_).
|
||||
|
||||
+ Added the ability to flip defaults: make ``(...)`` capturing and ``(! ...)``
|
||||
non-capturing with ``--invert-captures`` option or ``re2c:invert_captures``
|
||||
configuration
|
||||
(`20030ff1 <https://github.com/skvadrik/re2c/commit/20030ff1>`_,
|
||||
`ce756195 <https://github.com/skvadrik/re2c/commit/ce756195>`_).
|
||||
|
||||
- Regenerated Unicode include header to support a newer standard
|
||||
(`e3ec2597 <https://github.com/skvadrik/re2c/commit/e3ec2597>`_).
|
||||
|
||||
- Published TDFA paper: https://arxiv.org/abs/2206.01398, co-authored with
|
||||
Angelo Borsotti
|
||||
(`fa94d9c7 <https://github.com/skvadrik/re2c/commit/fa94d9c7>`_).
|
||||
|
||||
- Removed experimental algorithms that are superseded by TDFA(1) and
|
||||
generally less efficient:
|
||||
|
||||
+ Removed staDFA algorithm and deprecated ``--stadfa`` option
|
||||
(`ac5c06cc <https://github.com/skvadrik/re2c/commit/ac5c06cc>`_).
|
||||
|
||||
+ Removed TDFA(0) algorithm and deprecated ``--no-lookahead`` option
|
||||
(`dc8f264a <https://github.com/skvadrik/re2c/commit/dc8f264a>`_).
|
||||
|
||||
+ (libre2c) Removed backward-matching algorithm
|
||||
(`27256be1 <https://github.com/skvadrik/re2c/commit/27256be1>`_).
|
||||
|
||||
+ (libre2c) Removed Kuklewicz POSIX disambiguation algorithm
|
||||
(`aa97b014 <https://github.com/skvadrik/re2c/commit/aa97b014>`_).
|
||||
|
||||
+ (libre2c) Removed GTOP shortest path finding algorithm
|
||||
(`511a030c <https://github.com/skvadrik/re2c/commit/511a030c>`_).
|
||||
|
||||
- Bug fixes:
|
||||
|
||||
+ Fixed parsing of raw UTF-8 characters in Flex compatibility mode
|
||||
(`d87f86ed <https://github.com/skvadrik/re2c/commit/d87f86ed>`_).
|
||||
|
||||
+ Added header file to the dependencies generated with ``--depfile`` option
|
||||
(`f807f763 <https://github.com/skvadrik/re2c/commit/f807f763>`_
|
||||
and `2dda36aa <https://github.com/skvadrik/re2c/commit/2dda36aa>`_).
|
||||
|
||||
+ Fixed stack overflow on large regular expressions by rewriting recursive
|
||||
functions in iterative form
|
||||
(`46a9b4c4 <https://github.com/skvadrik/re2c/commit/46a9b4c4>`_,
|
||||
`aaf68292 <https://github.com/skvadrik/re2c/commit/aaf68292>`_,
|
||||
`02e5d797 <https://github.com/skvadrik/re2c/commit/02e5d797>`_,
|
||||
`5fffb187 <https://github.com/skvadrik/re2c/commit/5fffb187>`_)
|
||||
and limited stack to 256K on GithubActions CI
|
||||
(`111ee5da <https://github.com/skvadrik/re2c/commit/111ee5da>`_).
|
||||
|
||||
- Build system:
|
||||
|
||||
+ Added minimal http://bazel.build integration
|
||||
(`3205c867 <https://github.com/skvadrik/re2c/commit/3205c867>`_).
|
||||
|
||||
+ Added configure option ``--enable-parsers`` that regenerates bison parsers
|
||||
(`9e0dbd3c <https://github.com/skvadrik/re2c/commit/9e0dbd3c>`_).
|
||||
|
||||
+ Added CMake option ``RE2C_REBUILD_PARSERS``
|
||||
(`6e91c22d <https://github.com/skvadrik/re2c/commit/6e91c22d>`_).
|
||||
|
||||
+ With CMake, fixed documentation generation on Windows.
|
||||
|
||||
- Codebase improvements:
|
||||
|
||||
+ Moved the entire codebase to C++11.
|
||||
+ Added uniform error handling (return codes are now properly checked and
|
||||
returned to the caller).
|
||||
+ Reorganized codegen subsystem in four well-defined phases (analyze,
|
||||
generate, fixup, render) and separated codegen from parsing phase.
|
||||
+ Improved memory allocation by using slab allocators instead of global free
|
||||
lists.
|
||||
+ Moved to pure API for bison parsers.
|
||||
+ Unified code style.
|
||||
|
||||
- Testing:
|
||||
|
||||
+ Added ``--verbose`` flag to run_tests.py and suppressed verbose output by
|
||||
default.
|
||||
+ Multiple improvements of continuous testing with GithubActions.
|
||||
|
||||
|
||||
3.0 (2022-01-27)
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
- Added code generation backend for Rust:
|
||||
|
||||
+ Enabled with ``--lang rust`` option.
|
||||
+ A new ``re2rust`` binary (built by default, or configured with
|
||||
``--enable-rust`` Autoconf option and ``RE2C_BUILD_RE2RUST`` CMake option).
|
||||
|
||||
- Added options:
|
||||
|
||||
+ ``--loop-switch``
|
||||
+ ``--no-unsafe``
|
||||
|
||||
- Added configurations;
|
||||
|
||||
+ ``re2c:label:yyloop``
|
||||
+ ``re2c:unsafe``
|
||||
|
||||
- Renamed options to use common naming scheme. The old names are supported as
|
||||
aliases, so the change does not break existing code. Documentation has been
|
||||
updated to use new names.
|
||||
|
||||
+ ``--api`` is a new alias for ``--input``
|
||||
+ ``--ebcdic`` is a new alias for ``--ecb``
|
||||
+ ``--ucs2`` is a new alias for ``--wide-chars``
|
||||
+ ``--utf32`` is a new alias for ``--unicode``
|
||||
+ ``--utf16`` is a new alias for ``--utf-16``
|
||||
+ ``--utf8`` is a new alias for ``--utf-8``
|
||||
+ ``--header`` is a new alias for ``--type-header``
|
||||
|
||||
- Renamed configurations to use common naming scheme and support proper scoping
|
||||
under subcategories such as ``:define``, ``:label``, ``:variable``, etc. The
|
||||
old names are supported as aliases, so the change does not break existing
|
||||
code. Documentation has been updated to use new names.
|
||||
|
||||
+ ``re2c:api`` is a new alias for ``re2c:flags:input``
|
||||
+ ``re2c:bit-vectors`` is a new alias for ``re2c:flags:bit-vectors``
|
||||
+ ``re2c:case-insensitive`` is a new alias for ``re2c:flags:case-insensitive``
|
||||
+ ``re2c:case-inverted`` is a new alias for ``re2c:flags:case-inverted``
|
||||
+ ``re2c:case-ranges`` is a new alias for ``re2c:flags:case-ranges``
|
||||
+ ``re2c:cond:prefix`` is a new alias for ``re2c:condprefix``
|
||||
+ ``re2c:cond:enumprefix`` is a new alias for ``re2c:condenumprefix``
|
||||
+ ``re2c:computed-gotos`` is a new alias for ``re2c:flags:computed-gotos``
|
||||
+ ``re2c:computed-gotos:threshold`` is a new alias for ``re2c:cgoto:threshold``
|
||||
+ ``re2c:debug-output`` is a new alias for ``re2c:flags:debug-output``
|
||||
+ ``re2c:encoding:ebcdic`` is a new alias for ``re2c:flags:ecb``
|
||||
+ ``re2c:encoding:utf32`` is a new alias for ``re2c:flags:unicode``
|
||||
+ ``re2c:encoding:ucs2`` is a new alias for ``re2c:flags:wide-chars``
|
||||
+ ``re2c:encoding:utf16`` is a new alias for ``re2c:flags:utf-16``
|
||||
+ ``re2c:encoding:utf8`` is a new alias for ``re2c:flags:utf-8``
|
||||
+ ``re2c:encoding-policy`` is a new alias for ``re2c:flags:encoding-policy``
|
||||
+ ``re2c:empty-class`` is a new alias for ``re2c:flags:empty-class``
|
||||
+ ``re2c:header`` is a new alias for ``re2c:flags:type-header``
|
||||
+ ``re2c:label:prefix`` is a new alias for ``re2c:labelprefix``
|
||||
+ ``re2c:label:yyfill`` is a new alias for ``re2c:label:yyFillLabel``
|
||||
+ ``re2c:label:start`` is a new alias for ``re2c:startlabel``
|
||||
+ ``re2c:nested-ifs`` is a new alias for ``re2c:flags:nested-ifs``
|
||||
+ ``re2c:posix-captures`` is a new alias for ``re2c:flags:posix-captures``
|
||||
+ ``re2c:tags`` is a new alias for ``re2c:flags:tags``
|
||||
+ ``re2c:variable:yych:conversion`` is a new alias for ``re2c:yych:conversion``
|
||||
+ ``re2c:variable:yych:emit`` is a new alias for ``re2c:yych:emit``
|
||||
+ ``re2c:variable:yybm:hex`` is a new alias for ``re2c:yybm:hex``
|
||||
+ ``re2c:unsafe`` is a new alias for ``re2c:flags:unsafe``
|
||||
|
||||
- Added directive alias ``conditions:re2c`` for ``types:re2c``.
|
||||
|
||||
- Multiple small changes in code generation, including some formatting changes
|
||||
that result in large diffs in the generated code:
|
||||
|
||||
+ Do not allocate indices for unused state labels (this results in a change in
|
||||
state enumeration), commits
|
||||
`919570c4 <https://github.com/skvadrik/re2c/commit/919570c4>`_ and
|
||||
`82b704f6 <https://github.com/skvadrik/re2c/commit/82b704f6>`_.
|
||||
+ Do not generate redundant ``YYPEEK`` statements, commit
|
||||
`cca31d22 <https://github.com/skvadrik/re2c/commit/cca31d22>`_.
|
||||
+ Do not generate ``YYDEBUG`` statements for unused states labels, commit
|
||||
`a46f01e6 <https://github.com/skvadrik/re2c/commit/a46f01e6>`_.
|
||||
+ C backend: change formatting of switch statements, commit
|
||||
`ed88e12e <https://github.com/skvadrik/re2c/commit/ed88e12e>`_.
|
||||
+ Go backend: render continuous character ranges in compact form, commit
|
||||
`09161b14 <https://github.com/skvadrik/re2c/commit/09161b14>`_.
|
||||
+ Mark start and end of included .re files with line directives, commit
|
||||
`48e83fca <https://github.com/skvadrik/re2c/commit/48e83fca>`_.
|
||||
|
||||
- A fix to limit maximum allowed NFA and DFA size (to avoid out of memory
|
||||
crashes and stack overflows), commit
|
||||
`a3473fd7 <https://github.com/skvadrik/re2c/commit/a3473fd7>`_.
|
||||
|
||||
- A fix to correctly compute fixed tags in trailing context, commit
|
||||
`68e1ab71 <https://github.com/skvadrik/re2c/commit/68e1ab71>`_.
|
||||
|
||||
- A fix to generate non-overlapping names for s-tag and m-tag variables, commit
|
||||
`7c6b5c95 <https://github.com/skvadrik/re2c/commit/7c6b5c95>`_.
|
||||
|
||||
- Infrastructural: added support for CMake presets.
|
||||
|
||||
- Updated documentation.
|
||||
|
||||
- Backwards-incompatible changes that are unlikely to affect any users:
|
||||
|
||||
+ Restrict lexical contexts where ``%{`` is recognized as a block start,
|
||||
commit `dba7d055 <https://github.com/skvadrik/re2c/commit/dba7d055>`_.
|
||||
+ Emit an error when repetition lower bound exceeds upper bound, commit
|
||||
`039c1894 <https://github.com/skvadrik/re2c/commit/039c1894>`_.
|
||||
|
||||
|
||||
2.2 (2021-08-01)
|
||||
~~~~~~~~~~~~~~~~
|
||||
@@ -40,9 +642,6 @@ Changelog
|
||||
|
||||
- Updated documentation.
|
||||
|
||||
----
|
||||
2.1x
|
||||
----
|
||||
|
||||
2.1.1 (2021-03-27)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
@@ -98,9 +697,6 @@ Changelog
|
||||
|
||||
- Updated documentation for end of input handling and submatch extraction.
|
||||
|
||||
----
|
||||
2.0x
|
||||
----
|
||||
|
||||
2.0.3 (2020-08-22)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
@@ -208,9 +804,6 @@ Changelog
|
||||
|
||||
- Major revision of the paper "Efficient POSIX submatch extraction on NFA".
|
||||
|
||||
----
|
||||
1.3x
|
||||
----
|
||||
|
||||
1.3 (2019-12-14)
|
||||
~~~~~~~~~~~~~~~~
|
||||
@@ -234,9 +827,6 @@ Changelog
|
||||
(`#258 <https://github.com/skvadrik/re2c/pull/258>`_:
|
||||
Make the build reproducible).
|
||||
|
||||
----
|
||||
1.2x
|
||||
----
|
||||
|
||||
1.2.1 (2019-08-11)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
@@ -418,9 +1008,6 @@ Changelog
|
||||
- Updated documentation and website.
|
||||
|
||||
|
||||
----
|
||||
1.1x
|
||||
----
|
||||
|
||||
1.1.1 (2018-08-30)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
@@ -438,9 +1025,6 @@ Changelog
|
||||
Bugs with option: ``re2c:flags:no-debug-info``.
|
||||
- Reworked first part of TDFA paper.
|
||||
|
||||
----
|
||||
1.0x
|
||||
----
|
||||
|
||||
1.0.3 (2017-11-08)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
@@ -606,10 +1190,6 @@ Changelog
|
||||
Makefile.am: create target directory before writing into it
|
||||
|
||||
|
||||
-----
|
||||
0.16x
|
||||
-----
|
||||
|
||||
0.16 (2016-01-21)
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -622,10 +1202,6 @@ Changelog
|
||||
test failure on big endian archs with 0.15.3
|
||||
|
||||
|
||||
-----
|
||||
0.15x
|
||||
-----
|
||||
|
||||
0.15.3 (2015-12-02)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -749,10 +1325,6 @@ Changelog
|
||||
keep a mirror on sourceforge.
|
||||
|
||||
|
||||
-----
|
||||
0.14x
|
||||
-----
|
||||
|
||||
0.14.3 (2015-05-20)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -786,10 +1358,6 @@ Changelog
|
||||
Dot output label escaped characters
|
||||
|
||||
|
||||
-----
|
||||
0.13x
|
||||
-----
|
||||
|
||||
0.13.7.5 (2014-08-22)
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -900,10 +1468,6 @@ Changelog
|
||||
- Fixed #1708378 segfault ``in actions.cc``.
|
||||
|
||||
|
||||
-----
|
||||
0.12x
|
||||
-----
|
||||
|
||||
0.12.3 (2007-08-24)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -955,10 +1519,6 @@ Changelog
|
||||
+ aCC: HP C/aC++ B3910B A.06.15 [Mar 28 2007] (HP-UX IA64)
|
||||
|
||||
|
||||
-----
|
||||
0.11x
|
||||
-----
|
||||
|
||||
0.11.3 (2007-04-01)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -985,10 +1545,6 @@ Changelog
|
||||
- Added ``-u`` switch to support unicode.
|
||||
|
||||
|
||||
-----
|
||||
0.10x
|
||||
-----
|
||||
|
||||
0.10.8 (2007-04-01)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -1119,10 +1675,6 @@ Changelog
|
||||
- Applied #1307467 Unicode patch for 0.9.7.
|
||||
|
||||
|
||||
----
|
||||
0.9x
|
||||
----
|
||||
|
||||
0.9.12 (2005-12-28)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -1216,9 +1768,8 @@ Changelog
|
||||
|
||||
- Removed rcs comments in source files.
|
||||
|
||||
-------------------------
|
||||
re2c adopted (2003-12-09)
|
||||
-------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Version 0.9.1 README::
|
||||
|
||||
|
||||
+366
-215
@@ -1,62 +1,84 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
project(re2c VERSION 2.2 HOMEPAGE_URL "https://re2c.org/")
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
project(re2c VERSION 4.5.1 HOMEPAGE_URL "https://re2c.org/")
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
include(Re2cAutotoolsHelpers)
|
||||
include(Re2cBootstrapLexer)
|
||||
include(Re2cBootstrapParser)
|
||||
include(Re2cBootstrapSyntax)
|
||||
include(Re2cBuildType)
|
||||
include(Re2cGenDocs)
|
||||
include(Re2cCompilerFlags)
|
||||
|
||||
ac_subst(PACKAGE_VERSION "${PROJECT_VERSION}")
|
||||
|
||||
# check whether re2c is the root project
|
||||
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||
set(RE2C_IS_ROOT_PROJECT TRUE)
|
||||
else()
|
||||
set(RE2C_IS_ROOT_PROJECT FALSE)
|
||||
endif()
|
||||
|
||||
option(RE2C_REBUILD_LEXERS "Regenerate lexers" OFF)
|
||||
if(RE2C_REBUILD_LEXERS AND NOT RE2C_FOR_BUILD)
|
||||
message(FATAL_ERROR "option RE2C_FOR_BUILD is required for RE2C_REBUILD_LEXERS")
|
||||
endif()
|
||||
|
||||
option(RE2C_REBUILD_DOCS "Regenerate manpage" OFF)
|
||||
if(RE2C_REBUILD_DOCS)
|
||||
find_program(RST2MAN NAMES rst2man rst2man.py)
|
||||
if(NOT RST2MAN)
|
||||
message(FATAL_ERROR "rst2man (or rst2man.py) program is required for RE2C_REBUILD_DOCS")
|
||||
endif()
|
||||
|
||||
# Windows does not have a native 'man' and 'sed' commands.
|
||||
# Therefore, we are looking for the Cygwin versions of 'man' and 'sed'.
|
||||
if (WIN32)
|
||||
find_program(MAN_EXECUTABLE man)
|
||||
if(NOT MAN_EXECUTABLE)
|
||||
message(FATAL_ERROR "man program is required for RE2C_REBUILD_DOCS")
|
||||
endif()
|
||||
|
||||
find_program(SED_EXECUTABLE sed)
|
||||
if(NOT SED_EXECUTABLE)
|
||||
message(FATAL_ERROR "sed program is required for RE2C_REBUILD_DOCS")
|
||||
endif()
|
||||
endif()
|
||||
option(RE2C_REBUILD_PARSERS "Regenerate parsers with Bison" OFF)
|
||||
if(RE2C_REBUILD_PARSERS AND NOT RE2C_FOR_BUILD)
|
||||
find_package(BISON REQUIRED)
|
||||
endif()
|
||||
|
||||
option(RE2C_REBUILD_SYNTAX "Regenerate default syntax files" OFF)
|
||||
option(RE2C_REBUILD_DOCS "Regenerate manpage" OFF)
|
||||
option(RE2C_BUILD_LIBS "Build libraries" OFF)
|
||||
|
||||
option(RE2C_BUILD_RE2D "Build re2d executable (an alias for `re2c --lang d`)" ON)
|
||||
option(RE2C_BUILD_RE2GO "Build re2go executable (an alias for `re2c --lang go`)" ON)
|
||||
option(RE2C_BUILD_RE2HS "Build re2hs executable (an alias for `re2c --lang haskell`)" ON)
|
||||
option(RE2C_BUILD_RE2JAVA "Build re2java executable (an alias for `re2c --lang java`)" ON)
|
||||
option(RE2C_BUILD_RE2JS "Build re2js executable (an alias for `re2c --lang js`)" ON)
|
||||
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)
|
||||
|
||||
option(RE2C_BUILD_BENCHMARKS "Build benchmarks" OFF)
|
||||
option(RE2C_REGEN_BENCHMARKS "Regenerate C code for benchmarks" OFF)
|
||||
|
||||
# test targets are enabled by default only if re2c is the root project
|
||||
option(RE2C_BUILD_TESTS "Build tests" "${RE2C_IS_ROOT_PROJECT}")
|
||||
|
||||
# checks for programs
|
||||
find_package(BISON)
|
||||
find_package(Python3 COMPONENTS Interpreter)
|
||||
if(RE2C_REBUILD_DOCS OR RE2C_BUILD_TESTS OR RE2C_BUILD_BENCHMARKS)
|
||||
find_package(Python3 3.7 REQUIRED COMPONENTS Interpreter)
|
||||
endif()
|
||||
|
||||
# checks for C++ compiler flags
|
||||
set(CMAKE_CXX_STANDARD 98)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON) # make sure object libraries work with shared libraries
|
||||
if(RE2C_REBUILD_DOCS)
|
||||
execute_process(
|
||||
COMMAND "${Python3_EXECUTABLE}" -c "import docutils"
|
||||
RESULT_VARIABLE EXIT_CODE
|
||||
OUTPUT_QUIET
|
||||
)
|
||||
if (NOT ${EXIT_CODE} EQUAL 0)
|
||||
message(FATAL_ERROR "python package docutils (needed for docs) not found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Use C++11 standard. Note that without `set(CMAKE_CXX_EXTENSIONS OFF)` this enables
|
||||
# -std=gnu++11, not -std=c++11. Extensions are needed to enable POSIX functions on
|
||||
# Cygwin and NetBSD.
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON) # fail if the C++ compiler does not support this standard
|
||||
|
||||
# make sure object libraries work with shared libraries
|
||||
include(CheckPIESupported)
|
||||
check_pie_supported()
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
# use system stdint.h if present, otherwise fallback to src/c99_stdint.h
|
||||
ac_check_headers("stdint.h")
|
||||
# needed for POSIX file API
|
||||
ac_check_headers("sys/types.h")
|
||||
ac_check_headers("sys/stat.h")
|
||||
@@ -65,36 +87,54 @@ ac_check_headers("unistd.h")
|
||||
# windows POSIX-like API
|
||||
ac_check_headers("io.h")
|
||||
|
||||
# list of possible types to use in typedefs
|
||||
ac_check_sizeof("char")
|
||||
ac_check_sizeof("short")
|
||||
ac_check_sizeof("int")
|
||||
ac_check_sizeof("long")
|
||||
ac_check_sizeof("long long")
|
||||
ac_check_sizeof("__int64")
|
||||
ac_check_sizeof("void *")
|
||||
# 64-bit integer constant suffix
|
||||
ac_check_sizeof("0l")
|
||||
ac_check_sizeof("0ll")
|
||||
ac_check_sizeof("0i8")
|
||||
|
||||
# docs (manpages and help)
|
||||
set(re2c_manpage_source "${CMAKE_CURRENT_BINARY_DIR}/doc/manpage.rst")
|
||||
set(re2c_help_source "${CMAKE_CURRENT_BINARY_DIR}/doc/help.rst")
|
||||
set(re2c_manpage_bootstrap_c "${CMAKE_CURRENT_SOURCE_DIR}/bootstrap/doc/re2c.1")
|
||||
set(re2c_manpage_bootstrap_go "${CMAKE_CURRENT_SOURCE_DIR}/bootstrap/doc/re2go.1")
|
||||
set(re2c_help_bootstrap "${CMAKE_CURRENT_SOURCE_DIR}/bootstrap/src/msg/help.cc")
|
||||
set(re2c_manpage_c "${CMAKE_CURRENT_BINARY_DIR}/doc/re2c.1")
|
||||
set(re2c_manpage_go "${CMAKE_CURRENT_BINARY_DIR}/doc/re2go.1")
|
||||
set(re2c_help "${CMAKE_CURRENT_BINARY_DIR}/src/msg/help.cc")
|
||||
set(re2c_genhelp "${CMAKE_CURRENT_SOURCE_DIR}/build/gen_help.sh")
|
||||
set(re2c_splitman "${CMAKE_CURRENT_SOURCE_DIR}/build/split_man.sh")
|
||||
set(re2c_manpage_source "${CMAKE_CURRENT_BINARY_DIR}/doc/manpage.rst")
|
||||
set(re2c_help_source "${CMAKE_CURRENT_BINARY_DIR}/doc/help.rst")
|
||||
set(re2c_manpage_c "${CMAKE_CURRENT_BINARY_DIR}/doc/re2c.1")
|
||||
set(re2c_manpage_d "${CMAKE_CURRENT_BINARY_DIR}/doc/re2d.1")
|
||||
set(re2c_manpage_go "${CMAKE_CURRENT_BINARY_DIR}/doc/re2go.1")
|
||||
set(re2c_manpage_haskell "${CMAKE_CURRENT_BINARY_DIR}/doc/re2hs.1")
|
||||
set(re2c_manpage_java "${CMAKE_CURRENT_BINARY_DIR}/doc/re2java.1")
|
||||
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")
|
||||
set(re2c_help_d "${CMAKE_CURRENT_BINARY_DIR}/src/msg/help_re2d.cc")
|
||||
set(re2c_help_go "${CMAKE_CURRENT_BINARY_DIR}/src/msg/help_re2go.cc")
|
||||
set(re2c_help_haskell "${CMAKE_CURRENT_BINARY_DIR}/src/msg/help_re2hs.cc")
|
||||
set(re2c_help_java "${CMAKE_CURRENT_BINARY_DIR}/src/msg/help_re2java.cc")
|
||||
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")
|
||||
set(re2c_rst2txt "${CMAKE_CURRENT_SOURCE_DIR}/build/rst2txt.py")
|
||||
set(re2c_splitman "${CMAKE_CURRENT_SOURCE_DIR}/build/split_man.py")
|
||||
set(re2c_docs
|
||||
"${re2c_help}"
|
||||
"${re2c_manpage_c}"
|
||||
"$<$<BOOL:${RE2C_BUILD_RE2D}>:${re2c_manpage_d}>"
|
||||
"$<$<BOOL:${RE2C_BUILD_RE2GO}>:${re2c_manpage_go}>"
|
||||
"$<$<BOOL:${RE2C_BUILD_RE2HS}>:${re2c_manpage_haskell}>"
|
||||
"$<$<BOOL:${RE2C_BUILD_RE2JAVA}>:${re2c_manpage_java}>"
|
||||
"$<$<BOOL:${RE2C_BUILD_RE2JS}>:${re2c_manpage_js}>"
|
||||
"$<$<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}>"
|
||||
)
|
||||
|
||||
# syntax files
|
||||
set(re2c_stx2cpp "${CMAKE_CURRENT_SOURCE_DIR}/build/stx2cpp.py")
|
||||
|
||||
set(top_srcdir "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(top_builddir "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
set(PYTHON "${Python3_EXECUTABLE}")
|
||||
@@ -102,10 +142,12 @@ set(PYTHON "${Python3_EXECUTABLE}")
|
||||
configure_file(doc/manpage.rst.in doc/manpage.rst @ONLY)
|
||||
configure_file(doc/help.rst.in doc/help.rst @ONLY)
|
||||
|
||||
configure_file(run_tests.py.in run_tests.py @ONLY)
|
||||
set(RE2C_RUN_TESTS "${CMAKE_CURRENT_BINARY_DIR}/run_tests.py")
|
||||
if(CMAKE_HOST_UNIX)
|
||||
execute_process(COMMAND chmod +x "${RE2C_RUN_TESTS}")
|
||||
if(RE2C_BUILD_TESTS)
|
||||
configure_file(run_tests.py.in run_tests.py @ONLY)
|
||||
set(RE2C_RUN_TESTS "${CMAKE_CURRENT_BINARY_DIR}/run_tests.py")
|
||||
if(CMAKE_HOST_UNIX)
|
||||
execute_process(COMMAND chmod +x "${RE2C_RUN_TESTS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
ac_config_headers("config.h")
|
||||
@@ -123,12 +165,26 @@ include_directories(. "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
# WARNING: custom target that depends on autogenerated sources won't do here
|
||||
# as its dependencies get built multiple times, which ruins parallel builds.
|
||||
add_library(re2c_objects_autogen OBJECT
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/src/options/parse_opts.cc"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/src/parse/lexer.cc"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/src/parse/lexer.h"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/src/parse/parser.cc"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/src/parse/parser.h"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/src/parse/lex.cc"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/src/parse/lex.h"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/src/parse/lex_conf.cc"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/src/options/parse_opts.cc"
|
||||
"${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.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
|
||||
@@ -136,19 +192,14 @@ add_library(re2c_objects_autogen_ver_to_vernum OBJECT
|
||||
)
|
||||
|
||||
set(re2c_sources
|
||||
src/codegen/code_goto.cc
|
||||
src/codegen/combine.cc
|
||||
src/codegen/gen_bitmaps.cc
|
||||
src/codegen/gen_delayed.cc
|
||||
src/codegen/gen_dfa.cc
|
||||
src/codegen/gen_goto.cc
|
||||
src/codegen/gen_program.cc
|
||||
src/codegen/gen_state.cc
|
||||
src/codegen/helpers.cc
|
||||
src/codegen/render.cc
|
||||
src/codegen/output.cc
|
||||
src/codegen/pass1_analyze.cc
|
||||
src/codegen/pass2_generate.cc
|
||||
src/codegen/pass3_fixup.cc
|
||||
src/codegen/pass4_render.cc
|
||||
src/options/opt.cc
|
||||
src/options/symtab.cc
|
||||
src/nfa/estimate_size.cc
|
||||
src/nfa/re_to_nfa.cc
|
||||
src/adfa/adfa.cc
|
||||
src/debug/dump_adfa.cc
|
||||
@@ -174,27 +225,22 @@ set(re2c_sources
|
||||
src/dfa/fillpoints.cc
|
||||
src/dfa/find_state.cc
|
||||
src/dfa/minimization.cc
|
||||
src/dfa/stacmd.cc
|
||||
src/dfa/tagver_table.cc
|
||||
src/dfa/tcmd.cc
|
||||
src/encoding/ebcdic/ebcdic_regexp.cc
|
||||
src/encoding/ebcdic.cc
|
||||
src/encoding/enc.cc
|
||||
src/encoding/range_suffix.cc
|
||||
src/encoding/utf8/utf8_regexp.cc
|
||||
src/encoding/utf8/utf8.cc
|
||||
src/encoding/utf16/utf16_regexp.cc
|
||||
src/encoding/utf16/utf16.cc
|
||||
src/encoding/unicode_casemap.cc
|
||||
src/encoding/utf8.cc
|
||||
src/encoding/utf16.cc
|
||||
src/msg/msg.cc
|
||||
src/msg/warn.cc
|
||||
src/regexp/ast_to_re.cc
|
||||
src/regexp/default_tags.cc
|
||||
src/regexp/fixed_tags.cc
|
||||
src/regexp/nullable.cc
|
||||
src/regexp/re.cc
|
||||
src/regexp/rule.cc
|
||||
src/regexp/regexp.cc
|
||||
src/regexp/split_charset.cc
|
||||
src/regexp/tag.cc
|
||||
src/compile.cc
|
||||
src/skeleton/control_flow.cc
|
||||
src/skeleton/generate_code.cc
|
||||
src/skeleton/generate_data.cc
|
||||
@@ -202,126 +248,233 @@ set(re2c_sources
|
||||
src/skeleton/skeleton.cc
|
||||
src/parse/ast.cc
|
||||
src/parse/input.cc
|
||||
src/parse/parse.cc
|
||||
src/parse/scanner.cc
|
||||
src/parse/unescape.cc
|
||||
src/util/file_utils.cc
|
||||
src/util/s_to_n32_unsafe.cc
|
||||
src/util/temp_file.cc
|
||||
src/util/string_utils.cc
|
||||
src/util/range.cc
|
||||
src/main.cc
|
||||
$<TARGET_OBJECTS:re2c_objects_autogen>
|
||||
$<TARGET_OBJECTS:re2c_objects_autogen_ver_to_vernum>
|
||||
)
|
||||
|
||||
re2c_bootstrap_lexer("src/msg/ver_to_vernum.re" "src/msg/ver_to_vernum.cc")
|
||||
re2c_bootstrap_lexer("src/options/parse_opts.re" "src/options/parse_opts.cc")
|
||||
re2c_bootstrap_lexer("src/parse/lexer.re" "src/parse/lexer.cc" "src/parse/lexer.h")
|
||||
re2c_bootstrap_parser("src/parse/parser.ypp" "src/parse/parser.cc" "src/parse/parser.h")
|
||||
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.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
|
||||
"examples/*"
|
||||
"doc/manual/*"
|
||||
"${re2c_manpage_source}"
|
||||
)
|
||||
re2c_gen_help("${re2c_help_source}" "${re2c_help_c}")
|
||||
re2c_gen_manpage("${re2c_manpage_source}" "${re2c_manpage_c}")
|
||||
add_custom_target(docs DEPENDS "${re2c_docs}")
|
||||
|
||||
# re2c
|
||||
add_executable(re2c ${re2c_sources})
|
||||
add_executable(re2c ${re2c_sources} "${re2c_help_c}")
|
||||
|
||||
# re2d
|
||||
if (RE2C_BUILD_RE2D)
|
||||
re2c_gen_help("${re2c_help_source}" "${re2c_help_d}")
|
||||
re2c_gen_manpage("${re2c_manpage_source}" "${re2c_manpage_d}")
|
||||
add_executable(re2d ${re2c_sources} "${re2c_help_d}")
|
||||
target_compile_definitions(re2d PUBLIC
|
||||
"RE2C_LANG=Lang::D"
|
||||
"RE2C_PROG=\"re2d\""
|
||||
)
|
||||
endif()
|
||||
|
||||
# re2go
|
||||
if (RE2C_BUILD_RE2GO)
|
||||
add_executable(re2go ${re2c_sources})
|
||||
target_compile_definitions(re2go PUBLIC "RE2C_LANG=LANG_GO")
|
||||
re2c_gen_help("${re2c_help_source}" "${re2c_help_go}")
|
||||
re2c_gen_manpage("${re2c_manpage_source}" "${re2c_manpage_go}")
|
||||
add_executable(re2go ${re2c_sources} "${re2c_help_go}")
|
||||
target_compile_definitions(re2go PUBLIC
|
||||
"RE2C_LANG=Lang::GO"
|
||||
"RE2C_PROG=\"re2go\""
|
||||
)
|
||||
endif()
|
||||
|
||||
re2c_bootstrap_lexer("src/parse/lex.re" "src/parse/lex.cc" "src/parse/lex.h")
|
||||
re2c_bootstrap_lexer("src/parse/lex_conf.re" "src/parse/lex_conf.cc")
|
||||
re2c_bootstrap_lexer("src/options/parse_opts.re" "src/options/parse_opts.cc")
|
||||
re2c_bootstrap_lexer("src/msg/ver_to_vernum.re" "src/msg/ver_to_vernum.cc")
|
||||
re2c_bootstrap_parser("src/parse/parser.ypp" "src/parse/parser.cc" "src/parse/parser.h")
|
||||
# re2hs
|
||||
if (RE2C_BUILD_RE2HS)
|
||||
re2c_gen_help("${re2c_help_source}" "${re2c_help_haskell}")
|
||||
re2c_gen_manpage("${re2c_manpage_source}" "${re2c_manpage_haskell}")
|
||||
add_executable(re2hs ${re2c_sources} "${re2c_help_haskell}")
|
||||
target_compile_definitions(re2hs PUBLIC
|
||||
"RE2C_LANG=Lang::HASKELL"
|
||||
"RE2C_PROG=\"re2hs\""
|
||||
)
|
||||
endif()
|
||||
|
||||
# docs
|
||||
set(re2c_docs_sources
|
||||
"${re2c_manpage_source}"
|
||||
"doc/manual/api/interface.rst_"
|
||||
"doc/manual/conditions/conditions.rst_"
|
||||
"doc/manual/configurations/configurations.rst_"
|
||||
"doc/manual/directives/directives.rst_"
|
||||
"doc/manual/dot/dot.rst_"
|
||||
"doc/manual/encodings/encodings.rst_"
|
||||
"doc/manual/eof/01_sentinel.rst_"
|
||||
"doc/manual/eof/02_bounds_checking.rst_"
|
||||
"doc/manual/eof/03_eof_rule.rst_"
|
||||
"doc/manual/eof/04_generic_api.rst_"
|
||||
"doc/manual/eof/eof.rst_"
|
||||
"doc/manual/fill/01_fill.rst_"
|
||||
"doc/manual/fill/02_fill.rst_"
|
||||
"doc/manual/fill/fill.rst_"
|
||||
"doc/manual/headers/headers.rst_"
|
||||
"doc/manual/includes/includes.rst_"
|
||||
"doc/manual/options/debug.rst_"
|
||||
"doc/manual/options/internal.rst_"
|
||||
"doc/manual/options/options.rst_"
|
||||
"doc/manual/regexps/regular_expressions.rst_"
|
||||
"doc/manual/reuse/reuse.rst_"
|
||||
"doc/manual/skeleton/skeleton.rst_"
|
||||
"doc/manual/state/state.rst_"
|
||||
"doc/manual/submatch/submatch_example_mtags.rst_"
|
||||
"doc/manual/submatch/submatch_example_posix.rst_"
|
||||
"doc/manual/submatch/submatch_example_stags.rst_"
|
||||
"doc/manual/submatch/submatch_example_stags_fill.rst_"
|
||||
"doc/manual/submatch/submatch.rst_"
|
||||
"doc/manual/syntax/syntax.rst_"
|
||||
"doc/manual/syntax/api1.rst_"
|
||||
"doc/manual/syntax/api2_c.rst_"
|
||||
"doc/manual/syntax/api2_go.rst_"
|
||||
"doc/manual/syntax/api3.rst_"
|
||||
"doc/manual/warnings/warnings_general.rst_"
|
||||
"doc/manual/warnings/warnings_list.rst_"
|
||||
"examples/c/01_basic.re"
|
||||
"examples/c/conditions/parse_u32_conditions.re"
|
||||
"examples/c/encodings/unicode_identifier.re"
|
||||
"examples/c/eof/01_sentinel.re"
|
||||
"examples/c/eof/02_bounds_checking.re"
|
||||
"examples/c/eof/03_eof_rule.re"
|
||||
"examples/c/eof/05_generic_api_eof_rule.re"
|
||||
"examples/c/fill/01_fill.re"
|
||||
"examples/c/fill/02_fill.re"
|
||||
"examples/c/headers/header.re"
|
||||
"examples/c/headers/src/lexer/lexer.h"
|
||||
"examples/c/includes/include.re"
|
||||
"examples/c/includes/definitions.h"
|
||||
"examples/c/reuse/reuse.re"
|
||||
"examples/c/reuse/usedir.re"
|
||||
"examples/c/state/push.re"
|
||||
"examples/c/submatch/01_stags.re"
|
||||
"examples/c/submatch/01_stags_fill.re"
|
||||
"examples/c/submatch/02_mtags.re"
|
||||
"examples/c/submatch/03_posix.re"
|
||||
"examples/go/01_basic.re"
|
||||
"examples/go/conditions/parse_u32_conditions.re"
|
||||
"examples/go/encodings/unicode_identifier.re"
|
||||
"examples/go/eof/01_sentinel.re"
|
||||
"examples/go/eof/02_bounds_checking.re"
|
||||
"examples/go/eof/03_eof_rule.re"
|
||||
"examples/go/eof/05_generic_api_eof_rule.re"
|
||||
"examples/go/fill/01_fill.re"
|
||||
"examples/go/fill/02_fill.re"
|
||||
"examples/go/headers/header.re"
|
||||
"examples/go/headers/src/lexer/lexer.go"
|
||||
"examples/go/includes/include.re"
|
||||
"examples/go/includes/definitions.go"
|
||||
"examples/go/reuse/reuse.re"
|
||||
"examples/go/reuse/usedir.re"
|
||||
"examples/go/state/push.re"
|
||||
"examples/go/submatch/01_stags.re"
|
||||
"examples/go/submatch/02_mtags.re"
|
||||
"examples/go/submatch/03_posix.re"
|
||||
)
|
||||
re2c_gen_manpage("${re2c_manpage_source}" "${re2c_manpage_c}" "${re2c_manpage_bootstrap_c}" "c")
|
||||
re2c_gen_manpage("${re2c_manpage_source}" "${re2c_manpage_go}" "${re2c_manpage_bootstrap_go}" "go")
|
||||
re2c_gen_help("${re2c_help_source}" "${re2c_help}" "${re2c_help_bootstrap}")
|
||||
add_custom_target(docs DEPENDS "${re2c_docs}")
|
||||
# re2java
|
||||
if (RE2C_BUILD_RE2JAVA)
|
||||
re2c_gen_help("${re2c_help_source}" "${re2c_help_java}")
|
||||
re2c_gen_manpage("${re2c_manpage_source}" "${re2c_manpage_java}")
|
||||
add_executable(re2java ${re2c_sources} "${re2c_help_java}")
|
||||
target_compile_definitions(re2java PUBLIC
|
||||
"RE2C_LANG=Lang::JAVA"
|
||||
"RE2C_PROG=\"re2java\""
|
||||
)
|
||||
endif()
|
||||
|
||||
# install and test targets are enabled only if re2c is the root project
|
||||
if (CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||
# re2js
|
||||
if (RE2C_BUILD_RE2JS)
|
||||
re2c_gen_help("${re2c_help_source}" "${re2c_help_js}")
|
||||
re2c_gen_manpage("${re2c_manpage_source}" "${re2c_manpage_js}")
|
||||
add_executable(re2js ${re2c_sources} "${re2c_help_js}")
|
||||
target_compile_definitions(re2js PUBLIC
|
||||
"RE2C_LANG=Lang::JS"
|
||||
"RE2C_PROG=\"re2js\""
|
||||
)
|
||||
endif()
|
||||
|
||||
# re2ocaml
|
||||
if (RE2C_BUILD_RE2OCAML)
|
||||
re2c_gen_help("${re2c_help_source}" "${re2c_help_ocaml}")
|
||||
re2c_gen_manpage("${re2c_manpage_source}" "${re2c_manpage_ocaml}")
|
||||
add_executable(re2ocaml ${re2c_sources} "${re2c_help_ocaml}")
|
||||
target_compile_definitions(re2ocaml PUBLIC
|
||||
"RE2C_LANG=Lang::OCAML"
|
||||
"RE2C_PROG=\"re2ocaml\""
|
||||
)
|
||||
endif()
|
||||
|
||||
# re2py
|
||||
if (RE2C_BUILD_RE2PY)
|
||||
re2c_gen_help("${re2c_help_source}" "${re2c_help_python}")
|
||||
re2c_gen_manpage("${re2c_manpage_source}" "${re2c_manpage_python}")
|
||||
add_executable(re2py ${re2c_sources} "${re2c_help_python}")
|
||||
target_compile_definitions(re2py PUBLIC
|
||||
"RE2C_LANG=Lang::PYTHON"
|
||||
"RE2C_PROG=\"re2py\""
|
||||
)
|
||||
endif()
|
||||
|
||||
# re2rust
|
||||
if (RE2C_BUILD_RE2RUST)
|
||||
re2c_gen_help("${re2c_help_source}" "${re2c_help_rust}")
|
||||
re2c_gen_manpage("${re2c_manpage_source}" "${re2c_manpage_rust}")
|
||||
add_executable(re2rust ${re2c_sources} "${re2c_help_rust}")
|
||||
target_compile_definitions(re2rust PUBLIC
|
||||
"RE2C_LANG=Lang::RUST"
|
||||
"RE2C_PROG=\"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}")
|
||||
re2c_gen_manpage("${re2c_manpage_source}" "${re2c_manpage_v}")
|
||||
add_executable(re2v ${re2c_sources} "${re2c_help_v}")
|
||||
target_compile_definitions(re2v PUBLIC
|
||||
"RE2C_LANG=Lang::V"
|
||||
"RE2C_PROG=\"re2v\""
|
||||
)
|
||||
endif()
|
||||
|
||||
# re2zig
|
||||
if (RE2C_BUILD_RE2ZIG)
|
||||
re2c_gen_help("${re2c_help_source}" "${re2c_help_zig}")
|
||||
re2c_gen_manpage("${re2c_manpage_source}" "${re2c_manpage_zig}")
|
||||
add_executable(re2zig ${re2c_sources} "${re2c_help_zig}")
|
||||
target_compile_definitions(re2zig PUBLIC
|
||||
"RE2C_LANG=Lang::ZIG"
|
||||
"RE2C_PROG=\"re2zig\""
|
||||
)
|
||||
endif()
|
||||
|
||||
# install targets are enabled only if re2c is the root project
|
||||
if(RE2C_IS_ROOT_PROJECT)
|
||||
# install
|
||||
install(TARGETS re2c RUNTIME DESTINATION bin)
|
||||
install(FILES "${re2c_manpage_c}" DESTINATION "share/man/man1")
|
||||
if(RE2C_BUILD_RE2D)
|
||||
install(TARGETS re2d RUNTIME DESTINATION bin)
|
||||
install(FILES "${re2c_manpage_d}" DESTINATION "share/man/man1")
|
||||
endif()
|
||||
if(RE2C_BUILD_RE2GO)
|
||||
install(TARGETS re2go RUNTIME DESTINATION bin)
|
||||
install(FILES "${re2c_manpage_go}" DESTINATION "share/man/man1")
|
||||
endif()
|
||||
install(FILES include/unicode_categories.re DESTINATION "${RE2C_STDLIB_DIR}")
|
||||
if(RE2C_BUILD_RE2HS)
|
||||
install(TARGETS re2hs RUNTIME DESTINATION bin)
|
||||
install(FILES "${re2c_manpage_haskell}" DESTINATION "share/man/man1")
|
||||
endif()
|
||||
if(RE2C_BUILD_RE2JAVA)
|
||||
install(TARGETS re2java RUNTIME DESTINATION bin)
|
||||
install(FILES "${re2c_manpage_java}" DESTINATION "share/man/man1")
|
||||
endif()
|
||||
if(RE2C_BUILD_RE2JS)
|
||||
install(TARGETS re2js RUNTIME DESTINATION bin)
|
||||
install(FILES "${re2c_manpage_js}" DESTINATION "share/man/man1")
|
||||
endif()
|
||||
if(RE2C_BUILD_RE2OCAML)
|
||||
install(TARGETS re2ocaml RUNTIME DESTINATION bin)
|
||||
install(FILES "${re2c_manpage_ocaml}" DESTINATION "share/man/man1")
|
||||
endif()
|
||||
if(RE2C_BUILD_RE2PY)
|
||||
install(TARGETS re2py RUNTIME DESTINATION bin)
|
||||
install(FILES "${re2c_manpage_python}" DESTINATION "share/man/man1")
|
||||
endif()
|
||||
if(RE2C_BUILD_RE2RUST)
|
||||
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")
|
||||
endif()
|
||||
if(RE2C_BUILD_RE2ZIG)
|
||||
install(TARGETS re2zig RUNTIME DESTINATION bin)
|
||||
install(FILES "${re2c_manpage_zig}" DESTINATION "share/man/man1")
|
||||
endif()
|
||||
install(FILES
|
||||
include/syntax/c
|
||||
include/syntax/d
|
||||
include/syntax/go
|
||||
include/syntax/haskell
|
||||
include/syntax/java
|
||||
include/syntax/js
|
||||
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
|
||||
add_custom_target(bootstrap
|
||||
@@ -329,7 +482,9 @@ if (CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||
COMMAND "${CMAKE_COMMAND}" -E remove_directory "doc"
|
||||
COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_CURRENT_BINARY_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(RE2C_BUILD_TESTS)
|
||||
# tests
|
||||
add_custom_target(tests
|
||||
DEPENDS "${RE2C_RUN_TESTS}"
|
||||
@@ -349,17 +504,19 @@ if (CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||
COMMAND "${Python3_EXECUTABLE}" "${RE2C_RUN_TESTS}" --wine -j1
|
||||
)
|
||||
add_dependencies(wtests re2c)
|
||||
add_executable(re2c_test_list
|
||||
src/test/list/test.cc
|
||||
)
|
||||
add_executable(re2c_test_range
|
||||
src/test/range/test-impl.h
|
||||
src/test/range/test.cc
|
||||
src/test/range/test.h
|
||||
src/util/range.cc
|
||||
src/util/range.h
|
||||
src/util/static_assert.h
|
||||
)
|
||||
add_executable(re2c_test_s_to_n32_unsafe
|
||||
src/test/s_to_n32_unsafe/test.cc
|
||||
src/util/s_to_n32_unsafe.cc
|
||||
src/util/string_utils.cc
|
||||
)
|
||||
add_executable(re2c_test_ver_to_vernum
|
||||
src/test/ver_to_vernum/test.cc
|
||||
@@ -367,9 +524,9 @@ if (CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||
)
|
||||
add_executable(re2c_test_argsubst
|
||||
src/test/argsubst/test.cc
|
||||
src/codegen/helpers.cc
|
||||
)
|
||||
add_custom_target(check_re2c
|
||||
COMMAND ./re2c_test_list
|
||||
COMMAND ./re2c_test_range
|
||||
COMMAND ./re2c_test_s_to_n32_unsafe
|
||||
COMMAND ./re2c_test_ver_to_vernum
|
||||
@@ -401,21 +558,19 @@ if (RE2C_BUILD_LIBS)
|
||||
)
|
||||
re2c_bootstrap_lexer("lib/test_helper.re" "lib/test_helper.cc")
|
||||
|
||||
add_library(libre2c_objects OBJECT
|
||||
set(libre2c_sources
|
||||
lib/regcomp.cc
|
||||
lib/regexec.cc
|
||||
lib/regexec_dfa.cc
|
||||
lib/regexec_dfa_regless.cc
|
||||
lib/regexec_dfa_multipass.cc
|
||||
lib/regexec_nfa_leftmost.cc
|
||||
lib/regexec_nfa_leftmost_trie.cc
|
||||
lib/regexec_nfa_posix.cc
|
||||
lib/regexec_nfa_posix_trie.cc
|
||||
lib/regexec_nfa_posix_backward.cc
|
||||
lib/regexec_nfa_posix_kuklewicz.cc
|
||||
lib/regfree.cc
|
||||
lib/stubs.cc
|
||||
src/parse/ast.cc
|
||||
src/parse/unescape.cc
|
||||
src/parse/input.cc
|
||||
src/options/opt.cc
|
||||
src/options/symtab.cc
|
||||
src/cfg/cfg.cc
|
||||
@@ -441,36 +596,29 @@ if (RE2C_BUILD_LIBS)
|
||||
src/dfa/fillpoints.cc
|
||||
src/dfa/find_state.cc
|
||||
src/dfa/minimization.cc
|
||||
src/dfa/stacmd.cc
|
||||
src/dfa/tagver_table.cc
|
||||
src/dfa/tcmd.cc
|
||||
src/nfa/estimate_size.cc
|
||||
src/nfa/re_to_nfa.cc
|
||||
src/encoding/enc.cc
|
||||
src/encoding/range_suffix.cc
|
||||
src/encoding/ebcdic/ebcdic_regexp.cc
|
||||
src/encoding/utf16/utf16.cc
|
||||
src/encoding/utf16/utf16_regexp.cc
|
||||
src/encoding/utf8/utf8.cc
|
||||
src/encoding/utf8/utf8_regexp.cc
|
||||
src/encoding/unicode_casemap.cc
|
||||
src/encoding/ebcdic.cc
|
||||
src/encoding/utf16.cc
|
||||
src/encoding/utf8.cc
|
||||
src/msg/msg.cc
|
||||
src/msg/warn.cc
|
||||
src/regexp/ast_to_re.cc
|
||||
src/regexp/default_tags.cc
|
||||
src/regexp/fixed_tags.cc
|
||||
src/regexp/nullable.cc
|
||||
src/regexp/re.cc
|
||||
src/regexp/rule.cc
|
||||
src/regexp/regexp.cc
|
||||
src/regexp/split_charset.cc
|
||||
src/regexp/tag.cc
|
||||
src/skeleton/control_flow.cc
|
||||
src/skeleton/maxpath.cc
|
||||
src/skeleton/skeleton.cc
|
||||
src/util/range.cc
|
||||
src/util/s_to_n32_unsafe.cc
|
||||
)
|
||||
set(libre2c_sources
|
||||
$<TARGET_OBJECTS:libre2c_objects>
|
||||
src/util/file_utils.cc
|
||||
src/util/string_utils.cc
|
||||
$<TARGET_OBJECTS:libre2c_objects_autogen>
|
||||
$<TARGET_OBJECTS:re2c_objects_autogen_ver_to_vernum>
|
||||
)
|
||||
@@ -504,29 +652,32 @@ if (RE2C_BUILD_LIBS)
|
||||
endif()
|
||||
|
||||
# libre2c test
|
||||
add_executable(test_libre2c lib/test.cc)
|
||||
target_link_libraries(test_libre2c libre2c)
|
||||
target_link_libraries(test_libre2c test_libre2c_objects_autogen)
|
||||
add_custom_target(check_libre2c
|
||||
COMMAND ./test_libre2c
|
||||
)
|
||||
if(RE2C_BUILD_TESTS)
|
||||
add_executable(test_libre2c lib/test.cc)
|
||||
target_link_libraries(test_libre2c libre2c)
|
||||
target_link_libraries(test_libre2c test_libre2c_objects_autogen)
|
||||
add_custom_target(check_libre2c
|
||||
COMMAND ./test_libre2c
|
||||
)
|
||||
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
|
||||
add_custom_target(check_libre2c)
|
||||
if(RE2C_BUILD_TESTS)
|
||||
add_custom_target(check_libre2c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(RE2C_BUILD_BENCHMARKS)
|
||||
add_subdirectory(benchmarks/submatch_dfa_aot)
|
||||
add_subdirectory(benchmarks/c)
|
||||
endif()
|
||||
|
||||
# only add check target if toplevel project
|
||||
if (CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||
if(RE2C_BUILD_TESTS)
|
||||
add_custom_target(check)
|
||||
add_dependencies(check check_re2c check_libre2c)
|
||||
endif()
|
||||
+159
-24
@@ -11,7 +11,17 @@
|
||||
"hidden": true,
|
||||
"installDir": "${sourceDir}/install-2",
|
||||
"cacheVariables": {
|
||||
"RE2C_BUILD_RE2D": true,
|
||||
"RE2C_BUILD_RE2GO": true,
|
||||
"RE2C_BUILD_RE2HS": true,
|
||||
"RE2C_BUILD_RE2JAVA": true,
|
||||
"RE2C_BUILD_RE2JS": true,
|
||||
"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,
|
||||
"RE2C_REBUILD_LEXERS": true,
|
||||
"RE2C_REBUILD_DOCS": true,
|
||||
@@ -47,7 +57,17 @@
|
||||
"CMAKE_BUILD_TYPE": "Ubsan",
|
||||
"CMAKE_C_FLAGS": "-O2",
|
||||
"CMAKE_CXX_FLAGS": "-O2",
|
||||
"RE2C_BUILD_RE2GO": false
|
||||
"RE2C_BUILD_RE2D": false,
|
||||
"RE2C_BUILD_RE2GO": false,
|
||||
"RE2C_BUILD_RE2HS": false,
|
||||
"RE2C_BUILD_RE2JAVA": false,
|
||||
"RE2C_BUILD_RE2JS": false,
|
||||
"RE2C_BUILD_RE2OCAML": false,
|
||||
"RE2C_BUILD_RE2PY": false,
|
||||
"RE2C_BUILD_RE2RUST": false,
|
||||
"RE2C_BUILD_RE2SWIFT": false,
|
||||
"RE2C_BUILD_RE2V": false,
|
||||
"RE2C_BUILD_RE2ZIG": false
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -65,7 +85,17 @@
|
||||
"CMAKE_BUILD_TYPE": "Asan",
|
||||
"CMAKE_C_FLAGS": "-O2",
|
||||
"CMAKE_CXX_FLAGS": "-O2",
|
||||
"RE2C_BUILD_RE2GO": false
|
||||
"RE2C_BUILD_RE2D": false,
|
||||
"RE2C_BUILD_RE2GO": false,
|
||||
"RE2C_BUILD_RE2HS": false,
|
||||
"RE2C_BUILD_RE2JAVA": false,
|
||||
"RE2C_BUILD_RE2JS": false,
|
||||
"RE2C_BUILD_RE2OCAML": false,
|
||||
"RE2C_BUILD_RE2PY": false,
|
||||
"RE2C_BUILD_RE2RUST": false,
|
||||
"RE2C_BUILD_RE2SWIFT": false,
|
||||
"RE2C_BUILD_RE2V": false,
|
||||
"RE2C_BUILD_RE2ZIG": false
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -83,7 +113,17 @@
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"CMAKE_C_FLAGS": "-O2",
|
||||
"CMAKE_CXX_FLAGS": "-O2",
|
||||
"RE2C_BUILD_RE2GO": false
|
||||
"RE2C_BUILD_RE2D": false,
|
||||
"RE2C_BUILD_RE2GO": false,
|
||||
"RE2C_BUILD_RE2HS": false,
|
||||
"RE2C_BUILD_RE2JAVA": false,
|
||||
"RE2C_BUILD_RE2JS": false,
|
||||
"RE2C_BUILD_RE2OCAML": false,
|
||||
"RE2C_BUILD_RE2PY": false,
|
||||
"RE2C_BUILD_RE2RUST": false,
|
||||
"RE2C_BUILD_RE2SWIFT": false,
|
||||
"RE2C_BUILD_RE2V": false,
|
||||
"RE2C_BUILD_RE2ZIG": false
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -107,7 +147,17 @@
|
||||
"CMAKE_CXX_FLAGS": "-O2 -m32",
|
||||
"CMAKE_EXE_LINKER_FLAGS": "-m32",
|
||||
"CMAKE_SHARED_LINKER_FLAGS": "-m32",
|
||||
"RE2C_BUILD_RE2GO": false
|
||||
"RE2C_BUILD_RE2D": false,
|
||||
"RE2C_BUILD_RE2GO": false,
|
||||
"RE2C_BUILD_RE2HS": false,
|
||||
"RE2C_BUILD_RE2JAVA": false,
|
||||
"RE2C_BUILD_RE2JS": false,
|
||||
"RE2C_BUILD_RE2OCAML": false,
|
||||
"RE2C_BUILD_RE2PY": false,
|
||||
"RE2C_BUILD_RE2RUST": false,
|
||||
"RE2C_BUILD_RE2SWIFT": false,
|
||||
"RE2C_BUILD_RE2V": false,
|
||||
"RE2C_BUILD_RE2ZIG": false
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -123,7 +173,17 @@
|
||||
"installDir": "${sourceDir}/install",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"RE2C_BUILD_RE2GO": false
|
||||
"RE2C_BUILD_RE2D": false,
|
||||
"RE2C_BUILD_RE2GO": false,
|
||||
"RE2C_BUILD_RE2HS": false,
|
||||
"RE2C_BUILD_RE2JAVA": false,
|
||||
"RE2C_BUILD_RE2JS": false,
|
||||
"RE2C_BUILD_RE2OCAML": false,
|
||||
"RE2C_BUILD_RE2PY": false,
|
||||
"RE2C_BUILD_RE2RUST": false,
|
||||
"RE2C_BUILD_RE2SWIFT": false,
|
||||
"RE2C_BUILD_RE2V": false,
|
||||
"RE2C_BUILD_RE2ZIG": false
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -131,6 +191,16 @@
|
||||
"displayName": "Linux x86_64: GCC / Release / Skeleton / Out of tree (full)",
|
||||
"inherits": ["default-full-configuration", "linux-gcc-release-ootree-skeleton-fast"]
|
||||
},
|
||||
{
|
||||
"name": "linux-gcc-valgrind-ootree-fast",
|
||||
"displayName": "Linux x86_64: GCC / Valgrind / Out of tree (fast)",
|
||||
"inherits": ["linux-gcc-release-ootree-skeleton-fast"]
|
||||
},
|
||||
{
|
||||
"name": "linux-gcc-valgrind-ootree-full",
|
||||
"displayName": "Linux x86_64: GCC / Valgrind / Out of tree (full)",
|
||||
"inherits": ["linux-gcc-release-ootree-skeleton-full"]
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
@@ -161,7 +231,17 @@
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"CMAKE_C_FLAGS": "-O2",
|
||||
"CMAKE_CXX_FLAGS": "-O2",
|
||||
"RE2C_BUILD_RE2GO": false
|
||||
"RE2C_BUILD_RE2D": false,
|
||||
"RE2C_BUILD_RE2GO": false,
|
||||
"RE2C_BUILD_RE2HS": false,
|
||||
"RE2C_BUILD_RE2JAVA": false,
|
||||
"RE2C_BUILD_RE2JS": false,
|
||||
"RE2C_BUILD_RE2OCAML": false,
|
||||
"RE2C_BUILD_RE2PY": false,
|
||||
"RE2C_BUILD_RE2RUST": false,
|
||||
"RE2C_BUILD_RE2SWIFT": false,
|
||||
"RE2C_BUILD_RE2V": false,
|
||||
"RE2C_BUILD_RE2ZIG": false
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -179,7 +259,17 @@
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"CMAKE_C_FLAGS": "-O2",
|
||||
"CMAKE_CXX_FLAGS": "-O2",
|
||||
"RE2C_BUILD_RE2GO": false
|
||||
"RE2C_BUILD_RE2D": false,
|
||||
"RE2C_BUILD_RE2GO": false,
|
||||
"RE2C_BUILD_RE2HS": false,
|
||||
"RE2C_BUILD_RE2JAVA": false,
|
||||
"RE2C_BUILD_RE2JS": false,
|
||||
"RE2C_BUILD_RE2OCAML": false,
|
||||
"RE2C_BUILD_RE2PY": false,
|
||||
"RE2C_BUILD_RE2RUST": false,
|
||||
"RE2C_BUILD_RE2SWIFT": false,
|
||||
"RE2C_BUILD_RE2V": false,
|
||||
"RE2C_BUILD_RE2ZIG": false
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -195,7 +285,17 @@
|
||||
"installDir": "${sourceDir}/install",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"RE2C_BUILD_RE2GO": false
|
||||
"RE2C_BUILD_RE2D": false,
|
||||
"RE2C_BUILD_RE2GO": false,
|
||||
"RE2C_BUILD_RE2HS": false,
|
||||
"RE2C_BUILD_RE2JAVA": false,
|
||||
"RE2C_BUILD_RE2JS": false,
|
||||
"RE2C_BUILD_RE2OCAML": false,
|
||||
"RE2C_BUILD_RE2PY": false,
|
||||
"RE2C_BUILD_RE2RUST": false,
|
||||
"RE2C_BUILD_RE2SWIFT": false,
|
||||
"RE2C_BUILD_RE2V": false,
|
||||
"RE2C_BUILD_RE2ZIG": false
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -208,7 +308,7 @@
|
||||
{
|
||||
"name": "windows-config-base",
|
||||
"hidden": true,
|
||||
"generator": "Visual Studio 16 2019",
|
||||
"generator": "Visual Studio 17 2022",
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
@@ -231,16 +331,23 @@
|
||||
"installDir": "${sourceDir}/install",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"RE2C_BUILD_RE2GO": false
|
||||
"RE2C_BUILD_RE2D": false,
|
||||
"RE2C_BUILD_RE2GO": false,
|
||||
"RE2C_BUILD_RE2HS": false,
|
||||
"RE2C_BUILD_RE2JAVA": false,
|
||||
"RE2C_BUILD_RE2JS": false,
|
||||
"RE2C_BUILD_RE2OCAML": false,
|
||||
"RE2C_BUILD_RE2PY": false,
|
||||
"RE2C_BUILD_RE2RUST": false,
|
||||
"RE2C_BUILD_RE2SWIFT": false,
|
||||
"RE2C_BUILD_RE2V": false,
|
||||
"RE2C_BUILD_RE2ZIG": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "windows-msvc-debug-ootree-full",
|
||||
"displayName": "Windows x86_64: MSVC / Debug / Out of tree (full)",
|
||||
"inherits": ["default-full-configuration", "windows-msvc-debug-ootree-fast"],
|
||||
"cacheVariables": {
|
||||
"RE2C_REBUILD_DOCS": false
|
||||
}
|
||||
"inherits": ["default-full-configuration", "windows-msvc-debug-ootree-fast"]
|
||||
},
|
||||
{
|
||||
"name": "windows-msvc-debug-intree-fast",
|
||||
@@ -250,16 +357,23 @@
|
||||
"installDir": "${sourceDir}/install",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"RE2C_BUILD_RE2GO": false
|
||||
"RE2C_BUILD_RE2D": false,
|
||||
"RE2C_BUILD_RE2GO": false,
|
||||
"RE2C_BUILD_RE2HS": false,
|
||||
"RE2C_BUILD_RE2JAVA": false,
|
||||
"RE2C_BUILD_RE2JS": false,
|
||||
"RE2C_BUILD_RE2OCAML": false,
|
||||
"RE2C_BUILD_RE2PY": false,
|
||||
"RE2C_BUILD_RE2RUST": false,
|
||||
"RE2C_BUILD_RE2SWIFT": false,
|
||||
"RE2C_BUILD_RE2V": false,
|
||||
"RE2C_BUILD_RE2ZIG": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "windows-msvc-debug-intree-full",
|
||||
"displayName": "Windows x86_64: MSVC / Debug / In tree (full)",
|
||||
"inherits": ["default-full-configuration", "windows-msvc-debug-intree-fast"],
|
||||
"cacheVariables": {
|
||||
"RE2C_REBUILD_DOCS": false
|
||||
}
|
||||
"inherits": ["default-full-configuration", "windows-msvc-debug-intree-fast"]
|
||||
},
|
||||
{
|
||||
"name": "windows-msvc-release-ootree-fast",
|
||||
@@ -269,16 +383,23 @@
|
||||
"installDir": "${sourceDir}/install",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"RE2C_BUILD_RE2GO": false
|
||||
"RE2C_BUILD_RE2D": false,
|
||||
"RE2C_BUILD_RE2GO": false,
|
||||
"RE2C_BUILD_RE2HS": false,
|
||||
"RE2C_BUILD_RE2JAVA": false,
|
||||
"RE2C_BUILD_RE2JS": false,
|
||||
"RE2C_BUILD_RE2OCAML": false,
|
||||
"RE2C_BUILD_RE2PY": false,
|
||||
"RE2C_BUILD_RE2RUST": false,
|
||||
"RE2C_BUILD_RE2SWIFT": false,
|
||||
"RE2C_BUILD_RE2V": false,
|
||||
"RE2C_BUILD_RE2ZIG": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "windows-msvc-release-ootree-full",
|
||||
"displayName": "Windows x86_64: MSVC / Release / Out of tree (full)",
|
||||
"inherits": ["default-full-configuration", "windows-msvc-release-ootree-fast"],
|
||||
"cacheVariables": {
|
||||
"RE2C_REBUILD_DOCS": false
|
||||
}
|
||||
"inherits": ["default-full-configuration", "windows-msvc-release-ootree-fast"]
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
@@ -361,6 +482,20 @@
|
||||
"inherits": "linux-build-base",
|
||||
"configuration": "Release"
|
||||
},
|
||||
{
|
||||
"name": "linux-gcc-valgrind-ootree-fast",
|
||||
"displayName": "Linux x86_64: GCC / Valgrind / Out of tree (fast)",
|
||||
"configurePreset": "linux-gcc-valgrind-ootree-fast",
|
||||
"inherits": "linux-build-base",
|
||||
"configuration": "Release"
|
||||
},
|
||||
{
|
||||
"name": "linux-gcc-valgrind-ootree-full",
|
||||
"displayName": "Linux x86_64: GCC / Valgrind / Out of tree (full)",
|
||||
"configurePreset": "linux-gcc-valgrind-ootree-full",
|
||||
"inherits": "linux-build-base",
|
||||
"configuration": "Release"
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
|
||||
+38
-19
@@ -11,30 +11,49 @@ convenient).
|
||||
|
||||
## Language guidelines
|
||||
|
||||
re2c is written in C++. The project uses a conservative language subset (for
|
||||
portability reasons the currently used standard is C++98). The code should stay
|
||||
simple and avoid complex object hierarchies and excessive use of template
|
||||
metaprogramming. It should allow the reader to concentrate on the underlying
|
||||
algorithms, without the language getting in the way.
|
||||
re2c is written in C++ (the current standard is C++11). The algorithms and
|
||||
mathematical concepts used in the code are quite complex, so the code itself
|
||||
should stay simple and let the developer focus on the underlying logic, without
|
||||
the language getting in the way. For example, try to avoid complex object
|
||||
hierarchies and excessive use of template metaprogramming.
|
||||
|
||||
The line length limit is 90 characters, indentation is 4 spaces, and the
|
||||
indentation style is more or less K&R (egyptian braces).
|
||||
The line length limit is 100 characters, indentation is 4 spaces, and the
|
||||
indentation style is egyptian (the opening brace is on the same line). This is
|
||||
the approximate `astyle` command to auto-format re2c source code (it requires
|
||||
manual tweaking for argument/initializer lists and multiline comments):
|
||||
|
||||
## Updating bootstrap files
|
||||
$ # run in source directory
|
||||
$ astyle --style=google \
|
||||
--max-code-length=100 \
|
||||
--align-pointer=type \
|
||||
--align-reference=type \
|
||||
--keep-one-line-statements \
|
||||
--suffix=none \
|
||||
--recursive '*'
|
||||
|
||||
For changes that affect lexers (`.re` files), it is necessary to regenerate the
|
||||
corresponding bootstrap files. This can be done by reconfiguring and
|
||||
rebuilding re2c with options `--enable-lexers` (Autotools) or
|
||||
`-DRE2C_REBUILD_LEXERS=ON` (CMake). `RE2C_FOR_BUILD` should be defined as a
|
||||
path to an already existing re2c executable that will be used to regenerate
|
||||
the lexers.
|
||||
## Regenerating bootstrap files
|
||||
|
||||
For changes that affect parser (`.ypp` files), it is necessary to regenerate
|
||||
bootstrap parser files. This happens automatically if bison is installed.
|
||||
By default re2c uses bootstrap files for autogenerated sources (lexers, parsers,
|
||||
docs) and does not attempt to regenerate them. Developers may need to enable
|
||||
"regeneration mode" if they modify the corresponding source files.
|
||||
|
||||
For changes that update documentation, it is necessary to rebuild the
|
||||
bootstrap manpages by reconfiguring and rebuilding re2c with options
|
||||
`--enable-docs` (Autotools) or `-DRE2C_REBUILD_DOCS=ON` (CMake).
|
||||
For changes that affect lexers (`.re` files), regeneration mode is configured
|
||||
with options `--enable-lexers` (Autotools) or `-DRE2C_REBUILD_LEXERS=ON`
|
||||
(CMake). `RE2C_FOR_BUILD` should be defined as a path to an existing re2c
|
||||
executable that will be used to regenerate the lexers.
|
||||
|
||||
For changes that affect parsers (`.ypp` files), regeneration mode is configured
|
||||
with options `--enable-parsers` (Autotools) or `-DRE2C_REBUILD_PARSERS=ON`
|
||||
(CMake). In this case `bison` must be installed on the system. Otherwise
|
||||
Autoconf or CMake will fail at configuration stage.
|
||||
|
||||
For changes that affect syntax files, regeneration mode is configured
|
||||
with options `--enable-syntax` (Autotools) or `-DRE2C_REBUILD_SYNTAX=ON`
|
||||
(CMake).
|
||||
|
||||
For changes that update documentation, it is necessary to rebuild the bootstrap
|
||||
manpages by reconfiguring and rebuilding re2c with options `--enable-docs`
|
||||
(Autotools) or `-DRE2C_REBUILD_DOCS=ON` (CMake).
|
||||
|
||||
Please do not commit trivial updates to the bootstrap files, such as changes of
|
||||
the generator version or generation date.
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
If you run out of ideas of how to make re2c better...
|
||||
|
||||
## Multibyte switch
|
||||
|
||||
Reading multiple characters at a time is problematic due to the absence of
|
||||
alignment guarantees: even if unaligned reads are supported by the CPU, they are
|
||||
still likely to be slow.
|
||||
|
||||
But it should be possible to read a few characters, combine them into one using
|
||||
shifts and bitwise operations, and then switch on the combined character. It can
|
||||
be done with existing API; no new primitives are needed.
|
||||
|
||||
Of course it will only help in cases when the underlying DFA has long "chains"
|
||||
of transitions without branches that can be collapsed into one transition. But
|
||||
the optimization can be local (applied to some parts of the DFA).
|
||||
|
||||
## User-defined language support
|
||||
|
||||
The idea originated in a linux.org.ru thread (in Russian):
|
||||
https://www.linux.org.ru/news/development/16759268?cid=16762746
|
||||
|
||||
The original idea was to provide an API to render the generated AST into code
|
||||
and let the user implement it in the form of a plugin/library. This is
|
||||
problematic because 1) there is no stable AST, and 2) there are some language-
|
||||
agnostic optimizations and decisions that re2c takes way before the final
|
||||
rendering phase (so it is not as simple as providing a bunch or functions to
|
||||
generate code for different AST nodes).
|
||||
|
||||
There may be another way to provide any-language support: let the user define a
|
||||
set of primitives/configurations that re2c will use for language-agnostic
|
||||
decisions and for code generation (some of them exist already, but not enough to
|
||||
fully redefine the target language). This is akin to the idea of Midnight
|
||||
Commander's skins or syntax files. re2c can provide default syntax files for
|
||||
some languages (it already provides "standard" Unicode categories).
|
||||
|
||||
## Negation and complement
|
||||
|
||||
It would be good to support these operations on regular expressions, but it
|
||||
requires some research. Does TDFA present any special difficulties?
|
||||
|
||||
## Location support
|
||||
|
||||
It would be good to have something like Bison locations (automatic tracking of
|
||||
line/column/filename information). This is primarily useful for tokenizers and
|
||||
large lexers.
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
If re2c is unmaintained for a long time and starts to bitrot, or if you have a
|
||||
fork and need to make it as simple as possible, here is a list of things that
|
||||
can be cut off rather safely vs. things that are essential.
|
||||
|
||||
## Things to remove
|
||||
|
||||
These are mostly experimental research projects that have never been used
|
||||
outside of lab (to the best of author's knowledge, that is):
|
||||
|
||||
- Benchmarks: drop optional dependencies on re2, google-benchmark, Java (libre2c
|
||||
has JNI bindings); simplify the build system(s).
|
||||
|
||||
- libre2c: drop static/dynamic libraries support in the build system(s), e.g.
|
||||
Libtool; remove a few internal options and a bunch of explicit template
|
||||
instantiations in TDFA construction code that exist only for libre2c.
|
||||
|
||||
- One of the build systems: Autotools or CMake, whichever you like less. Someone
|
||||
will get unhappy in both cases (Windows is supported only by CMake, but distro
|
||||
maintainers may have decades old recipes based on Autotools).
|
||||
|
||||
## Things to remove only as a last resort
|
||||
|
||||
- Skeleton: it is really useful for testing and codegen validation, but re2c can
|
||||
live without it (and a few large tests can be dropped).
|
||||
|
||||
- Fuzzers: same here, they are really useful to find bugs and test hypotheses,
|
||||
but re2c can function without them.
|
||||
|
||||
## Things to keep
|
||||
|
||||
- Existing configurations / options / syntax: re2c must stay backwards
|
||||
compatible or it will become unusable. One exception is internal/debug options
|
||||
which may be removed with caution. For the rest, keep them as deprecated even
|
||||
if they do nothing.
|
||||
|
||||
- Language backends: they add little code complexity for a lot of value (and
|
||||
discipline in the codegen subsystem).
|
||||
|
||||
- Documentation (both on `master` branch and the website on `gh-pages` and
|
||||
`gh-pages-gen` branches). Without docs no one will know how to use re2c.
|
||||
|
||||
@@ -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")
|
||||
+625
-197
File diff suppressed because it is too large.
Load diff
+25
-46
@@ -7,7 +7,7 @@ libre2c_la_LDFLAGS = -module -no-undefined
|
||||
|
||||
libre2c_la_HDR = \
|
||||
lib/lex.h \
|
||||
lib/regcomp_dfa_regless.h \
|
||||
lib/regcomp_dfa_multipass.h \
|
||||
lib/regex.h \
|
||||
lib/regex_impl.h \
|
||||
lib/regoff_trie.h \
|
||||
@@ -22,70 +22,53 @@ libre2c_la_HDR = \
|
||||
src/dfa/determinization.h \
|
||||
src/dfa/dfa.h \
|
||||
src/dfa/posix_precedence.h \
|
||||
src/dfa/stacmd.h \
|
||||
src/dfa/tag_history.h \
|
||||
src/dfa/tagver_table.h \
|
||||
src/dfa/tcmd.h \
|
||||
src/nfa/nfa.h \
|
||||
src/encoding/case.h \
|
||||
src/encoding/ebcdic/ebcdic.h \
|
||||
src/encoding/ebcdic/ebcdic_regexp.h \
|
||||
src/encoding/ebcdic.h \
|
||||
src/encoding/enc.h \
|
||||
src/encoding/range_suffix.h \
|
||||
src/encoding/utf8/utf8.h \
|
||||
src/encoding/utf8/utf8_regexp.h \
|
||||
src/encoding/utf16/utf16_regexp.h \
|
||||
src/encoding/utf16/utf16.h \
|
||||
src/encoding/utf8.h \
|
||||
src/encoding/utf16.h \
|
||||
src/msg/location.h \
|
||||
src/msg/msg.h \
|
||||
src/msg/ver_to_vernum.h \
|
||||
src/msg/warn.h \
|
||||
src/regexp/re.h \
|
||||
src/regexp/regexp.h \
|
||||
src/regexp/rule.h \
|
||||
src/regexp/tag.h \
|
||||
src/compile.h \
|
||||
src/skeleton/path.h \
|
||||
src/skeleton/skeleton.h \
|
||||
src/parse/ast.h \
|
||||
src/parse/unescape.h \
|
||||
src/parse/input.h \
|
||||
src/parse/parser.h \
|
||||
src/parse/scanner.h \
|
||||
src/parse/unescape.h \
|
||||
src/debug/debug.h \
|
||||
src/util/allocate.h \
|
||||
src/util/allocator.h \
|
||||
src/util/attribute.h \
|
||||
src/util/c99_stdint.h \
|
||||
src/util/check.h \
|
||||
src/util/containers.h \
|
||||
src/util/file_utils.h \
|
||||
src/util/forbid_copy.h \
|
||||
src/util/free_list.h \
|
||||
src/util/hash32.h \
|
||||
src/util/local_increment.h \
|
||||
src/util/lookup.h \
|
||||
src/util/nowarn_in_bison.h \
|
||||
src/util/range.h \
|
||||
src/util/s_to_n32_unsafe.h \
|
||||
src/util/slab_allocator.h \
|
||||
src/util/smart_ptr.h \
|
||||
src/util/static_assert.h \
|
||||
src/util/string_utils.h \
|
||||
src/util/u32lim.h \
|
||||
src/util/uniq_vector.h
|
||||
src/util/u32lim.h
|
||||
|
||||
libre2c_la_SRC = \
|
||||
lib/regcomp.cc \
|
||||
lib/regexec.cc \
|
||||
lib/regexec_dfa.cc \
|
||||
lib/regexec_dfa_regless.cc \
|
||||
lib/regexec_dfa_multipass.cc \
|
||||
lib/regexec_nfa_leftmost.cc \
|
||||
lib/regexec_nfa_leftmost_trie.cc \
|
||||
lib/regexec_nfa_posix.cc \
|
||||
lib/regexec_nfa_posix_trie.cc \
|
||||
lib/regexec_nfa_posix_backward.cc \
|
||||
lib/regexec_nfa_posix_kuklewicz.cc \
|
||||
lib/regfree.cc \
|
||||
lib/stubs.cc \
|
||||
src/parse/ast.cc \
|
||||
src/parse/unescape.cc \
|
||||
src/parse/input.cc \
|
||||
src/options/opt.cc \
|
||||
src/options/symtab.cc \
|
||||
src/cfg/cfg.cc \
|
||||
@@ -111,33 +94,29 @@ libre2c_la_SRC = \
|
||||
src/dfa/fillpoints.cc \
|
||||
src/dfa/find_state.cc \
|
||||
src/dfa/minimization.cc \
|
||||
src/dfa/stacmd.cc \
|
||||
src/dfa/tagver_table.cc \
|
||||
src/dfa/tcmd.cc \
|
||||
src/nfa/estimate_size.cc \
|
||||
src/nfa/re_to_nfa.cc \
|
||||
src/encoding/enc.cc \
|
||||
src/encoding/range_suffix.cc \
|
||||
src/encoding/ebcdic/ebcdic_regexp.cc \
|
||||
src/encoding/utf16/utf16.cc \
|
||||
src/encoding/utf16/utf16_regexp.cc \
|
||||
src/encoding/utf8/utf8.cc \
|
||||
src/encoding/utf8/utf8_regexp.cc \
|
||||
src/encoding/unicode_casemap.cc \
|
||||
src/encoding/ebcdic.cc \
|
||||
src/encoding/utf16.cc \
|
||||
src/encoding/utf8.cc \
|
||||
src/msg/msg.cc \
|
||||
src/msg/warn.cc \
|
||||
src/regexp/ast_to_re.cc \
|
||||
src/regexp/default_tags.cc \
|
||||
src/regexp/fixed_tags.cc \
|
||||
src/regexp/nullable.cc \
|
||||
src/regexp/re.cc \
|
||||
src/regexp/rule.cc \
|
||||
src/regexp/regexp.cc \
|
||||
src/regexp/split_charset.cc \
|
||||
src/regexp/tag.cc \
|
||||
src/skeleton/control_flow.cc \
|
||||
src/skeleton/maxpath.cc \
|
||||
src/skeleton/skeleton.cc \
|
||||
src/util/range.cc \
|
||||
src/util/s_to_n32_unsafe.cc
|
||||
src/util/file_utils.cc \
|
||||
src/util/string_utils.cc
|
||||
|
||||
libre2c_la_SOURCES = \
|
||||
$(libre2c_la_HDR) \
|
||||
@@ -191,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
|
||||
@@ -1,7 +1,7 @@
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
||||
re2c is a free and open-source lexer generator for C, C++ and Go.
|
||||
re2c is a free and open-source lexer generator for C/C++, Go and Rust.
|
||||
|
||||
Its main goal is generating fast lexers: at least as fast as their reasonably
|
||||
optimized hand-coded counterparts. Instead of using traditional table-driven
|
||||
@@ -40,8 +40,8 @@ CONTRIBUTING
|
||||
------------
|
||||
|
||||
re2c is an Open Source, community-driven project. See
|
||||
[CONTRIBUTING.md](https://github.com/skvadrik/re2c/blob/master/CONTRIBUTING.md) for
|
||||
details about contributions to this repository.
|
||||
[CONTRIBUTING.md](https://github.com/skvadrik/re2c/blob/master/CONTRIBUTING.md)
|
||||
for details about contributions to this repository.
|
||||
|
||||
|
||||
BUILD
|
||||
@@ -73,6 +73,7 @@ You are welcome to ask for help or share your thoughts and ideas.
|
||||
|
||||
AUTHORS
|
||||
-------
|
||||
Re2c was originally written by Peter Bumbulis <peter@csg.uwaterloo.ca>.
|
||||
Since then many people contributed to the project. The current maintainer is
|
||||
|
||||
re2c was originally written by Peter Bumbulis <peter@csg.uwaterloo.ca>. Since
|
||||
then many volunteers have contributed to the project. The current maintainer is
|
||||
Ulya Trofimovich <skvadrik@gmail.com>.
|
||||
@@ -0,0 +1,16 @@
|
||||
workspace(name = "re2c")
|
||||
|
||||
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.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",
|
||||
],
|
||||
)
|
||||
|
||||
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
|
||||
|
||||
bazel_skylib_workspace()
|
||||
Whitespace-only changes.
@@ -1,5 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
git clean -fX
|
||||
mkdir -p m4
|
||||
autoreconf -i -W all
|
||||
@@ -0,0 +1,13 @@
|
||||
package(default_visibility = ["//visibility:private"])
|
||||
|
||||
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
|
||||
|
||||
exports_files([
|
||||
"re2c_config.h",
|
||||
])
|
||||
|
||||
bzl_library(
|
||||
name = "re2c_bzl",
|
||||
srcs = ["re2c.bzl"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
@@ -0,0 +1,70 @@
|
||||
# re2c generator rules - assuming that re2c is available as '@re2c//:re2c'.
|
||||
|
||||
load("@bazel_skylib//lib:paths.bzl", "paths")
|
||||
|
||||
visibility("public")
|
||||
|
||||
# Define supported extensions as defined by:
|
||||
# . https://bazel.build/reference/be/c-cpp#cc_library_args
|
||||
# . https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java
|
||||
_C_SRC_EXT = [".c", ".cc", ".cpp", ".cxx", ".c++", ".C", ".cu", ".cl"]
|
||||
_C_HDR_EXT = [".h", ".hh", ".hpp", ".ipp", ".hxx", ".h++", ".inc", ".inl", ".tlh", ".tli", ".H", ".tcc"]
|
||||
_RE2C_EXT = [".re", ".re2c"]
|
||||
|
||||
def _re2c_impl(ctx):
|
||||
srcs = ctx.files.srcs
|
||||
if len(srcs) != 1:
|
||||
fail("Attribute `srcs` must contain exactly 1 re2c source file ({exts}).".format(exts = ", ".join(_RE2C_EXT)))
|
||||
outs = ctx.outputs.outs
|
||||
if not outs or [o for o in outs if paths.split_extension(o.path)[1] not in _C_SRC_EXT + _C_HDR_EXT]:
|
||||
fail("Attribute `outs` must contain at least 1 C/C++ shource or header file ({exts}).".format(exts = ", ".join(_C_SRC_EXT + _C_HDR_EXT)))
|
||||
ctx.actions.run_shell(
|
||||
outputs = outs,
|
||||
tools = [ctx.executable._re2c_tool],
|
||||
inputs = ctx.files.srcs + ctx.files.data,
|
||||
command = """
|
||||
"{re2c}" --no-generation-date "{src}" -o "{out}" {re2c_args} {includes}
|
||||
""".format(
|
||||
re2c = ctx.executable._re2c_tool.path,
|
||||
src = srcs[0].path,
|
||||
out = outs[0].path,
|
||||
includes = " ".join(list(dict([("-I" + f.dirname, 1) for f in ctx.files.data]))),
|
||||
re2c_args = " ".join(ctx.attr.re2c_args),
|
||||
),
|
||||
mnemonic = "RE2C",
|
||||
progress_message = "Generating re2c %{label}",
|
||||
)
|
||||
|
||||
_re2c_attr = {
|
||||
"srcs": attr.label_list(
|
||||
doc = "The re2c source.",
|
||||
allow_files = _RE2C_EXT,
|
||||
mandatory = True,
|
||||
),
|
||||
"data": attr.label_list(
|
||||
doc = "Other input data files (e.g. include files).",
|
||||
allow_files = _C_SRC_EXT + _C_HDR_EXT,
|
||||
mandatory = False,
|
||||
),
|
||||
"outs": attr.output_list(
|
||||
doc = "The generated output source.",
|
||||
mandatory = True,
|
||||
),
|
||||
"re2c_args": attr.string_list(
|
||||
doc = "Arguments to re2c invocation.",
|
||||
),
|
||||
"_re2c_tool": attr.label(
|
||||
doc = "The target of the 're2c' executable.",
|
||||
default = Label("//:re2c"),
|
||||
allow_single_file = True,
|
||||
executable = True,
|
||||
cfg = "exec",
|
||||
),
|
||||
}
|
||||
|
||||
re2c_gen = rule(
|
||||
attrs = _re2c_attr,
|
||||
doc = """Use re2c tool to create an output file (e.g. '.cc') from a '.re' input.""",
|
||||
output_to_genfiles = True,
|
||||
implementation = _re2c_impl,
|
||||
)
|
||||
@@ -0,0 +1,4 @@
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_UNISTD_H 1
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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:
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,20 @@
|
||||
1
|
||||
12
|
||||
123
|
||||
1234
|
||||
12345
|
||||
123456
|
||||
1234567
|
||||
12345678
|
||||
123456789
|
||||
1234567890
|
||||
12345678901
|
||||
123456789012
|
||||
1234567890123
|
||||
12345678901234
|
||||
123456789012345
|
||||
1234567890123456
|
||||
12345678901234567
|
||||
123456789012345678
|
||||
1234567890123456789
|
||||
12345678901234567890
|
||||
@@ -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
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,7 @@
|
||||
Monday
|
||||
Tuesday
|
||||
Wednesday
|
||||
Thursday
|
||||
Friday
|
||||
Saturday
|
||||
Sunday
|
||||
@@ -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
File renamed without changes.
+5
-2
@@ -1,4 +1,4 @@
|
||||
set -e
|
||||
set -ex
|
||||
|
||||
if [ -e ragel7 ] ; then
|
||||
echo "ragel7 is already installed, quitting"
|
||||
@@ -10,7 +10,10 @@ RAGEL_DIR=ragel-7.0.4
|
||||
|
||||
wget http://www.colm.net/files/colm/"$COLM_DIR".tar.gz -O - | tar zx \
|
||||
&& cd "$COLM_DIR" \
|
||||
&& ./configure --prefix=$(pwd)/install \
|
||||
&& sed -i 's|^#!/bin/bash|#!/usr/bin/env bash|' src/colm-wrap.sh \
|
||||
&& ./configure \
|
||||
--prefix=$(pwd)/install \
|
||||
--disable-manual \
|
||||
&& make -j$(nproc) \
|
||||
&& make install \
|
||||
&& cd ..
|
||||
@@ -0,0 +1,390 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import math
|
||||
import sys
|
||||
from collections import OrderedDict
|
||||
|
||||
|
||||
plot_preamble = """
|
||||
\\documentclass[tikz]{standalone}
|
||||
|
||||
\\usepackage[utf8]{inputenc}
|
||||
\\usepackage{amsmath, amssymb, amsfonts}
|
||||
\\usepackage{xcolor}
|
||||
\\usepackage{tikz, pgfplots, pgfplotstable}
|
||||
\\usepackage{pifont}
|
||||
|
||||
\\definecolor{colorX}{HTML}{A1CAF1}
|
||||
\\definecolor{colorY}{HTML}{FBCEB1}
|
||||
"""
|
||||
|
||||
# Use Comic Neue font.
|
||||
plot_font_comicneue = """
|
||||
\\usepackage{comicneue}
|
||||
\\usepackage[T1]{fontenc}
|
||||
\\renewcommand{\\familydefault}{\\sfdefault}
|
||||
"""
|
||||
|
||||
# Use Computer Modern Bright font.
|
||||
plot_font_cmbright = """
|
||||
\\usepackage{cmbright}
|
||||
\\usepackage[T1]{fontenc}
|
||||
\\renewcommand{\\familydefault}{\\sfdefault}
|
||||
"""
|
||||
|
||||
# Counterintuitively, 'assume math mode' tricks pgfmathprintnumber into not
|
||||
# setting math mode, which is needed because Comic Neue does not support math.
|
||||
#
|
||||
# Use 'fixed relative' number format with very high precision (the numbers have
|
||||
# been previously rounded to a few non-zero digits in the fractional part, so
|
||||
# the trailing zeroes will will not be printed).
|
||||
plot_begin = """
|
||||
\\begin{document}
|
||||
|
||||
\\def\\plotwidth{%lfin}
|
||||
\\def\\barwidth{%lfin}
|
||||
|
||||
\\pgfplotsset{styleX/.style={
|
||||
font=\\scriptsize,
|
||||
xbar,
|
||||
axis y line*=none,
|
||||
axis x line=none,
|
||||
y=0.12in,
|
||||
width=\\plotwidth*1.15,
|
||||
bar width=\\barwidth,
|
||||
xshift=\\xplotshift,
|
||||
yshift=\\yplotshift,
|
||||
xmax=\\xmax,
|
||||
xmin=0,
|
||||
ymax=0.7,
|
||||
ymin=0.3 - \\nrows,
|
||||
ytick=data,
|
||||
ytick style={draw=none},
|
||||
yticklabels=\\empty,
|
||||
title=\\empty,
|
||||
clip=false,
|
||||
visualization depends on={x > \\xmax \\as \\xoverflow},
|
||||
visualization depends on={x > \\xmax ? -x + \\xmax : 0 \\as \\xshift},
|
||||
nodes near coords={
|
||||
\\ifdim \\xoverflow pt=1pt \\!\\ding{220}\\! \\scriptsize \\fi
|
||||
\\pgfmathprintnumber[assume math mode=true]{\\pgfplotspointmeta}
|
||||
},
|
||||
nodes near coords style={shift={(axis direction cs:\\xshift,0)}},
|
||||
nodes near coords style={/pgf/number format/.cd,
|
||||
fixed relative,
|
||||
precision = 10,
|
||||
1000 sep = {\\,}
|
||||
},%s}}
|
||||
"""
|
||||
|
||||
plot_labels_and_title = """
|
||||
yticklabels from table={\\table}{algo},
|
||||
every axis title/.style={below %s, at={(-0.08in,0)}},
|
||||
title=\\title,
|
||||
"""
|
||||
|
||||
plot_begin_picture = """
|
||||
\\begin{tikzpicture}
|
||||
|
||||
\\begin{scope}[xshift=-0.2in, yshift=%sin * 0.75]
|
||||
%s
|
||||
\\end{scope}
|
||||
"""
|
||||
|
||||
plot_middle = """
|
||||
\\def\\xplotshift{%lfin}
|
||||
\\def\\yplotshift{%lfin}
|
||||
\\def\\nrows{%d},
|
||||
\\def\\title{%s},
|
||||
\\def\\xmax{%lf}
|
||||
|
||||
\\pgfplotstableread {%s} \\table
|
||||
|
||||
\\begin{axis}[styleX,%s]
|
||||
\\clip(current axis.south west) rectangle(current axis.north east);
|
||||
\\addplot[fill=%s] table[x=value, y expr=-\\coordindex] from \\table;
|
||||
\\end{axis}
|
||||
"""
|
||||
|
||||
plot_end_picture = """
|
||||
\\end{tikzpicture}
|
||||
"""
|
||||
|
||||
plot_end = """
|
||||
\\end{document}
|
||||
"""
|
||||
|
||||
|
||||
VARIANTS = ['aot', 'jit', 'nfa']
|
||||
|
||||
|
||||
def parse_args():
|
||||
variants = ', '.join(VARIANTS)
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("input", help="input JSON file")
|
||||
parser.add_argument("output", help="output TeX file")
|
||||
parser.add_argument("--variant",
|
||||
help="variant of the benchmark, one of %s" % variants)
|
||||
parser.add_argument("--relative-to",
|
||||
help="output CPU time relative to the specified algorithm")
|
||||
parser.add_argument("--font",
|
||||
help="use the specified font (supported fonts: cmbright, comicneue)")
|
||||
|
||||
args = parser.parse_args()
|
||||
if args.variant not in VARIANTS:
|
||||
sys.exit("please specify --variant (possible values: %s)" % variants)
|
||||
|
||||
return args
|
||||
|
||||
|
||||
# Generate benchmark title from benchmark name.
|
||||
def gen_title(oldname, remove_suffix):
|
||||
if remove_suffix:
|
||||
# cut off the last sub-word after the dash
|
||||
oldname = oldname[:oldname.rfind("-")]
|
||||
|
||||
# Name begins with a letter, so it must be a plain language word.
|
||||
if oldname[0].isalpha():
|
||||
return oldname
|
||||
|
||||
# Name begins with something else than a letter, treat it as a regexp and
|
||||
# render as a TeX math formula. This requires adding a few metacharacters.
|
||||
newname = ""
|
||||
for char in oldname:
|
||||
if char in "{*+?":
|
||||
# Repetition counters must be in superscript.
|
||||
newname += "^"
|
||||
newname += char
|
||||
return "$\\boldsymbol{" + newname + "}$"
|
||||
|
||||
|
||||
# Find index of a group which algorithm contains the given string (stem).
|
||||
def index_of_algo(group, stem):
|
||||
if stem == None:
|
||||
return 0;
|
||||
|
||||
for i in range(len(group)):
|
||||
(algo, _, _, _, _) = group[i]
|
||||
if stem in algo:
|
||||
return i
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
# Time format: keep integer part precise, round fractional part relative to the
|
||||
# exponent (similar to PGFPLOTS's "fixed relative, precision = 2" numer format,
|
||||
# but doesn't round integer part). This is to reduce visual noise on the plot.
|
||||
#
|
||||
# Examples: 1004, 195, 13, 3.8, 0.85, 0.017, 0.0048
|
||||
#
|
||||
def time_format(time):
|
||||
order = math.floor(math.log(time, 10))
|
||||
if order > 0:
|
||||
return '%.1lf'
|
||||
else:
|
||||
return '%%.%dlf' % (-order + 1)
|
||||
|
||||
|
||||
class Params:
|
||||
def __init__(self, args):
|
||||
self.barwidth = 0.08
|
||||
|
||||
if args.variant == 'aot':
|
||||
self.override_params_aot()
|
||||
elif args.variant == 'jit':
|
||||
self.override_params_jit()
|
||||
elif args.variant == 'nfa':
|
||||
self.override_params_nfa()
|
||||
|
||||
self.font = ''
|
||||
if args.font == 'comicneue':
|
||||
self.font = plot_font_comicneue
|
||||
elif args.font == 'cmbright':
|
||||
self.font = plot_font_cmbright
|
||||
elif args.font:
|
||||
sys.exit('error: unsupported font: "%s"' % font)
|
||||
|
||||
if args.relative_to: # override only if set
|
||||
self.relative_to = args.relative_to
|
||||
|
||||
def override_params_aot(self):
|
||||
self.plotwidth = 1.5
|
||||
self.xshift = 2 * self.plotwidth
|
||||
self.header = """
|
||||
\\node[anchor=west] (x0) at (0.15in,0) {\\small\\bf{gcc (time)}};
|
||||
\\node[anchor=west] (x1) at (1.65in,0) {\\small\\bf{gcc (size)}};
|
||||
\\node[anchor=west] (x2) at (3.15in,0) {\\small\\bf{clang (time)}};
|
||||
\\node[anchor=west] (x3) at (4.65in,0) {\\small\\bf{clang (size)}};
|
||||
"""
|
||||
self.title_suffix = True
|
||||
self.relative_to = None
|
||||
self.title_annotate = False
|
||||
self.global_styles = ""
|
||||
self.local_styles = plot_labels_and_title % 'left'
|
||||
|
||||
def override_params_jit(self):
|
||||
self.plotwidth = 2.7
|
||||
self.xshift = self.plotwidth
|
||||
self.header = """
|
||||
\\node[anchor=west] (x0) at (0.15in,0) {\\small\\bf{regcomp (time)}};
|
||||
\\node[anchor=west] (x1) at (2.85in,0) {\\small\\bf{regexec (time)}};
|
||||
"""
|
||||
self.title_suffix = True
|
||||
self.relative_to = ''
|
||||
self.title_annotate = False
|
||||
self.global_styles = ""
|
||||
self.local_styles = plot_labels_and_title % 'left'
|
||||
|
||||
def override_params_nfa(self):
|
||||
self.plotwidth = 2.5
|
||||
self.xshift = self.plotwidth + 1
|
||||
self.header = ""
|
||||
self.only_1st_col_with_labels = False
|
||||
self.title_suffix = False
|
||||
self.relative_to = 'LG'
|
||||
self.title_annotate = True
|
||||
self.global_styles = plot_labels_and_title % 'right'
|
||||
self.local_styles = ""
|
||||
|
||||
|
||||
# Split benchmarks into groups by regexp (the first component of the name).
|
||||
# If the relative mode is on, normalize CPU time by the time of the first
|
||||
# benchmark in each group.
|
||||
#
|
||||
# Expected JSON fomat:
|
||||
# {
|
||||
# "benchmarks": [
|
||||
# {
|
||||
# "name": <string>,
|
||||
# ["cpu_time": <number>,]
|
||||
# ["bin_size": <number>,]
|
||||
# ["captures": <number>,]
|
||||
# ["regsize": <number>,] ...
|
||||
# }, ...
|
||||
# ], ...
|
||||
# }
|
||||
#
|
||||
def group_benchmarks(benchmarks, params):
|
||||
benchcount = len(benchmarks)
|
||||
|
||||
groups = OrderedDict()
|
||||
for bench in benchmarks:
|
||||
name, algo = bench['name'].split('_')
|
||||
cputime = bench['cpu_time'] if 'cpu_time' in bench else None
|
||||
binsize = bench['bin_size'] if 'bin_size' in bench else None
|
||||
captures = bench['captures'] if 'captures' in bench else None
|
||||
regsize = bench['regsize'] if 'regsize' in bench else None
|
||||
groups.setdefault(name, []).append(
|
||||
(algo, cputime, binsize, captures, regsize))
|
||||
|
||||
maxtime = 0
|
||||
avgtime = 0
|
||||
maxsize = 0
|
||||
avgsize = 0
|
||||
maxrows = 0
|
||||
nbench = 0
|
||||
|
||||
benchgroups = OrderedDict()
|
||||
for name in groups:
|
||||
group = groups[name]
|
||||
|
||||
relto = index_of_algo(group, params.relative_to)
|
||||
(_, cputime0, binsize0, captures, regsize) = group[relto]
|
||||
|
||||
timetbl = None
|
||||
if cputime0 != None:
|
||||
table = 'algo value\n'
|
||||
for (algo, time, _, _, _) in group:
|
||||
time = time / (cputime0 if params.relative_to != None else 1)
|
||||
maxtime = max(maxtime, time)
|
||||
avgtime += time
|
||||
table += ('{%s} ' + time_format(time) + '\n') % (algo, time)
|
||||
timetbl = table
|
||||
|
||||
sizetbl = None
|
||||
if binsize0 != None:
|
||||
table = 'algo value\n'
|
||||
for (algo, _, size, _, _) in group:
|
||||
maxsize = max(maxsize, size)
|
||||
avgsize += size
|
||||
table += '{%s} %lf\n' % (algo, size)
|
||||
sizetbl = table
|
||||
|
||||
title = gen_title(name, params.title_suffix)
|
||||
nrows = len(group)
|
||||
benchgroups[name] = (title, timetbl, sizetbl, nrows, regsize, captures)
|
||||
|
||||
nbench += nrows
|
||||
maxrows = max(maxrows, nrows)
|
||||
|
||||
avgtime /= nbench
|
||||
avgsize /= nbench
|
||||
factor = 10 if params.relative_to != None else 5
|
||||
maxtime = min(maxtime, factor * avgtime)
|
||||
maxsize = min(maxsize, factor * avgsize)
|
||||
|
||||
params.plotheight = 0.15 + maxrows * params.barwidth * 0.75
|
||||
params.maxtime = maxtime
|
||||
params.maxsize = maxsize
|
||||
|
||||
return benchgroups
|
||||
|
||||
|
||||
# Generate a Tikz picture with a PGF plot for each benchmark group. Crop
|
||||
# very long bars, so that they do not squash other bars to the left.
|
||||
def generate_plot(benchgroups, params):
|
||||
plot = plot_preamble
|
||||
plot += params.font
|
||||
plot += plot_begin % (params.plotwidth, params.barwidth, params.global_styles)
|
||||
plot += plot_begin_picture % (params.plotheight, params.header)
|
||||
|
||||
i = 0
|
||||
for name, benchgroup in benchgroups.items():
|
||||
even = i % 2 == 0
|
||||
i += 1
|
||||
(title, timetbl, sizetbl, nrows, regsize, captures) = benchgroup
|
||||
|
||||
xshift = 0 if even else params.xshift
|
||||
yshift = -params.plotheight * (i if even else i - 1)
|
||||
title = '\\textbf{%s}' % title
|
||||
if params.title_annotate and regsize != None and captures != None:
|
||||
title += ' \\, (%d symbol%s, %d capture%s)' % (
|
||||
regsize, 's' if regsize > 1 else '',
|
||||
captures, 's' if captures > 1 else '')
|
||||
|
||||
# Generate CPU time plots.
|
||||
if timetbl != None:
|
||||
plot += plot_middle % (xshift, yshift, nrows, title, params.maxtime,
|
||||
timetbl, params.local_styles if even else '', 'colorX')
|
||||
|
||||
# Generate binary size plots.
|
||||
if sizetbl != None:
|
||||
xshift += params.plotwidth
|
||||
plot += plot_middle % (xshift, yshift, nrows, title, params.maxsize,
|
||||
sizetbl, '', 'colorY')
|
||||
|
||||
plot += plot_end_picture
|
||||
plot += plot_end
|
||||
|
||||
return plot
|
||||
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
|
||||
with open(args.input) as f:
|
||||
input = json.load(f)
|
||||
|
||||
params = Params(args)
|
||||
groups = group_benchmarks(input['benchmarks'], params)
|
||||
plot = generate_plot(groups, params)
|
||||
|
||||
with open(args.output, 'w') as f:
|
||||
f.write(plot)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
File renamed without changes.
@@ -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}"
|
||||
)
|
||||
@@ -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
|
||||
File renamed without changes.
@@ -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
|
||||
@@ -0,0 +1,136 @@
|
||||
#ifndef _RE2C_BENCHMRKS_COMMON_COMMON_
|
||||
#define _RE2C_BENCHMRKS_COMMON_COMMON_
|
||||
|
||||
#include <benchmark/benchmark.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
enum engine_t {
|
||||
ENGINE_RE2C,
|
||||
ENGINE_RE2
|
||||
};
|
||||
|
||||
struct alg_t {
|
||||
const char *name;
|
||||
engine_t engine;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct bench_t {
|
||||
const char *name;
|
||||
const char *regexp;
|
||||
const char **strings;
|
||||
};
|
||||
|
||||
// Need to define benchmarks as functors for benchmark::RegisterBenchmark.
|
||||
struct bench_regcomp_t {
|
||||
void operator()(benchmark::State&, const alg_t&, const bench_t&) const;
|
||||
};
|
||||
struct bench_regexec_t {
|
||||
void operator()(benchmark::State&, const alg_t&, const bench_t&) const;
|
||||
};
|
||||
|
||||
// RFC URI and HTTP
|
||||
#define CRLF "[\\n]"
|
||||
#define OCT "([0-9]|[1-9][0-9]|[1][0-9]{2}|[2][0-4][0-9]|[2][5][0-5])"
|
||||
#define IPV4 "(" OCT "[.]" OCT "[.]" OCT "[.]" OCT ")"
|
||||
#define H16 "[0-9a-fA-F]{1,4}"
|
||||
#define LS32 "(" H16 ":" H16 "|" IPV4 ")"
|
||||
#define IPV6 "((" H16 ":){6}" LS32 \
|
||||
"|" "::(" H16 ":){5}" LS32 \
|
||||
"|(" H16 ")?::(" H16 ":){4}" LS32 \
|
||||
"|((" H16 ":){0,1}" H16 ")?::(" H16 ":){3}" LS32 \
|
||||
"|((" H16 ":){0,2}" H16 ")?::(" H16 ":){2}" LS32 \
|
||||
"|((" H16 ":){0,3}" H16 ")?::" H16 ":" LS32 \
|
||||
"|((" H16 ":){0,4}" H16 ")?::" LS32 \
|
||||
"|((" H16 ":){0,5}" H16 ")?::" H16 \
|
||||
"|((" H16 ":){0,6}" H16 ")?::)"
|
||||
#define IPVFUTURE "(v[0-9a-fA-F]+[.][-0-9a-zA-Z._~!$&'()*+,;=:]+)"
|
||||
#define IPLITERAL "([[](" IPV6 "|" IPVFUTURE ")[\\]])"
|
||||
#define REGNAME "(([-0-9a-zA-Z._~!$&'()*+,;=]|%[0-9a-fA-F]{2})*)"
|
||||
#define HOST "(" IPLITERAL "|" IPV4 "|" REGNAME ")"
|
||||
#define PORT "(:[0-9]*)?"
|
||||
#define USERINFO "(([-a-zA-Z0-9._~!$&'()*+,;=:]|%[0-9a-fA-F]{2})*@)?"
|
||||
#define SCHEME "([a-zA-Z][a-zA-Z0-9+.-]*):"
|
||||
#define QUERY "([?]([-a-zA-Z0-9._~!$&'()*+,;=:@/?]|%[0-9a-fA-F]{2})*)?"
|
||||
#define FRAGMENT "([#]([-a-zA-Z0-9._~!$&'()*+,;=:@/?]|%[0-9a-fA-F]{2})*)?"
|
||||
#define PCHAR "([-0-9a-zA-Z._~!$&'()*+,;=:@]|%[0-9a-fA-F]{2})"
|
||||
#define PATH_ABEMPTY "(/" PCHAR "*)*"
|
||||
#define PATH_ABSOLUTE "/(" PCHAR "+(/" PCHAR "*)*)?"
|
||||
#define PATH_ROOTLESS PCHAR "+(/" PCHAR "*)*"
|
||||
#define PATH_EMPTY "([/]?)"
|
||||
#define AUTHORITY "(" USERINFO HOST PORT ")"
|
||||
#define HIER_PART "(//" AUTHORITY PATH_ABEMPTY "|" PATH_ABSOLUTE "|" PATH_ROOTLESS "|" PATH_EMPTY ")"
|
||||
#define URI SCHEME HIER_PART QUERY FRAGMENT
|
||||
#define ABSOLUTE_URI SCHEME HIER_PART QUERY
|
||||
#define ORIGIN_FROM PATH_ABEMPTY QUERY
|
||||
#define REQUEST_TARGET "(" AUTHORITY "|" ABSOLUTE_URI "|" ORIGIN_FROM "|([*]))"
|
||||
#define METHOD "([-!#$%&'*+.^_`|~0-9a-zA-Z]+)"
|
||||
#define HTTP_VERSION "(HTTP/[0-9][.][0-9])"
|
||||
#define STATUS_CODE "([0-9]{3})"
|
||||
#define REASON_PHRASE "([ \\t \\x1f-\\x7e\\x80-\\xff]*)"
|
||||
#define REQUEST_LINE METHOD "[ ]" REQUEST_TARGET "[ ]" HTTP_VERSION CRLF
|
||||
#define STATUS_LINE HTTP_VERSION "[ ]" STATUS_CODE "[ ]" REASON_PHRASE CRLF
|
||||
#define FIELD_NAME "([-!#$%&'*+.^_`|~0-9a-zA-Z]+)"
|
||||
#define FIELD_VCHAR "[\\x1f-\\x7e\\x80-\\xff]"
|
||||
#define FIELD_CONTENT "(" FIELD_VCHAR "([ \\t]+" FIELD_VCHAR")?)"
|
||||
#define FIELD_VALUE "(" FIELD_CONTENT "|" CRLF "[ \\t]+)*"
|
||||
#define HEADER_FIELD "(" FIELD_NAME ":[ \\t]*" FIELD_VALUE "[ \\t]*)"
|
||||
#define MESSAGE_HEAD "(" REQUEST_LINE "|" STATUS_LINE ")" "(" HEADER_FIELD CRLF ")*"
|
||||
|
||||
// simplified URI and HTTP
|
||||
#define CHAR2 "[-._~%!$&'()*+,;=a-zA-Z0-9]"
|
||||
#define SCHEME2 "([-+.a-zA-Z0-9]+):"
|
||||
#define USERINFO2 "((" CHAR2 "|[:])+@)?"
|
||||
#define HOST2 "((" CHAR2 "|[:[\\]])+)"
|
||||
#define PORT2 "(:[0-9]*)?"
|
||||
#define AUTHORITY2 USERINFO2 HOST2 PORT2
|
||||
#define PATH2 "((" CHAR2 "|[:@/])*)"
|
||||
#define QUERY2 "([?](" CHAR2 "|[:@?/])*)?"
|
||||
#define FRAGMENT2 "([#](" CHAR2 "|[:@?/])*)?"
|
||||
#define URI2 SCHEME2 "(//" AUTHORITY2 ")?" PATH2 QUERY2 FRAGMENT2
|
||||
#define ABSOLUTE_URI2 SCHEME2 "(//" AUTHORITY2 PORT2 ")?" PATH2 QUERY2
|
||||
#define ORIGIN_FROM2 "/" PATH2 QUERY2
|
||||
#define REQUEST_TARGET2 "(" AUTHORITY2 "|" ABSOLUTE_URI2 "|" ORIGIN_FROM2 "|[*])"
|
||||
#define HTTP_VERSION2 "(HTTP/[0-9][.][0-9])"
|
||||
#define METHOD2 "([-._~%!$&'*+#^`|a-zA-Z0-9]+)"
|
||||
#define REQUEST_LINE2 "(" METHOD2 "[ ]" REQUEST_TARGET2 "[ ]" HTTP_VERSION2 CRLF ")"
|
||||
#define STATUS_LINE2 "(" HTTP_VERSION2 "[ ]([0-9]{3})[ ]([\\t \\x1f-\\x7e\\x80-\\xff]*)" CRLF ")"
|
||||
#define HEADER_FIELD2 "([-._~%!$&'*+#^`|a-zA-Z0-9]+:[\\x1f-\\x7e\\x80-\\xff \\t\\n]*)"
|
||||
#define MESSAGE_HEAD2 "(" REQUEST_LINE2 "|" STATUS_LINE2 ")" "(" HEADER_FIELD2 CRLF ")*"
|
||||
|
||||
// simplified IPv6
|
||||
#define IPV62 "(((" H16 ":){0,7}" H16 ")?(::)?((" H16 ":){0,7}" H16 ")?)"
|
||||
|
||||
// simplified IPv4
|
||||
#define IPV42 "([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})"
|
||||
|
||||
// date
|
||||
#define DATE "(Mon|Tue|Wed|Thu|Fri|Sat|Sun)" \
|
||||
"[ ]+(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)" \
|
||||
"[ ]+([0-9]{2})" \
|
||||
"[ ]+([0-9]{4})" \
|
||||
"[ ]+([0-9]{2}):([0-5][0-9]):[0-5][0-9](-[0-5][0-9])?(:[0-5][0-9])?" \
|
||||
"[ ]+(([A-Z]{3})([+-]([0-5][0-9]):([0-5][0-9]))?)"
|
||||
|
||||
// simplified date
|
||||
#define DATE2 "([a-zA-Z]+)[ ]+([a-zA-Z]+)[ ]+([0-9]+)[ ]+([0-9]+)[ ]+([0-9:-]+)[ ]+([A-Z0-9+-]+)"
|
||||
|
||||
// Gentoo package atom
|
||||
#define PACKAGE_STR "([a-zA-Z0-9_+-]+)"
|
||||
#define PACKAGE_NUM "([0-9]+)"
|
||||
#define PACKAGE_VER "(" PACKAGE_NUM "([.]" PACKAGE_NUM ")*)"
|
||||
#define PACKAGE_SFX1 "([a-z])?"
|
||||
#define PACKAGE_SFX2 "((alpha|beta|pre|rc|p)" PACKAGE_NUM "?)"
|
||||
#define PACKAGE_REV "(-r" PACKAGE_NUM ")?"
|
||||
#define PACKAGE_ATOM PACKAGE_STR "/" PACKAGE_STR "-" PACKAGE_VER PACKAGE_SFX1 "(_" PACKAGE_SFX2 ")*" PACKAGE_REV
|
||||
|
||||
// simplified Gentoo package atom
|
||||
#define PACKAGE_STR2 "([a-zA-Z0-9_/+-]+)"
|
||||
#define PACKAGE_VER2 "([0-9.a-z_]+)"
|
||||
#define PACKAGE_ATOM2 PACKAGE_STR2 "-" PACKAGE_VER2 PACKAGE_REV
|
||||
|
||||
#endif // _RE2C_BENCHMRKS_COMMON_COMMON_
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -15016,10 +15016,6 @@ for (int a = 0; a < reTest.length; a++){
|
||||
tex.printf("\\usepackage{amsmath, amssymb, amsfonts}\n");
|
||||
tex.printf("\\usepackage{tikz, pgfplots, pgfplotstable}\n");
|
||||
tex.printf("\n");
|
||||
tex.printf("\\usepackage{comicneue}\n");
|
||||
tex.printf("\\usepackage[T1]{fontenc}\n");
|
||||
tex.printf("\\renewcommand{\\familydefault}{\\sfdefault}\n");
|
||||
tex.printf("\n");
|
||||
tex.printf("\\begin{document}\n");
|
||||
tex.printf("\n");
|
||||
tex.printf("\\pgfplotstableread {\n");
|
||||
@@ -15044,12 +15040,13 @@ for (int a = 0; a < reTest.length; a++){
|
||||
tex.printf(" legend cell align = left,\n");
|
||||
tex.printf(" legend style = {thick, draw = none},\n");
|
||||
tex.printf(" xlabel = regular expression size (characters),\n");
|
||||
tex.printf(" ylabel = parse speed (characters per second)\n");
|
||||
tex.printf(" ylabel = parse speed (characters per second),\n");
|
||||
tex.printf(" width = 5in\n");
|
||||
tex.printf("]\n");
|
||||
String[] row0 = plot.get(0);
|
||||
for (int i = 1; i < row0.length; i++){
|
||||
String name = algolabels[i-1].split("\\|")[0];
|
||||
tex.printf("\\addplot [color=%s] table [x index=0, y index=%s] from \\datatable;\n",
|
||||
tex.printf("\\addplot [line width=0.7pt, color=%s] table [x index=0, y index=%s] from \\datatable;\n",
|
||||
tex_colors[i - 1], i);
|
||||
tex.printf("\\addlegendentry{%s}\n", name);
|
||||
}
|
||||
@@ -16314,41 +16311,41 @@ this.finreg = false;
|
||||
};
|
||||
|
||||
ReTdfa[] rearrDPO = new ReTdfa[]{
|
||||
new ReTdfa("DPOR", "negtags,posix,transtable,lookahead,okui,altbin,offsets,lastval"),
|
||||
new ReTdfa("DPOL", "negtags,posix,transtable,lookahead,okui,altbin,offsets,lastval,tagless"),
|
||||
new ReTdfa("DPOR-re2c", "re2c"),
|
||||
new ReTdfa("DPOL-re2c", "re2c,re2c_regless"),
|
||||
new ReTdfa("last-offset-java", "negtags,posix,transtable,lookahead,okui,altbin,offsets,lastval"),
|
||||
new ReTdfa("last-offset-multipass-java", "negtags,posix,transtable,lookahead,okui,altbin,offsets,lastval,tagless"),
|
||||
new ReTdfa("last-offset-re2c", "re2c"),
|
||||
new ReTdfa("last-offset-multipass-re2c", "re2c,re2c_regless"),
|
||||
};
|
||||
|
||||
ReTdfa[] rearrDPH = new ReTdfa[]{
|
||||
new ReTdfa("DPHR", "negtags,posix,transtable,lookahead,okui,altbin,finreg"),
|
||||
new ReTdfa("DPHL", "negtags,posix,transtable,lookahead,okui,altbin,finreg,tagless"),
|
||||
new ReTdfa("DPHR-re2c", "re2c,re2c_subhist"),
|
||||
new ReTdfa("DPHL-re2c", "re2c,re2c_subhist,re2c_regless"),
|
||||
new ReTdfa("all-offsets-java", "negtags,posix,transtable,lookahead,okui,altbin,finreg"),
|
||||
new ReTdfa("all-offsets-multipass-java", "negtags,posix,transtable,lookahead,okui,altbin,finreg,tagless"),
|
||||
new ReTdfa("all-offsets-re2c", "re2c,re2c_subhist"),
|
||||
new ReTdfa("all-offsets-multipass-re2c", "re2c,re2c_subhist,re2c_regless"),
|
||||
};
|
||||
|
||||
ReTdfa[] rearrDPT = new ReTdfa[]{
|
||||
new ReTdfa("DPTL", "negtags,posix,transtable,lookahead,okui,altbin,matchTstring,tagless"),
|
||||
new ReTdfa("DPTL-re2c", "re2c,re2c_tstring,re2c_regless"),
|
||||
new ReTdfa("tagged-string-multipass-java", "negtags,posix,transtable,lookahead,okui,altbin,matchTstring,tagless"),
|
||||
new ReTdfa("tagged-string-multipass-re2c", "re2c,re2c_tstring,re2c_regless"),
|
||||
};
|
||||
|
||||
ReTdfa[] rearrDFO = new ReTdfa[]{
|
||||
new ReTdfa("DFOR", "negtags,posix,transtable,lookahead,okui,altbin,autotags,offsets,lastval"),
|
||||
new ReTdfa("DFOL", "negtags,posix,transtable,lookahead,okui,altbin,autotags,offsets,lastval,tagless"),
|
||||
new ReTdfa("DFOR-re2c", "re2c,re2c_autotags"),
|
||||
new ReTdfa("DFOL-re2c", "re2c,re2c_autotags,re2c_regless"),
|
||||
new ReTdfa("last-offset-java", "negtags,posix,transtable,lookahead,okui,altbin,autotags,offsets,lastval"),
|
||||
new ReTdfa("last-offset-multipass-java", "negtags,posix,transtable,lookahead,okui,altbin,autotags,offsets,lastval,tagless"),
|
||||
new ReTdfa("last-offset-re2c", "re2c,re2c_autotags"),
|
||||
new ReTdfa("last-offset-multipass-re2c", "re2c,re2c_autotags,re2c_regless"),
|
||||
};
|
||||
|
||||
ReTdfa[] rearrDFH = new ReTdfa[]{
|
||||
new ReTdfa("DFHR", "negtags,posix,transtable,lookahead,okui,altbin,autotags,finreg"),
|
||||
new ReTdfa("DFHL", "negtags,posix,transtable,lookahead,okui,altbin,autotags,finreg,tagless"),
|
||||
new ReTdfa("DFHR-re2c", "re2c,re2c_autotags,re2c_subhist"),
|
||||
new ReTdfa("DFHL-re2c", "re2c,re2c_autotags,re2c_subhist,re2c_regless"),
|
||||
new ReTdfa("all-offsets-java", "negtags,posix,transtable,lookahead,okui,altbin,autotags,finreg"),
|
||||
new ReTdfa("all-offsets-multipass-java", "negtags,posix,transtable,lookahead,okui,altbin,autotags,finreg,tagless"),
|
||||
new ReTdfa("all-offsets-re2c", "re2c,re2c_autotags,re2c_subhist"),
|
||||
new ReTdfa("all-offsets-multipass-re2c", "re2c,re2c_autotags,re2c_subhist,re2c_regless"),
|
||||
};
|
||||
|
||||
ReTdfa[] rearrDFT = new ReTdfa[]{
|
||||
new ReTdfa("DFTL", "negtags,posix,transtable,lookahead,okui,autotags,altbin,matchTstring,tagless"),
|
||||
new ReTdfa("DFTL-re2c", "re2c,re2c_autotags,re2c_tstring,re2c_regless"),
|
||||
new ReTdfa("tagged-string-multipass-java", "negtags,posix,transtable,lookahead,okui,autotags,altbin,matchTstring,tagless"),
|
||||
new ReTdfa("tagged-string-multipass-re2c", "re2c,re2c_autotags,re2c_tstring,re2c_regless"),
|
||||
};
|
||||
|
||||
ReTdfa[] rearrDP = concatArrays(rearrDPO, concatArrays(rearrDPH, rearrDPT));
|
||||
@@ -16361,8 +16358,8 @@ this.finreg = false;
|
||||
//bench(rearrDFO, "measure_DFO.ser", "chart_DFO.html");
|
||||
//bench(rearrDFH, "measure_DFH.ser", "chart_DFH.html");
|
||||
//bench(rearrDFT, "measure_DFT.ser", "chart_DFT.html");
|
||||
bench(rearrDP, "measure_DP.ser", "chart_DP.html");
|
||||
bench(rearrDF, "measure_DF.ser", "chart_DF.html");
|
||||
bench(rearrDP, "measure_sparse.ser", "chart_sparse.html");
|
||||
bench(rearrDF, "measure_dense.ser", "chart_dense.html");
|
||||
|
||||
if (testErrors > 0){
|
||||
System.out.printf("end test %s tests failed\n",testErrors);
|
||||
File renamed without changes.
+1
-1
@@ -11,7 +11,7 @@ JNIEXPORT jlong JNICALL Java_re2c_RE2C_regcomp(JNIEnv *env, jclass, jstring patt
|
||||
if (c_pattern == NULL) return 1;
|
||||
|
||||
const int flags = (nfa ? REG_NFA : 0)
|
||||
| (regless ? REG_REGLESS : 0)
|
||||
| (regless ? REG_MULTIPASS : 0)
|
||||
| (subhist ? REG_SUBHIST : 0)
|
||||
| (tstring ? REG_TSTRING : 0)
|
||||
| (autotags ? REG_AUTOTAGS : 0);
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,6 @@
|
||||
The measurements have been taken on an Intel(R) Core(TM) i7-8750H CPU with
|
||||
32 KiB L1 Data cache (x6 cores),
|
||||
32 KiB L1 Instruction cache (x6 cores),
|
||||
256 KiB L2 Unified cache (x6 cores),
|
||||
9216 KiB L3 Unified cache,
|
||||
32 GiB RAM.
|
||||
@@ -0,0 +1,106 @@
|
||||
\documentclass[tikz]{standalone}
|
||||
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage{amsmath, amssymb, amsfonts}
|
||||
\usepackage{tikz, pgfplots, pgfplotstable}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\pgfplotstableread {
|
||||
18.00 64067.60 42946.34 182933.76 105057.40 6229.27 22180.86 26243.90 32994.76 73211.37 97660.34
|
||||
19.00 62548.54 42164.01 178722.37 103400.35 5770.58 20847.07 23890.54 30599.08 73046.09 97387.81
|
||||
20.00 60048.83 40443.29 171833.91 100612.70 5015.70 18897.54 21808.86 28312.46 72539.33 96542.90
|
||||
22.00 57079.79 38515.24 159793.27 96907.26 4217.08 16900.47 19528.35 25703.02 72258.85 95088.91
|
||||
23.00 54436.63 36775.10 147812.44 93065.74 3584.12 15030.44 17188.28 22920.65 71393.41 94080.62
|
||||
24.00 52415.17 35525.41 138862.51 90118.03 3143.60 13812.73 15617.56 21128.39 70804.77 93103.91
|
||||
25.00 50851.49 34423.06 131785.43 88851.06 2671.71 12209.55 13325.01 18396.98 70234.27 92666.51
|
||||
26.00 49875.77 33780.79 125493.62 87792.96 2410.59 11148.35 11685.93 16473.76 69745.11 92356.24
|
||||
27.00 49120.55 33395.10 120200.73 86274.06 2395.18 11243.06 11809.34 16687.19 68995.42 92307.63
|
||||
28.00 48941.82 33446.25 119836.68 86694.70 2445.77 11597.05 12206.75 17403.04 68681.69 92504.90
|
||||
29.00 47242.85 32428.99 112650.91 84709.63 2194.40 10686.36 11067.65 16096.81 68017.29 92522.99
|
||||
30.00 46547.71 31908.05 106896.82 83234.19 2060.92 10322.06 10615.28 15596.19 67661.79 92201.19
|
||||
31.00 44746.78 30761.95 96590.88 79863.36 1893.17 9583.53 9831.02 14350.11 66572.29 90726.62
|
||||
32.00 43436.08 30015.85 89575.18 77760.96 1782.59 9124.68 9183.95 13631.79 65740.34 89967.07
|
||||
33.00 42483.05 29415.64 87542.50 76519.29 1692.18 8776.04 8789.94 13070.47 65460.19 89770.30
|
||||
34.00 41734.65 28869.28 84681.78 74992.78 1605.51 8386.69 8342.75 12501.38 64854.47 88944.96
|
||||
35.00 41119.13 28632.57 81703.60 74722.48 1497.51 7894.08 7611.52 11732.78 64085.34 88243.59
|
||||
36.00 40704.36 28343.84 80300.17 73822.50 1498.01 7896.33 7613.06 11860.52 63595.18 87867.33
|
||||
37.00 40065.40 27844.84 76968.74 72293.78 1406.94 7636.42 7447.81 11603.40 62937.90 86801.18
|
||||
38.00 39294.27 27215.83 70966.47 70686.86 1350.01 7207.91 6881.68 10919.70 62590.66 85851.13
|
||||
39.00 39098.45 27083.52 69155.33 69889.97 1321.95 7020.93 6731.99 10696.01 62042.75 85317.37
|
||||
40.00 38196.73 26541.44 65568.32 68152.49 1265.99 6765.98 6426.98 10195.64 61179.72 83724.00
|
||||
41.00 36471.62 25422.34 58940.92 65249.09 1184.08 6302.20 5953.32 9435.59 59935.34 81613.14
|
||||
42.00 36716.62 25509.28 59561.80 65702.64 1216.76 6537.99 6220.15 10002.22 59544.22 80900.90
|
||||
43.00 36617.92 25273.60 58865.21 65134.54 1226.27 6529.91 6198.52 9889.73 59192.09 80493.85
|
||||
44.00 36150.33 24864.28 57058.67 64057.84 1183.46 6377.57 6040.99 9666.42 58676.93 79926.59
|
||||
45.00 36182.35 24996.13 56715.01 64209.18 1188.66 6421.67 6135.37 9821.71 58395.16 79381.75
|
||||
46.00 36443.85 24884.45 55786.43 63845.59 1149.77 6162.49 5895.39 9357.53 58500.98 79228.39
|
||||
47.00 36058.47 24419.19 51646.99 63004.55 1095.61 5929.20 5597.65 8944.25 58246.49 79276.10
|
||||
48.00 34956.31 23801.95 48932.21 61693.23 1011.48 5500.96 5029.95 8140.69 58036.83 79196.46
|
||||
49.00 34277.03 23629.45 48088.23 60894.19 1018.97 5582.97 5111.21 8275.08 57724.55 78635.00
|
||||
50.00 33246.76 22945.42 44546.84 59595.18 905.60 5086.73 4571.06 7410.58 57668.88 78301.40
|
||||
51.00 33773.89 23190.66 44321.00 60535.16 885.48 5039.04 4540.15 7393.76 58323.35 78631.12
|
||||
52.00 33337.63 22958.67 43083.19 59922.10 837.92 4822.92 4253.07 6963.98 58365.64 79467.41
|
||||
53.00 32602.41 22650.08 41747.10 58711.50 791.56 4606.34 4051.73 6618.74 58248.54 79207.90
|
||||
54.00 32021.90 22488.91 40203.96 58074.90 754.94 4415.61 3850.97 6310.81 58131.37 78549.87
|
||||
55.00 32799.74 23152.05 41538.58 59410.15 784.08 4529.31 3842.67 6473.81 58196.56 78239.61
|
||||
56.00 32629.68 23110.97 41488.36 59501.76 802.40 4536.56 3809.06 6459.95 58417.71 78993.91
|
||||
57.00 31385.48 22496.83 39347.65 57967.45 770.21 4412.27 3698.44 6297.75 57922.23 78275.11
|
||||
58.00 30680.96 22559.73 38096.34 57409.70 737.30 4230.11 3533.81 6005.96 57943.76 76944.89
|
||||
59.00 31446.28 22839.60 38096.15 58277.81 764.03 4460.26 3814.62 6475.04 58093.17 77455.98
|
||||
60.00 31067.82 22715.31 36172.22 58136.03 710.39 4153.83 3474.16 5924.73 58263.23 77761.50
|
||||
61.00 30689.92 22441.92 34874.99 57353.23 687.94 4077.04 3382.82 5816.85 58186.13 77640.38
|
||||
62.00 29916.43 21939.89 33817.99 55758.16 670.90 3927.07 3205.77 5512.63 57187.21 76937.32
|
||||
63.00 29961.36 22164.15 34131.52 56447.34 675.59 4023.28 3295.78 5712.03 56930.67 75941.26
|
||||
64.00 29651.76 21915.98 32842.30 55660.78 653.84 3903.05 3130.16 5402.50 56589.14 75840.17
|
||||
65.00 30096.51 22293.16 32886.52 56660.89 638.10 3854.69 3132.62 5413.33 57112.42 76597.87
|
||||
66.00 29546.36 21925.33 31172.53 56137.56 598.51 3639.77 2962.22 5056.47 57237.38 77300.51
|
||||
67.00 29489.32 21914.59 30122.63 56272.61 565.86 3527.39 2817.11 4902.97 57319.13 77385.28
|
||||
68.00 29519.33 22149.89 29778.41 57078.95 555.96 3494.03 2781.40 4838.88 57562.13 77899.66
|
||||
69.00 29268.33 21855.40 30071.74 56633.31 558.78 3599.36 2866.62 4978.05 57774.46 78687.77
|
||||
70.00 28712.40 22026.22 28757.99 56817.35 531.88 3404.62 2636.81 4696.89 57994.28 78935.42
|
||||
71.00 28623.79 22021.90 27828.04 56346.02 532.71 3342.18 2634.22 4652.04 57881.34 78591.40
|
||||
72.00 28453.65 22009.10 27358.01 56227.07 520.55 3267.49 2594.98 4545.64 57973.20 79095.49
|
||||
73.00 27926.89 21898.66 26803.92 56104.33 509.09 3215.34 2526.01 4466.13 58263.83 79606.04
|
||||
74.00 27890.34 21796.17 25780.69 55701.50 485.78 3056.41 2365.57 4181.06 58783.30 80228.20
|
||||
75.00 27771.84 21793.06 24647.71 56153.07 468.49 2962.53 2286.49 4052.66 58865.13 80711.66
|
||||
} \datatable
|
||||
|
||||
\begin{tikzpicture}
|
||||
\begin{axis} [
|
||||
font=\scriptsize,
|
||||
scaled y ticks = false,
|
||||
y tick label style = {/pgf/number format/.cd,fixed,1000 sep = {\,}},
|
||||
ymajorgrids,
|
||||
grid style={line width=.1pt, draw=gray!20},
|
||||
legend pos=outer north east,
|
||||
legend cell align = left,
|
||||
legend style = {thick, draw = none},
|
||||
xlabel = regular expression size (characters),
|
||||
ylabel = parse speed (characters per second),
|
||||
width = 5in
|
||||
]
|
||||
\addplot [line width=0.7pt, color=violet] table [x index=0, y index=1] from \datatable;
|
||||
\addlegendentry{last-offset-java}
|
||||
\addplot [line width=0.7pt, color=teal] table [x index=0, y index=2] from \datatable;
|
||||
\addlegendentry{last-offset-multipass-java}
|
||||
\addplot [line width=0.7pt, color=blue] table [x index=0, y index=3] from \datatable;
|
||||
\addlegendentry{last-offset-re2c}
|
||||
\addplot [line width=0.7pt, color=cyan] table [x index=0, y index=4] from \datatable;
|
||||
\addlegendentry{last-offset-multipass-re2c}
|
||||
\addplot [line width=0.7pt, color=lightgray] table [x index=0, y index=5] from \datatable;
|
||||
\addlegendentry{all-offsets-java}
|
||||
\addplot [line width=0.7pt, color=pink] table [x index=0, y index=6] from \datatable;
|
||||
\addlegendentry{all-offsets-multipass-java}
|
||||
\addplot [line width=0.7pt, color=gray] table [x index=0, y index=7] from \datatable;
|
||||
\addlegendentry{all-offsets-re2c}
|
||||
\addplot [line width=0.7pt, color=purple] table [x index=0, y index=8] from \datatable;
|
||||
\addlegendentry{all-offsets-multipass-re2c}
|
||||
\addplot [line width=0.7pt, color=orange] table [x index=0, y index=9] from \datatable;
|
||||
\addlegendentry{tagged-string-multipass-java}
|
||||
\addplot [line width=0.7pt, color=olive] table [x index=0, y index=10] from \datatable;
|
||||
\addlegendentry{tagged-string-multipass-re2c}
|
||||
\end{axis}
|
||||
\end{tikzpicture}
|
||||
|
||||
\end{document}
|
||||
@@ -0,0 +1,106 @@
|
||||
\documentclass[tikz]{standalone}
|
||||
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage{amsmath, amssymb, amsfonts}
|
||||
\usepackage{tikz, pgfplots, pgfplotstable}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\pgfplotstableread {
|
||||
18.00 77594.81 51424.59 202781.71 122255.25 13391.78 32436.12 93838.33 65352.91 81385.82 100029.52
|
||||
19.00 73778.38 49193.48 201226.52 119932.12 12427.55 30789.67 90207.09 62057.45 80696.01 100001.57
|
||||
20.00 68598.33 45313.31 199038.73 116879.33 9779.37 27609.39 83788.03 57103.94 78705.31 99578.88
|
||||
22.00 62094.95 40611.16 195320.45 112322.17 6817.72 23787.60 76318.91 51559.50 76104.81 98604.00
|
||||
23.00 59685.51 38868.61 193951.49 110531.28 6054.46 22321.52 71496.68 49149.24 75141.38 98153.73
|
||||
24.00 57919.84 37570.77 193959.47 108887.92 5566.88 21339.09 68563.67 47238.86 74504.28 97825.43
|
||||
25.00 54729.44 35519.66 190951.64 108377.86 5081.34 19948.73 64985.29 44812.02 74510.63 98446.81
|
||||
26.00 53889.17 35043.71 190534.09 108943.25 4974.79 19575.42 64173.63 44156.63 74396.88 98868.71
|
||||
27.00 53972.18 34940.15 189604.95 109075.69 4991.53 19685.01 64533.47 43911.21 74026.11 98884.19
|
||||
28.00 51677.15 34148.21 189807.01 107070.06 4696.17 19200.68 64421.79 42800.69 73770.16 98203.95
|
||||
29.00 50981.66 33481.24 190440.69 107817.52 4562.04 18797.15 62962.60 42641.34 73677.70 98734.47
|
||||
30.00 51012.97 33422.60 189987.41 107898.59 4529.17 18755.21 63182.28 42456.92 73693.00 99013.87
|
||||
31.00 51447.73 33418.47 189874.71 107319.28 4591.04 18760.34 62872.03 42570.92 73412.16 98292.07
|
||||
32.00 49959.28 32571.09 188258.74 106806.76 4433.92 18287.30 61437.20 41966.99 73167.12 98076.14
|
||||
33.00 50491.42 32701.29 190458.88 108591.88 4477.34 18392.31 61445.25 42367.95 73623.08 98717.22
|
||||
34.00 48137.78 31388.15 189331.30 106272.84 4180.48 17615.45 60073.29 40638.50 73377.88 98514.42
|
||||
35.00 45720.16 29940.55 186112.45 104916.90 3912.74 16692.92 57813.18 39078.92 73049.46 97983.58
|
||||
36.00 46016.79 30211.96 188227.09 104823.62 3899.43 16829.86 57644.40 38966.99 73057.45 97444.05
|
||||
37.00 44640.77 29459.22 185966.34 103308.30 3716.86 16393.91 56824.13 37809.63 72736.91 96742.83
|
||||
38.00 43829.60 28951.22 183638.55 101928.33 3647.35 16089.67 55640.13 37301.34 72416.42 96497.18
|
||||
39.00 42651.68 28023.83 181633.84 100526.99 3555.32 15554.73 55565.79 36234.74 72133.25 95956.64
|
||||
40.00 42129.18 27689.50 180641.57 100440.26 3530.57 15331.44 54898.74 35680.42 72197.65 95892.56
|
||||
41.00 39529.78 26071.10 178680.81 98367.20 3226.95 14368.76 52840.98 33779.61 72026.62 95236.18
|
||||
42.00 38479.04 25783.16 175481.55 97117.73 3080.63 14178.11 51951.28 33288.53 71565.33 94697.91
|
||||
43.00 37676.67 25394.52 175021.87 95720.28 3011.24 13943.19 51921.41 32659.88 71336.49 94472.22
|
||||
44.00 34991.38 23959.28 171886.62 92252.57 2722.21 13049.85 50259.07 30741.44 70568.38 93669.95
|
||||
45.00 34165.65 23466.72 167800.34 92487.25 2649.59 12798.30 49300.31 30303.29 70227.83 93100.29
|
||||
46.00 33444.64 23021.17 166785.14 92211.05 2580.73 12572.76 48848.65 29502.10 70192.46 93003.41
|
||||
47.00 32778.35 22557.57 165867.30 91204.14 2492.84 12348.95 48376.54 29257.43 69917.55 93233.97
|
||||
48.00 30710.59 21224.27 163747.55 89474.47 2288.47 11559.17 45756.85 27451.26 69872.49 93616.63
|
||||
49.00 30324.96 21033.06 164086.33 89333.25 2226.44 11408.11 45953.43 26927.54 70033.38 93211.68
|
||||
50.00 28961.94 20121.55 160111.62 89202.28 2086.82 10857.46 43798.37 25714.91 70106.27 93359.73
|
||||
51.00 26563.74 18913.19 156965.70 86824.70 1806.15 10099.12 42250.25 24145.96 69544.12 92530.46
|
||||
52.00 25153.97 18001.19 155564.89 85211.96 1701.37 9590.67 41862.18 23304.04 69182.62 92466.66
|
||||
53.00 24519.40 17616.96 157148.12 85449.94 1626.37 9394.67 41858.09 23036.94 69662.26 93046.68
|
||||
54.00 23643.88 17041.50 153919.71 84191.72 1544.42 9050.56 40971.95 22059.34 69320.06 92749.13
|
||||
55.00 23756.97 17317.91 153586.07 85154.63 1594.03 9204.95 41451.99 22432.80 69675.14 92794.70
|
||||
56.00 23600.84 17188.94 153292.10 84890.03 1605.10 9092.85 40942.48 22245.50 69874.46 93139.78
|
||||
57.00 22912.77 16765.70 150786.18 83578.35 1546.94 8824.80 39671.36 21687.28 69677.13 93162.14
|
||||
58.00 21559.32 15878.42 146909.50 82843.64 1464.39 8289.27 37967.48 20343.59 69615.87 92659.51
|
||||
59.00 22147.44 16445.21 146336.19 83638.61 1508.75 8616.36 38782.21 21180.32 69974.59 92477.79
|
||||
60.00 20734.23 15351.76 140006.00 82554.20 1434.14 8051.80 36922.29 20012.74 69406.74 92080.61
|
||||
61.00 19910.09 14976.77 138024.46 81202.11 1364.36 7830.45 35802.78 19454.87 68954.08 92110.22
|
||||
62.00 19640.55 14788.54 136548.53 80166.50 1344.14 7735.37 35390.46 19260.55 68659.56 92354.74
|
||||
63.00 20450.27 15466.44 136567.18 81901.54 1413.37 8108.19 34691.18 19770.11 68869.02 92408.59
|
||||
64.00 18977.32 14357.22 132431.47 81476.92 1308.58 7475.16 32965.95 18143.17 68931.05 92649.27
|
||||
65.00 18483.82 13970.31 131639.73 83849.35 1266.76 7253.87 32134.77 17812.73 69666.02 93113.23
|
||||
66.00 17575.93 13269.76 128523.85 82949.61 1181.90 6852.48 30312.31 16878.36 69540.52 92648.37
|
||||
67.00 17025.49 13024.66 126292.89 81863.68 1138.11 6701.23 30092.51 16573.23 69375.29 92351.89
|
||||
68.00 17636.20 13362.69 126077.77 83119.45 1179.52 6910.53 30240.87 16994.03 69604.33 92638.66
|
||||
69.00 18595.50 14128.87 127252.00 83490.95 1246.90 7332.97 31441.90 18145.91 69592.81 92747.82
|
||||
70.00 18433.97 13728.82 124454.12 82980.33 1237.80 7112.65 30400.05 17456.83 69126.98 92485.97
|
||||
71.00 18147.59 13546.32 123926.12 82356.85 1191.15 7003.25 30143.97 17218.75 69088.17 92097.08
|
||||
72.00 18117.52 13383.66 122834.63 82087.67 1188.82 6933.67 30185.92 17353.59 69053.54 92100.82
|
||||
73.00 17435.05 12876.20 119406.59 81578.44 1153.69 6660.49 29806.57 16546.17 69154.79 91334.41
|
||||
74.00 16388.19 12103.48 113225.95 79286.00 1073.92 6257.82 29029.85 15621.33 68518.77 90520.91
|
||||
75.00 15717.38 11688.79 107030.45 76881.02 1028.43 6038.20 28352.02 15172.25 67457.34 89242.56
|
||||
} \datatable
|
||||
|
||||
\begin{tikzpicture}
|
||||
\begin{axis} [
|
||||
font=\scriptsize,
|
||||
scaled y ticks = false,
|
||||
y tick label style = {/pgf/number format/.cd,fixed,1000 sep = {\,}},
|
||||
ymajorgrids,
|
||||
grid style={line width=.1pt, draw=gray!20},
|
||||
legend pos=outer north east,
|
||||
legend cell align = left,
|
||||
legend style = {thick, draw = none},
|
||||
xlabel = regular expression size (characters),
|
||||
ylabel = parse speed (characters per second),
|
||||
width = 5in
|
||||
]
|
||||
\addplot [line width=0.7pt, color=violet] table [x index=0, y index=1] from \datatable;
|
||||
\addlegendentry{last-offset-java}
|
||||
\addplot [line width=0.7pt, color=teal] table [x index=0, y index=2] from \datatable;
|
||||
\addlegendentry{last-offset-multipass-java}
|
||||
\addplot [line width=0.7pt, color=blue] table [x index=0, y index=3] from \datatable;
|
||||
\addlegendentry{last-offset-re2c}
|
||||
\addplot [line width=0.7pt, color=cyan] table [x index=0, y index=4] from \datatable;
|
||||
\addlegendentry{last-offset-multipass-re2c}
|
||||
\addplot [line width=0.7pt, color=lightgray] table [x index=0, y index=5] from \datatable;
|
||||
\addlegendentry{all-offsets-java}
|
||||
\addplot [line width=0.7pt, color=pink] table [x index=0, y index=6] from \datatable;
|
||||
\addlegendentry{all-offsets-multipass-java}
|
||||
\addplot [line width=0.7pt, color=gray] table [x index=0, y index=7] from \datatable;
|
||||
\addlegendentry{all-offsets-re2c}
|
||||
\addplot [line width=0.7pt, color=purple] table [x index=0, y index=8] from \datatable;
|
||||
\addlegendentry{all-offsets-multipass-re2c}
|
||||
\addplot [line width=0.7pt, color=orange] table [x index=0, y index=9] from \datatable;
|
||||
\addlegendentry{tagged-string-multipass-java}
|
||||
\addplot [line width=0.7pt, color=olive] table [x index=0, y index=10] from \datatable;
|
||||
\addlegendentry{tagged-string-multipass-re2c}
|
||||
\end{axis}
|
||||
\end{tikzpicture}
|
||||
|
||||
\end{document}
|
||||
File renamed without changes.
File renamed without changes.
@@ -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()
|
||||
@@ -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
|
||||
@@ -0,0 +1,66 @@
|
||||
#include <benchmark/benchmark.h>
|
||||
#include <string.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"
|
||||
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
static const size_t MAX_TITLE = 1024;
|
||||
char title[MAX_TITLE];
|
||||
|
||||
static const size_t AAA_LEN = 1 << 14;
|
||||
char *aaa = new char[AAA_LEN + 1];
|
||||
memset(aaa, 'a', AAA_LEN);
|
||||
const char *aaa_strings[] = {aaa, NULL};
|
||||
|
||||
const std::vector<bench_t> benches {
|
||||
{"http-rfc7230", MESSAGE_HEAD, http_strings},
|
||||
{"http-simple", MESSAGE_HEAD2, http_strings},
|
||||
{"uri-rfc3986", URI, uri_strings},
|
||||
{"uri-simple", URI2, uri_strings},
|
||||
{"ipv6", IPV6, ipv6_strings},
|
||||
{"ipv4", IPV4, ipv4_strings},
|
||||
{"date", DATE, date_strings},
|
||||
{"package", PACKAGE_ATOM, atom_strings},
|
||||
|
||||
{NULL, "(a)*a{10}", aaa_strings},
|
||||
{NULL, "(a)*a{100}", aaa_strings},
|
||||
{NULL, "(a)*a{1000}", aaa_strings},
|
||||
};
|
||||
|
||||
const std::vector<alg_t> algs {
|
||||
{"last-offset", ENGINE_RE2C, 0},
|
||||
{"multipass-last-offset", ENGINE_RE2C, REG_MULTIPASS},
|
||||
{"all-offsets", ENGINE_RE2C, REG_SUBHIST},
|
||||
{"multipass-all-offsets", ENGINE_RE2C, REG_SUBHIST | REG_MULTIPASS},
|
||||
};
|
||||
|
||||
benchmark::Initialize(&argc, argv);
|
||||
|
||||
for (const bench_t &bench : benches) {
|
||||
for (const alg_t &alg : algs) {
|
||||
const char *name = bench.name ? bench.name : bench.regexp;
|
||||
snprintf(title, MAX_TITLE, "%s-regcomp_%s", name, alg.name);
|
||||
benchmark::RegisterBenchmark(title, bench_regcomp_t(), alg, bench)
|
||||
->Unit(benchmark::kMicrosecond);
|
||||
}
|
||||
for (const alg_t &alg : algs) {
|
||||
const char *name = bench.name ? bench.name : bench.regexp;
|
||||
snprintf(title, MAX_TITLE, "%s-regexec_%s", name, alg.name);
|
||||
benchmark::RegisterBenchmark(title, bench_regexec_t(), alg, bench)
|
||||
->Unit(benchmark::kMicrosecond);
|
||||
}
|
||||
}
|
||||
|
||||
benchmark::RunSpecifiedBenchmarks();
|
||||
|
||||
delete[] aaa;
|
||||
}
|
||||
File renamed without changes.
@@ -0,0 +1,8 @@
|
||||
The measurements have been taken on an Intel(R) Core(TM) i7-8750H CPU with
|
||||
32 KiB L1 Data cache (x6 cores),
|
||||
32 KiB L1 Instruction cache (x6 cores),
|
||||
256 KiB L2 Unified cache (x6 cores),
|
||||
9216 KiB L3 Unified cache,
|
||||
32 GiB RAM.
|
||||
Software versions:
|
||||
re2c built from Git at commit `814d38f <https://github.com/skvadrik/re2c/commit/814d38f7eb19130a926f8d06172a00088967779f>`_.
|
||||
File renamed without changes.
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,21 @@
|
||||
add_executable(bench_submatch_nfa
|
||||
"bench.cc"
|
||||
"${CMAKE_SOURCE_DIR}/benchmarks/c/common/common.cc"
|
||||
)
|
||||
|
||||
target_link_libraries(bench_submatch_nfa libre2c)
|
||||
|
||||
find_package(benchmark REQUIRED)
|
||||
target_link_libraries(bench_submatch_nfa 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_nfa PROPERTIES
|
||||
CXX_STANDARD 17
|
||||
CXX_STANDARD_REQUIRED ON)
|
||||
target_compile_definitions(bench_submatch_nfa PRIVATE "HAVE_RE2_RE2_H=1")
|
||||
target_include_directories(bench_submatch_nfa PRIVATE "${RE2_INCLUDE_DIRECTORY}")
|
||||
target_link_libraries(bench_submatch_nfa "${RE2_LIBRARY}")
|
||||
endif()
|
||||
@@ -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
|
||||
@@ -0,0 +1,103 @@
|
||||
#include <benchmark/benchmark.h>
|
||||
#include <string.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"
|
||||
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
static const size_t MAX_TITLE = 1024;
|
||||
char title[MAX_TITLE];
|
||||
|
||||
static const size_t AAA_LEN = 1 << 13;
|
||||
char *aaa = new char[AAA_LEN + 1];
|
||||
memset(aaa, 'a', AAA_LEN);
|
||||
const char *aaa_strings[] = {aaa, NULL};
|
||||
|
||||
const std::vector<bench_t> benches = {
|
||||
{"HTTP-RFC7230", MESSAGE_HEAD, http_strings},
|
||||
{"HTTP-simple", MESSAGE_HEAD2, http_strings},
|
||||
|
||||
{"URI-RFC3986", URI, uri_strings},
|
||||
{"URI-simple", URI2, uri_strings},
|
||||
|
||||
{"IPv6", IPV6, ipv6_strings},
|
||||
{"IPv6-simple", IPV62, ipv6_strings},
|
||||
{"IPv4", IPV4, ipv4_strings},
|
||||
{"IPv4-simple", IPV42, ipv4_strings},
|
||||
{"date", DATE, date_strings},
|
||||
{"date-simple", DATE2, date_strings},
|
||||
{"package", PACKAGE_ATOM, atom_strings},
|
||||
{"package-simple", PACKAGE_ATOM2, atom_strings},
|
||||
|
||||
{NULL, "(a{2}|a{3}|a{5})*", aaa_strings},
|
||||
{NULL, "(a{7}|a{13}|a{19})*", aaa_strings},
|
||||
{NULL, "(a{29}|a{41}|a{53})*", aaa_strings},
|
||||
{NULL, "(a{67}|a{83}|a{103})*", aaa_strings},
|
||||
{NULL, "(a{127}|a{151}|a{179})*", aaa_strings},
|
||||
{NULL, "(a{199}|a{239}|a{271})*", aaa_strings},
|
||||
|
||||
{NULL, "(((a){2})|((a){3})|((a){5}))*", aaa_strings},
|
||||
{NULL, "(((a){7})|((a){13})|((a){19}))*", aaa_strings},
|
||||
{NULL, "(((a){29})|((a){41})|((a){53}))*", aaa_strings},
|
||||
{NULL, "(((a){67})|((a){83})|((a){103}))*", aaa_strings},
|
||||
{NULL, "(((a){127})|((a){151})|((a){179}))*", aaa_strings},
|
||||
{NULL, "(((a){199})|((a){239})|((a){271}))*", aaa_strings},
|
||||
|
||||
{NULL, "(a{0,16})*", aaa_strings},
|
||||
{NULL, "((a){0,16})*", aaa_strings},
|
||||
{NULL, "(a{0,64})*", aaa_strings},
|
||||
{NULL, "((a){0,64})*", aaa_strings},
|
||||
{NULL, "(a{0,256})*", aaa_strings},
|
||||
{NULL, "((a){0,256})*", aaa_strings},
|
||||
|
||||
// Pathological case for constant-memory POSIX algorithms that use naive
|
||||
// (worst-case cubic in the size of TNFA) algorithm for precedence matrix
|
||||
// computation. Cubic behaviour is caused by quadratic-time computation
|
||||
// of precedence matrix on each step (the number of core items in closure
|
||||
// approaches TNFA size), multiplied by the length of compared histores
|
||||
// (which also approaches TNFA size). Trie-based algorithms are not
|
||||
// affected, but they consume memory proportional to the length of input,
|
||||
// and so are also not practical.
|
||||
|
||||
{NULL, "((a?){0,16})*", aaa_strings},
|
||||
{NULL, "((a*){0,16})*", aaa_strings},
|
||||
{NULL, "((a?){0,64})*", aaa_strings},
|
||||
{NULL, "((a*){0,64})*", aaa_strings},
|
||||
{NULL, "((a?){0,256})*", aaa_strings},
|
||||
{NULL, "((a*){0,256})*", aaa_strings},
|
||||
};
|
||||
|
||||
const std::vector<alg_t> algs = {
|
||||
{"LG", ENGINE_RE2C, REG_NFA | REG_LEFTMOST},
|
||||
{"lazy-LG", ENGINE_RE2C, REG_NFA | REG_LEFTMOST | REG_TRIE},
|
||||
{"OS", ENGINE_RE2C, REG_NFA},
|
||||
{"simple-OS", ENGINE_RE2C, REG_NFA | REG_SLOWPREC},
|
||||
{"lazy-OS", ENGINE_RE2C, REG_NFA | REG_TRIE},
|
||||
#ifdef HAVE_RE2_RE2_H
|
||||
{"re2-LG", ENGINE_RE2, 0},
|
||||
#endif
|
||||
};
|
||||
|
||||
benchmark::Initialize(&argc, argv);
|
||||
|
||||
for (const bench_t &bench : benches) {
|
||||
for (const alg_t &alg : algs) {
|
||||
const char *name = bench.name ? bench.name : bench.regexp;
|
||||
snprintf(title, MAX_TITLE, "%s_%s", name, alg.name);
|
||||
benchmark::RegisterBenchmark(title, bench_regexec_t(), alg, bench)
|
||||
->Unit(benchmark::kMicrosecond);
|
||||
}
|
||||
}
|
||||
|
||||
benchmark::RunSpecifiedBenchmarks();
|
||||
|
||||
delete[] aaa;
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
@@ -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
|
||||
@@ -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
|
||||
Loaded 100 of 5182 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user