0

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

Corey
  • 771
  • 3
  • 14
  • 32

1 Answers1

1

Java as an enum type.

http://download.oracle.com/javase/tutorial/java/javaOO/enum.html

An example:

public enum Colors{
    RED,BLUE,GREEN;
}
Jeremy
  • 22,188
  • 4
  • 68
  • 81