diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2017-04-10 22:55:22 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2017-04-10 22:55:22 -0400 |
| commit | 7a510ceb37780a7d0da37117a5cfce23c2919257 (patch) | |
| tree | e5f7a796cc6555cdcc5f09d969408f80c79b10e8 /JPratt/src/main/java/bjc/pratt/commands/BlockInitialCommand.java | |
| parent | 56f07e9a3aaa873fe385d224f088f048dbafa8f7 (diff) | |
More work on parse blocks
Diffstat (limited to 'JPratt/src/main/java/bjc/pratt/commands/BlockInitialCommand.java')
| -rw-r--r-- | JPratt/src/main/java/bjc/pratt/commands/BlockInitialCommand.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/JPratt/src/main/java/bjc/pratt/commands/BlockInitialCommand.java b/JPratt/src/main/java/bjc/pratt/commands/BlockInitialCommand.java new file mode 100644 index 0000000..f0448f7 --- /dev/null +++ b/JPratt/src/main/java/bjc/pratt/commands/BlockInitialCommand.java @@ -0,0 +1,41 @@ +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 <K> + * The token key type. + * + * @param <V> + * The token value type. + * + * @param <C> + * The parser state type. + * + */ +public class BlockInitialCommand<K, V, C> extends AbstractInitialCommand<K, V, C> { + private ParseBlock<K, V, C> blck; + + /** + * Create a new block initial command. + * + * @param block + * The block to delegate to. + */ + public BlockInitialCommand(ParseBlock<K, V, C> block) { + blck = block; + } + + @Override + protected ITree<Token<K, V>> intNullDenotation(Token<K, V> operator, ParserContext<K, V, C> ctx) + throws ParserException { + return blck.parse(ctx); + } +}
\ No newline at end of file |
