package bjc.pratt.commands; import bjc.pratt.ParserContext; import bjc.pratt.tokens.Token; import bjc.data.Tree; import bjc.utils.parserutils.ParserException; /** * Abstract base for initial commands. * * @author bjculkin * * @param * The key type of the tokens. * * @param * The value type of the tokens. * * @param * The state type of the parser. */ public abstract class AbstractInitialCommand implements InitialCommand { @Override public Tree> denote(final Token operator, final ParserContext ctx) throws ParserException { return intNullDenotation(operator, ctx); } /** * Internal null denotation method. * * @param operator * The operator that was parsed. * @param ctx * The parser context at this point. * * @return The tree that this method parsed. * * @throws ParserException * If something went wrong while parsing. */ protected abstract Tree> intNullDenotation(Token operator, ParserContext ctx) throws ParserException; }