From 2d8f0aba5565b292f17695afd276143a4f71c72b Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Tue, 13 Feb 2018 20:52:37 -0400 Subject: Update --- base/src/main/java/bjc/utils/parserutils/ShuntingYard.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'base/src/main/java/bjc/utils/parserutils/ShuntingYard.java') 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 { */ 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 { 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 { */ 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 -- cgit v1.2.3