Enum Class SleighUtils.LitIdMode
- All Implemented Interfaces:
Serializable, Comparable<SleighUtils.LitIdMode>, Constable
- Enclosing class:
SleighUtils
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Stringfinal booleanfinal intstatic final List<SleighUtils.LitIdMode> -
Method Summary
Modifier and TypeMethodDescriptionstatic SleighUtils.LitIdModeReturns the enum constant of this class with the specified name.static SleighUtils.LitIdMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NORMAL
The normal mode. Un-prefixed integers are in base 10. Labels start with an alpha. -
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
Hex mode preferring ids. This works the same asHEX, 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
-
description
-
radix
public final int radix -
preferId
public final boolean preferId
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-