Class Ek9Identifiers

java.lang.Object
org.ek9lang.compiler.support.Ek9Identifiers

public final class Ek9Identifiers extends Object
THE characters of an EK9 identifier - the lexer's Identifier : Letter LetterOrDigit* with Letter : [a-zA-Z] and LetterOrDigit : [a-zA-Z0-9_] (EK9LexerRules.g4). Use this rather than Character.isJavaIdentifierPart or a private copy.

Java's rule is not EK9's: it admits $, which in EK9 is the string operator. A rename that asked Java whether `${$count}` held a longer name than count was told yes - the $ in front - and skipped the site, leaving the interpolation naming a variable that no longer existed (found 2026-10-23 through ek9_find_symbols with renameTo). It also admits non-ASCII letters, which the lexer does not.

Whether a well-formed identifier is free to be a NAME is Ek9Keywords.isReservedWord(String)'s question.

  • Method Details

    • isStart

      public static boolean isStart(char c)
      True when c can begin an identifier: an ASCII letter.
    • isPart

      public static boolean isPart(char c)
      True when c can continue an identifier: an ASCII letter, a digit or _.
    • isIdentifier

      public static boolean isIdentifier(String text)
      True when text is one whole identifier by the lexer's rule (keywords included).