Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO-NOT-MERGE] Enable new parser test for CI check in relation to incubator-kie-drools/pull/5989 #5990

Closed
wants to merge 127 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
9f48f0f
[DROOLS-7591] Experiment branch : migrate a new drools-lsp parser int…
tkobayas Feb 14, 2024
4d20c37
Revert "[DROOLS-7591] Experiment branch : migrate a new drools-lsp pa…
mariofusco Feb 14, 2024
0d54513
add antlr4 based drl parser
mariofusco Jan 14, 2022
9bc7188
bump to drools 8.16.0.Beta
mariofusco Jan 20, 2022
b309bdd
improve node position discovery
mariofusco Jan 27, 2022
300fb05
first c3 integration
mariofusco Jan 28, 2022
30ae2c6
Module reorganization (#2)
gitgabrio Feb 10, 2022
ab19cb7
manage null ast nodes and fix failing test
mariofusco Feb 11, 2022
a6f631d
improve drl parser
mariofusco Feb 14, 2022
5ff116d
Fix basic completion (#4)
lbenc135 Mar 25, 2022
42b893e
add constraints parsing
mariofusco Apr 22, 2022
c936ed7
- Added DRLParserWrapper to store errors using DRLErrorListener (#5)
tkobayas Apr 27, 2022
bad33de
Enhance test/grammar coverage. function import, global, exists, not (#6)
tkobayas May 10, 2022
80cede2
Enhance test/grammar coverage. and, or, listExpression (#7)
tkobayas May 29, 2022
1adc7ca
Enhance test/grammar coverage. matches, single quoted string, escape …
tkobayas Jun 27, 2022
6009ccf
Enhance test/grammar coverage. dialect, invalid lhs (#10)
tkobayas Aug 15, 2022
bdbd59e
Enhance test/grammar coverage. keyword collision (#11)
tkobayas Sep 22, 2022
6e7e3a9
Enhance test/grammar coverage. function, attributes, consequence (#12)
tkobayas Oct 5, 2022
98ca5ba
Enhance test/grammar coverage. OR, inline map (#13)
tkobayas Nov 3, 2022
30d16ec
OpenRewrite applied for junit5 and assertj (#14)
tkobayas Nov 30, 2022
0257be5
Enhance test/grammar coverage. label, consequenceLocation, test refac…
tkobayas Dec 6, 2022
57e60dc
[DROOLS-7253] Review and improve drools-lsp parser Visitor design (#16)
tkobayas Dec 16, 2022
20d4e90
[DROOLS-7270] Enhance test/grammar coverage : andRestriction, orRestr…
tkobayas Jan 12, 2023
b1e31dd
[DROOLS-7271] Fully port RuleParserTest as MiscDRLParserTest with @Di…
tkobayas Jan 30, 2023
cfcc06c
[DROOLS-7285] Failed to parse and/or with parentheses in LHS (#15)
tkobayas Mar 13, 2023
b664cc3
[DROOLS-7286] Failed to parse binding with || (#21)
tkobayas May 18, 2023
9b9f450
[DROOLS-7287] Failed to parse comments in RHS (#23)
tkobayas Jul 19, 2023
5be971d
[DROOLS-7515] Parser : Accept plain text in RHS (#26)
tkobayas Aug 14, 2023
b199302
[DROOLS-7288] Failed to parse complex parentheses (#27)
tkobayas Aug 24, 2023
246ab9f
[DROOLS-7289] Implement accumulate (#28)
tkobayas Sep 20, 2023
4e54ae8
[DROOLS-7296] Implement from entry-point (#30)
tkobayas Sep 21, 2023
20e7bc2
[DROOLS-7297] Implement import accumulate (#29)
tkobayas Sep 22, 2023
c3d7b43
[DROOLS-7290] Implement BigInteger literal, BigDecimal literal (#31)
tkobayas Sep 22, 2023
47c7fe0
[DROOLS-7292] Implement eval (#32)
tkobayas Sep 22, 2023
424a157
[DROOLS-7293] Implement extends (#33)
tkobayas Sep 25, 2023
45f12e3
[DROOLS-7294] Implement forall (#34)
tkobayas Sep 29, 2023
8eae710
[DROOLS-7298] Implement memberOf (#35)
tkobayas Oct 3, 2023
b41571e
[DROOLS-7300] Implement positional constraint (#36)
tkobayas Oct 3, 2023
a1cd58c
[DROOLS-7304] Implement temporal operators (#38)
tkobayas Oct 13, 2023
224ee2f
[DROOLS-7301] Implement query (#37)
tkobayas Oct 13, 2023
fe24e25
[DROOLS-7295] Implement from collect (#39)
tkobayas Oct 18, 2023
cf17979
[DROOLS-7305] Implement type declaration (#40)
tkobayas Oct 18, 2023
0e17748
[DROOLS-7306] Implement unification (#41)
tkobayas Oct 20, 2023
1ad6eb4
[DROOLS-7310] parse nested parentheses (#42)
tkobayas Oct 27, 2023
6f64320
[DROOLS-7577] drools-lsp : Add comments and explanations for drools-p…
tkobayas Nov 17, 2023
15c3f5d
[DROOLS-7591] Experiment branch : migrate a new drools-lsp parser int…
tkobayas Dec 5, 2023
8451292
Move necessary files without any additional modifications
yurloc Jan 15, 2024
3703556
Update DRL6Expressions.g4 to ANTLR 4 (#47)
yurloc Jan 17, 2024
1983875
Add DescrDumperTest and fix the expression parser grammar (#48)
yurloc Feb 7, 2024
dd3402a
[DROOLS-7591] Experiment branch : migrate a new drools-lsp parser int…
tkobayas Feb 9, 2024
b1563ee
- License header
tkobayas Feb 13, 2024
1efe247
[incubator-kie-drools#5681] Experiment: New DRL Parser : Test failure…
tkobayas Feb 20, 2024
629b3eb
[incubator-kie-drools#5679] New DRL parser : Test failure : RHS end w…
tkobayas Feb 21, 2024
ece43d2
[incubator-kie-drools#5700] [new-parser] Can't use single-quoted Stri…
tkobayas Feb 26, 2024
c805b14
[incubator-kie-drools#5701] org.kie.api.KieBase.getRule(String, Strin…
tkobayas Feb 26, 2024
7e60b10
Fix super_key failed predicate (#5748)
yurloc Feb 29, 2024
d0bfc9e
Fix minor issues in the new parser (#5747)
yurloc Feb 29, 2024
b099dc2
[incubator-kie-drools#5743] Update Developer_Notes.md to be community…
tkobayas Mar 4, 2024
b184788
Fix the rest of the keywords (#5759)
yurloc Mar 5, 2024
2cc9f10
[incubator-kie-drools#5705] [new-parser] no viable alternative after …
tkobayas Mar 7, 2024
0e4f2af
[incubator-kie-drools#5707] [new-parser] null-safe dereferencing brok…
tkobayas Mar 9, 2024
e52b30c
Add error listener to DrlExprParser (#5778)
yurloc Mar 13, 2024
c0004f3
[incubator-kie-drools#5776] [new-parser] failed to parse when a metho…
tkobayas Mar 18, 2024
3a7d63c
Primary rule should accept `this` keyword (#5791)
yurloc Mar 18, 2024
2a4d9dc
[incubator-kie-drools#5706] Grouped accessors for nested objects brok…
tkobayas Mar 19, 2024
8ec4736
[incubator-kie-drools#5709] [new-parser] Some rules do not fire in Mu…
tkobayas Mar 21, 2024
dade6eb
[incubator-kie-drools#5708] [new-parser] function definition causes a…
tkobayas Mar 21, 2024
906e260
[new-parser] Support LHS pattern annotations (#5797)
yurloc Mar 21, 2024
3b527eb
[incubator-kie-drools#5710] [new-parser] Unable to resolve method (fr…
tkobayas Mar 22, 2024
76e045a
Enable time literal (#5800)
yurloc Mar 23, 2024
0a6a4b4
Improve the chunk rule not to include parentheses (#5801)
yurloc Mar 25, 2024
2ce9b0a
Fix window reference (#5802)
yurloc Mar 25, 2024
5382e8a
Populate AST descriptors with line numbers (#5804)
yurloc Mar 26, 2024
13289f9
[incubator-kie-drools#5711] Broken OOPath expressions (#5805)
tkobayas Mar 27, 2024
8b252d4
[incubator-kie-drools#5742] [new-parser] Broken inline cast (#5806)
tkobayas Mar 28, 2024
b72316a
[incubator-kie-drools-5712] Queries with arguments cannot be parsed (…
tkobayas Apr 2, 2024
49c7774
[new-parser] Complete support for built-in operators (after, before) …
yurloc Apr 2, 2024
b575dd9
[new-parser] Fix two minor type declaration issues (#5815)
yurloc Apr 3, 2024
235f3b1
Support trait type declaration (#5820)
yurloc Apr 3, 2024
9dfc31d
Allow traits to inherit multiple traits (#5824)
yurloc Apr 4, 2024
97e5035
[incubator-kie-drools-5798] [new-parser] Ensure Descr properties (#5827)
tkobayas Apr 5, 2024
38cc15b
[incubator-kie-drools-5716] [new-parser] mismatched input 'if'/'do' (…
tkobayas Apr 11, 2024
ab292bb
[new-parser] Support pluggable evaluators and class literal (#5834)
yurloc Apr 15, 2024
9ce9a54
[incubator-kie-drools-5808] [new-parser] Combining DRLParser.g4 and D…
tkobayas Apr 16, 2024
ca3b453
Add missing DRL soft keywords to the drlIdentfier rule (#5861)
yurloc Apr 23, 2024
703a8cf
[incubator-kie-drools-5792] [new-parser] improve drools-drl-parser-te…
tkobayas Apr 23, 2024
beed2b5
Reuse DRL6Expressions' fullAnnotation rule in DRLParser (#5865)
yurloc Apr 24, 2024
f6a5a1a
Allow soft keywords in chained method calls (#5864)
yurloc Apr 24, 2024
10ad502
[incubator-kie-drools-5714] Broken QueryTest#testRecursiveQueryWithBa…
tkobayas Apr 25, 2024
436fa8e
[incubator-kie-drools-5741] [new-parser] Broken enum declaration (#5870)
tkobayas Apr 26, 2024
27e30c7
[new-parser] Fix AccumulateTest and add groupBy support (#5876)
yurloc Apr 30, 2024
7973ccb
[incubator-kie-drools-5724] [new-parser] Broken ExisistentialTest#tes…
tkobayas Apr 30, 2024
6f3c0c6
[incubator-kie-drools-5784] Review DRLParser.g4 and DRL6Expressions.g…
tkobayas Apr 30, 2024
ac19e9b
[new-parser] Allow OOPath as a LHS pattern (#5884)
yurloc May 7, 2024
f55162a
Preserve whitespace in accumulate/result (#5889)
yurloc May 7, 2024
bbcb06f
Allow empty queries (#5892)
yurloc May 7, 2024
d34c2d6
Improve Verifier's consequence processing resiliency (#5887)
yurloc May 7, 2024
e7e9166
Avoid NPE when the input DRL is empty (#5894)
yurloc May 8, 2024
c52e943
Avoid error when there is no space between rule keyword and rule name…
yurloc May 8, 2024
1ffa7c4
Strip double quotes from declared entry-point ID (#5905)
yurloc May 8, 2024
37e945b
[incubator-kie-drools-5879] [new-parser] build failure on kie-dmn-val…
tkobayas May 8, 2024
1a884ef
[incubator-kie-drools-5906] [new-parser] unification in accumulate (#…
tkobayas May 9, 2024
d972f20
[incubator-kie-drools-5912] [new-parser] Corner-case combinations of …
tkobayas May 10, 2024
0ad1193
[incubator-kie-drools-5918] [new-parser] Annotations can appear in lh…
tkobayas May 10, 2024
2a058bb
[incubator-kie-drools-5915] [new-parser] ctx.lhsPattern().size() == 0…
tkobayas May 10, 2024
880f276
[incubator-kie-drools-5908] ReteOOWaltzTest 'end' detection issue (#5…
tkobayas May 13, 2024
dd776b1
Match EOF at the end of the compilation unit (#5930)
yurloc May 13, 2024
766d200
Use InternalResource's encoding (#5940)
yurloc May 14, 2024
e64755a
[incubator-kie-drools-5924] [new-parser] Remove DRLIncompleteCodeTest…
tkobayas May 14, 2024
5411e12
Set namespace of qualified declared types (#5947)
yurloc May 15, 2024
04c54cd
[incubator-kie-drools-5945] [new-parser] Broken named consequences in…
tkobayas May 15, 2024
5e2a896
[incubator-kie-drools-5818] [new-parser] Parsing fails if a Java keyw…
tkobayas May 21, 2024
ef5b3af
Avoid IndexOutOfBoundsException in lhsUnary (#5956)
yurloc May 22, 2024
fe01bdd
[incubator-kie-drools-5909] [new-parser] Accumulate parsed incorrectl…
tkobayas May 22, 2024
65cff36
[incubator-kie-drools-5936] [new-parser] || and && should be allowed …
tkobayas May 23, 2024
191ffce
[incubator-kie-drools-5938] [new-parser] Tests using wrong duration a…
tkobayas May 27, 2024
c6f0b71
[incubator-kie-drools-5948] [new-parser] Broken testIncompatibleListO…
tkobayas Jun 3, 2024
1cae534
[incubator-kie-drools-5932] [new-parser] Anonymous classes not suppor…
tkobayas Jun 4, 2024
88a3adc
[incubator-kie-drools-5920] [new-parser] Strict annotation parsing (#…
tkobayas Jun 4, 2024
e13629a
[incubator-kie-drools-5911] [new-parser] Support optional type keywor…
tkobayas Jun 4, 2024
dda4fa5
[incubator-kie-drools-5980-DSL] [new-parser] Enable DSL tests (#5981)
tkobayas Jun 7, 2024
e216b00
[incubator-kie-drools-5982] [new-parser] Enable alternative attribute…
tkobayas Jun 7, 2024
8658f7a
[incubator-kie-drools-5933] [new-parser] PackageDescr.resource not se…
tkobayas Jun 7, 2024
aaef430
Incubator kie drools 5792 cleanup tests (#5986)
tkobayas Jun 10, 2024
7da9750
[incubator-kie-drools-5988] [new-parser] Merge dev-new-parser to main
tkobayas Jun 11, 2024
8e508ea
[DO-NOT-MERGE] Enable new parser test for CI check in relation to inc…
tkobayas Jun 11, 2024
4449df3
trigger GHA
tkobayas Oct 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ public KnowledgeBuilderRulesConfigurationImpl(CompositeConfiguration<KnowledgeBu
}

private void init() {

setProperty( TrimCellsInDTableOption.PROPERTY_NAME,
getPropertyValue(TrimCellsInDTableOption.PROPERTY_NAME,
"true"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.drools.drl.ast.descr.OperatorDescr;
import org.drools.drl.ast.descr.RelationalExprDescr;
import org.drools.drl.parser.DrlExprParser;
import org.drools.drl.parser.DrlExprParserFactory;
import org.drools.drl.parser.impl.Operator;
import org.kie.internal.builder.conf.LanguageLevelOption;

Expand Down Expand Up @@ -137,7 +138,7 @@ public StringBuilder dump( StringBuilder sbuilder,
}

private void processConstraint(StringBuilder sbuilder, ExprConstraintDescr base, boolean isInsideRelCons, DumperContext context) {
DrlExprParser expr = new DrlExprParser( context.getRuleContext().getConfiguration().getOption(LanguageLevelOption.KEY));
DrlExprParser expr = DrlExprParserFactory.getDrlExprParser(context.getRuleContext().getConfiguration().getOption(LanguageLevelOption.KEY));
ConstraintConnectiveDescr result = expr.parse( base.getExpression() );
if ( result.getDescrs().size() == 1 ) {
dump( sbuilder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
import org.drools.drl.ast.descr.ReturnValueRestrictionDescr;
import org.drools.drl.ast.descr.RuleDescr;
import org.drools.drl.parser.DrlExprParser;
import org.drools.drl.parser.DrlExprParserFactory;
import org.drools.drl.parser.DroolsParserException;
import org.drools.util.ClassUtils;
import org.drools.util.StringUtils;
Expand Down Expand Up @@ -1803,17 +1804,17 @@ protected ConstraintConnectiveDescr parseExpression(final RuleBuildContext conte
final PatternDescr patternDescr,
final BaseDescr original,
final String expression) {
DrlExprParser parser = new DrlExprParser(context.getConfiguration().getOption(LanguageLevelOption.KEY));
DrlExprParser parser = DrlExprParserFactory.getDrlExprParser(context.getConfiguration().getOption(LanguageLevelOption.KEY));
ConstraintConnectiveDescr result = parser.parse(normalizeEval(expression));
result.setResource(patternDescr.getResource());
result.copyLocation(original);
if (parser.hasErrors()) {
for (DroolsParserException error : parser.getErrors()) {
registerDescrBuildError(context, patternDescr,
"Unable to parse pattern expression:\n" + error.getMessage());
}
return null;
}
result.setResource(patternDescr.getResource());
result.copyLocation(original);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.drools.drl.ast.descr.ExprConstraintDescr;
import org.drools.drl.ast.descr.PatternDescr;
import org.drools.drl.parser.DrlExprParser;
import org.drools.drl.parser.DrlExprParserFactory;
import org.drools.drl.parser.DroolsParserException;
import org.drools.util.ClassUtils;
import org.drools.util.StringUtils;
Expand All @@ -68,7 +69,7 @@ public RuleConditionElement build( RuleBuildContext context,
BaseDescr descr ) {
throw new UnsupportedOperationException();
}

public RuleConditionElement build( RuleBuildContext context,
BaseDescr descr,
Pattern prefixPattern ) {
Expand Down Expand Up @@ -264,7 +265,7 @@ private void processBinding( RuleBuildContext context,
} else {
// it must be a literal/expression
// it's an expression and thus an input
DrlExprParser parser = new DrlExprParser( context.getConfiguration().getOption(LanguageLevelOption.KEY));
DrlExprParser parser = DrlExprParserFactory.getDrlExprParser(context.getConfiguration().getOption(LanguageLevelOption.KEY));
ConstraintConnectiveDescr bresult = parser.parse( bind.getExpression() );
if ( parser.hasErrors() ) {
for ( DroolsParserException error : parser.getErrors() ) {
Expand Down Expand Up @@ -395,7 +396,7 @@ private static int getPos( String identifier,
private ConstraintConnectiveDescr parseExpression( final RuleBuildContext context,
final PatternDescr patternDescr,
final String expression ) {
DrlExprParser parser = new DrlExprParser( context.getConfiguration().getOption(LanguageLevelOption.KEY));
DrlExprParser parser = DrlExprParserFactory.getDrlExprParser( context.getConfiguration().getOption(LanguageLevelOption.KEY));
ConstraintConnectiveDescr result = parser.parse( expression );
if ( result == null || parser.hasErrors() ) {
for ( DroolsParserException error : parser.getErrors() ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public String getOperator() {
}

public void setOperator( String operator ) {
this.operator = operator.trim();
this.operator = operator != null ? operator.trim() : null;
}

public boolean isNegated() {
Expand Down
124 changes: 124 additions & 0 deletions drools-drl/drools-drl-parser-tests/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.drools</groupId>
<artifactId>drools-drl</artifactId>
<version>999-SNAPSHOT</version>
</parent>

<groupId>org.drools</groupId>
<artifactId>drools-drl-parser-tests</artifactId>

<name>Drools :: DRL :: Parser :: Tests</name>

<properties>
<java.module.name>org.drools.drl.parser.tests</java.module.name>
</properties>

<dependencies>
<!-- Tests -->
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-drl-parser</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-mvel</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<!-- override default-test for new parser -->
<id>default-test</id>
<configuration>
<systemPropertyVariables>
<drools.drl.antlr4.parser.enabled>true</drools.drl.antlr4.parser.enabled>
</systemPropertyVariables>
</configuration>
</execution>
<execution>
<id>old-parser-test</id>
<configuration>
<systemPropertyVariables>
<drools.drl.antlr4.parser.enabled>false</drools.drl.antlr4.parser.enabled>
</systemPropertyVariables>
</configuration>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading
Loading