Class NonDescriptiveNames

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

public final class NonDescriptiveNames extends Object
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), all through ExpandBannedNameTokens. THE check is IsNonDescriptiveName. 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).

  • Field Details

    • BANNED_NAMES_TOKEN

      public static final String BANNED_NAMES_TOKEN
      Expanded to the banned names written as prose: temp, tmp, ..., arg (and arg0, arg1, ...).
      See Also:
    • ALTERNATIVES_TOKEN

      public static final String ALTERNATIVES_TOKEN
      Expanded to one line per group: - temp, tmp -> temporaryUser, calculationResult.
      See Also:
    • GROUPS

      public static final List<NonDescriptiveNames.Group> GROUPS
      Every group, in the order they are published.
    • NAMES

      public static final Set<String> NAMES
      The banned names themselves (lower case) - a positional name appears once, standing for itself and itself followed by digits.
    • PROSE

      public static final String PROSE
      The banned names as prose: temp, tmp, flag, ..., buf, arg (and arg0, arg1, ...).
    • ALTERNATIVES

      public static final String ALTERNATIVES
      One line per group: - temp, tmp -> temporaryUser, calculationResult.