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 |
CLOSURE_CALL_NO_ARG, CLOSURE_CALL_ONE_ARG, CLOSURE_CALL_VARGS, CURRENT_SIGNATURE_PROTOCOL, CURRENT_SIGNATURE_PROTOCOL_VERSION, DELEGATES_TO, DELEGATES_TO_TARGET, DGM_CLASSNODE, EMPTY_METHODNODE_LIST, ERROR_COLLECTOR, extension, GENERATED_EMPTY_STATEMENT, GET_DELEGATE, GET_OWNER, GET_THISOBJECT, ITERABLE_TYPE, LINKEDHASHMAP_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 the list of type checking annotations class nodes.
|
static boolean |
isStaticallyCompiled(AnnotatedNode node) |
void |
visitClass(ClassNode node)
Visit a ClassNode.
|
void |
visitConstructorCallExpression(ConstructorCallExpression call) |
void |
visitForLoop(ForStatement forLoop) |
void |
visitMethod(MethodNode node)
Visit a MethodNode.
|
void |
visitMethodCallExpression(MethodCallExpression call) |
void |
visitSpreadExpression(SpreadExpression expression) |
addAmbiguousErrorMessage, addAssignmentError, addCategoryMethodCallError, addClosureReturnType, addError, addNoMatchingMethodError, addReceivers, addStaticTypeError, addTypeCheckingExtension, addTypeCheckingInfoAnnotation, addUnsupportedPreOrPostfixExpressionError, areCategoryMethodCalls, checkCast, checkClosureParameters, checkForbiddenSpreadArgument, checkGroovyConstructorMap, checkGroovyStyleConstructor, checkReturnType, collectAllInterfaceMethodsByName, existsProperty, extractPropertyNameFromMethodName, extractTemporaryTypeInfoKey, extractTypesFromParameters, findCurrentInstanceOfClass, findMethod, findMethodsWithGenerated, formatArgumentList, fullyResolve, fullyResolveType, getArgumentTypes, getDelegationMetadata, getGroupOperationResultType, getInferredReturnType, getInferredReturnTypeFromWithClosureArgument, getOriginalDeclarationType, getResultType, getSourceUnit, getTemporaryTypesForExpression, getType, getTypeCheckingContext, hasRHSIncompleteGenericTypeInfo, hasSetter, inferComponentType, inferDiamondType, inferListExpressionType, inferLoopElementType, inferMapExpressionType, inferReturnTypeGenerics, initialize, isClassInnerClassOrEqualTo, isClosureCall, isNullConstant, isSecondPassNeededForControlStructure, isSkipMode, isSkippedInnerClass, makeOwnerList, performSecondPass, pickInferredTypeFromMethodAnnotation, popAssignmentTracking, prettyPrintMethodList, pushAssignmentTracking, pushInstanceOfTypeInfo, restoreVariableExpressionMetadata, saveVariableExpressionMetadata, setMethodsToBeVisited, shouldSkipClassNode, shouldSkipMethodNode, silentlyVisitMethodNode, startMethodInference, storeInferredReturnType, storeInferredTypeForPropertyExpression, storeTargetMethod, storeType, typeCheckAssignment, typeCheckClosureCall, typeCheckMapConstructor, typeCheckMethodArgumentWithGenerics, typeCheckMethodsWithGenerics, visitAttributeExpression, visitBinaryExpression, visitBitwiseNegationExpression, visitCaseStatement, visitCastExpression, visitClassExpression, visitClosureExpression, visitConstructorOrMethod, visitField, visitIfElse, visitMethodCallArguments, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitReturnStatement, visitStaticMethodCallExpression, visitSwitch, visitTernaryExpression, visitTryCatchFinally, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression, visitWhileLoop, wrapTypeIfNecessary
visitAnnotations, visitAssertStatement, visitBlockStatement, visitBreakStatement, visitCatchStatement, visitClassCodeContainer, visitConstructor, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitExpressionStatement, visitImports, visitObjectInitializerStatements, visitPackage, visitProperty, visitStatement, visitSynchronizedStatement, visitThrowStatement
visitArgumentlistExpression, visitArrayExpression, visitBooleanExpression, visitBytecodeExpression, visitClosureListExpression, visitConstantExpression, visitEmptyStatement, visitFieldExpression, visitGStringExpression, visitListExpression, visitListOfExpressions, visitMapEntryExpression, visitMapExpression, visitMethodPointerExpression, visitNotExpression, visitShortTernaryExpression, visitSpreadMapExpression, visitTupleExpression
public static final ClassNode ARRAYLIST_CLASSNODE
public static final MethodNode ARRAYLIST_CONSTRUCTOR
public static final MethodNode ARRAYLIST_ADD_METHOD
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 visitSpreadExpression(SpreadExpression expression)
visitSpreadExpression
in interface GroovyCodeVisitor
visitSpreadExpression
in class CodeVisitorSupport
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 forLoop)
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 visitor