Class TokenExtractor

java.lang.Object
org.ek9lang.cli.TokenExtractor

public final class TokenExtractor extends Object
Extracts tokens (keywords, operators, identifiers) from a line at a cursor position. Used for hover help and completion in the REPL.
  • Constructor Details

    • TokenExtractor

      public TokenExtractor()
  • Method Details

    • extractAt

      public Optional<String> extractAt(String line, int cursor)
      Extract the token at the cursor position.
      Parameters:
      line - The input line
      cursor - The cursor position (0-based)
      Returns:
      The token if found, empty otherwise