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