package bjc.pratt.commands.impls; import bjc.pratt.ParserContext; import bjc.pratt.commands.InitialCommand; import bjc.pratt.tokens.Token; import bjc.data.ITree; import bjc.data.Tree; import bjc.utils.parserutils.ParserException; /** * A operator that stands for itself. * * @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 LeafCommand implements InitialCommand { @Override public ITree> denote(final Token operator, final ParserContext ctx) throws ParserException { return new Tree<>(operator); } }