class JNegateOp extends JUnaryExpression
arg
isStatementExpression, type
compilationUnit, 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.
|
writeToStdOut
codegen, isStatementExpression, type
line, partialCodegen
public 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 JExpression
context
- context in which names are resolved.