2017-07-25 11:08:03 -07:00
|
|
|
package org.nwapw.abacus.tree;
|
|
|
|
|
2017-07-26 10:10:37 -07:00
|
|
|
/**
|
|
|
|
* Enum to represent the type of the token that has been matched
|
|
|
|
* by the lexer.
|
|
|
|
*/
|
2017-07-25 11:08:03 -07:00
|
|
|
public enum TokenType {
|
|
|
|
|
2017-07-27 12:53:58 -07:00
|
|
|
INTERNAL_FUNCTION_END(-1),
|
2017-07-27 16:36:13 -07:00
|
|
|
ANY(0), WHITESPACE(1), COMMA(2), OP(3), NUM(4), FUNCTION(5), OPEN_PARENTH(6), CLOSE_PARENTH(7);
|
2017-07-25 11:08:03 -07:00
|
|
|
|
2017-07-26 10:10:37 -07:00
|
|
|
/**
|
|
|
|
* The priority by which this token gets sorted.
|
|
|
|
*/
|
2017-07-25 11:08:03 -07:00
|
|
|
public final int priority;
|
|
|
|
|
2017-07-26 10:10:37 -07:00
|
|
|
/**
|
|
|
|
* Creates a new token type with the given priority.
|
|
|
|
* @param priority the priority of this token type.
|
|
|
|
*/
|
2017-07-25 11:08:03 -07:00
|
|
|
TokenType(int priority){
|
|
|
|
this.priority = priority;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|