abstract class JAST extends Object
Modifier and Type | Field and Description |
---|---|
static JCompilationUnit |
compilationUnit
Current compilation unit (set in JCompilationUnit()).
|
protected int |
line
Line in which the source for the AST was found.
|
Modifier | Constructor and Description |
---|---|
protected |
JAST(int line)
Construct an AST node the given its line number in the source file.
|
Modifier and Type | Method and Description |
---|---|
abstract JAST |
analyze(Context context)
Perform semantic analysis on this AST.
|
abstract void |
codegen(CLEmitter output)
Perform code generation for this AST.
|
int |
line()
Return the line in which the source for the AST was found.
|
void |
partialCodegen(Context context,
CLEmitter partial)
Generate a partial class for this type, reflecting only the member
information required to do analysis.
|
abstract void |
writeToStdOut(PrettyPrinter p)
Write the information pertaining to this AST to STDOUT.
|
public static JCompilationUnit compilationUnit
protected int line
protected JAST(int line)
line
- line in which the source for the AST was found.public int line()
public abstract JAST analyze(Context context)
context
- the environment (scope) in which code is analyzed.public void partialCodegen(Context context, CLEmitter partial)
context
- the parent (class) context.partial
- the code emitter (basically an abstraction for producing the
partial class).public abstract void codegen(CLEmitter output)
output
- the code emitter (basically an abstraction for producing the
.class file).public abstract void writeToStdOut(PrettyPrinter p)
p
- for pretty printing with indentation.