blob: fede0969872e161c0d606e301df2e57469a7f545 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
package bjc.pratt.blocks;
import bjc.pratt.ParserContext;
import bjc.pratt.commands.CommandResult;
import bjc.pratt.tokens.Token;
import bjc.data.Tree;
import bjc.utils.parserutils.ParserException;
/**
* Represents a embedded block in an expression.
*
* @author bjculkin
*
* @param <K>
* The key type of the token.
*
* @param <V>
* The value type of the token.
*
* @param <C>
* The state type of the parser.
*/
@FunctionalInterface
public interface ParseBlock<K, V, C> {
/**
* Parse the block this represents.
*
* @param ctx
* The context for parsing.
*
* @return A AST for this block.
*
* @throws ParserException
* If something goes wrong during parsing, or the block fails
* validation.
*/
CommandResult<K, V> parse(ParserContext<K, V, C> ctx) throws ParserException;
}
|