diff options
| author | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2020-12-14 19:29:37 -0400 |
|---|---|---|
| committer | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2020-12-14 19:29:37 -0400 |
| commit | 9351ea3e97bbe2d348aa17067ccc6267dc7c080f (patch) | |
| tree | dd2269c26161c735d94d8dc83d56e6076c2a155d /base/src/main/java/bjc/utils/parserutils/ShuntingYard.java | |
| parent | 8933de7f646f0565edf700aa2f2fcab06d639855 (diff) | |
| parent | 6dcadc360dafdd12142d53327f44579379a4c9dd (diff) | |
Merge branch 'master' of https://github.com/bculkin2442/bjc-utils2
Diffstat (limited to 'base/src/main/java/bjc/utils/parserutils/ShuntingYard.java')
| -rw-r--r-- | base/src/main/java/bjc/utils/parserutils/ShuntingYard.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/base/src/main/java/bjc/utils/parserutils/ShuntingYard.java b/base/src/main/java/bjc/utils/parserutils/ShuntingYard.java index ac82388..f0475ff 100644 --- a/base/src/main/java/bjc/utils/parserutils/ShuntingYard.java +++ b/base/src/main/java/bjc/utils/parserutils/ShuntingYard.java @@ -6,8 +6,8 @@ import java.util.function.Function; import bjc.funcdata.FunctionalList; import bjc.funcdata.FunctionalMap; -import bjc.funcdata.IList; -import bjc.funcdata.IMap; +import bjc.funcdata.ListEx; +import bjc.funcdata.MapEx; import bjc.utils.funcutils.StringUtils; /** @@ -25,7 +25,7 @@ public class ShuntingYard<TokenType> { * @author ben * */ - public static enum Operator implements IPrecedent { + public static enum Operator implements Precedent { /** * Represents addition. */ @@ -59,7 +59,7 @@ public class ShuntingYard<TokenType> { /* * Holds all the shuntable operations. */ - private IMap<String, IPrecedent> operators; + private MapEx<String, Precedent> operators; /** * Create a new shunting yard with a default set of operators. @@ -95,7 +95,7 @@ public class ShuntingYard<TokenType> { /* * Create the precedence marker */ - final IPrecedent prec = IPrecedent.newSimplePrecedent(precedence); + final Precedent prec = Precedent.newSimplePrecedent(precedence); this.addOp(operator, prec); } @@ -109,7 +109,7 @@ public class ShuntingYard<TokenType> { * @param precedence * The precedence of the operator. */ - public void addOp(final String operator, final IPrecedent precedence) { + public void addOp(final String operator, final Precedent precedence) { /* * Complain about trying to add an incorrect operator */ @@ -158,7 +158,7 @@ public class ShuntingYard<TokenType> { * * @return A list of tokens in postfix notation. */ - public IList<TokenType> postfix(final IList<String> input, + public ListEx<TokenType> postfix(final ListEx<String> input, final Function<String, TokenType> transformer) { /* * Check our input @@ -169,7 +169,7 @@ public class ShuntingYard<TokenType> { /* * Here's what we're handing back */ - final IList<TokenType> output = new FunctionalList<>(); + final ListEx<TokenType> output = new FunctionalList<>(); /* * The stack to put operators on |
