Class Ek9Keywords
java.lang.Object
org.ek9lang.compiler.support.Ek9Keywords
THE source for EK9's word keywords, and for whether a keyword can still be used as a NAME. Use this rather
than walking the lexer vocabulary again or hand-copying a list.
The two questions differ: the grammar's identifier rule deliberately admits many word keywords
(sort, cat, filter, map, text, type, ...), so "is a keyword" is
NOT "cannot be a name". isReservedWord(String) answers the second by parsing word <- 1 in a minimal
program, once per word, cached - DERIVED from the grammar, never a list that drifts when the grammar changes.
Consolidated 2026-09-26 (front-end audit batch 9) from compiler-services CursorColumn (which now
delegates here) and a cruder copy in SyntheticParameterNames that treated every keyword as reserved.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisReservedWord(String word) True whenwordis a keyword that CANNOT be used as a name.Every word-shaped token literal of the EK9 grammar (defines,as,sort, ...).
-
Method Details
-
wordKeywords
-
isReservedWord
True whenwordis a keyword that CANNOT be used as a name.
-