From 572551b78e7f36b65185cb258bea31114d9992f6 Mon Sep 17 00:00:00 2001 From: bjculkin Date: Mon, 27 Mar 2017 10:51:28 -0400 Subject: Simplifications --- .../pratt/commands/DenestingCommand.java | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/commands/DenestingCommand.java (limited to 'BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/commands/DenestingCommand.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/commands/DenestingCommand.java b/BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/commands/DenestingCommand.java new file mode 100644 index 0000000..d2d7829 --- /dev/null +++ b/BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/commands/DenestingCommand.java @@ -0,0 +1,31 @@ +package bjc.utils.parserutils.pratt.commands; + +import bjc.utils.data.ITree; +import bjc.utils.parserutils.ParserException; +import bjc.utils.parserutils.pratt.InitialCommand; +import bjc.utils.parserutils.pratt.ParserContext; +import bjc.utils.parserutils.pratt.Token; + +public class DenestingCommand extends AbstractInitialCommand { + private InitialCommand internal; + + /** + * Create a new transforming initial command. + * + * @param internal + * The initial command to delegate to. + * + * @param transform + * The transform to apply to the returned tree. + */ + public DenestingCommand(InitialCommand internal) { + super(); + this.internal = internal; + } + + @Override + protected ITree> intNullDenotation(Token operator, ParserContext ctx) + throws ParserException { + return internal.denote(operator, ctx).getChild(0); + } +} \ No newline at end of file -- cgit v1.2.3