package bjc.pratt.commands.impls; import bjc.pratt.ParserContext; import bjc.pratt.commands.InitialCommand; import bjc.pratt.tokens.Token; import bjc.utils.data.ITree; import bjc.utils.parserutils.ParserException; /** * A command that represents a specific tree. * * @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 ConstantCommand implements InitialCommand { private final ITree> val; /** * Create a new constant. * * @param con * The tree this constant represents. */ public ConstantCommand(final ITree> con) { val = con; } @Override public ITree> denote(final Token operator, final ParserContext ctx) throws ParserException { return val; } }