Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SableCC STUPS
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
SableCC STUPS
Commits
cd07a89b
Commit
cd07a89b
authored
1 year ago
by
dgelessus
Browse files
Options
Downloads
Patches
Plain Diff
Remove deprecated Lexer.nextList and related code
parent
b4ed3438
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#118792
passed
1 year ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/sablecc/sablecc/lexer/Lexer.java
+4
-35
4 additions, 35 deletions
src/main/java/org/sablecc/sablecc/lexer/Lexer.java
src/main/resources/org/sablecc/sablecc/lexer.txt
+4
-35
4 additions, 35 deletions
src/main/resources/org/sablecc/sablecc/lexer.txt
with
8 additions
and
70 deletions
src/main/java/org/sablecc/sablecc/lexer/Lexer.java
+
4
−
35
View file @
cd07a89b
...
@@ -7,10 +7,6 @@ import java.io.DataInputStream;
...
@@ -7,10 +7,6 @@ import java.io.DataInputStream;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.PushbackReader
;
import
java.io.PushbackReader
;
import
java.util.LinkedList
;
import
java.util.Queue
;
import
de.hhu.stups.sablecc.patch.IToken
;
import
org.sablecc.sablecc.node.*
;
import
org.sablecc.sablecc.node.*
;
...
@@ -27,61 +23,34 @@ public class Lexer
...
@@ -27,61 +23,34 @@ 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
>();
/**
* @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
;
}
protected
void
filter
()
throws
LexerException
,
IOException
protected
void
filter
()
throws
LexerException
,
IOException
{}
{}
/**
* @deprecated Override {@link #filter()} instead.
*/
@Deprecated
protected
void
filterWrap
()
throws
LexerException
,
IOException
{
filter
();
if
(
token
!=
null
)
{
nextList
.
add
(
token
);
}
}
public
Lexer
(
PushbackReader
in
)
public
Lexer
(
PushbackReader
in
)
{
{
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
)
{
{
token
=
getToken
();
token
=
getToken
();
filter
Wrap
();
filter
();
}
}
return
(
T
oken
)
nextList
.
peek
()
;
return
t
oken
;
}
}
@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
)
{
{
token
=
getToken
();
token
=
getToken
();
filter
Wrap
();
filter
();
}
}
Token
result
=
(
T
oken
)
nextList
.
poll
()
;
Token
result
=
t
oken
;
token
=
null
;
token
=
null
;
return
result
;
return
result
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/org/sablecc/sablecc/lexer.txt
+
4
−
35
View file @
cd07a89b
...
@@ -31,10 +31,6 @@ import java.io.DataInputStream;
...
@@ -31,10 +31,6 @@ import java.io.DataInputStream;
import java.io.InputStream;
import java.io.InputStream;
import java.io.IOException;
import java.io.IOException;
import java.io.PushbackReader;
import java.io.PushbackReader;
import java.util.LinkedList;
import java.util.Queue;
import de.hhu.stups.sablecc.patch.IToken;
import $0$node.*;
import $0$node.*;
...
@@ -51,61 +47,34 @@ public class Lexer
...
@@ -51,61 +47,34 @@ 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>();
/**
* @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;
}
protected void filter() throws LexerException, IOException
protected void filter() throws LexerException, IOException
{}
{}
/**
* @deprecated Override {@link #filter()} instead.
*/
@Deprecated
protected void filterWrap() throws LexerException, IOException
{
filter();
if (token != null) {
nextList.add(token);
}
}
public Lexer(PushbackReader in)
public Lexer(PushbackReader in)
{
{
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)
{
{
token = getToken();
token = getToken();
filter
Wrap
();
filter();
}
}
return
(T
oken
) nextList.peek()
;
return
t
oken;
}
}
@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)
{
{
token = getToken();
token = getToken();
filter
Wrap
();
filter();
}
}
Token result =
(T
oken
) nextList.poll()
;
Token result =
t
oken;
token = null;
token = null;
return result;
return result;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment