0.0.8 2006/08/09: - When compiling grammar rules, avoid updating rules that are already being compiled. Such double-updates resulted in lost trimming rules. Added trimAndRecursion test case to make sure this bug does not resurface. Synced parsing tree images of old test cases that suffered from this bug. - Reworked left recursion handling. The old code would stop the left recursion immediately after repeated parsing tree paths were found (without consuming any input). That logic was too aggressive because parsing progress is made not only by consuming input (the left side of the parsing tree) but also by building the right side of the parsing tree (i.e., rules that must match later). The old code could stop recursion before rules like G=*(G a) could produce enough "a"s to match the "aaaaaaaa" input, for example. The new code computes the minimum input size a rule is expected to consume and uses non-zero sizes to measure progress. If cumulative minimum size exceeds actual input length, then a different parsing path needs to be tried. This change results in correct handling of test cases like leftRecursion or indirectRecursion with larger input sizes (that would cause the old code to fail). The change also leads to slightly different parsing trees when the parser is allowed to be more greedy upfront, yielding deeper/longer left-most branches of a parsing [sub]tree. It is possible that parsing large inputs at once, while using a grammar with left recursion may take much more RAM and time than before because Hapy may have to let the recursion to build the deepest possible tree before it can know where to cut the repetition. Future look-ahead optimizations should help with this, but it would probably always be possible to design a grammar and input that would yield unacceptable performance. Think, for example, of a C++ grammar and an invalid input with thousands of nested block statements. In practice, we may have to add an optional knob to artificially limit the depth of left recursion. The "pure" alternative is [still] to rewrite the grammar to avoid left recursion, of course. Synced parsing tree images of old test cases affected by this change. - Polished debugging, including automatic naming of anonymous rules. - Improved test cases. 0.0.7 2006/07/10: - Fixed action setting via the [] operator (SourceForge bug #1023215). The action-carrying copy of the original rule now preserves commitment state and other properties of the original rule. Rewrote how the Rule class is initialized and copied to enable this fix. This is a relatively big change. While the new code passes all test cases, application-specific testing is recommended before switching to this version. - Fixed string prefix matching bug that caused partial prefixes to result in "miss" rather than "need more data" parsing outcomes (reported by Romain Behar). - Fixed First.cc compilation on VS .net 2003 (Tom Glastonbury) - Fixed compilation on systems that look in supplied -I directories before looking in system include directories (e.g., GCC 4.0 on MacOS loads Hapy/String.h instead of /usr/include/string.h) - Made GCC 3.4 happier. - Added and improved test cases. Check that when input is accepted, the generated Parsing Tree matches the expected one. Added "expected trees" to old test cases without manual verification. Thus, some of them may be wrong, but at least we can use the current trees for regression testing. - Upgraded automake to 1.9.6. Upgraded libtool to v1.5.22. Polished build files. 0.0.6 2004/05/13: - Allow Parser::parse() to be called multiple times. No need to explicitly reset the parser; the parser is reset automatically whenever parse() is called. - Added ability to supply actions inline, through Rule's subscript[] operator - Got rid of now-gone ptr_action Action wrapper; using action() directly or new subscript[] operator should work instead; Action uses templated method; this may not be portable and should probably be checked in ./configure - Added "Attaching Action to a Rule" section to "Actions" documentation page, explaining old Rule's action() method and newly added subscript[] operator - Added optional command line options to TestMaker, to control the shape of generated test cases: generate test cases that use one parser per clause or one parser per case; generate test cases that feed all input at once or one input octet at a time. The later is not supported yet. Defaults have not changed. - Generate and execute "shared parsers" and "encapsulated parsers" tests using newly added TestMaker command-line options - Temporary disabled a parsing optimization that failed tests for some recursive grammars (causing infinite loop during parser initialization) 0.0.5 2004/03/04: - enable debugging if the code writer did not explicitly prohibit it by calling Rule::Debug(false), and the code runner set the HAPY_DEBUG environmental variable to "USER"; this allows debugging of previously compiled programs without modifying their code - parsing speed and greed optimizations - added dedicated user-level interfaces for controlling debugging and optimization: Hapy::Debug() and Hapy::Optimize() - when debugging, report rejection due to left recursion or empty sequence repetition - use AX_PREFIX_CONFIG_H autoconf macro to prefix config.h #defines with a HAPY_ prefix, to avoid conflicts with other libraries using autoconf - do not #include config.h if HAVE_CONFIG_H or HAPY_HAVE_CONFIG_H is not defined; always include Top.h though - changed left recursion detection algorithm to take care of cases where the parsing rule is repeated without visible progress but the second appearance may lead (once the duplicate path is rejected) to a different path, making progress; added an indirectRecursion test case to make sure we always handle this kind of recursion correctly - added UselessRecursion test case, mainly to test handling of A = A kind of rules; this test case exposed the problem with the negative operator (A - B): when placed at the top of the grammar, the exceptional rule (B) may not match end of input while the user may expect it to; explicit end_r rule would be required to parse (A - B) correctly at the top of the grammar - Pree::rid() now returns RuleId, not int 0.0.4 2004/02/04: - added char_range_r(first,last) rule to match any character in the specified [first,last] inclusive range - added char_set_r(string) rule to match any character in the specified string - added action interface; a rule can now be augmented with an action that gets triggered when the rule matches; an action can confirm the match, generate a parsing error, or reject the match with a miss; the latter causes new matches to be found; the action is called before the rule commits - added find_if(node,f) function to search for a parsing tree node for which f() returns true - polished and documented debugging mechanisms - use loops instead of indirect recursion when backtracking through alternatives; recursion can easily run out of [stack] memory when dealing with huge invalid inputs and character-at-a-time rules; not all algorithms were checked for recursion loops so this may need more work - avoid polluting macro name space with VERSION and PACKAGE* #defines in config.h; such pollution prevented seemless integration of Hapy with other packages 0.0.3 2004/01/12: - added RuleId class to hold Rule identifiers (used to be integers); switched to new RuleId-based construction of user-level Rules; one no longer can specify Rule IDs, but can only extract auto-assigned ones if needed; this avoids extra ink in some cases and might make integration of 3rd party rules easier - when Parser::parse() interface is used, assume that all input must be consumed to report a successful match; that is, end_r becomes implied and users no longer need to specify it explicitly if they use the simple Parser::parse() interface. - do not build examples, tests, and doc programs when running "make" only "make check" builds them now; the intent is to increase chances of having a functional "make install" even if some examples/tests (i.e., non-essential features) fail to compile - support and use implicit conversion from char to char_r; grammar rules can now use characters directly, without a char_r wrapper - parser debugging is now controlled by the Rule::Debug(bool) call rather than the HAPY_DEBUG #define - increased parsing speed and decreased parser memory consumption in some common cases - benchmarking methodology is now documented and is being reviewed by other parser generation projects prior to getting "officially" published. - MS Visual Studio .NET 2003 portability fixes - GCC 3.2 portability fixes - fixed parsing tree node memory leaks (known since 0.0.1) - enabled most GCC warnings by default 0.0.2 2003/12/25: - ported Hapy to GCC 3.2.2 by being careful about std namespace - avoid 'using namespace Hapy' when defining class methods because MS VC compiler does not like it in combination of explicit Hapy:: prefixes in method names; explicit prefixes are probably essential to keep - optional ("!") rule now produces correct parsing tree - polished and documented prefix parsing interface - changed quoted_r profile to match documentation and avoid implication that character-to-rule conversion works - added a simple "interactive" calculator to illustrate some of the techniques common to parsing a stream of "messages". In this case, a message is an arithmetic expression. - config.h in the source directory was referenced instead of the one created by configure in the built directory; it was also distributed - disable default skipping of whitespace by cin stream in examples - added test cases for the option rule - added GiovanniChallenge backtracking test cases 0.0.1 2003/12/18: - first release