From 0fea7e4c55867022d3b029cf95afda74a03cfd25 Mon Sep 17 00:00:00 2001 From: theshadowco Date: Tue, 16 Apr 2024 12:59:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=B5=D0=B7=D0=B4=20?= =?UTF-8?q?=D0=BD=D0=B0=20antlr=204.13.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ build.gradle.kts | 4 ++-- .../github/_1c_syntax/bsl/parser/testing/TestLexer.java | 4 +--- .../bsl/parser/testing/demo/DemoEmptyLexer.java | 6 ++++++ .../bsl/parser/testing/demo/DemoEmptyParser.java | 6 ++++++ .../_1c_syntax/bsl/parser/testing/demo/DemoLexer.java | 6 ++++++ .../_1c_syntax/bsl/parser/testing/demo/DemoParser.java | 9 ++++++--- 7 files changed, 29 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 8031540..7c1c172 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,5 @@ gen/ /.idea/compiler.xml /.idea/jarRepositories.xml /.idea/inspectionProfiles/Project_Default.xml +/.idea/material_theme_project_new.xml +/.idea/vcs.xml diff --git a/build.gradle.kts b/build.gradle.kts index 33ac716..af6f638 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -45,8 +45,8 @@ gitVersioning.apply { val isSnapshot = gitVersioning.gitVersionDetails.refType != GitRefType.TAG dependencies { - implementation("io.github.1c-syntax", "bsl-parser-core", "0.1.0") - implementation("com.tunnelvisionlabs", "antlr4", "4.9.0") + implementation("io.github.1c-syntax", "bsl-parser-core", "0.2.0") + implementation("org.antlr", "antlr4", "4.13.1") implementation("commons-io", "commons-io", "2.15.1") implementation("org.junit.jupiter", "junit-jupiter-api", "5.10.1") implementation("org.assertj", "assertj-core", "3.25.0") diff --git a/src/main/java/com/github/_1c_syntax/bsl/parser/testing/TestLexer.java b/src/main/java/com/github/_1c_syntax/bsl/parser/testing/TestLexer.java index 1ded2ba..523b52a 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/parser/testing/TestLexer.java +++ b/src/main/java/com/github/_1c_syntax/bsl/parser/testing/TestLexer.java @@ -21,7 +21,6 @@ */ package com.github._1c_syntax.bsl.parser.testing; -import com.github._1c_syntax.bsl.parser.CaseChangingCharStream; import com.github._1c_syntax.bsl.parser.UnicodeBOMInputStream; import lombok.Getter; import lombok.SneakyThrows; @@ -96,8 +95,7 @@ public CommonTokenStream getTokensStream(int mode, String inputString) { var inputStreamReader = new InputStreamReader(ubis, StandardCharsets.UTF_8) ) { ubis.skipBOM(); - var inputTemp = CharStreams.fromReader(inputStreamReader); - input = new CaseChangingCharStream(inputTemp); + input = CharStreams.fromReader(inputStreamReader); } catch (IOException e) { throw new RuntimeException(e); } diff --git a/src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoEmptyLexer.java b/src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoEmptyLexer.java index 67e25b6..278a64c 100644 --- a/src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoEmptyLexer.java +++ b/src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoEmptyLexer.java @@ -23,6 +23,7 @@ import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.Lexer; +import org.antlr.v4.runtime.atn.ATN; public class DemoEmptyLexer extends Lexer { @@ -39,4 +40,9 @@ public String[] getRuleNames() { public String getGrammarFileName() { return null; } + + @Override + public ATN getATN() { + return null; + } } diff --git a/src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoEmptyParser.java b/src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoEmptyParser.java index 9132c84..0f5400f 100644 --- a/src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoEmptyParser.java +++ b/src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoEmptyParser.java @@ -23,6 +23,7 @@ import org.antlr.v4.runtime.Parser; import org.antlr.v4.runtime.TokenStream; +import org.antlr.v4.runtime.atn.ATN; public class DemoEmptyParser extends Parser { @@ -45,4 +46,9 @@ public String[] getRuleNames() { public String getGrammarFileName() { return null; } + + @Override + public ATN getATN() { + return null; + } } diff --git a/src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoLexer.java b/src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoLexer.java index dcadcfb..0990747 100644 --- a/src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoLexer.java +++ b/src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoLexer.java @@ -23,6 +23,7 @@ import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.Lexer; +import org.antlr.v4.runtime.atn.ATN; public class DemoLexer extends Lexer { @@ -44,4 +45,9 @@ public String[] getTokenNames() { public String getGrammarFileName() { return null; } + + @Override + public ATN getATN() { + return null; + } } \ No newline at end of file diff --git a/src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoParser.java b/src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoParser.java index 7701135..1433d49 100644 --- a/src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoParser.java +++ b/src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoParser.java @@ -24,8 +24,8 @@ import com.github._1c_syntax.bsl.parser.BSLParserRuleContext; import org.antlr.v4.runtime.Parser; import org.antlr.v4.runtime.RecognitionException; -import org.antlr.v4.runtime.RuleVersion; import org.antlr.v4.runtime.TokenStream; +import org.antlr.v4.runtime.atn.ATN; import org.antlr.v4.runtime.tree.ParseTree; import java.util.Collections; @@ -55,17 +55,20 @@ public String getGrammarFileName() { return null; } + @Override + public ATN getATN() { + return null; + } + @Override public void reset() { // no op } - @RuleVersion(0) public final BSLParserRuleContext rule1() throws RecognitionException { return new DemoRuleContext(0, new DemoRuleContext(1), new DemoRuleContext(1), new DemoRuleContext(2)); } - @RuleVersion(0) public final BSLParserRuleContext rule2() throws RecognitionException { return new DemoRuleContext(1); }