class JStringConcatenationOp extends JBinaryExpression
lhs, operator, rhsisStatementExpression, typecompilationUnit, line| Constructor and Description |
|---|
JStringConcatenationOp(int line,
JExpression lhs,
JExpression rhs)
Construct an AST node for a string concatenation expression given its
line number, and the lhs and rhs operands.
|
| Modifier and Type | Method and Description |
|---|---|
JExpression |
analyze(Context context)
Analysis is simple here.
|
void |
codegen(CLEmitter output)
Code generation generates code for creating a StringBuilder atop the
runtime stack, appending the operands (which might contain nested
concatenations; these are handled by cascadingCodegen()), and then for
converting the StringBuilder to a String.
|
(package private) void |
nestedCodegen(CLEmitter output)
Like a codegen() but we needn't (and shouldn't) create a StringBuilder
nor convert the result to a String, as that will be done in a parent.
|
writeToStdOutcodegen, isStatementExpression, typeline, partialCodegenpublic JStringConcatenationOp(int line,
JExpression lhs,
JExpression rhs)
line - line in which the expression occurs in the source file.lhs - lhs operand.rhs - rhs operand.public JExpression analyze(Context context)
analyze in class JExpressioncontext - context in which names are resolved.public void codegen(CLEmitter output)
void nestedCodegen(CLEmitter output)
output - the code emitter (basically an abstraction for producing the
.class file).