]>
granicus.if.org Git - re2c/log
Ulya Trofimovich [Wed, 16 Jan 2019 21:49:38 +0000 (21:49 +0000)]
libre2c_posix: handle empty group () in parser; added more tests.
Ulya Trofimovich [Tue, 15 Jan 2019 23:45:53 +0000 (23:45 +0000)]
Make re2c:eof usable with push-model lexers (-f, --storable-state option).
Ulya Trofimovich [Tue, 15 Jan 2019 00:24:22 +0000 (00:24 +0000)]
libre2c_posix: parse repetition counters in the lexer.
Ulya Trofimovich [Mon, 14 Jan 2019 23:04:23 +0000 (23:04 +0000)]
libre2c_posix: initial support for character classes in parser.
Ulya Trofimovich [Sun, 13 Jan 2019 11:11:45 +0000 (11:11 +0000)]
libre2c_posix (test): clear error status on expected failures.
Ulya Trofimovich [Sun, 13 Jan 2019 10:57:53 +0000 (10:57 +0000)]
libre2c_posix: skip fictive tags in regexec(); handle dot in parser; added more tests.
Ulya Trofimovich [Sat, 12 Jan 2019 20:32:15 +0000 (20:32 +0000)]
libre2c_posix: use C-array initializers instead of variadic functions for offset lists.
Variadic functions cause subtle toolchain-specific errors because integer
literals used to initialize offsets may have different type than the type
expected by variadic function (e.g. int vs long).
Ulya Trofimovich [Sat, 12 Jan 2019 14:42:24 +0000 (14:42 +0000)]
libre2c_posix (test): a more concise error message.
Ulya Trofimovich [Sat, 12 Jan 2019 14:19:21 +0000 (14:19 +0000)]
libre2c_posix: fixed -Wmaybe-uninitialized GCC warning.
Ulya Trofimovich [Sat, 12 Jan 2019 14:18:21 +0000 (14:18 +0000)]
libre2c_posix: fixed memleaks.
Ulya Trofimovich [Sat, 12 Jan 2019 12:50:47 +0000 (12:50 +0000)]
Experimental: initial implementation of libre2c_posix, POSIX regexp library based on re2c.
Ulya Trofimovich [Fri, 11 Jan 2019 08:16:00 +0000 (08:16 +0000)]
Paper: don't forget to pass precedence matrices to initial closure.
Ulya Trofimovich [Fri, 11 Jan 2019 00:34:07 +0000 (00:34 +0000)]
Makefile.am: further simplify parser generation rules and avoid copying file to itself.
Ulya Trofimovich [Fri, 11 Jan 2019 00:19:01 +0000 (00:19 +0000)]
Makefile.am: don't forget to run main test suite on `make check`.
Ulya Trofimovich [Thu, 10 Jan 2019 23:28:30 +0000 (23:28 +0000)]
Makefile.am: use more universal rules for autogenerated lexers and parsers.
Ulya Trofimovich [Thu, 10 Jan 2019 22:16:07 +0000 (22:16 +0000)]
Avoid unexpected removal of untracked files and directories.
Ulya Trofimovich [Thu, 10 Jan 2019 22:09:25 +0000 (22:09 +0000)]
Moved function declarations to the header they belong in.
Ulya Trofimovich [Sun, 6 Jan 2019 16:44:45 +0000 (16:44 +0000)]
Updated range test.
Ulya Trofimovich [Sun, 6 Jan 2019 16:25:39 +0000 (16:25 +0000)]
Use a simple fixed-size slab allocator for ranges.
Ulya Trofimovich [Sun, 6 Jan 2019 08:40:16 +0000 (08:40 +0000)]
Handle single chars and 1-char ranges in the same way.
Ulya Trofimovich [Sat, 5 Jan 2019 22:53:45 +0000 (22:53 +0000)]
Updated autogenerated files after change of directory layout.
Ulya Trofimovich [Sat, 5 Jan 2019 22:49:52 +0000 (22:49 +0000)]
Moved duplicated code into a separate function.
Ulya Trofimovich [Sat, 5 Jan 2019 22:41:45 +0000 (22:41 +0000)]
Changed directory layout (cosmetic).
Ulya Trofimovich [Sat, 5 Jan 2019 13:16:36 +0000 (13:16 +0000)]
Handle EBCDIC like other encodings instead of coupling it with character validation.
Ulya Trofimovich [Sat, 5 Jan 2019 11:42:29 +0000 (11:42 +0000)]
Moved repeated code into a separate function.
Ulya Trofimovich [Fri, 4 Jan 2019 20:59:25 +0000 (20:59 +0000)]
Fixed error in range difference with EBCDIC, added tests for various encodings.
Ulya Trofimovich [Fri, 4 Jan 2019 10:53:22 +0000 (10:53 +0000)]
Compute range difference before applying encoding expansion to operands.
Ulya Trofimovich [Fri, 4 Jan 2019 19:27:58 +0000 (19:27 +0000)]
Added test for bug #238.
Ulya Trofimovich [Fri, 4 Jan 2019 12:54:03 +0000 (12:54 +0000)]
Fixed out-of-bounds write caused by misuse of slab allocator in case of large allocation size.
This fixes bug #238.
Found by american fuzzy lop (thanks to Henri Salo).
Ulya Trofimovich [Thu, 3 Jan 2019 22:56:34 +0000 (22:56 +0000)]
Adjusting formatting, dropping old macros (cosmetic).
Ulya Trofimovich [Thu, 3 Jan 2019 22:37:54 +0000 (22:37 +0000)]
Added tests for debug options.
Ulya Trofimovich [Thu, 3 Jan 2019 21:58:53 +0000 (21:58 +0000)]
Added debug options --dump-cfg and --dump-interf.
Ulya Trofimovich [Thu, 3 Jan 2019 21:17:22 +0000 (21:17 +0000)]
Moved debug stuff to a separate subdirectory.
Ulya Trofimovich [Thu, 3 Jan 2019 20:26:36 +0000 (20:26 +0000)]
Disable --dump-* options in non-debug mode.
Ulya Trofimovich [Thu, 3 Jan 2019 11:33:04 +0000 (11:33 +0000)]
Adding --enable-debug to Travis CI configuration.
Ulya Trofimovich [Thu, 3 Jan 2019 11:26:51 +0000 (11:26 +0000)]
Added some tests for GTOP closure algorithm.
Ulya Trofimovich [Thu, 3 Jan 2019 11:13:15 +0000 (11:13 +0000)]
Added test comparing POSIX closure statistics with GOR1 and GTOP.
Ulya Trofimovich [Thu, 3 Jan 2019 10:44:24 +0000 (10:44 +0000)]
In debug build, add " (debug)" to version string.
Ulya Trofimovich [Thu, 3 Jan 2019 09:53:57 +0000 (09:53 +0000)]
Small simplifications in GOR1 initialization phase.
Instead of using two stacks to weed out low-precedence initial
configurations with duplicate target state, let them remain on the
bottom of topsort stack, which effectively makes them ignored.
Ulya Trofimovich [Wed, 2 Jan 2019 22:57:51 +0000 (22:57 +0000)]
Paper: simplifying GOR1 initialization pseudocode.
Ulya Trofimovich [Wed, 2 Jan 2019 17:54:11 +0000 (17:54 +0000)]
Small cosmetic simplifications in POSIX precedence.
Ulya Trofimovich [Wed, 2 Jan 2019 17:43:17 +0000 (17:43 +0000)]
Use a specialized simplified version of POSIX comparison for initial configurations.
Ulya Trofimovich [Tue, 1 Jan 2019 13:24:10 +0000 (13:24 +0000)]
Intrinsic options that do not have configurations should be immutable.
Ulya Trofimovich [Tue, 1 Jan 2019 13:13:14 +0000 (13:13 +0000)]
Added debug option --dump-closure-stats.
Ulya Trofimovich [Mon, 31 Dec 2018 20:55:01 +0000 (20:55 +0000)]
Adjust TNFA construction for bounded repetition to the needs of GOR1.
Ulya Trofimovich [Mon, 31 Dec 2018 12:52:43 +0000 (12:52 +0000)]
Order initial configurations by POSIX precedence in GOR1.
Ulya Trofimovich [Mon, 31 Dec 2018 12:37:12 +0000 (12:37 +0000)]
Added option --posix-closure <gor1|gtop>. Removed configurations for internal options.
Ulya Trofimovich [Mon, 31 Dec 2018 12:08:42 +0000 (12:08 +0000)]
Added GTOP SSSP algorithm for computing epsilon-closure with POSIX disambiguation.
GTOP SSSP meand "Global Topsort Single Source Shortes Path".
It is well known that SSSP can be solved in linear time on DAGs (directed
acyclic graphs) by exploring graph nodes in topological order. In our case
TNFA is not a DAG (it may have cycles), but it is possible to compute fake
topologcal order by ignoring back edges.
The algorithm works by having a priority queue of nodes, where priorities
are indices of nodes in fake topological ordering. At each step, the node
with the minimal priority is popped from queue and explored. All nodes
reachable from it on admissible arcs are enqueued, unless they are already
on queue.
The resulting algorithm is of course not optimal: it can get stuck on
graphs with loops, because it will give priority to some of the loop nodes
compared to others for no good reason.
However the algorithm is simple and optimal for DAGs, therefore we keep it.
Ulya Trofimovich [Mon, 31 Dec 2018 10:57:47 +0000 (10:57 +0000)]
run_tests.sh: cleanup .inc files.
Ulya Trofimovich [Sun, 30 Dec 2018 23:35:29 +0000 (23:35 +0000)]
Converting tabs to spaces (cosmetic).
Ulya Trofimovich [Sun, 30 Dec 2018 23:30:28 +0000 (23:30 +0000)]
Eh, some of the asserts were doing useful work and affecting control flow.
Ulya Trofimovich [Sun, 30 Dec 2018 19:53:46 +0000 (19:53 +0000)]
Added assert wrapper that is turned on/off with --enable-debug configure option.
Ulya Trofimovich [Sun, 30 Dec 2018 17:21:39 +0000 (17:21 +0000)]
Fixed errors in packing of signed integers.
Ulya Trofimovich [Sun, 30 Dec 2018 11:42:38 +0000 (11:42 +0000)]
Reduce boilerplate in option parser with a few macros.
Ulya Trofimovich [Sun, 30 Dec 2018 10:59:28 +0000 (10:59 +0000)]
Use a couple of helper functions to make string construction easier.
Ulya Trofimovich [Sun, 30 Dec 2018 10:30:19 +0000 (10:30 +0000)]
Correctly parse -I option with or without space before the argument.
Ulya Trofimovich [Sat, 29 Dec 2018 21:40:08 +0000 (21:40 +0000)]
run_tests.sh: use paths relative to build directory, not to source directory.
Otherwise test results aren't reproducible: they depend on the
location of build directory relative to source directory.
Ulya Trofimovich [Sat, 29 Dec 2018 14:24:32 +0000 (14:24 +0000)]
Adding forgotten files to git.
Ulya Trofimovich [Sat, 29 Dec 2018 14:17:31 +0000 (14:17 +0000)]
More tests for include directive.
Ulya Trofimovich [Sat, 29 Dec 2018 00:16:53 +0000 (00:16 +0000)]
Resolve names of included files relative to including file, not to the main file.
Ulya Trofimovich [Sat, 29 Dec 2018 00:06:28 +0000 (00:06 +0000)]
Use correct order when unreading files from lexer buffer.
In lexer buffer nested files come before outer files. In lexer file
stack, however, outer files go before nested files (nested are at the
top). We want to break from the unreading cycle early, therefore we
proceed in reverse order of file offsets in buffer and break as soon
as the end offset is less than cursor (current position).
Ulya Trofimovich [Thu, 27 Dec 2018 22:49:25 +0000 (22:49 +0000)]
Simplified lexing of include directive.
Ulya Trofimovich [Thu, 27 Dec 2018 22:38:59 +0000 (22:38 +0000)]
Tweaking a couple of labels in lexer to simplify updating of token pointer.
Ulya Trofimovich [Thu, 27 Dec 2018 22:17:52 +0000 (22:17 +0000)]
Removed unused struct field.
Ulya Trofimovich [Thu, 27 Dec 2018 22:10:49 +0000 (22:10 +0000)]
Added test for EOF rule.
Ulya Trofimovich [Thu, 27 Dec 2018 22:08:38 +0000 (22:08 +0000)]
Track current line of each input file separately.
Ulya Trofimovich [Wed, 26 Dec 2018 20:12:51 +0000 (20:12 +0000)]
Correctly handle current directory '.' in include paths.
Ulya Trofimovich [Wed, 26 Dec 2018 11:37:30 +0000 (11:37 +0000)]
Added -I option (paths to include directories).
Ulya Trofimovich [Tue, 25 Dec 2018 19:53:23 +0000 (19:53 +0000)]
Added /*!include:re2c ... */ directive.
Ulya Trofimovich [Sun, 23 Dec 2018 19:32:29 +0000 (19:32 +0000)]
Preparations to support #include: keep input files in a stack.
Ulya Trofimovich [Sun, 23 Dec 2018 19:16:02 +0000 (19:16 +0000)]
configure.ac: set -Wreturn-type to error.
Ulya Trofimovich [Sat, 22 Dec 2018 23:34:41 +0000 (23:34 +0000)]
Initial support of EOF rule.
Ulya Trofimovich [Sat, 22 Dec 2018 11:48:12 +0000 (11:48 +0000)]
Updated unicode tests and test generators for newer versions of unicode.
Ulya Trofimovich [Thu, 20 Dec 2018 00:06:42 +0000 (00:06 +0000)]
Paper: added two output() functions that convert t-string to parse tree and offsets.
Ulya Trofimovich [Tue, 18 Dec 2018 23:56:04 +0000 (23:56 +0000)]
Paper: tweaked TNFA construction.
Ulya Trofimovich [Thu, 6 Dec 2018 22:03:34 +0000 (22:03 +0000)]
Lexer: use YYMAXFILL padding and don't forget to shift tag variables in YYFILL.
This fixes bug #232, #233 and #234.
Found by american fuzzy lop (thanks to Henri Salo).
Ulya Trofimovich [Thu, 6 Dec 2018 22:01:25 +0000 (22:01 +0000)]
Correctly identify mapped TDFA state with --dump-dfa-raw option.
Ulya Trofimovich [Thu, 29 Nov 2018 22:21:43 +0000 (22:21 +0000)]
Makefile.am: enable RE2C warnings (-W option).
Ulya Trofimovich [Thu, 29 Nov 2018 22:15:18 +0000 (22:15 +0000)]
Fixed read past the end of buffer in configuration parser.
This fixes bug #231.
Found by american fuzzy lop (thanks to Henri Salo).
Also reported by re2c -W (shame on me for not using it all this time!).
Ulya Trofimovich [Mon, 26 Nov 2018 22:58:14 +0000 (22:58 +0000)]
Paper: tweaking TNFA construction.
Ulya Trofimovich [Thu, 22 Nov 2018 01:00:57 +0000 (01:00 +0000)]
Makefile.am: build autogenerates files before other targets (they may create headers).
Note: I used $(@:cc=*) construct as bmake doesn't understand $*.* .
Ulya Trofimovich [Wed, 21 Nov 2018 22:03:12 +0000 (22:03 +0000)]
Use tags to lex condition goto.
Ulya Trofimovich [Wed, 21 Nov 2018 00:15:15 +0000 (00:15 +0000)]
Started using tags in re2c own lexer.
Ulya Trofimovich [Mon, 19 Nov 2018 23:38:07 +0000 (23:38 +0000)]
Removed redundant wrapper around output file struct.
Ulya Trofimovich [Mon, 19 Nov 2018 23:22:33 +0000 (23:22 +0000)]
Dump header on stdout if filename is not set, but /*!header:re2c:on*/ is used.
Ulya Trofimovich [Fri, 16 Nov 2018 23:43:41 +0000 (23:43 +0000)]
Added configurations for -o, --output and -t, --type-header options.
Ulya Trofimovich [Sun, 18 Nov 2018 12:19:27 +0000 (12:19 +0000)]
Added missing #line info after /*!header:re2c: ... */ directive.
Renamed:
/*!header:re2c:1*/ -> /*!header:re2c:on*/
/*!header:re2c:0*/ -> /*!header:re2c:off*/
Ulya Trofimovich [Sun, 18 Nov 2018 10:50:00 +0000 (10:50 +0000)]
Added /*!header:re2c:0*/ and /*!header:re2c:1*/ directives.
Combined with -t, --type-header option, this allows to put arbitrary
parts of the generated output in a header file.
Ulya Trofimovich [Fri, 16 Nov 2018 00:36:11 +0000 (00:36 +0000)]
Tweaking condition list lexer.
Ulya Trofimovich [Wed, 21 Nov 2018 21:54:58 +0000 (21:54 +0000)]
Merge pull request #230 from sergeyklay/patch-1
Changes for upcoming Travis' infra migration
Serghei Iakovlev [Wed, 21 Nov 2018 20:23:09 +0000 (22:23 +0200)]
Changes for upcoming Travis' infra migration
See: https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration
Ulya Trofimovich [Thu, 15 Nov 2018 07:33:25 +0000 (07:33 +0000)]
Fixed segfault cause by out of bounds access.
This fixes bug #227.
Found by american fuzzy lop (thanks to Henri Salo).
Ulya Trofimovich [Wed, 14 Nov 2018 22:58:47 +0000 (22:58 +0000)]
Moved tests into subdirectories.
Ulya Trofimovich [Tue, 13 Nov 2018 23:42:11 +0000 (23:42 +0000)]
Fixed a couple of lexer/parser errors in flex mode (-F option).
This fixes bug #229: re2c option -F (flex syntax) broken,
reported by Robert van Engelen.
A well-formed example that caused syntax error (flex-style raw literal
followed by one or more spaces and a curly brace):
/*!re2c
a {}
*/
The faulty behaviour goes back as far as re2c-0.13.6 (and supposedly
before that): in flex mode, raw literal may occur in various contexts
both as a regexp (string literal) and an identifier (named definition,
condiiton name). RE2C uses lookahead to infer the context and determine
the appropriate type of lexer token, but it missed some cases.
The fix has two sides. First, if reduces the number of contexts where
the general lexer may encounter raw literal (by using specialized lexers
for condition lists <x,y,...,z> and condition goto => and :=>). Second,
it fixes the lookahead regexps used for context inference.
Also added a bunch of tests (generated by a script).
Ulya Trofimovich [Tue, 13 Nov 2018 23:38:02 +0000 (23:38 +0000)]
Suppress -Wnullable warning on <> condition (it has no regexp -- always empty).
Ulya Trofimovich [Mon, 5 Nov 2018 23:35:11 +0000 (23:35 +0000)]
Adjusting formatting (cosmetic).
Ulya Trofimovich [Sun, 4 Nov 2018 22:38:56 +0000 (22:38 +0000)]
Fixed out of bounds read in configuration lexer (not handling EOF in configuration value).
Found by american fuzzy lop (thanks to Henri Salo).
Ulya Trofimovich [Thu, 1 Nov 2018 00:01:25 +0000 (00:01 +0000)]
Small tweaks in lexer subroutines for semantic actions.
Ulya Trofimovich [Wed, 31 Oct 2018 23:15:28 +0000 (23:15 +0000)]
Fixed yet another out of bounds read in lexer due to not handling EOF after escape.
Found by american fuzzy lop (thanks to Henri Salo).
Ulya Trofimovich [Tue, 30 Oct 2018 22:11:32 +0000 (22:11 +0000)]
Fixed some more out of bounds reads in lexer due to not handling EOF properly.
Found by american fuzzy lop (thanks to Henri Salo).