Class Token

java.lang.Object
edu.umd.cs.findbugs.Token

public class Token extends Object
Simple token class.
Author:
David Hovemeyer
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    A comment.
    static final int
    End of file.
    static final int
    End of line.
    static final int
    A single character token.
    static final int
    A string or character literal.
    static final int
    An ordinary word, number, etc.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Token(int kind)
    Constructor when there is no text.
    Token(int kind, String lexeme)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Get the kind of token.
    Get the text value of the token.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Token

      public Token(int kind, String lexeme)
      Constructor.
      Parameters:
      kind - the kind of token
      lexeme - the text value of the token
    • Token

      public Token(int kind)
      Constructor when there is no text. E.g., EOF and EOL.
      Parameters:
      kind - the kind of token
  • Method Details

    • getKind

      public int getKind()
      Get the kind of token.
    • getLexeme

      public String getLexeme()
      Get the text value of the token.