Commit graph

7435 commits

Author SHA1 Message Date
overflowerror
a5df42591b fixed problem with context analysis
non-trivial quantifiers in context path are not handled correctly.

change to getNextElementsInContext():
add non-trivially quantified elements in path (except first element
because of potential endless recursion) to result set
2022-01-14 17:22:15 +01:00
overflowerror
e5f08c34aa fixed bug in context analysis
when the following context element is optional, the minimal sequence is
not going to get bigger. in this case further context analysis is
blocked by the exception.
=> removed exception

also made sure getNextElementsInContext() won't return non-token,
non-compound elements like actions or predicates.
2022-01-11 22:07:33 +01:00
overflowerror
edbc920247 changed token limit for tree rebuild
is necessary because otherwise the identity analysis might not be able
to detect if paths are identical up to the token limit (which should
cause an error)
2022-01-07 20:44:36 +01:00
overflowerror
8fac71dda9 added comment to failing test case
testRecursiveRuleCallingAlternative_expectCorrectGuard

guard for nested alternatives might not be optimal if the positions that
discriminate in the first alternatives is different from the positions
needed on the next one
2021-12-25 16:41:19 +01:00
overflowerror
428dfb93d0 fixed path collapse
collapsed paths loose the containing token guard
=> fixed problem
+ added positional condition in token sequence guard constructor to not
check positions twice (order matters: give local token guard first in
case it is sufficient)

removed testNestedAlternativesWithSingleTokenDifference, because it is
wrong: 'a' 'b' 'd' with p1 satisfies semantic predicates but not the
generated guard condition
2021-12-25 16:10:54 +01:00
overflowerror
a83e3627cc disabled recursive debugging outputs for testing 2021-12-23 18:25:30 +01:00
overflowerror
ebef309674 fixed problem with unordered groups and non-trivial cardinalities in
nested prefix alternatives analysis

now flattenPaths() considers following repetitions

new problem: unordered groups and non-trivial cardinalities without
non-optional elements causes explosion of generated alternatives, which
in turn cause the identity analysis to go out of control
example: S: ('a'? | 'b'?)+
with a token limit of 10 the nested prefix alternatives analysis would
generate over 1300 alternatives

current quick fix: limit of alternatives
2021-12-23 18:13:52 +01:00
overflowerror
36f790b37b fixed test cases concerning identical paths and nested prefix paths 2021-12-17 21:59:00 +01:00
overflowerror
2726ec0e09 removed unnecessary parenthesis from rendered output 2021-12-17 21:52:25 +01:00
overflowerror
be80d5ffbc added basic support for nested prefix alternatives
after minimal path difference analysis failed, flatten paths (limited by
token limit; justification: identity check would error out if paths are
not distinguishable within the limit) and recompute alternative guard.
now nested prefixes will be collapsed with all corresponding guard
conditions
2021-12-17 21:18:59 +01:00
overflowerror
45d2df5c33 fixed uninitialized hoisting processer
moved init before generateFile
used flattenedGrammar instead of original grammar (it)
2021-12-14 15:13:35 +01:00
overflowerror
94a3601dff fixed identical path analysis to consider prefixes 2021-12-13 16:58:10 +01:00
overflowerror
d8ee388b31 basic support for context analysis in unordered groups 2021-12-10 17:33:28 +01:00
overflowerror
08b240eed4 added more test cases for context analysis 2021-12-09 19:43:05 +01:00
overflowerror
0a6b1b69c9 added support for context analysis with optional cardinalities
unordered groups not yet working properly
2021-12-09 19:30:19 +01:00
overflowerror
d2c6a46071 fixed context analysis not able to see context tokens
added toString methods in guard classes for debugging
2021-12-08 20:17:15 +01:00
overflowerror
372d0a4a01 basic support for simple prefix paths 2021-12-08 18:45:54 +01:00
overflowerror
621f37874f changed terminal token condition to use LA syntax 2021-12-07 18:55:01 +01:00
overflowerror
8d34bc2a23 fixed non-optimal guard with nested groups
nested groups produce non-optimal guard (redundant parentheses)
-> group guard now adds elements of groups instead of the group itself

added test case
2021-12-05 18:31:57 +01:00
overflowerror
83232e5a43 fixed bug with alternatives containing unordered groups
gave exception in token analysis
-> added handling for unordered groups to token analysis

