summaryrefslogtreecommitdiff
path: root/dice-lang/src/bjc/dicelang/expr/Lexer.java
diff options
context:
space:
mode:
authorbculkin2442 <bjculkin@mix.wvu.edu>2017-04-11 21:48:50 -0400
committerbculkin2442 <bjculkin@mix.wvu.edu>2017-04-11 21:48:50 -0400
commit57f9a3bfdad20bead5b35ee540e8790e80a6b9a4 (patch)
tree1e7184825eaa8d22077b505513df3e0d8502fb39 /dice-lang/src/bjc/dicelang/expr/Lexer.java
parent675ae734dd7b7a47d93ee3527dd1eb7195be047b (diff)
Cleanup
Diffstat (limited to 'dice-lang/src/bjc/dicelang/expr/Lexer.java')
-rw-r--r--dice-lang/src/bjc/dicelang/expr/Lexer.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/dice-lang/src/bjc/dicelang/expr/Lexer.java b/dice-lang/src/bjc/dicelang/expr/Lexer.java
index 52be56c..bac866b 100644
--- a/dice-lang/src/bjc/dicelang/expr/Lexer.java
+++ b/dice-lang/src/bjc/dicelang/expr/Lexer.java
@@ -1,11 +1,11 @@
package bjc.dicelang.expr;
-import bjc.utils.funcdata.IList;
-import bjc.utils.parserutils.splitter.ConfigurableTokenSplitter;
-
import java.util.LinkedList;
import java.util.List;
+import bjc.utils.funcdata.IList;
+import bjc.utils.parserutils.splitter.ConfigurableTokenSplitter;
+
/**
* Implements the lexer for simple expression operations.
*
@@ -15,7 +15,7 @@ public class Lexer {
/*
* Splitter we use.
*/
- private ConfigurableTokenSplitter split;
+ private final ConfigurableTokenSplitter split;
/**
* Create a new expression lexer.
@@ -38,14 +38,14 @@ public class Lexer {
*
* @return A series of infix tokens representing the command.
*/
- public Token[] lexString(String inp, Tokens tks) {
- String[] spacedTokens = inp.split("[ \t]");
+ public Token[] lexString(final String inp, final Tokens tks) {
+ final String[] spacedTokens = inp.split("[ \t]");
- List<Token> tokens = new LinkedList<>();
+ final List<Token> tokens = new LinkedList<>();
- for(String spacedToken : spacedTokens) {
- IList<String> splitTokens = split.split(spacedToken);
- IList<Token> rawTokens = splitTokens.map(tok -> tks.lexToken(tok, spacedToken));
+ for (final String spacedToken : spacedTokens) {
+ final IList<String> splitTokens = split.split(spacedToken);
+ final IList<Token> rawTokens = splitTokens.map(tok -> tks.lexToken(tok, spacedToken));
rawTokens.forEach(tokens::add);
}