Skip to content

Commit 79dd86e

Browse files
committed
Revert "Переезд на оригинальную версию antlr 4.13.1
Нуршена обратная совместимость" This reverts commit 56a8435.
1 parent 631ca76 commit 79dd86e

File tree

5 files changed

+6
-25
lines changed

5 files changed

+6
-25
lines changed

src/main/java/com/github/_1c_syntax/bsl/parser/testing/TestLexer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*/
2222
package com.github._1c_syntax.bsl.parser.testing;
2323

24+
import com.github._1c_syntax.bsl.parser.CaseChangingCharStream;
2425
import com.github._1c_syntax.bsl.parser.UnicodeBOMInputStream;
2526
import lombok.Getter;
2627
import lombok.SneakyThrows;
@@ -95,7 +96,8 @@ public CommonTokenStream getTokensStream(int mode, String inputString) {
9596
var inputStreamReader = new InputStreamReader(ubis, StandardCharsets.UTF_8)
9697
) {
9798
ubis.skipBOM();
98-
input = CharStreams.fromReader(inputStreamReader);
99+
var inputTemp = CharStreams.fromReader(inputStreamReader);
100+
input = new CaseChangingCharStream(inputTemp);
99101
} catch (IOException e) {
100102
throw new RuntimeException(e);
101103
}

src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoEmptyLexer.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
import org.antlr.v4.runtime.CharStream;
2525
import org.antlr.v4.runtime.Lexer;
26-
import org.antlr.v4.runtime.atn.ATN;
2726

2827
public class DemoEmptyLexer extends Lexer {
2928

@@ -40,9 +39,4 @@ public String[] getRuleNames() {
4039
public String getGrammarFileName() {
4140
return null;
4241
}
43-
44-
@Override
45-
public ATN getATN() {
46-
return null;
47-
}
4842
}

src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoEmptyParser.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
import org.antlr.v4.runtime.Parser;
2525
import org.antlr.v4.runtime.TokenStream;
26-
import org.antlr.v4.runtime.atn.ATN;
2726

2827

2928
public class DemoEmptyParser extends Parser {
@@ -46,9 +45,4 @@ public String[] getRuleNames() {
4645
public String getGrammarFileName() {
4746
return null;
4847
}
49-
50-
@Override
51-
public ATN getATN() {
52-
return null;
53-
}
5448
}

src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoLexer.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
import org.antlr.v4.runtime.CharStream;
2525
import org.antlr.v4.runtime.Lexer;
26-
import org.antlr.v4.runtime.atn.ATN;
2726

2827
public class DemoLexer extends Lexer {
2928

@@ -45,9 +44,4 @@ public String[] getTokenNames() {
4544
public String getGrammarFileName() {
4645
return null;
4746
}
48-
49-
@Override
50-
public ATN getATN() {
51-
return null;
52-
}
5347
}

src/test/java/com/github/_1c_syntax/bsl/parser/testing/demo/DemoParser.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
import com.github._1c_syntax.bsl.parser.BSLParserRuleContext;
2525
import org.antlr.v4.runtime.Parser;
2626
import org.antlr.v4.runtime.RecognitionException;
27+
import org.antlr.v4.runtime.RuleVersion;
2728
import org.antlr.v4.runtime.TokenStream;
28-
import org.antlr.v4.runtime.atn.ATN;
2929
import org.antlr.v4.runtime.tree.ParseTree;
3030

3131
import java.util.Collections;
@@ -55,20 +55,17 @@ public String getGrammarFileName() {
5555
return null;
5656
}
5757

58-
@Override
59-
public ATN getATN() {
60-
return null;
61-
}
62-
6358
@Override
6459
public void reset() {
6560
// no op
6661
}
6762

63+
@RuleVersion(0)
6864
public final BSLParserRuleContext rule1() throws RecognitionException {
6965
return new DemoRuleContext(0, new DemoRuleContext(1), new DemoRuleContext(1), new DemoRuleContext(2));
7066
}
7167

68+
@RuleVersion(0)
7269
public final BSLParserRuleContext rule2() throws RecognitionException {
7370
return new DemoRuleContext(1);
7471
}

0 commit comments

Comments
 (0)