| com.pnfsoftware.jeb.core.units.code.java.IJavaAssignment |
Java AST interface to represent assignments.
Example of a simple assignment: left = right
A simple assignment can be modified to represent non-standard assignments:
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| abstract IJavaOperator |
getCombinedOperator()
Retrieve the combined operator of a combined assignment.
| ||||||||||
| abstract IJavaLeftExpression |
getLeft()
Get the left part of the assignment.
| ||||||||||
| abstract IJavaExpression |
getRight()
Get the right part of the assignment.
| ||||||||||
| abstract void |
getUnaryOperator(boolean[] r)
Retrieve the unary operator of a unary operator assignment.
| ||||||||||
| abstract boolean |
isCombinedOperatorAssignment()
Determine if the assignment is a combined assignment.
| ||||||||||
| abstract boolean |
isSimpleAssignment()
Determine if the assignment is a regular ('=') assignment.
| ||||||||||
| abstract boolean |
isUnaryOperatorAssignment()
Determine if the assignment is a unary-operator assignment.
| ||||||||||
| abstract void |
setCombinedOperator(IJavaOperator operator)
Transform a simple assignment into a combined operator assignment.
| ||||||||||
| abstract void |
setLeft(IJavaLeftExpression left)
Set the left part of the assignment.
| ||||||||||
| abstract void |
setRight(IJavaExpression right)
Set the right part of the assignment.
| ||||||||||
| abstract void |
setUnaryOperator(boolean isIncrement, boolean isPrefixed)
Transform the non-unary assignment into one of the four unary assignments: postfix increment,
postfix decrement, prefix increment, prefix decrement.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.pnfsoftware.jeb.core.units.code.java.IJavaElement
| |||||||||||
Retrieve the combined operator of a combined assignment.
Example: for "a += b", the operator returned would be "+"
| IllegalStateException | if the assignment is not a combined assignment |
|---|
Retrieve the unary operator of a unary operator assignment.
| r | mandatory 2-element array, will be set to {is_increment, is_prefixed} |
|---|
| IllegalStateException | if the assignment is not a unary assignment |
|---|
Determine if the assignment is a combined assignment. There ar 11 possible types of combined operators. Examples include: '+=', '-=', etc.
Determine if the assignment is a regular ('=') assignment.
Determine if the assignment is a unary-operator assignment.
Example: i++ or --j
Transform a simple assignment into a combined operator assignment. The current assignment cannot be a unary assignment, else the method will throw.
| operator | mandatory combined operator, there are eleven possibilities:MUL, DIV, ADD, SUB, REM, SHL, SHR, USHR, AND, XOR, OR
|
|---|
Set the left part of the assignment.
| left | mandatory left expression |
|---|
Set the right part of the assignment. The assignment cannot be a unary assignment.
| right | mandatory right expression |
|---|
Transform the non-unary assignment into one of the four unary assignments: postfix increment, postfix decrement, prefix increment, prefix decrement. The right member of the expression is automatically nullified.
| isIncrement | true for increment, false for decrement |
|---|---|
| isPrefixed | true for prefixed, false for postfixed |