Package jtb.visitor
Class TreeFormatter
- Object
-
- DepthFirstVisitor
-
- TreeFormatter
-
- All Implemented Interfaces:
Visitor
public class TreeFormatter extends DepthFirstVisitor
-
-
Field Summary
-
Fields inherited from class DepthFirstVisitor
debug, indent, indents
-
-
Constructor Summary
Constructors Constructor Description TreeFormatter()
TreeFormatter(int indentAmt, int wrapWidth)
-
Method Summary
-
-
-
Constructor Detail
-
TreeFormatter
public TreeFormatter()
-
TreeFormatter
public TreeFormatter(int indentAmt, int wrapWidth)
-
-
Method Detail
-
processList
protected void processList(NodeListInterface n)
-
processList
protected void processList(NodeListInterface n, FormatCommand cmd)
-
force
protected FormatCommand force()
-
force
protected FormatCommand force(int i)
-
indent
protected FormatCommand indent()
-
indent
protected FormatCommand indent(int i)
-
outdent
protected FormatCommand outdent()
-
outdent
protected FormatCommand outdent(int i)
-
space
protected FormatCommand space()
-
space
protected FormatCommand space(int i)
-
add
protected void add(FormatCommand cmd)
-
visit
public void visit(NodeToken n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(CompilationUnit n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(PackageDeclaration n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ImportDeclaration n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(Modifiers n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(TypeDeclaration n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ClassOrInterfaceDeclaration n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ExtendsList n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ImplementsList n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(EnumDeclaration n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(EnumBody n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(EnumConstant n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(TypeParameters n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(TypeParameter n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(TypeBound n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ClassOrInterfaceBody n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ClassOrInterfaceBodyDeclaration n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(FieldDeclaration n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(VariableDeclarator n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(VariableDeclaratorId n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(VariableInitializer n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ArrayInitializer n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(MethodDeclaration n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(MethodDeclarator n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(FormalParameters n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(FormalParameter n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ConstructorDeclaration n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ExplicitConstructorInvocation n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(Initializer n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(Type n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ReferenceType n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ClassOrInterfaceType n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(TypeArguments n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(TypeArgument n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(WildcardBounds n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(PrimitiveType n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ResultType n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(Name n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(NameList n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(Expression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(AssignmentOperator n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ConditionalExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ConditionalOrExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ConditionalAndExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(InclusiveOrExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ExclusiveOrExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(AndExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(EqualityExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(InstanceOfExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(RelationalExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ShiftExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(AdditiveExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(MultiplicativeExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(UnaryExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(PreIncrementExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(PreDecrementExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(UnaryExpressionNotPlusMinus n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(CastLookahead n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(PostfixExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(CastExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(PrimaryExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(MemberSelector n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(PrimaryPrefix n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(PrimarySuffix n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(Literal n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(BooleanLiteral n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(NullLiteral n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(Arguments n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ArgumentList n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(AllocationExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ArrayDimsAndInits n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(Statement n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(AssertStatement n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(LabeledStatement n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(Block n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(BlockStatement n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(LocalVariableDeclaration n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(EmptyStatement n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(StatementExpression n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(SwitchStatement n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(SwitchLabel n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(IfStatement n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(WhileStatement n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(DoStatement n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ForStatement n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ForInit n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(StatementExpressionList n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ForUpdate n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(BreakStatement n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ContinueStatement n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ReturnStatement n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(ThrowStatement n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(SynchronizedStatement n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(TryStatement n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(RUNSIGNEDSHIFT n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(RSIGNEDSHIFT n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(Annotation n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(NormalAnnotation n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(MarkerAnnotation n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(SingleMemberAnnotation n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(MemberValuePairs n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(MemberValuePair n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(MemberValue n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(MemberValueArrayInitializer n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(AnnotationTypeDeclaration n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(AnnotationTypeBody n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(AnnotationTypeMemberDeclaration n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
visit
public void visit(DefaultValue n)
- Specified by:
visit
in interfaceVisitor
- Overrides:
visit
in classDepthFirstVisitor
-
-