Enum Class SleighUtils.LitIdMode

java.lang.Object
java.lang.Enum<SleighUtils.LitIdMode>
ghidra.pcode.exec.SleighUtils.LitIdMode
All Implemented Interfaces:
Serializable, Comparable<SleighUtils.LitIdMode>, Constable
Enclosing class:
SleighUtils

public static enum SleighUtils.LitIdMode extends Enum<SleighUtils.LitIdMode>
Modes for resolving integer literals and labels

Because Sleigh expressions are often used for address input, we want to allow the default radix to be 16, rather than requiring the user to type 0x.... This complicates things, however, in that the literal 'face' could be a label or the integer value in base 16. Parsers that need to permit this should take this enum as a parameter.

  • Enum Constant Details

    • NORMAL

      public static final SleighUtils.LitIdMode NORMAL
      The normal mode. Un-prefixed integers are in base 10. Labels start with an alpha.
    • HEX

      public static final SleighUtils.LitIdMode HEX
      Hex mode preferring integer values. Un-prefixed are in base 16. Any literal that could be a hex integer is taken for its integer value. '0b'-prefixed literals are no longer allowed. They are instead taken as hex literals. Identifiers/labels consisting only of hex digits are also taken as hex literals. Note that explicit prefixes are still allowed, except for '0b' (binary). Also note that only the "value" portion of a literal is implicitly hex. The size, bitranges, etc., are still base 10 by default.
    • ID_HEX

      public static final SleighUtils.LitIdMode ID_HEX
      Hex mode preferring ids. This works the same as HEX, except that a literal that could be an identifier/label is taken as that id instead of its integer value. To avoid interpreting a value as a label, prefix it with a 0.
  • Field Details

    • VALUES

      public static final List<SleighUtils.LitIdMode> VALUES
    • description

      public final String description
    • radix

      public final int radix
    • preferId

      public final boolean preferId
  • Method Details

    • values

      public static SleighUtils.LitIdMode[] 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 SleighUtils.LitIdMode 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