class JNegateOp extends JUnaryExpression
argisStatementExpression, typecompilationUnit, line| Constructor and Description |
|---|
JNegateOp(int line,
JExpression arg)
Construct an AST node for a negation expression given its line number,
and the operand.
|
| Modifier and Type | Method and Description |
|---|---|
JExpression |
analyze(Context context)
Analyzing the negation operation involves analyzing its operand, checking
its type and determining the result type.
|
void |
codegen(CLEmitter output)
Generating code for the negation operation involves generating code for
the operand, and then the negation instruction.
|
writeToStdOutcodegen, isStatementExpression, typeline, partialCodegenpublic JNegateOp(int line,
JExpression arg)
line - line in which the negation expression occurs in the source
file.arg - the operand.public JExpression analyze(Context context)
analyze in class JExpressioncontext - context in which names are resolved.