class JPreIncrementOp extends JUnaryExpression
arg
isStatementExpression, type
compilationUnit, line
Constructor and Description |
---|
JPreIncrementOp(int line,
JExpression arg)
Construct an AST node for a ++expr given its line number, and the
operand.
|
Modifier and Type | Method and Description |
---|---|
JExpression |
analyze(Context context)
Analyze the operand as a lhs (since there is a side effect), check types
and determine the type of the result.
|
void |
codegen(CLEmitter output)
In generating code for a pre-increment operation, we treat simple
variable (JVariable) operands specially since the JVM has an increment
instruction.
|
writeToStdOut
codegen, isStatementExpression, type
line, partialCodegen
public JPreIncrementOp(int line, JExpression arg)
line
- line in which the expression occurs in the source file.arg
- the operand.public JExpression analyze(Context context)
analyze
in class JExpression
context
- context in which names are resolved.public void codegen(CLEmitter output)