class JLogicalAndOp extends JBooleanBinaryExpression
lhs, operator, rhsisStatementExpression, typecompilationUnit, line| Constructor and Description |
|---|
JLogicalAndOp(int line,
JExpression lhs,
JExpression rhs)
Construct an AST node for a logical AND expression given its line number,
and lhs and rhs operands.
|
| Modifier and Type | Method and Description |
|---|---|
JExpression |
analyze(Context context)
Analyzing a logical AND expression involves analyzing its operands and
insuring they are boolean; the result type is of course boolean.
|
void |
codegen(CLEmitter output,
String targetLabel,
boolean onTrue)
The semantics of j-- require that we implement short-circuiting branching
in implementing the logical AND.
|
codegenwriteToStdOutisStatementExpression, typeline, partialCodegenpublic JLogicalAndOp(int line,
JExpression lhs,
JExpression rhs)
line - line in which the logical AND 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, String targetLabel, boolean onTrue)
codegen in class JExpressionoutput - the code emitter (basically an abstraction for producing the
.class file).targetLabel - target for generated branch instruction.onTrue - should we branch on true?