Commit Graph

118 Commits

Author SHA1 Message Date
Andrea Cavalli da387d1165 Removed old libraries 2019-11-01 15:25:01 +01:00
Riccardo Azzolini a74f047655 Fix/improve hashCode for Functions
Some types of Function had hashCode methods which didn't match the
behavior of equals, while others could simply be rewritten in a simpler
way by using Objects.hash.
2019-10-25 22:48:49 +02:00
Riccardo Azzolini 0c316226e6 Make Function.equals test for exact equality instead of equivalence
Actually, testing for equivalence was only partially implemented (by
considering the commutative property for some FunctionOperators).

Additionally, should it be needed in the future, equivalence testing
would probably be better implemented as a separate, specialized method
anyway.
2019-10-25 22:30:10 +02:00
Riccardo Azzolini d8f401cb22 Remove zip file handling code and zip4j dependency
.zip files were only used to cache compiled Java rules, and the new rule
system has nothing to cache.
2019-10-25 20:49:31 +02:00
Riccardo Azzolini 12406c787b Ensure that lex and parse methods are only called once per instance 2019-09-09 18:34:52 +02:00
Riccardo Azzolini c37f7f52b3 Specify that TabExpandedString only works on single lines 2019-09-09 18:34:52 +02:00
Riccardo Azzolini 804fee4db0 Use tab-expanded column numbers when formatting DSL errors 2019-09-09 18:34:52 +02:00
Riccardo Azzolini b3f2ad82d0 Migrate from JUnit 4 to 5 2019-09-09 18:34:52 +02:00
Riccardo Azzolini 082f694b1b Tweak DSL error formatting
- Add a blank line between the DslFilesException stack trace and
   formatted error messages.
 - Quote the sub-function name in the message for UndefinedSubFunction
   errors.
2019-09-09 18:34:52 +02:00
Riccardo Azzolini fbb6cf590d Throw an exception when a sub-function is undefined in SubFunctionPattern.replace 2019-09-09 18:34:52 +02:00
Riccardo Azzolini feb894bacd Improve SubFunctionPattern documentation 2019-09-09 18:34:52 +02:00
Riccardo Azzolini b4fc6dd019 Improve PatternRule documentation 2019-09-09 18:34:52 +02:00
Riccardo Azzolini eb8fcaafb9 Keep track of identifiers separately for each SubFunctionPattern object 2019-09-09 18:34:52 +02:00
Riccardo Azzolini c8656d1b30 Improve DSL front-end documentation 2019-08-12 11:28:39 +02:00
Riccardo Azzolini e297d3592f Reduce creation of Map objects in Pattern matching 2019-08-12 11:28:39 +02:00
Riccardo Azzolini 2b9fb97648 Make DSL rule loading work on TeaVM 2019-08-12 11:28:39 +02:00
Riccardo Azzolini fef30042ce Avoid using methods which are not available on TeaVM 2019-08-08 14:36:07 +02:00
Riccardo Azzolini d4b91c4d4f Merge branch 'master' into rules-dsl 2019-08-08 12:52:59 +02:00
Riccardo Azzolini 7819e19e6f Make Function visitor an inner interface of Function 2019-08-07 13:11:59 +02:00
Riccardo Azzolini aeb0388925 Implement DSL error pretty-printing 2019-08-07 13:11:59 +02:00
Andrea Cavalli c906c43b8b Updated TeaVM to the latest snapshot and fixed panels history behaviour 2019-02-25 13:12:22 +01:00
Riccardo Azzolini 788f9663e2 Use Collections.emptyMap and Collections.singletonMap in pattern matching code 2019-02-12 11:40:50 +01:00
Riccardo Azzolini 04d01565da Correctly handle and report unterminated multiline comments in Lexer 2019-02-11 16:31:03 +01:00
Riccardo Azzolini e86a7a6346 Remove Java rule compiling and loading code 2019-02-11 15:55:29 +01:00
Riccardo Azzolini fd074b16b7 Do not load DSL rules on JavaScript platforms 2019-02-11 15:11:59 +01:00
Riccardo Azzolini b9c025d74c Make function rules built-in 2019-02-10 19:59:38 +01:00
Riccardo Azzolini df5de92931 Make NegativePattern match and produce negative numbers 2019-02-10 19:05:13 +01:00
Riccardo Azzolini d18e2d3708 Test the content of DslAggregateExceptions in RulesDslTest 2019-02-07 20:20:58 +01:00
Riccardo Azzolini e65f20382f Document the RulesDsl class and its makeRules method 2019-02-04 18:07:51 +01:00
Riccardo Azzolini 92ad2a9c1e Remove unused imports 2019-01-31 20:39:56 +01:00
Riccardo Azzolini 57011ceb86 Make EquationsSystemPattern patterns field private (was accidentally package-private) 2019-01-31 20:38:35 +01:00
Riccardo Azzolini 8eba0cd568 Correctly store sub-function identifiers for rules with the same name and identical rules 2019-01-31 19:23:37 +01:00
Riccardo Azzolini 2a347e6d19 Allow unary operators in power exponent 2019-01-31 13:10:02 +01:00
Riccardo Azzolini ebbf8b013a Replace DslException with the DslError interface and the SyntaxException wrapper 2019-01-31 12:55:15 +01:00
Riccardo Azzolini 0d89711772 Report DSL errors from RulesDsl.makeRules as a DslAggregateException 2019-01-30 21:47:00 +01:00
Riccardo Azzolini f930242ee8 Properly report undefined sub-functions in replacement patterns 2019-01-30 21:47:00 +01:00
Riccardo Azzolini 3a5ccdfc13 Keep track of sub-function identifier tokens for error reporting 2019-01-30 21:47:00 +01:00
Riccardo Azzolini bdb1fc738e Implement multiple error reporting and recovery in Parser 2019-01-30 21:47:00 +01:00
Riccardo Azzolini f0d2cdc1ab Implement multiple error reporting and recovery in Lexer 2019-01-29 12:08:35 +01:00
Riccardo Azzolini 1e0d2e5a0e Create base class for DSL exceptions 2019-01-28 21:13:24 +01:00
Riccardo Azzolini 1304755c25 Implement loading of DSL rules 2019-01-28 18:19:27 +01:00
Riccardo Azzolini c00b71e2ba Remove unneeded throws spec from PatternRule.execute 2019-01-27 21:18:53 +01:00
Riccardo Azzolini bea2eb67c8 Check that sub-functions in replacement patterns are defined 2019-01-27 21:18:53 +01:00
Riccardo Azzolini ba468d199a Add method to get sub-functions from patterns 2019-01-27 21:18:44 +01:00
Riccardo Azzolini 591813402d Prevent instantiation of PatternUtils 2019-01-27 19:56:18 +01:00
Riccardo Azzolini a92c3a3272 Implement and test RulesDsl.makeRules 2019-01-27 19:24:49 +01:00
Riccardo Azzolini 6ab69a1613 Implement and test Parser (with temporary error handling) 2019-01-27 19:24:49 +01:00
Riccardo Azzolini b959fac770 Implement equals (and hashCode) in PatternRule and patterns for testing 2019-01-27 19:24:49 +01:00
Riccardo Azzolini 27b128a6ea Add single and multi-line comments 2018-11-23 18:52:36 +01:00
Riccardo Azzolini da91a5df33 Implement Lexer (with temporary error handling and basic tests) 2018-11-22 20:04:48 +01:00