added test case
2021-12-05 18:18:18 +01:00
overflowerror
13aef9e99b fixed problem with unsupported constructs in unguarded rules 2021-12-04 18:36:50 +01:00
overflowerror
62e9d44a64 added SynStateTypes for semantic predicates and java actions 2021-12-04 18:13:23 +01:00
overflowerror
0ad55d42cc render predicates for non-trivial-cardinalities 2021-12-04 18:03:41 +01:00
overflowerror
1058d2bf3c changed unordered group hoisting to just use + instead
cardinality * is only possible if all element in the unordered group are
optional. This case doesn't matter for hoisting or rather is already
dealt with in the containing group (the guard of the resulting
alternatives won't have a terminal).
2021-12-04 17:28:45 +01:00
overflowerror
1d4b649755 hoisting in unordered groups uses one or more cardinality if it contains
non-optional elements

TODO: fix special case in anlternatives hoisting
2021-12-02 21:36:05 +01:00
overflowerror
2303cce7c4 added hoisted predicates to unordered group rendering 2021-12-02 21:21:16 +01:00
overflowerror
f23274e072 fixed problem with clone method by using EcoreUtil.copy instead 2021-12-02 21:19:27 +01:00
overflowerror
b3e48838f3 changed grammar generator to not render gated semantic predicates 2021-12-02 20:37:13 +01:00
overflowerror
8e1fa55e7d fixed bug that identical paths are deleted in the original ecore objects 2021-12-02 17:26:39 +01:00
overflowerror
3f665c0d39 fixed null ptr in debugging output on virtual/floating elements 2021-12-02 17:24:48 +01:00
overflowerror
5f136cf262 added short string function to debug utils 2021-11-30 20:54:53 +01:00
overflowerror
967f491402 added init block rendering to ContentAssistGrammarGenerator 2021-11-30 20:09:11 +01:00
overflowerror
365de63327 temporary fix for missing SynStateType for new elements in
SyntacticSequencer
2021-11-30 19:59:14 +01:00
overflowerror
b4deb67876 fixed problem with recursive rule calls in debug function 2021-11-30 19:54:38 +01:00
overflowerror
a6993a01f7 refactoring, better exception handling, changes to error detection
exception messages now contain the the rule that caused the problem
2021-11-29 21:12:02 +01:00
overflowerror
5aba8ab724 collapse nested alternatives to reduce generated code
doesn't work if nested alternative is in nested group
doesn't work if nested alternative is in merged path
2021-11-29 18:33:45 +01:00
overflowerror
2dc2b23ad9 added test cases for simplifying nested alternatives & unordered groups 2021-11-29 18:20:08 +01:00
overflowerror
8d5af71314 added basic support (sub optimal) support for unordered groups 2021-11-27 20:30:31 +01:00
overflowerror
5110d180b7 added hosting test for unordered groups 2021-11-27 19:50:44 +01:00
overflowerror
ef91f872ef added support for enum rules in hoisting code 2021-11-27 19:44:38 +01:00
overflowerror
7f352990a4 added test cases for enum rules 2021-11-27 19:25:25 +01:00
overflowerror
7925e2040f return alternative guard analysis if all paths are trivial 2021-11-27 19:23:43 +01:00
overflowerror
5fdb3424ac refactoring of hoisting code 2021-11-27 18:37:24 +01:00
overflowerror
cb606d6937 add test for alternatives with only unguarded paths 2021-11-27 16:55:38 +01:00
overflowerror
61847d2d82 added limit cache for mindiff analysis
save first index that causes the tokens to be exhausted as the new limit
2021-11-27 16:50:37 +01:00
overflowerror
6055348451 added alternative guard conditions for
AntlrContentAssistGrammarGenerator
2021-11-27 16:25:16 +01:00
overflowerror
58e3bba502 changed check for token-based path identity to be boundary test
+ changed default token limit to 10
+ prepared test for symbolic identity analysis
2021-11-27 16:04:53 +01:00
overflowerror
cd0629d828 fixed testAlternaitves in FirstSetComputationTest 2021-11-27 15:37:55 +01:00
overflowerror
bf970d77fd fixed hoisting processor to corresponding tests succeed 2021-11-25 16:58:37 +01:00
overflowerror
21125ebc46 added test cases for hoisting processor 2021-11-25 16:57:26 +01:00