1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-12-22 15:30:09 -08:00

Implement two enums for conversion between strings and tokens.

This commit is contained in:
Danila Fedorin 2017-07-25 11:08:03 -07:00
parent 42db6b3c2f
commit 1dcd6beb1c
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,5 @@
package org.nwapw.abacus.tree;
public enum OperatorAssociativity {
LEFT, RIGHT
}

View File

@ -0,0 +1,13 @@
package org.nwapw.abacus.tree;
public enum TokenType {
ANY(0), OP(1), NUM(2), WORD(3), OPEN_PARENTH(4), CLOSE_PARENTH(5);
public final int priority;
TokenType(int priority){
this.priority = priority;
}
}