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