Class DebugLexer

java.lang.Object
redempt.redlex.processing.Lexer
redempt.redlex.debug.DebugLexer

public class DebugLexer extends Lexer
A specialized Lexer used for debugging
  • Constructor Details

    • DebugLexer

      public DebugLexer(TokenType root)
      Create a Lexer from a token. Not recommended unless you want to do everything by hand.
      Parameters:
      root - The root TokenType for this Lexer
  • Method Details

    • tokenize

      public Token tokenize(String str)
      Description copied from class: Lexer
      Tokenizes an input String
      Overrides:
      tokenize in class Lexer
      Parameters:
      str - The string to tokenize
      Returns:
      The root Token of the tokenized tree
    • tokenize

      public Token tokenize(String str, boolean errorOnFail)
      Description copied from class: Lexer
      Tokenizes an input String
      Overrides:
      tokenize in class Lexer
      Parameters:
      str - The string to tokenize
      errorOnFail - Whether to throw a LexException on failure, returns null if false
      Returns:
      The root Token of the tokenized tree
    • getDebugHistory

      public DebugHistory getDebugHistory()
      Returns:
      The DebugHistory representing all steps for the previous call to tokenize