From 42990231fee502552b769b9af4c04ac0dcaeb195 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Sat, 25 Mar 2017 19:13:42 -0400 Subject: Update Pratt parser --- .../parserutils/pratt/commands/PostfixCommand.java | 28 ++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/commands/PostfixCommand.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/commands/PostfixCommand.java b/BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/commands/PostfixCommand.java index 19c540a..bab3de4 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/commands/PostfixCommand.java +++ b/BJC-Utils2/src/main/java/bjc/utils/parserutils/pratt/commands/PostfixCommand.java @@ -6,14 +6,34 @@ import bjc.utils.parserutils.ParserException; import bjc.utils.parserutils.pratt.ParserContext; import bjc.utils.parserutils.pratt.Token; +/** + * A postfix operator. + * + * @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 PostfixCommand extends BinaryPostCommand { - public PostfixCommand(int leftPower) { - super(leftPower); + /** + * Create a new postfix operator. + * + * @param precedence + * The precedence of the operator. + */ + public PostfixCommand(int precedence) { + super(precedence); } @Override - public ITree> denote(ITree> operand, Token operator, - ParserContext ctx) throws ParserException { + public ITree> denote(ITree> operand, Token operator, ParserContext ctx) + throws ParserException { return new Tree<>(operator, operand); } } \ No newline at end of file -- cgit v1.2.3