Enum Class COperatorType
- All Implemented Interfaces:
Serializable
,Comparable<COperatorType>
,Constable
Operator types are used to build
operators
used by AST components, eg, in
operations
.
All types are regular except the CUSTOM
and CAST
types, which are used to build
custom operators.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Operator associativity (left, right).Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionProvide associativity (left, right) information about the operation type.int
Get the number of operands accepted by this operator.int
Provide precedence information about the operation type.mirror()
Retrieve a mirror of this operator.reverse()
Retrieve a reverse of this operator.toString()
static COperatorType
Returns the enum constant of this class with the specified name.static COperatorType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CUSTOM
-
NEG
-
NOT
-
LOG_NOT
-
PTR
-
REF
-
CAST
-
SIZEOF
-
LOG_IDENT
Logical pseudo-identity operator (no output); the opposite of LOG_NOT -
MUL
-
DIV
-
REM
-
ADD
-
SUB
-
SHL
-
SHR
-
USHR
-
GE
-
GT
-
LT
-
LE
-
EQ
-
NE
-
AND
-
XOR
-
OR
-
LOG_AND
-
LOG_OR
-
COND
ternary conditional operator
-
-
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
-
getOperandCount
public int getOperandCount()Get the number of operands accepted by this operator.- Returns:
-
getPrecedence
public int getPrecedence()Provide precedence information about the operation type.- Returns:
- a positive value (lower means "higher precedence"), 0 if unknown
-
getAssociativity
Provide associativity (left, right) information about the operation type.- Returns:
- the associativity, or null if irrelevant
-
toString
- Overrides:
toString
in classEnum<COperatorType>
-
reverse
Retrieve a reverse of this operator.- Returns:
- the reverse operator or null
-
mirror
Retrieve a mirror of this operator.- Returns:
- the mirror operator or null
-