package bjc.pratt.commands; import bjc.pratt.ParseBlock; import bjc.pratt.ParserContext; import bjc.pratt.Token; import bjc.utils.data.ITree; import bjc.utils.parserutils.ParserException; /** * An initial command that delegates all the work to a {@link ParseBlock} * * @author bjculkin * @param * The token key type. * * @param * The token value type. * * @param * The parser state type. * */ public class BlockInitialCommand extends AbstractInitialCommand { private final ParseBlock blck; /** * Create a new block initial command. * * @param block * The block to delegate to. */ public BlockInitialCommand(final ParseBlock block) { blck = block; } @Override protected ITree> intNullDenotation(final Token operator, final ParserContext ctx) throws ParserException { return blck.parse(ctx); } }