edu.cmu.cs.crystal.tac.model
Enum BinaryOperator
java.lang.Object
java.lang.Enum<BinaryOperator>
edu.cmu.cs.crystal.tac.model.BinaryOperator
- All Implemented Interfaces:
- Serializable, Comparable<BinaryOperator>
public enum BinaryOperator
- extends Enum<BinaryOperator>
Binary operators including arithmetic, relational, and bitwise operators
as well as bit shifts and string concatenation. Notice that we distinguish
addition (ARIT_ADD
) from string concatenation
(STRING_CONCAT
), even though both are written + (plus)
in the source. Also notice that + (plus) and - (minus) can also be BinaryOperator
s.
- Author:
- Kevin Bierhoff
Field Summary |
String |
token
Token representing the operator in source code, such as +, !=, or >>. |
ARIT_ADD
public static final BinaryOperator ARIT_ADD
ARIT_MULTIPLY
public static final BinaryOperator ARIT_MULTIPLY
ARIT_SUBTRACT
public static final BinaryOperator ARIT_SUBTRACT
ARIT_DIVIDE
public static final BinaryOperator ARIT_DIVIDE
ARIT_MODULO
public static final BinaryOperator ARIT_MODULO
REL_EQ
public static final BinaryOperator REL_EQ
REL_NEQ
public static final BinaryOperator REL_NEQ
REL_GT
public static final BinaryOperator REL_GT
REL_GEQ
public static final BinaryOperator REL_GEQ
REL_LT
public static final BinaryOperator REL_LT
REL_LEQ
public static final BinaryOperator REL_LEQ
BITWISE_AND
public static final BinaryOperator BITWISE_AND
BITWISE_OR
public static final BinaryOperator BITWISE_OR
BITWISE_XOR
public static final BinaryOperator BITWISE_XOR
SHIFT_LEFT
public static final BinaryOperator SHIFT_LEFT
SHIFT_RIGHT
public static final BinaryOperator SHIFT_RIGHT
SHIFT_UNSIGNED_RIGHT
public static final BinaryOperator SHIFT_UNSIGNED_RIGHT
STRING_CONCAT
public static final BinaryOperator STRING_CONCAT
token
public final String token
- Token representing the operator in source code, such as +, !=, or >>.
values
public static final BinaryOperator[] values()
- Returns an array containing the constants of this enum type, in
the order they're declared. This method may be used to iterate
over the constants as follows:
for(BinaryOperator c : BinaryOperator.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they're declared
valueOf
public static BinaryOperator 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
toString
public String toString()
- Overrides:
toString
in class Enum<BinaryOperator>