Module jEdit

Class Token

java.lang.Object
org.gjt.sp.jedit.syntax.Token
Direct Known Subclasses:
Chunk

public class Token extends Object
A linked list of syntax tokens.
Version:
$Id: Token.java 25244 2020-04-15 15:14:49Z kpouer $
Author:
Slava Pestov
  • Field Details

  • Constructor Details

    • Token

      public Token(byte id, int offset, int length, ParserRuleSet rules)
      Creates a new token.
      Parameters:
      id - The id of the token
      offset - The start offset of the token
      length - The length of the token
      rules - The parser rule set that generated this token
  • Method Details

    • stringToToken

      public static byte stringToToken(String value)
      Converts a token type string to a token type constant.
      Parameters:
      value - The token type
      Since:
      jEdit 4.1pre1
    • tokenToString

      public static String tokenToString(byte token)
      Converts a token type constant to a token type string.
      Since:
      jEdit 4.2pre1
    • toString

      public String toString()
      Returns a string representation of this token.
      Overrides:
      toString in class Object
    • isCommentOrLiteral

      public static boolean isCommentOrLiteral(byte id)
      Returns:
      true for COMMENTx and LITERALx tokens