java.lang.Object
org.kink_lang.kink.internal.program.lex.Lexer
All Implemented Interfaces:
Function<String,List<Token>>

public class Lexer extends Object implements Function<String,List<Token>>
A lexical analyzer of Kink programs.
  • Constructor Details

    • Lexer

      public Lexer(Locale locale)
      Constructs a lexer.
      Parameters:
      locale - the locale for error message.
  • Method Details

    • apply

      public List<Token> apply(String programText)
      Returns a list of tokens analyzed from the program text.

      The result tokens ends with an EotToken or an ErrorToken.

      Specified by:
      apply in interface Function<String,List<Token>>
      Parameters:
      programText - the program text to be analyzed.
      Returns:
      a list of token analyzed from the program text.