summaryrefslogtreecommitdiff
path: root/JPratt/src/main/java/bjc/pratt/commands/InitialCommand.java
blob: 0cfa2906f496c3c2e447261d65f3a23fd0fbd55e (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.commands;

import bjc.pratt.ParserContext;
import bjc.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;
}