Reputation: 781
I'm writing a lexer using jflex for a made up programming language. It requires an enumeration java class which holds a bunch of tokens for the made up language. Things like STRING_TKN, ON_TKN, GOTO_TKN, COMMAND_TKN, etc. I haven't used java in a while so I forget how to set these up.
Thanks
Upvotes: 0
Views: 1546
Reputation: 22435
Java as an enum
type.
http://download.oracle.com/javase/tutorial/java/javaOO/enum.html
An example:
public enum Colors{
RED,BLUE,GREEN;
}
Upvotes: 1