class JPlusOp extends JBinaryExpression
lhs, operator, rhs
isStatementExpression, type
compilationUnit, line
Constructor and Description |
---|
JPlusOp(int line,
JExpression lhs,
JExpression rhs)
Construct an AST node for an addition expression given its line number,
and the lhs and rhs operands.
|
Modifier and Type | Method and Description |
---|---|
JExpression |
analyze(Context context)
Analysis involves first analyzing the operands.
|
void |
codegen(CLEmitter output)
Any string concatenation has been rewritten as a JStringConcatenationOp
(in analyze()), so code generation here involves simply generating code
for loading the operands onto the stack and then generating the
appropriate add instruction.
|
writeToStdOut
codegen, isStatementExpression, type
line, partialCodegen
public JPlusOp(int line, JExpression lhs, JExpression rhs)
line
- line in which the addition 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)