public class StaticCompilationVisitor extends StaticTypeCheckingVisitor
StaticTypeCheckingVisitor.SignatureCodecFactory, StaticTypeCheckingVisitor.VariableExpressionTypeMemoizer
Modifier and Type | Field and Description |
---|---|
static MethodNode |
ARRAYLIST_ADD_METHOD |
static ClassNode |
ARRAYLIST_CLASSNODE |
static MethodNode |
ARRAYLIST_CONSTRUCTOR |
static ClassNode |
COMPILESTATIC_CLASSNODE |
static ClassNode |
TYPECHECKED_CLASSNODE |
CLOSURE_CALL_NO_ARG, CLOSURE_CALL_ONE_ARG, CLOSURE_CALL_VARGS, CLOSUREPARAMS_CLASSNODE, CURRENT_SIGNATURE_PROTOCOL, CURRENT_SIGNATURE_PROTOCOL_VERSION, currentField, currentProperty, DELEGATES_TO, DELEGATES_TO_TARGET, DGM_CLASSNODE, EMPTY_METHODNODE_LIST, ENUMERATION_TYPE, ERROR_COLLECTOR, extension, GENERATED_EMPTY_STATEMENT, GET_DELEGATE, GET_OWNER, GET_THISOBJECT, ITERABLE_TYPE, LINKEDHASHMAP_CLASSNODE, MAP_ENTRY_TYPE, NAMED_PARAMS_CLASSNODE, returnAdder, returnListener, TYPECHECKING_ANNOTATIONS, TYPECHECKING_INFO_NODE, typeCheckingContext
Constructor and Description |
---|
StaticCompilationVisitor(SourceUnit unit,
ClassNode node) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
existsProperty(PropertyExpression pexp,
boolean checkForReadOnly,
ClassCodeVisitorSupport visitor)
Checks whether a property exists on the receiver, or on any of the possible receiver classes (found in the
temporary type information table)
|
protected MethodNode |
findMethodOrFail(Expression expr,
ClassNode receiver,
String name,
ClassNode... args) |
protected ClassNode[] |
getTypeCheckingAnnotations()
Returns array of type checking annotations.
|
static boolean |
isStaticallyCompiled(AnnotatedNode node) |
void |
visitClass(ClassNode node)
Visit a ClassNode.
|
void |
visitConstructorCallExpression(ConstructorCallExpression call) |
void |
visitForLoop(ForStatement statement) |
void |
visitMethod(MethodNode node)
Visit a MethodNode.
|
void |
visitMethodCallExpression(MethodCallExpression call) |
void |
visitPropertyExpression(PropertyExpression expression) |
void |
visitSpreadExpression(SpreadExpression expression) |
addAmbiguousErrorMessage, addAssignmentError, addCategoryMethodCallError, addClosureReturnType, addError, addNoMatchingMethodError, addReceivers, addStaticTypeError, addTypeCheckingExtension, addTypeCheckingInfoAnnotation, addUnsupportedPreOrPostfixExpressionError, afterSwitchConditionExpressionVisited, areCategoryMethodCalls, checkCast, checkClosureParameters, checkForbiddenSpreadArgument, checkGroovyConstructorMap, checkGroovyStyleConstructor, checkGroovyStyleConstructor, checkReturnType, collectAllInterfaceMethodsByName, existsProperty, extractPropertyNameFromMethodName, extractTemporaryTypeInfoKey, extractTypesFromParameters, findCurrentInstanceOfClass, findInstanceOfNotReturnExpression, findMethod, findMethodsWithGenerated, findNotInstanceOfReturnExpression, formatArgumentList, getArgumentTypes, getDelegationMetadata, getGroupOperationResultType, getInferredReturnType, getInferredReturnTypeFromWithClosureArgument, getOriginalDeclarationType, getResultType, getSourceUnit, getTemporaryTypesForExpression, getType, getTypeCheckingContext, hasRHSIncompleteGenericTypeInfo, inferClosureParameterTypes, inferComponentType, inferDiamondType, inferListExpressionType, inferLoopElementType, inferMapExpressionType, inferReturnTypeGenerics, inferReturnTypeGenerics, initialize, isClassInnerClassOrEqualTo, isClosureCall, isNullConstant, isSecondPassNeededForControlStructure, isSkipMode, isSkippedInnerClass, isSuperExpression, isThisExpression, makeOwnerList, performSecondPass, popAssignmentTracking, prettyPrintMethodList, pushAssignmentTracking, pushInstanceOfTypeInfo, restoreVariableExpressionMetadata, saveVariableExpressionMetadata, setCompilationUnit, setMethodsToBeVisited, shouldSkipClassNode, shouldSkipMethodNode, silentlyVisitMethodNode, startMethodInference, storeInferredReturnType, storeInferredTypeForPropertyExpression, storeTargetMethod, storeType, typeCheckAssignment, typeCheckClosureCall, typeCheckMapConstructor, typeCheckMethodsWithGenericsOrFail, visitAttributeExpression, visitBinaryExpression, visitBitwiseNegationExpression, visitBlockStatement, visitCaseStatement, visitCastExpression, visitClassExpression, visitClosingBlock, visitClosureExpression, visitConstructor, visitConstructorOrMethod, visitExpressionStatement, visitField, visitIfElse, visitInstanceofNot, visitMethodCallArguments, visitPostfixExpression, visitPrefixExpression, visitProperty, visitRangeExpression, visitReturnStatement, visitStaticMethodCallExpression, visitSwitch, visitTernaryExpression, visitTryCatchFinally, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression, visitWhileLoop, wrapTypeIfNecessary
visitAnnotation, visitAnnotations, visitAssertStatement, visitBreakStatement, visitCatchStatement, visitClassCodeContainer, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitImports, visitObjectInitializerStatements, visitPackage, visitStatement, visitSynchronizedStatement, visitThrowStatement
visitArgumentlistExpression, visitArrayExpression, visitBooleanExpression, visitBytecodeExpression, visitClosureListExpression, visitConstantExpression, visitEmptyStatement, visitFieldExpression, visitGStringExpression, visitLambdaExpression, visitListExpression, visitMapEntryExpression, visitMapExpression, visitMethodPointerExpression, visitMethodReferenceExpression, visitNotExpression, visitShortTernaryExpression, visitSpreadMapExpression, visitTupleExpression
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
visitEmptyExpression, visitListOfExpressions
public static final ClassNode TYPECHECKED_CLASSNODE
public static final ClassNode COMPILESTATIC_CLASSNODE
public static final ClassNode ARRAYLIST_CLASSNODE
public static final MethodNode ARRAYLIST_ADD_METHOD
public static final MethodNode ARRAYLIST_CONSTRUCTOR
public StaticCompilationVisitor(SourceUnit unit, ClassNode node)
protected ClassNode[] getTypeCheckingAnnotations()
StaticTypeCheckingVisitor
The default implementation returns TypeChecked
.
getTypeCheckingAnnotations
in class StaticTypeCheckingVisitor
public static boolean isStaticallyCompiled(AnnotatedNode node)
public void visitClass(ClassNode node)
GroovyClassVisitor
visitClass
in interface GroovyClassVisitor
visitClass
in class StaticTypeCheckingVisitor
public void visitMethod(MethodNode node)
GroovyClassVisitor
visitMethod
in interface GroovyClassVisitor
visitMethod
in class StaticTypeCheckingVisitor
public void visitMethodCallExpression(MethodCallExpression call)
visitMethodCallExpression
in interface GroovyCodeVisitor
visitMethodCallExpression
in class StaticTypeCheckingVisitor
public void visitConstructorCallExpression(ConstructorCallExpression call)
visitConstructorCallExpression
in interface GroovyCodeVisitor
visitConstructorCallExpression
in class StaticTypeCheckingVisitor
public void visitForLoop(ForStatement statement)
visitForLoop
in interface GroovyCodeVisitor
visitForLoop
in class StaticTypeCheckingVisitor
protected MethodNode findMethodOrFail(Expression expr, ClassNode receiver, String name, ClassNode... args)
findMethodOrFail
in class StaticTypeCheckingVisitor
protected boolean existsProperty(PropertyExpression pexp, boolean checkForReadOnly, ClassCodeVisitorSupport visitor)
StaticTypeCheckingVisitor
existsProperty
in class StaticTypeCheckingVisitor
pexp
- a property expressioncheckForReadOnly
- if true, look for property read, else for property setvisitor
- if not null, when the property node is found, visit it with the provided visitorpublic void visitPropertyExpression(PropertyExpression expression)
visitPropertyExpression
in interface GroovyCodeVisitor
visitPropertyExpression
in class StaticTypeCheckingVisitor
public void visitSpreadExpression(SpreadExpression expression)
visitSpreadExpression
in interface GroovyCodeVisitor
visitSpreadExpression
in class CodeVisitorSupport