blob: 3b613a3c5d0ea50105c0dfa2d186b1e35c8058ed (
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
40
|
package com.ashardalon.pratt.commands;
import com.ashardalon.pratt.ParserContext;
import com.ashardalon.pratt.tokens.Token;
import bjc.utils.parserutils.ParserException;
/**
* Represents an initial command in parsing.
*
* @author EVE
*
* @param <K>
* The key type for the tokens.
*
* @param <V>
* The value type for the tokens.
*
* @param <C>
* The state type of the parser.
*
*
*/
@FunctionalInterface
public interface InitialCommand<K, V, C> {
/**
* Construct the null denotation of this command.
*
* @param operator
* The operator for this command.
* @param ctx
* The context for the command.
*
* @return The result of executing the command.
*
* @throws ParserException
* If something goes wrong during parsing.
*/
CommandResult<K, V> denote(Token<K, V> operator, ParserContext<K, V, C> ctx) throws ParserException;
}
|