Package org.codehaus.groovy.control
Class LabelVerifier
java.lang.Object
org.codehaus.groovy.ast.CodeVisitorSupport
org.codehaus.groovy.ast.ClassCodeVisitorSupport
org.codehaus.groovy.control.LabelVerifier
- All Implemented Interfaces:
GroovyClassVisitor,GroovyCodeVisitor,ErrorCollecting
This class checks the handling of labels in the AST
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected SourceUnitProvides access to theSourceUnitfor error reporting during visitation.protected voidvoidvisitAssertStatement(AssertStatement statement) Visits anAssertStatement, invoking the statement hook before parent traversal.voidvisitBlockStatement(BlockStatement statement) Visits aBlockStatement, invoking the statement hook before parent traversal.voidvisitBreakStatement(BreakStatement breakStatement) Visits aBreakStatement, invoking the statement hook before parent traversal.voidvisitCaseStatement(CaseStatement statement) Visits aCaseStatement, invoking the statement hook before parent traversal.voidvisitCatchStatement(CatchStatement statement) Visits aCatchStatement, processing variable annotations and invoking the statement hook.protected voidVisits a code statement container, traversing it if present.voidvisitContinueStatement(ContinueStatement continueStatement) Visits aContinueStatement, invoking the statement hook before parent traversal.voidVisits aDoWhileStatement, invoking statement hooks before parent traversal.voidvisitEmptyStatement(EmptyStatement statement) Visits anEmptyStatement.voidvisitExpressionStatement(ExpressionStatement statement) Visits anExpressionStatement, invoking the statement hook before parent traversal.voidvisitForLoop(ForStatement loop) Visits aForStatement, invoking statement hooks and processing loop variable annotations.voidvisitIfElse(IfStatement cond) Visits anIfStatement, invoking the statement hook before parent traversal.voidvisitReturnStatement(ReturnStatement statement) Visits aReturnStatement, invoking the statement hook before parent traversal.protected voidHook method called when visiting anyStatement.voidvisitSwitch(SwitchStatement switchStatement) Visits aSwitchStatement, invoking the statement hook before parent traversal.voidvisitSynchronizedStatement(SynchronizedStatement statement) Visits aSynchronizedStatement, invoking the statement hook before parent traversal.voidvisitThrowStatement(ThrowStatement statement) Visits aThrowStatement, invoking the statement hook before parent traversal.voidvisitTryCatchFinally(TryCatchStatement statement) Visits aTryCatchStatement, invoking the statement hook before parent traversal.voidvisitWhileLoop(WhileStatement loop) Visits aWhileStatement, invoking statement hooks before parent traversal.Methods inherited from class org.codehaus.groovy.ast.ClassCodeVisitorSupport
addError, visitAnnotation, visitAnnotations, visitAnnotations, visitClass, visitClosureExpression, visitConstructor, visitConstructorOrMethod, visitDeclarationExpression, visitField, visitImports, visitMethod, visitObjectInitializerStatements, visitPackage, visitProperty, visitStatementAnnotationsMethods inherited from class org.codehaus.groovy.ast.CodeVisitorSupport
afterSwitchCaseStatementsVisited, afterSwitchConditionExpressionVisited, visitArgumentlistExpression, visitArrayExpression, visitAttributeExpression, visitBinaryExpression, visitBitwiseNegationExpression, visitBooleanExpression, visitBytecodeExpression, visitCastExpression, visitClassExpression, visitClosureListExpression, visitConstantExpression, visitConstructorCallExpression, visitFieldExpression, visitGStringExpression, visitLambdaExpression, visitListExpression, visitMapEntryExpression, visitMapExpression, visitMethodCallExpression, visitMethodPointerExpression, visitMethodReferenceExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitTernaryExpression, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpressionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.codehaus.groovy.ast.GroovyCodeVisitor
visit, visit, visitEmptyExpression, visitListOfExpressions
-
Constructor Details
-
LabelVerifier
-
-
Method Details
-
getSourceUnit
Description copied from class:ClassCodeVisitorSupportProvides access to theSourceUnitfor error reporting during visitation. Implementations must override this method.- Specified by:
getSourceUnitin classClassCodeVisitorSupport- Returns:
- the source unit for this visitor
-
assertNoLabelsMissed
protected void assertNoLabelsMissed() -
visitStatement
Description copied from class:ClassCodeVisitorSupportHook method called when visiting anyStatement. Subclasses may override to perform common processing on all statements.- Parameters:
s- the statement being visited
-
postVisitStatement
-
visitClassCodeContainer
Description copied from class:ClassCodeVisitorSupportVisits a code statement container, traversing it if present.- Overrides:
visitClassCodeContainerin classClassCodeVisitorSupport- Parameters:
code- the statement to visit, may be null
-
visitIfElse
Description copied from class:ClassCodeVisitorSupportVisits anIfStatement, invoking the statement hook before parent traversal.- Specified by:
visitIfElsein interfaceGroovyCodeVisitor- Parameters:
cond- the if statement to visit
-
visitForLoop
Description copied from class:ClassCodeVisitorSupportVisits aForStatement, invoking statement hooks and processing loop variable annotations.- Specified by:
visitForLoopin interfaceGroovyCodeVisitor- Parameters:
loop- the for statement to visit
-
visitWhileLoop
Description copied from class:ClassCodeVisitorSupportVisits aWhileStatement, invoking statement hooks before parent traversal.- Specified by:
visitWhileLoopin interfaceGroovyCodeVisitor- Parameters:
loop- the while statement to visit
-
visitDoWhileLoop
Description copied from class:ClassCodeVisitorSupportVisits aDoWhileStatement, invoking statement hooks before parent traversal.- Specified by:
visitDoWhileLoopin interfaceGroovyCodeVisitor- Parameters:
loop- the do-while statement to visit
-
visitSwitch
Description copied from class:ClassCodeVisitorSupportVisits aSwitchStatement, invoking the statement hook before parent traversal.- Specified by:
visitSwitchin interfaceGroovyCodeVisitor- Parameters:
switchStatement- the switch statement to visit
-
visitBreakStatement
Description copied from class:ClassCodeVisitorSupportVisits aBreakStatement, invoking the statement hook before parent traversal.- Specified by:
visitBreakStatementin interfaceGroovyCodeVisitor- Parameters:
breakStatement- the break statement to visit
-
visitContinueStatement
Description copied from class:ClassCodeVisitorSupportVisits aContinueStatement, invoking the statement hook before parent traversal.- Specified by:
visitContinueStatementin interfaceGroovyCodeVisitor- Parameters:
continueStatement- the continue statement to visit
-
visitAssertStatement
Description copied from class:ClassCodeVisitorSupportVisits anAssertStatement, invoking the statement hook before parent traversal.- Specified by:
visitAssertStatementin interfaceGroovyCodeVisitor- Overrides:
visitAssertStatementin classClassCodeVisitorSupport- Parameters:
statement- the assert statement to visit
-
visitBlockStatement
Description copied from class:ClassCodeVisitorSupportVisits aBlockStatement, invoking the statement hook before parent traversal.- Specified by:
visitBlockStatementin interfaceGroovyCodeVisitor- Overrides:
visitBlockStatementin classClassCodeVisitorSupport- Parameters:
statement- the block statement to visit- See Also:
-
visitCaseStatement
Description copied from class:ClassCodeVisitorSupportVisits aCaseStatement, invoking the statement hook before parent traversal.- Specified by:
visitCaseStatementin interfaceGroovyCodeVisitor- Overrides:
visitCaseStatementin classClassCodeVisitorSupport- Parameters:
statement- the case statement to visit
-
visitCatchStatement
Description copied from class:ClassCodeVisitorSupportVisits aCatchStatement, processing variable annotations and invoking the statement hook.- Specified by:
visitCatchStatementin interfaceGroovyCodeVisitor- Overrides:
visitCatchStatementin classClassCodeVisitorSupport- Parameters:
statement- the catch statement to visit
-
visitEmptyStatement
Description copied from class:CodeVisitorSupportVisits anEmptyStatement. No traversal is performed as empty statements contain no child nodes.- Specified by:
visitEmptyStatementin interfaceGroovyCodeVisitor- Overrides:
visitEmptyStatementin classCodeVisitorSupport- Parameters:
statement- the empty statement
-
visitExpressionStatement
Description copied from class:ClassCodeVisitorSupportVisits anExpressionStatement, invoking the statement hook before parent traversal.- Specified by:
visitExpressionStatementin interfaceGroovyCodeVisitor- Overrides:
visitExpressionStatementin classClassCodeVisitorSupport- Parameters:
statement- the expression statement to visit
-
visitReturnStatement
Description copied from class:ClassCodeVisitorSupportVisits aReturnStatement, invoking the statement hook before parent traversal.- Specified by:
visitReturnStatementin interfaceGroovyCodeVisitor- Overrides:
visitReturnStatementin classClassCodeVisitorSupport- Parameters:
statement- the return statement to visit
-
visitSynchronizedStatement
Description copied from class:ClassCodeVisitorSupportVisits aSynchronizedStatement, invoking the statement hook before parent traversal.- Specified by:
visitSynchronizedStatementin interfaceGroovyCodeVisitor- Overrides:
visitSynchronizedStatementin classClassCodeVisitorSupport- Parameters:
statement- the synchronized statement to visit
-
visitThrowStatement
Description copied from class:ClassCodeVisitorSupportVisits aThrowStatement, invoking the statement hook before parent traversal.- Specified by:
visitThrowStatementin interfaceGroovyCodeVisitor- Overrides:
visitThrowStatementin classClassCodeVisitorSupport- Parameters:
statement- the throw statement to visit
-
visitTryCatchFinally
Description copied from class:ClassCodeVisitorSupportVisits aTryCatchStatement, invoking the statement hook before parent traversal.- Specified by:
visitTryCatchFinallyin interfaceGroovyCodeVisitor- Overrides:
visitTryCatchFinallyin classClassCodeVisitorSupport- Parameters:
statement- the try-catch statement to visit
-