Package icyllis.arc3d.compiler
Enum Class Operator
- All Implemented Interfaces:
Serializable
,Comparable<Operator>
,Constable
Operators.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
OperatorPrecedence
.static final int
OperatorPrecedence
.static final int
OperatorPrecedence
.static final int
OperatorPrecedence
.static final int
OperatorPrecedence
.static final int
OperatorPrecedence
.static final int
OperatorPrecedence
.static final int
OperatorPrecedence
.static final int
OperatorPrecedence
.static final int
OperatorPrecedence
.static final int
OperatorPrecedence
.static final int
OperatorPrecedence
.static final int
OperatorPrecedence
.static final int
OperatorPrecedence
.static final int
OperatorPrecedence
.static final int
OperatorPrecedence
.static final int
OperatorPrecedence
.static final int
OperatorPrecedence
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
determineBinaryType
(Context context, Type left, Type right, Type[] out) Determines the operand and result types of a binary expression.int
Returns the operator name surrounded by the expected whitespace for a tidy binary expression.boolean
Returns true if op is '=' or any compound assignment operator ('+=', '-=', etc.)boolean
boolean
Defines the set of operators which are only valid on integral types: % %= invalid input: '<'invalid input: '<' invalid input: '<'invalid input: '<'= >> >>= ~ invalid input: '&' invalid input: '&'= | |= ^ ^=boolean
Defines the set of relational (comparison) operators: invalid input: '<' invalid input: '<'= > >=boolean
Defines the set of operators which perform vector/matrix math.Given a compound assignment operator, returns the non-assignment version of the operator (e.g.toString()
Returns the operator name without any surrounding whitespace.static Operator
Returns the enum constant of this class with the specified name.static Operator[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ADD
-
SUB
-
MUL
-
DIV
-
MOD
-
SHL
-
SHR
-
LOGICAL_NOT
-
LOGICAL_AND
-
LOGICAL_OR
-
LOGICAL_XOR
-
BITWISE_NOT
-
BITWISE_AND
-
BITWISE_OR
-
BITWISE_XOR
-
ASSIGN
-
EQ
-
NE
-
LT
-
GT
-
LE
-
GE
-
ADD_ASSIGN
-
SUB_ASSIGN
-
MUL_ASSIGN
-
DIV_ASSIGN
-
MOD_ASSIGN
-
SHL_ASSIGN
-
SHR_ASSIGN
-
AND_ASSIGN
-
OR_ASSIGN
-
XOR_ASSIGN
-
INC
-
DEC
-
COMMA
-
-
Field Details
-
PRECEDENCE_POSTFIX
public static final int PRECEDENCE_POSTFIXOperatorPrecedence
.Enum values:
- See Also:
-
PRECEDENCE_PREFIX
public static final int PRECEDENCE_PREFIXOperatorPrecedence
.Enum values:
- See Also:
-
PRECEDENCE_MULTIPLICATIVE
public static final int PRECEDENCE_MULTIPLICATIVEOperatorPrecedence
.Enum values:
- See Also:
-
PRECEDENCE_ADDITIVE
public static final int PRECEDENCE_ADDITIVEOperatorPrecedence
.Enum values:
- See Also:
-
PRECEDENCE_SHIFT
public static final int PRECEDENCE_SHIFTOperatorPrecedence
.Enum values:
- See Also:
-
PRECEDENCE_RELATIONAL
public static final int PRECEDENCE_RELATIONALOperatorPrecedence
.Enum values:
- See Also:
-
PRECEDENCE_EQUALITY
public static final int PRECEDENCE_EQUALITYOperatorPrecedence
.Enum values:
- See Also:
-
PRECEDENCE_BITWISE_AND
public static final int PRECEDENCE_BITWISE_ANDOperatorPrecedence
.Enum values:
- See Also:
-
PRECEDENCE_BITWISE_XOR
public static final int PRECEDENCE_BITWISE_XOROperatorPrecedence
.Enum values:
- See Also:
-
PRECEDENCE_BITWISE_OR
public static final int PRECEDENCE_BITWISE_OROperatorPrecedence
.Enum values:
- See Also:
-
PRECEDENCE_LOGICAL_AND
public static final int PRECEDENCE_LOGICAL_ANDOperatorPrecedence
.Enum values:
- See Also:
-
PRECEDENCE_LOGICAL_XOR
public static final int PRECEDENCE_LOGICAL_XOROperatorPrecedence
.Enum values:
- See Also:
-
PRECEDENCE_LOGICAL_OR
public static final int PRECEDENCE_LOGICAL_OROperatorPrecedence
.Enum values:
- See Also:
-
PRECEDENCE_CONDITIONAL
public static final int PRECEDENCE_CONDITIONALOperatorPrecedence
.Enum values:
- See Also:
-
PRECEDENCE_ASSIGNMENT
public static final int PRECEDENCE_ASSIGNMENTOperatorPrecedence
.Enum values:
- See Also:
-
PRECEDENCE_SEQUENCE
public static final int PRECEDENCE_SEQUENCEOperatorPrecedence
.Enum values:
- See Also:
-
PRECEDENCE_EXPRESSION
public static final int PRECEDENCE_EXPRESSIONOperatorPrecedence
.Enum values:
- See Also:
-
PRECEDENCE_STATEMENT
public static final int PRECEDENCE_STATEMENTOperatorPrecedence
.Enum values:
- See Also:
-
-
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
-
getBinaryPrecedence
public int getBinaryPrecedence() -
getPrettyName
Returns the operator name surrounded by the expected whitespace for a tidy binary expression. -
toString
Returns the operator name without any surrounding whitespace. -
isEquality
public boolean isEquality() -
isRelational
public boolean isRelational()Defines the set of relational (comparison) operators: invalid input: '<' invalid input: '<'= > >= -
isAssignment
public boolean isAssignment()Returns true if op is '=' or any compound assignment operator ('+=', '-=', etc.) -
removeAssignment
Given a compound assignment operator, returns the non-assignment version of the operator (e.g. '+=' becomes '+') -
isOnlyValidForIntegers
public boolean isOnlyValidForIntegers()Defines the set of operators which are only valid on integral types: % %= invalid input: '<'invalid input: '<' invalid input: '<'invalid input: '<'= >> >>= ~ invalid input: '&' invalid input: '&'= | |= ^ ^= -
isValidForVectorOrMatrix
public boolean isValidForVectorOrMatrix()Defines the set of operators which perform vector/matrix math. + += - -= * *= / /= % %= invalid input: '<'invalid input: '<' invalid input: '<'invalid input: '<'= >> >>= invalid input: '&' invalid input: '&'= | |= ^ ^= -
determineBinaryType
Determines the operand and result types of a binary expression. Returns true if the expression is legal, false otherwise. If false, the values of the out parameters are undefined.- Parameters:
out
- left type, right type and result type, respectively
-