Enum Class ReplMode

java.lang.Object
java.lang.Enum<ReplMode>
org.ek9lang.cli.ReplMode
All Implemented Interfaces:
Serializable, Comparable<ReplMode>, Constable

public enum ReplMode extends Enum<ReplMode>
Defines the different modes the REPL can operate in. Each mode determines which EK9 section receives the user input.
  • Enum Constant Details

    • PROGRAM

      public static final ReplMode PROGRAM
    • FUNCTION

      public static final ReplMode FUNCTION
    • CLASS

      public static final ReplMode CLASS
    • RECORD

      public static final ReplMode RECORD
    • TRAIT

      public static final ReplMode TRAIT
    • TYPE

      public static final ReplMode TYPE
  • Method Details

    • values

      public static ReplMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ReplMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getPrompt

      public String getPrompt()
    • fromCommand

      public static ReplMode fromCommand(String command)
      Parse a mode switch command and return the corresponding mode.
      Parameters:
      command - The command string (e.g., "/function", "/class")
      Returns:
      The matching mode, or null if not found