From 251419e1f0ab8eb04d21287b708b06a552f4c58a Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Mon, 10 Apr 2017 16:49:31 -0400 Subject: Warning resolution --- .../src/main/java/bjc/pratt/commands/PreTernaryCommand.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'JPratt/src/main/java/bjc/pratt/commands/PreTernaryCommand.java') diff --git a/JPratt/src/main/java/bjc/pratt/commands/PreTernaryCommand.java b/JPratt/src/main/java/bjc/pratt/commands/PreTernaryCommand.java index efa7872..072c58c 100644 --- a/JPratt/src/main/java/bjc/pratt/commands/PreTernaryCommand.java +++ b/JPratt/src/main/java/bjc/pratt/commands/PreTernaryCommand.java @@ -22,7 +22,7 @@ import bjc.utils.parserutils.ParserException; * The state type of the parser. */ public class PreTernaryCommand extends AbstractInitialCommand { - private Token term; + private Token trm; private ParseBlock condBlock; @@ -54,11 +54,11 @@ public class PreTernaryCommand extends AbstractInitialCommand throw new NullPointerException("Op block #1 must not be null"); else if (op2 == null) throw new NullPointerException("Op block #2 must not be null"); - this.condBlock = cond; - this.opblock1 = op1; - this.opblock2 = op2; + condBlock = cond; + opblock1 = op1; + opblock2 = op2; - this.term = term; + trm = term; } @Override @@ -70,6 +70,6 @@ public class PreTernaryCommand extends AbstractInitialCommand ITree> op2 = opblock2.parse(ctx); - return new Tree<>(term, cond, op1, op2); + return new Tree<>(trm, cond, op1, op2); } } \ No newline at end of file -- cgit v1.2.3 From 56f07e9a3aaa873fe385d224f088f048dbafa8f7 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Mon, 10 Apr 2017 16:49:54 -0400 Subject: Cleanup --- .../java/bjc/pratt/commands/PreTernaryCommand.java | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'JPratt/src/main/java/bjc/pratt/commands/PreTernaryCommand.java') diff --git a/JPratt/src/main/java/bjc/pratt/commands/PreTernaryCommand.java b/JPratt/src/main/java/bjc/pratt/commands/PreTernaryCommand.java index 072c58c..d8304e2 100644 --- a/JPratt/src/main/java/bjc/pratt/commands/PreTernaryCommand.java +++ b/JPratt/src/main/java/bjc/pratt/commands/PreTernaryCommand.java @@ -9,43 +9,43 @@ import bjc.utils.parserutils.ParserException; /** * A prefix ternary operator, like an if/then/else group. - * + * * @author bjculkin * * @param * The key type of the tokens. - * + * * @param * The value type of the tokens. - * + * * @param * The state type of the parser. */ public class PreTernaryCommand extends AbstractInitialCommand { - private Token trm; + private final Token trm; - private ParseBlock condBlock; + private final ParseBlock condBlock; - private ParseBlock opblock1; - private ParseBlock opblock2; + private final ParseBlock opblock1; + private final ParseBlock opblock2; /** * Create a new ternary statement. - * + * * @param cond * The block for handling the condition. - * + * * @param op1 * The block for handling the first operator. - * + * * @param op2 * The block for handling the second operator. - * + * * @param term * The token to use as the node for the AST. */ - public PreTernaryCommand(ParseBlock cond, ParseBlock op1, ParseBlock op2, - Token term) { + public PreTernaryCommand(final ParseBlock cond, final ParseBlock op1, + final ParseBlock op2, final Token term) { super(); if (cond == null) @@ -62,13 +62,13 @@ public class PreTernaryCommand extends AbstractInitialCommand } @Override - protected ITree> intNullDenotation(Token operator, ParserContext ctx) + protected ITree> intNullDenotation(final Token operator, final ParserContext ctx) throws ParserException { - ITree> cond = condBlock.parse(ctx); + final ITree> cond = condBlock.parse(ctx); - ITree> op1 = opblock1.parse(ctx); + final ITree> op1 = opblock1.parse(ctx); - ITree> op2 = opblock2.parse(ctx); + final ITree> op2 = opblock2.parse(ctx); return new Tree<>(trm, cond, op1, op2); } -- cgit v1.2.3 From f394306a4b65a3328551f9f6b8d4abff8bfd5b27 Mon Sep 17 00:00:00 2001 From: bjculkin Date: Wed, 12 Apr 2017 10:46:51 -0400 Subject: Package reorganization --- .../java/bjc/pratt/commands/PreTernaryCommand.java | 75 ---------------------- 1 file changed, 75 deletions(-) delete mode 100644 JPratt/src/main/java/bjc/pratt/commands/PreTernaryCommand.java (limited to 'JPratt/src/main/java/bjc/pratt/commands/PreTernaryCommand.java') diff --git a/JPratt/src/main/java/bjc/pratt/commands/PreTernaryCommand.java b/JPratt/src/main/java/bjc/pratt/commands/PreTernaryCommand.java deleted file mode 100644 index d8304e2..0000000 --- a/JPratt/src/main/java/bjc/pratt/commands/PreTernaryCommand.java +++ /dev/null @@ -1,75 +0,0 @@ -package bjc.pratt.commands; - -import bjc.pratt.ParseBlock; -import bjc.pratt.ParserContext; -import bjc.pratt.Token; -import bjc.utils.data.ITree; -import bjc.utils.data.Tree; -import bjc.utils.parserutils.ParserException; - -/** - * A prefix ternary operator, like an if/then/else group. - * - * @author bjculkin - * - * @param - * The key type of the tokens. - * - * @param - * The value type of the tokens. - * - * @param - * The state type of the parser. - */ -public class PreTernaryCommand extends AbstractInitialCommand { - private final Token trm; - - private final ParseBlock condBlock; - - private final ParseBlock opblock1; - private final ParseBlock opblock2; - - /** - * Create a new ternary statement. - * - * @param cond - * The block for handling the condition. - * - * @param op1 - * The block for handling the first operator. - * - * @param op2 - * The block for handling the second operator. - * - * @param term - * The token to use as the node for the AST. - */ - public PreTernaryCommand(final ParseBlock cond, final ParseBlock op1, - final ParseBlock op2, final Token term) { - super(); - - if (cond == null) - throw new NullPointerException("Cond block must not be null"); - else if (op1 == null) - throw new NullPointerException("Op block #1 must not be null"); - else if (op2 == null) throw new NullPointerException("Op block #2 must not be null"); - - condBlock = cond; - opblock1 = op1; - opblock2 = op2; - - trm = term; - } - - @Override - protected ITree> intNullDenotation(final Token operator, final ParserContext ctx) - throws ParserException { - final ITree> cond = condBlock.parse(ctx); - - final ITree> op1 = opblock1.parse(ctx); - - final ITree> op2 = opblock2.parse(ctx); - - return new Tree<>(trm, cond, op1, op2); - } -} \ No newline at end of file -- cgit v1.2.3