diff --git a/src/main/java/org/sablecc/sablecc/lexer/Lexer.java b/src/main/java/org/sablecc/sablecc/lexer/Lexer.java index a68790058e1d55cbaa70c521c21798b744b89b50..2cd749cc272348c17de5a8071a0aeea4e9f4043b 100644 --- a/src/main/java/org/sablecc/sablecc/lexer/Lexer.java +++ b/src/main/java/org/sablecc/sablecc/lexer/Lexer.java @@ -27,8 +27,14 @@ public class Lexer private boolean eof; private final StringBuilder text = new StringBuilder(); + @Deprecated private final Queue<IToken> nextList = new LinkedList<IToken>(); + /** + * @deprecated Use {@link #token} to get, modify, replace, and/or delete the current token. + * Injecting new tokens into the token stream will not be supported in the future. + */ + @Deprecated public Queue<IToken> getNextList() { return nextList; } @@ -38,6 +44,10 @@ public class Lexer // Do nothing } + /** + * @deprecated Override {@link #filter()} instead. + */ + @Deprecated protected void filterWrap() throws LexerException, IOException { filter(); @@ -52,6 +62,7 @@ public class Lexer this.in = in; } + @SuppressWarnings("deprecation") // because of filterWrap and nextList public Token peek() throws LexerException, IOException { while(this.token == null) @@ -63,6 +74,7 @@ public class Lexer return (Token) nextList.peek(); } + @SuppressWarnings("deprecation") // because of filterWrap and nextList public Token next() throws LexerException, IOException { while(this.token == null) diff --git a/src/main/resources/org/sablecc/sablecc/lexer.txt b/src/main/resources/org/sablecc/sablecc/lexer.txt index f9a786d419576799b5164905e8bea42b7218369b..efa65983db58191cd7d0e628fb2ce51ebeced1b4 100644 --- a/src/main/resources/org/sablecc/sablecc/lexer.txt +++ b/src/main/resources/org/sablecc/sablecc/lexer.txt @@ -51,8 +51,14 @@ public class Lexer private boolean eof; private final StringBuilder text = new StringBuilder(); + @Deprecated private final Queue<IToken> nextList = new LinkedList<IToken>(); + /** + * @deprecated Use {@link #token} to get, modify, replace, and/or delete the current token. + * Injecting new tokens into the token stream will not be supported in the future. + */ + @Deprecated public Queue<IToken> getNextList() { return nextList; } @@ -62,6 +68,10 @@ public class Lexer // Do nothing } + /** + * @deprecated Override {@link #filter()} instead. + */ + @Deprecated protected void filterWrap() throws LexerException, IOException { filter(); @@ -76,6 +86,7 @@ public class Lexer this.in = in; } + @SuppressWarnings("deprecation") // because of filterWrap and nextList public Token peek() throws LexerException, IOException { while(this.token == null) @@ -87,6 +98,7 @@ public class Lexer return (Token) nextList.peek(); } + @SuppressWarnings("deprecation") // because of filterWrap and nextList public Token next() throws LexerException, IOException { while(this.token == null)