class JCastOp extends JExpression
isStatementExpression, type
compilationUnit, line
Constructor and Description |
---|
JCastOp(int line,
Type cast,
JExpression expr)
Construct an AST node for a cast operation from its line number, cast,
and expression.
|
Modifier and Type | Method and Description |
---|---|
JExpression |
analyze(Context context)
Analyzing a cast expression means, resolving the type (to which we are
casting), checking the legality of the cast, and computing a (possibly
null) conversion for use in code generation.
|
void |
codegen(CLEmitter output)
Generating code for a cast expression involves generating code for the
original expr, and then for any necessary conversion.
|
void |
writeToStdOut(PrettyPrinter p)
Write the information pertaining to this AST to STDOUT.
|
codegen, isStatementExpression, type
line, partialCodegen
public JCastOp(int line, Type cast, JExpression expr)
line
- the line in which the operation occurs in the source file.cast
- the type we're casting our expression as.expr
- the expression we're casting.public JExpression analyze(Context context)
analyze
in class JExpression
context
- context in which names are resolved.public void codegen(CLEmitter output)
public void writeToStdOut(PrettyPrinter p)
JAST
writeToStdOut
in class JAST
p
- for pretty printing with indentation.