summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/parserutils/IPrecedent.java
blob: 287c8a96b49c016b042d6cd67a77021b4ca77138 (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
package bjc.utils.parserutils;

/**
 * Represents something that has a set precedence
 * 
 * @author ben
 *
 */
@FunctionalInterface
public interface IPrecedent {
	/**
	 * Create a new object with set precedence
	 * 
	 * @param precedence
	 *            The precedence of the object to handle
	 * @return A new object with set precedence
	 */
	public static IPrecedent newSimplePrecedent(int precedence) {
		return () -> precedence;
	}

	/**
	 * Get the precedence of the attached object
	 * 
	 * @return The precedence of the attached object
	 */
	public int getPrecedence();
}