Package jminusminus

Enum Class TokenKind

java.lang.Object
java.lang.Enum<TokenKind>
jminusminus.TokenKind
All Implemented Interfaces:
Serializable, Comparable<TokenKind>, Constable

enum TokenKind extends Enum<TokenKind>
An enum of token kinds. Each entry in this enum represents the kind of a token along with its image (string representation).
  • Enum Constant Details

    • ABSTRACT

      public static final TokenKind ABSTRACT
      Reserved word, "abstract".
    • BOOLEAN

      public static final TokenKind BOOLEAN
      Reserved word, "boolean".
    • CHAR

      public static final TokenKind CHAR
      Reserved word, "char".
    • CLASS

      public static final TokenKind CLASS
      Reserved word, "class".
    • ELSE

      public static final TokenKind ELSE
      Reserved word, "else".
    • EXTENDS

      public static final TokenKind EXTENDS
      Reserved word, "extends".
    • FALSE

      public static final TokenKind FALSE
      Reserved word, "false".
    • IF

      public static final TokenKind IF
      Reserved word, "if".
    • IMPORT

      public static final TokenKind IMPORT
      Reserved word, "import".
    • INSTANCEOF

      public static final TokenKind INSTANCEOF
      Reserved word, "instanceof".
    • INT

      public static final TokenKind INT
      Reserved word, "int".
    • NEW

      public static final TokenKind NEW
      Reserved word, "new".
    • NULL

      public static final TokenKind NULL
      Reserved word, "null".
    • PACKAGE

      public static final TokenKind PACKAGE
      Reserved word, "package".
    • PRIVATE

      public static final TokenKind PRIVATE
      Reserved word, "private".
    • PROTECTED

      public static final TokenKind PROTECTED
      Reserved word, "protected".
    • PUBLIC

      public static final TokenKind PUBLIC
      Reserved word, "public".
    • RETURN

      public static final TokenKind RETURN
      Reserved word, "return".
    • STATIC

      public static final TokenKind STATIC
      Reserved word, "static".
    • SUPER

      public static final TokenKind SUPER
      Reserved word, "super".
    • THIS

      public static final TokenKind THIS
      Reserved word, "this".
    • TRUE

      public static final TokenKind TRUE
      Reserved word, "true".
    • VOID

      public static final TokenKind VOID
      Reserved word, "void".
    • WHILE

      public static final TokenKind WHILE
      Reserved word, "while".
    • ASSIGN

      public static final TokenKind ASSIGN
      Operator, "=".
    • DEC

      public static final TokenKind DEC
      Operator, "--".
    • EQUAL

      public static final TokenKind EQUAL
      Operator, "==".
    • GT

      public static final TokenKind GT
      Operator, ">".
    • INC

      public static final TokenKind INC
      Operator, "++".
    • LAND

      public static final TokenKind LAND
      Operator, "&&".
    • LE

      public static final TokenKind LE
      Operator, "<=".
    • LNOT

      public static final TokenKind LNOT
      Operator, "!".
    • MINUS

      public static final TokenKind MINUS
      Operator, "-".
    • PLUS

      public static final TokenKind PLUS
      Operator, "+".
    • PLUS_ASSIGN

      public static final TokenKind PLUS_ASSIGN
      Operator, "+=".
    • STAR

      public static final TokenKind STAR
      Operator, "*".
    • COMMA

      public static final TokenKind COMMA
      Separator, ",".
    • DOT

      public static final TokenKind DOT
      Separator, ".".
    • LBRACK

      public static final TokenKind LBRACK
      Separator, "[".
    • LCURLY

      public static final TokenKind LCURLY
      Separator, "{}".
    • LPAREN

      public static final TokenKind LPAREN
      Separator, "(".
    • RBRACK

      public static final TokenKind RBRACK
      Separator, "]".
    • RCURLY

      public static final TokenKind RCURLY
      Separator, "}".
    • RPAREN

      public static final TokenKind RPAREN
      Separator, ")".
    • SEMI

      public static final TokenKind SEMI
      Separator, ";".
    • IDENTIFIER

      public static final TokenKind IDENTIFIER
      Identifier.
    • CHAR_LITERAL

      public static final TokenKind CHAR_LITERAL
      Character literal.
    • INT_LITERAL

      public static final TokenKind INT_LITERAL
      Integer literal.
    • STRING_LITERAL

      public static final TokenKind STRING_LITERAL
      String literal.
    • EOF

      public static final TokenKind EOF
      End of file character.
  • Method Details

    • values

      public static TokenKind[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TokenKind valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • tokenRep

      public String tokenRep()
      Returns the token kind's string representation.
      Returns:
      the token kind's string representation.
    • image

      public String image()
      Returns the token kind's image.
      Returns:
      the token kind's image.