public class Operator extends ASTNode
The precedence values for Java operators were taken from Java-FAQ.com.
Modifier and Type | Field and Description |
---|---|
static int |
AND
Value of the
operation variable. |
static int |
AND_ASSIGN
Value of the
operation variable. |
static int |
ARROW
Value of the
operation variable. |
static int |
ASSIGN
Value of the
operation variable. |
static int |
BITWISE_AND
Value of the
operation variable. |
static int |
BITWISE_NOT
Value of the
operation variable. |
static int |
BITWISE_OR
Value of the
operation variable. |
static int |
CONDITIONAL
Value of the
operation variable. |
static int |
CONJUNCTION
Value of the
operation variable. |
static int |
CONSTRAINT_EQUAL
Value of the
operation variable. |
static int |
CONSTRAINT_NOT_EQUAL
Value of the
operation variable. |
static int |
DIVIDE
Value of the
operation variable. |
static int |
DIVIDE_ASSIGN
Value of the
operation variable. |
static int |
DOT
Value of the
operation variable. |
static int |
DOUBLE_IMPLICATION
Value of the
operation variable. |
static int |
EQUAL
Value of the
operation variable. |
static int |
GREATER_THAN
Value of the
operation variable. |
static int |
GREATER_THAN_OR_EQUAL
Value of the
operation variable. |
static int |
IMPLICATION
Value of the
operation variable. |
static int |
INSTANCEOF
Value of the
operation variable. |
static int |
LEFT_SHIFT
Value of the
operation variable. |
static int |
LEFT_SHIFT_ASSIGN
Value of the
operation variable. |
static int |
LESS_THAN
Value of the
operation variable. |
static int |
LESS_THAN_OR_EQUAL
Value of the
operation variable. |
static int |
LOGICAL_CONJUNCTION
Value of the
operation variable. |
static int |
LOGICAL_DISJUNCTION
Value of the
operation variable. |
static int |
MINUS
Value of the
operation variable. |
static int |
MINUS_ASSIGN
Value of the
operation variable. |
static int |
MOD
Value of the
operation variable. |
static int |
MOD_ASSIGN
Value of the
operation variable. |
static int |
MULTIPLY_ASSIGN
Value of the
operation variable. |
static int |
NEW
Value of the
operation variable. |
static int |
NOT
Value of the
operation variable. |
static int |
NOT_EQUAL
Value of the
operation variable. |
int |
operation
The index of the operation represented by this
Operator . |
static int |
OR
Value of the
operation variable. |
static int |
OR_ASSIGN
Value of the
operation variable. |
static int |
PLUS
Value of the
operation variable. |
static int |
PLUS_ASSIGN
Value of the
operation variable. |
static int |
POST_DECREMENT
Value of the
operation variable. |
static int |
POST_INCREMENT
Value of the
operation variable. |
static int |
PRE_DECREMENT
Value of the
operation variable. |
static int |
PRE_INCREMENT
Value of the
operation variable. |
static int |
SIGNED_RIGHT_SHIFT
Value of the
operation variable. |
static int |
SIGNED_RIGHT_SHIFT_ASSIGN
Value of the
operation variable. |
static int |
TIMES
Value of the
operation variable. |
static int |
UNSIGNED_RIGHT_SHIFT
Value of the
operation variable. |
static int |
UNSIGNED_RIGHT_SHIFT_ASSIGN
Value of the
operation variable. |
static int |
XOR
Value of the
operation variable. |
static int |
XOR_ASSIGN
Value of the
operation variable. |
byteOffset, line, nodeID, symbolTable
Constructor and Description |
---|
Operator(int operation)
Default constructor.
|
Operator(int operation,
int line,
int byteOffset)
Full constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a new object with the same primitive data, and recursively creates new member data
objects as well.
|
boolean |
equals(Object o)
Indicates whether some other object is "equal to" this one.
|
int |
getPrecedence()
Produces the precedence of this operator.
|
int |
hashCode()
Returns a hash code value for java hash structures.
|
ASTNodeIterator |
iterator()
Returns an iterator used to successively access the children of this node.
|
static int |
operatorPrecedence(int operation)
Produces the precedence of an operator given its index.
|
static String |
operatorSymbol(int operation)
Produces the name of an operator given its index.
|
void |
runPass(Pass pass)
Ensures that the correct
run() method is called for this type of node. |
void |
write(StringBuffer buffer)
Writes a string representation of this
ASTNode to the specified buffer. |
public static final int DOT
operation
variable.public static final int PRE_INCREMENT
operation
variable.public static final int POST_INCREMENT
operation
variable.public static final int PRE_DECREMENT
operation
variable.public static final int POST_DECREMENT
operation
variable.public static final int BITWISE_NOT
operation
variable.public static final int NOT
operation
variable.public static final int NEW
operation
variable.public static final int TIMES
operation
variable.public static final int DIVIDE
operation
variable.public static final int MOD
operation
variable.public static final int PLUS
operation
variable.public static final int MINUS
operation
variable.public static final int LEFT_SHIFT
operation
variable.public static final int SIGNED_RIGHT_SHIFT
operation
variable.public static final int UNSIGNED_RIGHT_SHIFT
operation
variable.public static final int LESS_THAN
operation
variable.public static final int LESS_THAN_OR_EQUAL
operation
variable.public static final int GREATER_THAN
operation
variable.public static final int GREATER_THAN_OR_EQUAL
operation
variable.public static final int INSTANCEOF
operation
variable.public static final int EQUAL
operation
variable.public static final int NOT_EQUAL
operation
variable.public static final int BITWISE_AND
operation
variable.public static final int XOR
operation
variable.public static final int BITWISE_OR
operation
variable.public static final int AND
operation
variable.public static final int OR
operation
variable.public static final int CONDITIONAL
operation
variable.public static final int ASSIGN
operation
variable.public static final int MULTIPLY_ASSIGN
operation
variable.public static final int DIVIDE_ASSIGN
operation
variable.public static final int MOD_ASSIGN
operation
variable.public static final int PLUS_ASSIGN
operation
variable.public static final int MINUS_ASSIGN
operation
variable.public static final int LEFT_SHIFT_ASSIGN
operation
variable.public static final int SIGNED_RIGHT_SHIFT_ASSIGN
operation
variable.public static final int UNSIGNED_RIGHT_SHIFT_ASSIGN
operation
variable.public static final int AND_ASSIGN
operation
variable.public static final int OR_ASSIGN
operation
variable.public static final int XOR_ASSIGN
operation
variable.public static final int CONJUNCTION
operation
variable.public static final int ARROW
operation
variable.public static final int CONSTRAINT_EQUAL
operation
variable.public static final int CONSTRAINT_NOT_EQUAL
operation
variable.public static final int LOGICAL_CONJUNCTION
operation
variable.public static final int LOGICAL_DISJUNCTION
operation
variable.public static final int IMPLICATION
operation
variable.public static final int DOUBLE_IMPLICATION
operation
variable.public int operation
Operator
.public Operator(int operation)
operation
- The index of the operation.public Operator(int operation, int line, int byteOffset)
operation
- The index of the operation.line
- The line on which the source code represented by this node is found.byteOffset
- The byte offset from the beginning of the source file at which the source
code represented by this node is found.public static String operatorSymbol(int operation)
operation
- The index of the operation. (See the static member variables.)public static int operatorPrecedence(int operation)
operation
- The index of the operation.public int getPrecedence()
public int hashCode()
public boolean equals(Object o)
public ASTNodeIterator iterator()
public Object clone()
public void runPass(Pass pass)
run()
method is called for this type of node.public void write(StringBuffer buffer)
ASTNode
to the specified buffer. The
representation written is parsable by the LBJava compiler, but not very readable.Copyright © 2016. All rights reserved.