Skip to content
Snippets Groups Projects
Commit 1796fb94 authored by dgelessus's avatar dgelessus
Browse files

Deprecate Lexer.nextList and related code

parent 3090ef1f
No related branches found
No related tags found
No related merge requests found
Pipeline #117663 passed
...@@ -27,8 +27,14 @@ public class Lexer ...@@ -27,8 +27,14 @@ public class Lexer
private boolean eof; private boolean eof;
private final StringBuilder text = new StringBuilder(); private final StringBuilder text = new StringBuilder();
@Deprecated
private final Queue<IToken> nextList = new LinkedList<IToken>(); 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() { public Queue<IToken> getNextList() {
return nextList; return nextList;
} }
...@@ -38,6 +44,10 @@ public class Lexer ...@@ -38,6 +44,10 @@ public class Lexer
// Do nothing // Do nothing
} }
/**
* @deprecated Override {@link #filter()} instead.
*/
@Deprecated
protected void filterWrap() throws LexerException, IOException protected void filterWrap() throws LexerException, IOException
{ {
filter(); filter();
...@@ -52,6 +62,7 @@ public class Lexer ...@@ -52,6 +62,7 @@ public class Lexer
this.in = in; this.in = in;
} }
@SuppressWarnings("deprecation") // because of filterWrap and nextList
public Token peek() throws LexerException, IOException public Token peek() throws LexerException, IOException
{ {
while(this.token == null) while(this.token == null)
...@@ -63,6 +74,7 @@ public class Lexer ...@@ -63,6 +74,7 @@ public class Lexer
return (Token) nextList.peek(); return (Token) nextList.peek();
} }
@SuppressWarnings("deprecation") // because of filterWrap and nextList
public Token next() throws LexerException, IOException public Token next() throws LexerException, IOException
{ {
while(this.token == null) while(this.token == null)
......
...@@ -51,8 +51,14 @@ public class Lexer ...@@ -51,8 +51,14 @@ public class Lexer
private boolean eof; private boolean eof;
private final StringBuilder text = new StringBuilder(); private final StringBuilder text = new StringBuilder();
@Deprecated
private final Queue<IToken> nextList = new LinkedList<IToken>(); 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() { public Queue<IToken> getNextList() {
return nextList; return nextList;
} }
...@@ -62,6 +68,10 @@ public class Lexer ...@@ -62,6 +68,10 @@ public class Lexer
// Do nothing // Do nothing
} }
/**
* @deprecated Override {@link #filter()} instead.
*/
@Deprecated
protected void filterWrap() throws LexerException, IOException protected void filterWrap() throws LexerException, IOException
{ {
filter(); filter();
...@@ -76,6 +86,7 @@ public class Lexer ...@@ -76,6 +86,7 @@ public class Lexer
this.in = in; this.in = in;
} }
@SuppressWarnings("deprecation") // because of filterWrap and nextList
public Token peek() throws LexerException, IOException public Token peek() throws LexerException, IOException
{ {
while(this.token == null) while(this.token == null)
...@@ -87,6 +98,7 @@ public class Lexer ...@@ -87,6 +98,7 @@ public class Lexer
return (Token) nextList.peek(); return (Token) nextList.peek();
} }
@SuppressWarnings("deprecation") // because of filterWrap and nextList
public Token next() throws LexerException, IOException public Token next() throws LexerException, IOException
{ {
while(this.token == null) while(this.token == null)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment