package bjc.pratt.commands; import bjc.pratt.ParserContext; import bjc.pratt.Token; import bjc.utils.data.ITree; import bjc.utils.data.Tree; import bjc.utils.parserutils.ParserException; /** * 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 { /** * 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 { return new Tree<>(operator, operand); } }