Groovy 2.2.0

groovy.inspect.swingui
[Groovy] Class AstNodeToScriptVisitor

java.lang.Object
  org.codehaus.groovy.control.CompilationUnit.PrimaryClassNodeOperation
      groovy.inspect.swingui.AstNodeToScriptVisitor
All Implemented Interfaces:
GroovyCodeVisitor, GroovyClassVisitor

class AstNodeToScriptVisitor
extends PrimaryClassNodeOperation

An adapter from ASTNode tree to source code.

Authors:
Hamlet D'Arcy


Property Summary
String _indent

Stack classNameStack

boolean readyToIndent

boolean scriptHasBeenVisited

boolean showScriptClass

boolean showScriptFreeForm

 
Constructor Summary
AstNodeToScriptVisitor(Writer writer, boolean showScriptFreeForm = true, boolean showScriptClass = true)

 
Method Summary
void call(SourceUnit source, GeneratorContext context, ClassNode classNode)

def indented(Closure block)

void print(def parameter)

def printDoubleBreak()

def printLineBreak()

def println(def parameter)

void visitAnnotationNode(AnnotationNode node)

void visitArgumentlistExpression(ArgumentListExpression expression, boolean showTypes = false)

void visitArrayExpression(ArrayExpression expression)

void visitAssertStatement(AssertStatement statement)

void visitAttributeExpression(AttributeExpression attributeExpression)

void visitBinaryExpression(BinaryExpression expression)

void visitBitwiseNegationExpression(BitwiseNegationExpression expression)

void visitBlockStatement(BlockStatement block)

void visitBooleanExpression(BooleanExpression expression)

void visitBreakStatement(BreakStatement statement)

void visitBytecodeExpression(BytecodeExpression expression)

void visitCaseStatement(CaseStatement statement)

void visitCastExpression(CastExpression expression)

void visitCatchStatement(CatchStatement statement)

void visitClass(ClassNode node)

void visitClassExpression(ClassExpression expression)

void visitClosureExpression(ClosureExpression expression)

void visitClosureListExpression(ClosureListExpression expression)

void visitConstantExpression(ConstantExpression expression, boolean unwrapQuotes = false)

void visitConstructor(ConstructorNode node)

void visitConstructorCallExpression(ConstructorCallExpression expression)

void visitContinueStatement(ContinueStatement statement)

void visitDeclarationExpression(DeclarationExpression expression)

void visitDoWhileLoop(DoWhileStatement statement)

void visitExpressionStatement(ExpressionStatement statement)

void visitField(FieldNode node)

void visitFieldExpression(FieldExpression expression)

void visitForLoop(ForStatement statement)

void visitGStringExpression(GStringExpression expression)

void visitIfElse(IfStatement ifElse)

void visitImport(ImportNode node)

void visitListExpression(ListExpression expression)

void visitMapEntryExpression(MapEntryExpression expression)

void visitMapExpression(MapExpression expression)

void visitMethod(MethodNode node)

void visitMethodCallExpression(MethodCallExpression expression)

void visitMethodPointerExpression(MethodPointerExpression expression)

void visitNotExpression(NotExpression expression)

void visitPackage(PackageNode packageNode)

void visitPostfixExpression(PostfixExpression expression)

void visitPrefixExpression(PrefixExpression expression)

void visitProperty(PropertyNode node)

void visitPropertyExpression(PropertyExpression expression)

void visitRangeExpression(RangeExpression expression)

void visitReturnStatement(ReturnStatement statement)

void visitShortTernaryExpression(ElvisOperatorExpression expression)

void visitSpreadExpression(SpreadExpression expression)

void visitSpreadMapExpression(SpreadMapExpression expression)

void visitStaticMethodCallExpression(StaticMethodCallExpression expression)

void visitSwitch(SwitchStatement statement)

void visitSynchronizedStatement(SynchronizedStatement statement)

void visitTernaryExpression(TernaryExpression expression)

void visitThrowStatement(ThrowStatement statement)

void visitTryCatchFinally(TryCatchStatement statement)

void visitTupleExpression(TupleExpression expression)

void visitType(ClassNode classNode)

Prints out the type, safely handling arrays.

void visitUnaryMinusExpression(UnaryMinusExpression expression)

void visitUnaryPlusExpression(UnaryPlusExpression expression)

void visitVariableExpression(VariableExpression expression, boolean spacePad = true)

void visitWhileLoop(WhileStatement statement)

 

Property Detail

_indent

String _indent


classNameStack

Stack classNameStack


readyToIndent

boolean readyToIndent


scriptHasBeenVisited

boolean scriptHasBeenVisited


showScriptClass

boolean showScriptClass


showScriptFreeForm

boolean showScriptFreeForm


 
Constructor Detail

AstNodeToScriptVisitor

AstNodeToScriptVisitor(Writer writer, boolean showScriptFreeForm = true, boolean showScriptClass = true)


 
Method Detail

call

void call(SourceUnit source, GeneratorContext context, ClassNode classNode)


indented

def indented(Closure block)


print

void print(def parameter)


printDoubleBreak

def printDoubleBreak()


printLineBreak

def printLineBreak()


println

def println(def parameter)


visitAnnotationNode

void visitAnnotationNode(AnnotationNode node)


visitArgumentlistExpression

