mirror of https://github.com/DanilaFe/abacus
25 lines
587 B
Java
25 lines
587 B
Java
package org.nwapw.abacus.tree;
|
|
|
|
/**
|
|
* Enum to represent the type of the token that has been matched
|
|
* by the lexer.
|
|
*/
|
|
public enum TokenType {
|
|
|
|
INTERNAL_FUNCTION_END(-1), INTERNAL_FUNCTION_START(-1), ANY(0), COMMA(1), OP(2), NUM(3), WORD(4), OPEN_PARENTH(5), CLOSE_PARENTH(6);
|
|
|
|
/**
|
|
* The priority by which this token gets sorted.
|
|
*/
|
|
public final int priority;
|
|
|
|
/**
|
|
* Creates a new token type with the given priority.
|
|
* @param priority the priority of this token type.
|
|
*/
|
|
TokenType(int priority){
|
|
this.priority = priority;
|
|
}
|
|
|
|
}
|