From fb7d03388e298258563c22abda1bd46cdaf991b7 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Mon, 25 Apr 2016 22:11:28 -0400 Subject: General code cleanup, and some more GUI controls --- .../java/bjc/utils/parserutils/TreeConstructor.java | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/parserutils/TreeConstructor.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/parserutils/TreeConstructor.java b/BJC-Utils2/src/main/java/bjc/utils/parserutils/TreeConstructor.java index 2d2a69e..283d16e 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/parserutils/TreeConstructor.java +++ b/BJC-Utils2/src/main/java/bjc/utils/parserutils/TreeConstructor.java @@ -24,7 +24,7 @@ public class TreeConstructor { * * Only binary operators are accepted. * - * @param + * @param * The elements of the parse tree * @param tokens * The list of tokens to build a tree from @@ -33,8 +33,9 @@ public class TreeConstructor { * operator * @return A AST from the expression */ - public static ITree constructTree(IFunctionalList tokens, - Predicate operatorPredicate) { + public static ITree constructTree( + IFunctionalList tokens, + Predicate operatorPredicate) { return constructTree(tokens, operatorPredicate, (op) -> false, null); } @@ -45,7 +46,7 @@ public class TreeConstructor { * Only binary operators are accepted by default. Use the last two * parameters to handle non-binary operators * - * @param + * @param * The elements of the parse tree * @param tokens * The list of tokens to build a tree from @@ -63,9 +64,11 @@ public class TreeConstructor { * interface. Maybe there's a better way to express how that * works */ - public static ITree constructTree(IFunctionalList tokens, - Predicate operatorPredicate, Predicate isSpecialOperator, - Function>, ITree>> handleSpecialOperator) { + public static ITree constructTree( + IFunctionalList tokens, + Predicate operatorPredicate, + Predicate isSpecialOperator, + Function>, ITree>> handleSpecialOperator) { if (tokens == null) { throw new NullPointerException("Tokens must not be null"); } else if (operatorPredicate == null) { @@ -76,8 +79,8 @@ public class TreeConstructor { "Special operator determiner must not be null"); } - IHolder>, ITree>> initialState = new Identity<>( - new Pair<>(new LinkedList<>(), null)); + IHolder>, ITree>> initialState = + new Identity<>(new Pair<>(new LinkedList<>(), null)); tokens.forEach( new TokenTransformer<>(initialState, operatorPredicate, -- cgit v1.2.3