Enum BuiltinFunction

java.lang.Object
java.lang.Enum<BuiltinFunction>
io.jawk.intermediate.BuiltinFunction
All Implemented Interfaces:
Serializable, Comparable<BuiltinFunction>

public enum BuiltinFunction extends Enum<BuiltinFunction>
The standard AWK built-in functions, the single source of truth shared by the parser (recognition and dispatch) and the runtime (the FUNCTAB listing). Each constant carries the function name as it appears in AWK source code, which may differ from the constant name itself (e.g. INT for the int function). print, printf, and getline are statements, not functions, so they are not listed, as in gawk.
  • Enum Constant Details

  • Method Details

    • values

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

      public static BuiltinFunction valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • getAwkName

      public String getAwkName()
      Returns the name of the function as it appears in AWK source code.
      Returns:
      the AWK-visible function name
    • of

      public static BuiltinFunction of(String name)
      Resolves an AWK function name to its enum constant.
      Parameters:
      name - the function name as it appears in AWK source code
      Returns:
      the matching constant, or null if the name does not denote a built-in function
    • names

      public static Set<String> names()
      Returns the names of all standard built-in functions, as they appear in AWK source code and in gawk's FUNCTAB.
      Returns:
      unmodifiable set of function names, in declaration order