enum Token {
IDENTIFIER("ID"), INTEGER("INT"), LPAREN("("), RPAREN(")"), COMMA(",");
private final String tokValue;
Token(String tokValue) {
this.tokValue = tokValue;
}
@Override
public String toString() {
return tokValue;
}
}
public class Main{
public static void main(String[] args) {
for (int i = 0; i < Token.values().length; i++){
System.out.println(Token.values()[i].name() + " = " + Token.values()[i]);
}
}
}
IDENTIFIER = ID
INTEGER = INT
LPAREN = (
RPAREN = )
COMMA = ,