Class CodeGenVisitor

java.lang.Object
  extended byhw3.ReflectiveVisitor
      extended byhw3.NodeVisitor
          extended byCodeGenVisitor

public class CodeGenVisitor
extends NodeVisitor


Field Summary
 
Fields inherited from class hw3.NodeVisitor
level, ps
 
Fields inherited from class hw3.ReflectiveVisitor
debug
 
Constructor Summary
CodeGenVisitor()
           
 
Method Summary
 void defaultVisit(java.lang.Object o)
          Default visitation if nothing suitable is found
static ReflectiveVisitor getCodeGenVisitor()
          Change this method to return the visitor you want for code generation.
static ReflectiveVisitor getTypeSetVisitor()
           
 void visit(ClassDeclaring c)
          This outputs a standard prelude, with the class extending Object, a dummy method for main(String[] args) that calls main431 Thus, your test file must have a static main431 to kick things off
 
Methods inherited from class hw3.NodeVisitor
err, err, out, out, setPrintStream, visitChildren
 
Methods inherited from class hw3.ReflectiveVisitor
dispatch, getBestMethodFor, perform, performVisit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodeGenVisitor

public CodeGenVisitor()
Method Detail

getCodeGenVisitor

public static ReflectiveVisitor getCodeGenVisitor()
Change this method to return the visitor you want for code generation. As given to you, it runs the course-sponsored solution (CourseProjectCodeGenVisitor); Change the return to "new CodeGenVisitor()" to return an instance of this class instead.

Returns:
the visitor for performing code generation

getTypeSetVisitor

public static ReflectiveVisitor getTypeSetVisitor()

visit

public void visit(ClassDeclaring c)
This outputs a standard prelude, with the class extending Object, a dummy method for main(String[] args) that calls main431 Thus, your test file must have a static main431 to kick things off


defaultVisit

public void defaultVisit(java.lang.Object o)
Description copied from class: NodeVisitor
Default visitation if nothing suitable is found

Overrides:
defaultVisit in class NodeVisitor