mirror of
https://github.com/DanilaFe/abacus
synced 2024-11-05 02:09:53 -08:00
Implement two enums for conversion between strings and tokens.
This commit is contained in:
parent
42db6b3c2f
commit
1dcd6beb1c
5
src/org/nwapw/abacus/tree/OperatorAssociativity.java
Normal file
5
src/org/nwapw/abacus/tree/OperatorAssociativity.java
Normal file
|
@ -0,0 +1,5 @@
|
|||
package org.nwapw.abacus.tree;
|
||||
|
||||
public enum OperatorAssociativity {
|
||||
LEFT, RIGHT
|
||||
}
|
13
src/org/nwapw/abacus/tree/TokenType.java
Normal file
13
src/org/nwapw/abacus/tree/TokenType.java
Normal 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;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user