void visitArgumentlistExpression(ArgumentListExpression expression, boolean showTypes = false)


visitArrayExpression

@Override
void visitArrayExpression(ArrayExpression expression)


visitAssertStatement

@Override
void visitAssertStatement(AssertStatement statement)


visitAttributeExpression

@Override
void visitAttributeExpression(AttributeExpression attributeExpression)


visitBinaryExpression

@Override
void visitBinaryExpression(BinaryExpression expression)


visitBitwiseNegationExpression

@Override
void visitBitwiseNegationExpression(BitwiseNegationExpression expression)


visitBlockStatement

@Override
void visitBlockStatement(BlockStatement block)


visitBooleanExpression

@Override
void visitBooleanExpression(BooleanExpression expression)


visitBreakStatement

@Override
void visitBreakStatement(BreakStatement statement)


visitBytecodeExpression

@Override
void visitBytecodeExpression(BytecodeExpression expression)


visitCaseStatement

@Override
void visitCaseStatement(CaseStatement statement)


visitCastExpression

@Override
void visitCastExpression(CastExpression expression)


visitCatchStatement

@Override
void visitCatchStatement(CatchStatement statement)


visitClass

@Override
void visitClass(ClassNode node)


visitClassExpression

@Override
void visitClassExpression(ClassExpression expression)


visitClosureExpression

@Override
void visitClosureExpression(ClosureExpression expression)


visitClosureListExpression

@Override
void visitClosureListExpression(ClosureListExpression expression)


visitConstantExpression

void visitConstantExpression(ConstantExpression expression, boolean unwrapQuotes = false)


visitConstructor

@Override
void visitConstructor(ConstructorNode node)


visitConstructorCallExpression

@Override
void visitConstructorCallExpression(ConstructorCallExpression expression)


visitContinueStatement

@Override
void visitContinueStatement(ContinueStatement statement)


visitDeclarationExpression

@Override
void visitDeclarationExpression(DeclarationExpression expression)


visitDoWhileLoop

@Override
void visitDoWhileLoop(DoWhileStatement statement)


visitExpressionStatement

@Override
void visitExpressionStatement(ExpressionStatement statement)


visitField

@Override
void visitField(FieldNode node)


visitFieldExpression

@Override
void visitFieldExpression(FieldExpression expression)


visitForLoop

@Override
void visitForLoop(ForStatement statement)


visitGStringExpression

@Override
void visitGStringExpression(GStringExpression expression)


visitIfElse

@Override
void visitIfElse(IfStatement ifElse)


visitImport

void visitImport(ImportNode node)


visitListExpression

@Override
void visitListExpression(ListExpression expression)


visitMapEntryExpression

@Override
void visitMapEntryExpression(MapEntryExpression expression)


visitMapExpression

@Override
void visitMapExpression(MapExpression expression)


visitMethod

@Override
void visitMethod(MethodNode node)


visitMethodCallExpression

@Override
void visitMethodCallExpression(MethodCallExpression expression)


visitMethodPointerExpression

@Override
void visitMethodPointerExpression(MethodPointerExpression expression)


visitNotExpression

@Override
void visitNotExpression(NotExpression expression)


visitPackage

void visitPackage(PackageNode packageNode)


visitPostfixExpression

@Override
void visitPostfixExpression(PostfixExpression expression)


visitPrefixExpression

@Override
void visitPrefixExpression(PrefixExpression expression)


visitProperty

@Override
void visitProperty(PropertyNode node)


visitPropertyExpression

@Override
void visitPropertyExpression(PropertyExpression expression)


visitRangeExpression

@Override
void visitRangeExpression(RangeExpression expression)


visitReturnStatement

@Override
void visitReturnStatement(ReturnStatement statement)


visitShortTernaryExpression

@Override
void visitShortTernaryExpression(ElvisOperatorExpression expression)


visitSpreadExpression

@Override
void visitSpreadExpression(SpreadExpression expression)


visitSpreadMapExpression

@Override
void visitSpreadMapExpression(SpreadMapExpression expression)


visitStaticMethodCallExpression

@Override
void visitStaticMethodCallExpression(StaticMethodCallExpression expression)


visitSwitch

@Override
void visitSwitch(SwitchStatement statement)


visitSynchronizedStatement

@Override
void visitSynchronizedStatement(SynchronizedStatement statement)


visitTernaryExpression

@Override
void visitTernaryExpression(TernaryExpression expression)


visitThrowStatement

@Override
void visitThrowStatement(ThrowStatement statement)


visitTryCatchFinally

@Override
void visitTryCatchFinally(TryCatchStatement statement)


visitTupleExpression

@Override
void visitTupleExpression(TupleExpression expression)


visitType

void visitType(ClassNode classNode)
Prints out the type, safely handling arrays.
Parameters:
classNode - classnode


visitUnaryMinusExpression

@Override
void visitUnaryMinusExpression(UnaryMinusExpression expression)


visitUnaryPlusExpression

@Override
void visitUnaryPlusExpression(UnaryPlusExpression expression)


visitVariableExpression

void visitVariableExpression(VariableExpression expression, boolean spacePad = true)


visitWhileLoop

@Override
void visitWhileLoop(WhileStatement statement)


 

Copyright © 2003-2013 The Codehaus. All rights reserved.