diff --git a/src/main/java/org/sablecc/sablecc/lexer/Lexer.java b/src/main/java/org/sablecc/sablecc/lexer/Lexer.java index 88b92d80838b97fcfbc1fb179ba27212e6ce5d49..a582d499010aec9ae53f0529e766388864304d1a 100644 --- a/src/main/java/org/sablecc/sablecc/lexer/Lexer.java +++ b/src/main/java/org/sablecc/sablecc/lexer/Lexer.java @@ -13,12 +13,11 @@ import java.util.List; import java.util.Queue; import de.hhu.stups.sablecc.patch.IToken; -import de.hhu.stups.sablecc.patch.ITokenListContainer; import org.sablecc.sablecc.node.*; @SuppressWarnings({"deprecation", "unused"}) // ITokenListContainer is deprecated, but the generated lexer still implements it for compatibility -public class Lexer implements ITokenListContainer +public class Lexer implements de.hhu.stups.sablecc.patch.ITokenListContainer { protected Token token; protected State state = State.NORMAL; diff --git a/src/main/java/org/sablecc/sablecc/parser/Parser.java b/src/main/java/org/sablecc/sablecc/parser/Parser.java index 28bbe35ebec81dbc4b25e20e817b561c61ea55af..992afd4ecfdc014ed141f4c19f41e8e0aa3d1f0d 100644 --- a/src/main/java/org/sablecc/sablecc/parser/Parser.java +++ b/src/main/java/org/sablecc/sablecc/parser/Parser.java @@ -16,7 +16,6 @@ import java.util.Map; import de.hhu.stups.sablecc.patch.IParser; import de.hhu.stups.sablecc.patch.IToken; import de.hhu.stups.sablecc.patch.PositionedNode; -import de.hhu.stups.sablecc.patch.SourcecodeRange; import org.sablecc.sablecc.lexer.Lexer; import org.sablecc.sablecc.lexer.LexerException; @@ -46,14 +45,14 @@ public class Parser implements IParser } @Deprecated - private Map<PositionedNode, SourcecodeRange> mapping = new HashMap<PositionedNode, SourcecodeRange>(); + private Map<PositionedNode, de.hhu.stups.sablecc.patch.SourcecodeRange> mapping = new HashMap<>(); /** * @deprecated All generated token classes store their own position info. * Use the {@link PositionedNode} or {@link IToken} APIs to access the positions stored in the tokens. */ @Deprecated @Override - public Map<PositionedNode, SourcecodeRange> getMapping() { return this.mapping; } + public Map<PositionedNode, de.hhu.stups.sablecc.patch.SourcecodeRange> getMapping() { return this.mapping; } private void checkResult(Object elementToCheck, List<Object> beginNodeList, List<Object> endNodeList) { if (elementToCheck instanceof List<?>) { @@ -92,7 +91,7 @@ public class Parser implements IParser PositionedNode endNode = findEndNode(endNodeList); int end = findEndPos(endNode); if (end == -1) end = begin; - final SourcecodeRange range = new SourcecodeRange(begin, end); + final de.hhu.stups.sablecc.patch.SourcecodeRange range = new de.hhu.stups.sablecc.patch.SourcecodeRange(begin, end); this.getMapping().put(node, range); @@ -139,7 +138,7 @@ public class Parser implements IParser return findIndex((IToken) node); } - final SourcecodeRange item = this.getMapping().get(node); + final de.hhu.stups.sablecc.patch.SourcecodeRange item = this.getMapping().get(node); if (item == null) { return -1; } diff --git a/src/main/resources/org/sablecc/sablecc/lexer.txt b/src/main/resources/org/sablecc/sablecc/lexer.txt index 5651a1f7a25dcb950ec7ac530463232d1e35b713..f129be40152c9ae2562978e2e5d07a882943e241 100644 --- a/src/main/resources/org/sablecc/sablecc/lexer.txt +++ b/src/main/resources/org/sablecc/sablecc/lexer.txt @@ -37,12 +37,11 @@ import java.util.List; import java.util.Queue; import de.hhu.stups.sablecc.patch.IToken; -import de.hhu.stups.sablecc.patch.ITokenListContainer; import $0$node.*; @SuppressWarnings({"deprecation", "unused"}) // ITokenListContainer is deprecated, but the generated lexer still implements it for compatibility -public class Lexer implements ITokenListContainer +public class Lexer implements de.hhu.stups.sablecc.patch.ITokenListContainer { protected Token token; protected State state = State.$1$; diff --git a/src/main/resources/org/sablecc/sablecc/parser.txt b/src/main/resources/org/sablecc/sablecc/parser.txt index f7ebae738fbe8b00d4bb75c972125ab5918820f2..302d4d88448d65f0179d1bcf53bac5b21df2674d 100644 --- a/src/main/resources/org/sablecc/sablecc/parser.txt +++ b/src/main/resources/org/sablecc/sablecc/parser.txt @@ -24,7 +24,6 @@ import java.util.Map; import de.hhu.stups.sablecc.patch.IParser; import de.hhu.stups.sablecc.patch.IToken; import de.hhu.stups.sablecc.patch.PositionedNode; -import de.hhu.stups.sablecc.patch.SourcecodeRange; import $0$lexer.Lexer; import $0$lexer.LexerException; @@ -54,14 +53,14 @@ public class Parser implements IParser } @Deprecated - private Map<PositionedNode, SourcecodeRange> mapping = new HashMap<PositionedNode, SourcecodeRange>(); + private Map<PositionedNode, de.hhu.stups.sablecc.patch.SourcecodeRange> mapping = new HashMap<>(); /** * @deprecated All generated token classes store their own position info. * Use the {@link PositionedNode} or {@link IToken} APIs to access the positions stored in the tokens. */ @Deprecated @Override - public Map<PositionedNode, SourcecodeRange> getMapping() { return this.mapping; } + public Map<PositionedNode, de.hhu.stups.sablecc.patch.SourcecodeRange> getMapping() { return this.mapping; } private void checkResult(Object elementToCheck, List<Object> beginNodeList, List<Object> endNodeList) { if (elementToCheck instanceof List<?>) { @@ -100,7 +99,7 @@ public class Parser implements IParser PositionedNode endNode = findEndNode(endNodeList); int end = findEndPos(endNode); if (end == -1) end = begin; - final SourcecodeRange range = new SourcecodeRange(begin, end); + final de.hhu.stups.sablecc.patch.SourcecodeRange range = new de.hhu.stups.sablecc.patch.SourcecodeRange(begin, end); this.getMapping().put(node, range); @@ -147,7 +146,7 @@ public class Parser implements IParser return findIndex((IToken) node); } - final SourcecodeRange item = this.getMapping().get(node); + final de.hhu.stups.sablecc.patch.SourcecodeRange item = this.getMapping().get(node); if (item == null) { return -1; }