Class Ek9Identifiers
java.lang.Object
org.ek9lang.compiler.support.Ek9Identifiers
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 Summary
Modifier and TypeMethodDescriptionstatic booleanisIdentifier(String text) True whentextis one whole identifier by the lexer's rule (keywords included).static booleanisPart(char c) True whenccan continue an identifier: an ASCII letter, a digit or_.static booleanisStart(char c) True whenccan begin an identifier: an ASCII letter.
-
Method Details
-
isStart
public static boolean isStart(char c) True whenccan begin an identifier: an ASCII letter. -
isPart
public static boolean isPart(char c) True whenccan continue an identifier: an ASCII letter, a digit or_. -
isIdentifier
True whentextis one whole identifier by the lexer's rule (keywords included).
-