package bjc.pratt.commands; /** * A non-associative 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 NonBinaryCommand extends BinaryCommand { /** * Create a new non-associative operator. * * @param precedence * The precedence of the operator. */ public NonBinaryCommand(int precedence) { super(precedence); } @Override protected int rightBinding() { return 1 + leftBinding(); } @Override public int nextBinding() { return leftBinding() - 1; } }