package bjc.pratt.commands.impls; import bjc.pratt.ParserContext; import bjc.pratt.blocks.ParseBlock; import bjc.pratt.commands.AbstractInitialCommand; import bjc.pratt.tokens.Token; import bjc.data.Tree; 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 Tree> intNullDenotation(final Token operator, final ParserContext ctx) throws ParserException { return blck.parse(ctx); } }