Class NonDescriptiveNames
java.lang.Object
org.ek9lang.compiler.support.NonDescriptiveNames
THE single source of the variable names E11031 (NON_DESCRIPTIVE_VARIABLE_NAME) bans - and of everything published
about them. Nothing else may write the list out: the phase-5 check, SyntheticParameterNames, the editors'
RefusedNames, the CLI/AI help text and the site all read it from here.
Documents cannot call Java, so they carry a TOKEN instead and the one place that loads them expands it:
BANNED_NAMES_TOKEN (the names, in prose) and ALTERNATIVES_TOKEN (one "name -> use instead" line
per group) - in the rich error messages (RichErrorMessageLoader), the Q&A answers (Ek9QaFileLoader) and the
site pages (SiteGeneratorMain, which also renders forAI.json's bannedIdentifiers and the HTML tables from
groups()). Before 2026-10-05 the list was hand-copied into a dozen places and they had drifted - a site
table missed two of the six groups.
Single-character names are ALWAYS allowed (generic type parameters T/K/V, math x/y/z, loop i/j/k).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne group of banned names with what is published about it. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringasProse()The banned names as prose:temp, tmp, flag, ..., buf, arg (and arg0, arg1, ...).static StringtextwithBANNED_NAMES_TOKENandALTERNATIVES_TOKENexpanded - for every loader of a document that publishes the list.static List<NonDescriptiveNames.Group> groups()Every group, in the order they are published.static booleanisNonDescriptive(String name) True when E11031 would rejectname(case-insensitive; single characters are always allowed).names()The banned names themselves (lower case) - a positional name appears once, standing for itself and itself followed by digits.
-
Field Details
-
BANNED_NAMES_TOKEN
Expanded to the banned names written as prose:temp, tmp, ..., arg (and arg0, arg1, ...).- See Also:
-
ALTERNATIVES_TOKEN
Expanded to one line per group:- temp, tmp -> temporaryUser, calculationResult.- See Also:
-
-
Method Details
-
groups
Every group, in the order they are published. -
names
-
isNonDescriptive
True when E11031 would rejectname(case-insensitive; single characters are always allowed). -
asProse
The banned names as prose:temp, tmp, flag, ..., buf, arg (and arg0, arg1, ...). -
expand
textwithBANNED_NAMES_TOKENandALTERNATIVES_TOKENexpanded - for every loader of a document that publishes the list.
-