Package polyglot.visit

Contains the standard visitor which provide type checking as well as output.


Class Summary
AddMemberVisitor Visitor which traverses the AST constructing type objects.
AlphaRenamer The AlphaRenamer runs over the AST and alpha-renames any local variable declarations that it encounters.
AmbiguityRemover A visitor which traverses the AST and remove ambiguities found in fields, method signatures and the code itself.
AscriptionVisitor Visitor which allows type information to be utilized to perform AST modifications.
CFGBuilder Class used to construct a CFG.
ClassSerializer Visitor which serializes class objects and adds a field to the class containing the serialization.
CodeCleaner The CodeCleaner runs over the AST and performs some trivial dead code elimination, while flattening blocks wherever possible.
ConstantFolder Visitor which performs constant folding.
ConstructorCallChecker Visitor which ensures that constructor calls are not recursive.
ContextVisitor A visitor which maintains a context throughout the visitor's pass.
CopyPropagator Visitor which performs copy propagation.
DataFlow Abstract dataflow Visitor, to allow simple dataflow equations to be easily implemented.
DataFlow.BoolItem This class contains two Items, one being the Item that is used when an expression is true, the other being the one that is used when an expression is false.
DataFlow.ConditionNavigator Deprecated.  
DataFlow.Item An Item contains the data which flows during the dataflow analysis.
DeadCodeEliminator Visitor which performs dead code elimination.
DumpAst Visitor which dumps the AST to a file.
ExceptionChecker Visitor which checks if exceptions are caught or declared properly.
ExitChecker Visitor which checks that all (terminating) paths through a method must return.
FlattenVisitor The FlattenVisitor flattens the AST,
FlowGraph.Edge This class represents an edge in the flow graph.
FlowGraph.EdgeKey This class provides an identifying label for edges in the flow graph.
FlowGraph.ExceptionEdgeKey This class extends EdgeKey and is the key for edges that are taken when an exception of type t is thrown.
FlowGraph.ListKey Class to be used for inserting Lists in hashtables using collection equality (as defined in CollectionUtil).
FlowGraph.Peer A Peer is an occurance of an AST node in a flow graph.
FwdReferenceChecker Visitor which ensures that field intializers and initializers do not make illegal forward references to fields.
HaltingVisitor A HaltingVisitor is used to prune the traversal of the AST at a particular node.
HeaderTranslator A HeaderTranslator acts exactly like a Translator object, but translate() functions which are recipients of this object know that they're supposed to be generating a .h file instead of a .cpp file (this is only used for the c++ backend)
InitChecker Visitor which checks that all local variables must be defined before use, and that final variables and fields are initialized correctly.
InitChecker.ClassBodyInfo This class is just a data structure containing relevant information needed for performing initialization checking of a class declaration.
InitChecker.InitCount Class representing the initialization counts of variables.
InitChecker.MinMaxInitCount Class to record counts of the minimum and maximum number of times a variable or field has been initialized or assigned to.
NodeScrambler The NodeScrambler is test case generator of sorts.
NodeVisitor The NodeVisitor represents an implementation of the "Visitor" style of tree traversal.
PrettyPrinter A PrettyPrinter generates output code from the processed AST.
ReachChecker Visitor which checks that all statements must be reachable
StringPrettyPrinter A PrettyPrinter generates output code from the processed AST.
Translator A Translator generates output code from the processed AST.
TypeBuilder Visitor which traverses the AST constructing type objects.
TypeChecker Visitor which performs type checking on the AST.

Exception Summary
CFGBuildError Exception thrown when the CFG cannot be built.

Package polyglot.visit Description

Contains the standard visitor which provide type checking as well as output. The visitor specification is defined in polyglot.visit.NodeVisitor. HaltingVisitor provides a method to prune the visitor traversal. ContextVisitor contains code to automatically enter and leave scopes and to manage error messages. Most other visitors are subclasses of this class. PrettyPrinter is not a visitor (the package name is a misnomer for historical reasons). It contains methods for pretty printing the AST. The code generator is implemented by the Translator translator class, which is PrettyPrinter that opens appropriate Java output files.