class JPlusAssignOp extends JAssignment
lhs, operator, rhs
isStatementExpression, type
compilationUnit, line
Constructor and Description |
---|
JPlusAssignOp(int line,
JExpression lhs,
JExpression rhs)
Construct the AST node for a += expression given its lhs and rhs
operands.
|
Modifier and Type | Method and Description |
---|---|
JExpression |
analyze(Context context)
Analyze the lhs and rhs, rewrite rhs as lhs + rhs (string concatenation)
if lhs is a String, and set the result type.
|
void |
codegen(CLEmitter output)
Code generation for += involves, generating code for loading any
necessary l-value onto the stack, for (unless a string concatenation)
loading the r-value, for (unless a statement) copying the r-value to its
proper place on the stack, and for doing the store.
|
writeToStdOut
codegen, isStatementExpression, type
line, partialCodegen
public JPlusAssignOp(int line, JExpression lhs, JExpression rhs)
line
- line in which the assignment expression occurs in the source
file.lhs
- the lhs operand.rhs
- the rhs operand.public JExpression analyze(Context context)
analyze
in class JExpression
context
- context in which names are resolved.public void codegen(CLEmitter output)