diff options
| author | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2018-02-13 20:52:37 -0400 |
|---|---|---|
| committer | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2018-02-13 20:52:37 -0400 |
| commit | 2d8f0aba5565b292f17695afd276143a4f71c72b (patch) | |
| tree | 2e855252038af0b15275958b64caaee9e72f8847 /base/src/main/java/bjc/utils/parserutils/ShuntingYard.java | |
| parent | cb45a62d8629e079ae403489efab392d7208cb62 (diff) | |
Update
Diffstat (limited to 'base/src/main/java/bjc/utils/parserutils/ShuntingYard.java')
| -rw-r--r-- | base/src/main/java/bjc/utils/parserutils/ShuntingYard.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/base/src/main/java/bjc/utils/parserutils/ShuntingYard.java b/base/src/main/java/bjc/utils/parserutils/ShuntingYard.java index a0b1249..352ad04 100644 --- a/base/src/main/java/bjc/utils/parserutils/ShuntingYard.java +++ b/base/src/main/java/bjc/utils/parserutils/ShuntingYard.java @@ -181,7 +181,8 @@ public class ShuntingYard<TokenType> { */ if(operator == null) throw new NullPointerException("Operator must not be null"); - else if(precedence == null) throw new NullPointerException("Precedence must not be null"); + else if (precedence == null) + throw new NullPointerException("Precedence must not be null"); /* * Add the operator to the ones we handle @@ -189,6 +190,7 @@ public class ShuntingYard<TokenType> { operators.put(operator, precedence); } + /* Check if one operator is higher precedence than another. */ private boolean isHigherPrec(final String left, final String right) { /* * Check if the right operator exists @@ -229,7 +231,8 @@ public class ShuntingYard<TokenType> { */ if(input == null) throw new NullPointerException("Input must not be null"); - else if(transformer == null) throw new NullPointerException("Transformer must not be null"); + else if (transformer == null) + throw new NullPointerException("Transformer must not be null"); /* * Here's what we're handing back |
