protected IEObjectDescription createDescription(QualifiedName name, JvmConstructor constructor, boolean superType) { if (superType) return new SuperConstructorDescription(name, constructor, getReceiverTypeParameterMapping(), 0, getSession().isVisible(constructor)); return new ConstructorDescription(name, constructor, 0, getSession().isVisible(constructor)); }
protected BucketedEObjectDescription doCreateDescription(QualifiedName name, JvmFeature feature, TypeBucket bucket) { if (implicit) { return new StaticExtensionFeatureDescriptionWithImplicitFirstArgument(name, feature, receiver, receiverType, bucket.getId(), getSession().isVisible(feature)); } return new StaticExtensionFeatureDescription(name, feature, receiver, receiverType, bucket.getId(), getSession().isVisible(feature)); }
@Override protected BucketedEObjectDescription createDescription(QualifiedName name, JvmFeature feature, TypeBucket bucket) { return new StaticFeatureDescription(name, feature, bucket.getId(), getSession().isVisible(feature)); }
protected IEObjectDescription createDescription(QualifiedName name, JvmFeature feature, TypeBucket bucket) { if (receiver != null) { return new StaticFeatureDescriptionWithSyntacticReceiver(name, feature, receiver, receiverType, bucket.getId(), getSession().isVisible(feature)); } if (receiverType != null) { return new StaticFeatureDescriptionWithImplicitReceiver(name, feature, receiverType, bucket.getId(), getSession().isVisible(feature)); } return new StaticFeatureDescription(name, feature, bucket.getId(), getSession().isVisible(feature)); }
@Override protected IEObjectDescription createDescription(QualifiedName name, JvmFeature feature, TypeBucket bucket) { return new StaticFeatureDescriptionWithTypeLiteralReceiver(name, feature, getReceiver(), getReceiverType(), bucket.getId(), getSession().isVisible(feature)); }
protected IEObjectDescription createDescription(QualifiedName name, JvmFeature feature, TypeBucket bucket) { if (implicit) { return new InstanceFeatureDescriptionWithImplicitReceiver(name, feature, receiver, receiverType, getReceiverTypeParameterMapping(), bucket.getFlags(), bucket.getId(), isVisible(feature), validStaticState); } else { return new InstanceFeatureDescription(name, feature, receiver, receiverType, getReceiverTypeParameterMapping(), bucket.getFlags(), bucket.getId(), isVisible(feature)); } }
protected BucketedEObjectDescription createReceiverDescription(QualifiedName name, JvmFeature feature, XExpression receiver, LightweightTypeReference receiverType, Map<JvmTypeParameter, LightweightMergedBoundTypeArgument> receiverTypeParameterMapping, ExpressionBucket bucket, boolean validStaticState) { return new InstanceFeatureDescriptionWithImplicitReceiver( name, feature, receiver, receiverType, receiverTypeParameterMapping, ConformanceFlags.CHECKED_SUCCESS, bucket.getId(), getSession().isVisible(feature), validStaticState); }
protected IScope createImplicitFeatureCallAndLocalVariableScope(EObject context, IScope parent, IFeatureScopeSession session, IResolvedTypes resolvedTypes) { IFeatureScopeSession nextCaptureLayer = session.getNextCaptureLayer(); if (nextCaptureLayer != null) { parent = createImplicitFeatureCallAndLocalVariableScope(context, parent, nextCaptureLayer, resolvedTypes); } IScope implicitReceivers = createImplicitFeatureCallScope(context, parent, session, resolvedTypes); IScope constructors = createConstructorDelegates(context, implicitReceivers, session, resolvedTypes); IScope localVariables = createLocalVariableScope(context, constructors, session, resolvedTypes); return localVariables; }
protected boolean isVisible(JvmType type) { if (type instanceof JvmMember) return getSession().isVisible((JvmMember) type); return true; // primitives et. al }
@Override public IEObjectDescription getSingleElement(QualifiedName name) { IEObjectDescription localElement = getSession().getLocalElement(name); if (localElement != null) return localElement; return super.getSingleElement(name); }
@Override protected BucketedEObjectDescription createDescription(QualifiedName name, JvmFeature feature, TypeBucket bucket) { if (!helper.isPossibleExtension(feature)) { return null; } if (!helper.isMatchingFirstParameter((JvmOperation) feature)) { return null; } return doCreateDescription(name, feature, bucket); }
@Override protected void addExtensionProviders(List<ExpressionBucket> result) { ExpressionBucket bucket = new ExpressionBucket(getId(), extensionProviders, resolvedFeaturesProvider); result.add(bucket); super.addExtensionProviders(result); }
protected BucketedEObjectDescription createExtensionDescription(QualifiedName name, JvmFeature feature, XExpression receiver, LightweightTypeReference receiverType, Map<JvmTypeParameter, LightweightMergedBoundTypeArgument> receiverTypeParameterMapping, ExpressionBucket bucket, boolean validStaticState) { if (helper == null || !helper.isPossibleExtension(feature)) { return null; } return doCreateExtensionDescription(name, feature, receiver, receiverType, receiverTypeParameterMapping, bucket, validStaticState); }
/** * Creates a scope for the local variables that have been registered in the given session. * * @param featureCall the feature call that is currently processed by the scoping infrastructure * @param parent the parent scope. Is never null. * @param session the currently known scope session. Is never null. * @param resolvedTypes may be used by inheritors. */ protected IScope createLocalVariableScope(EObject featureCall, IScope parent, IFeatureScopeSession session, IResolvedTypes resolvedTypes) { return new LocalVariableScope(parent, session, asAbstractFeatureCall(featureCall)); }
/** * Creates a scope for the statically imported features. * * @param featureCall the feature call that is currently processed by the scoping infrastructure * @param parent the parent scope. Is never null. * @param session the currently known scope session. Is never null. */ protected IScope createStaticFeaturesScope(EObject featureCall, IScope parent, IFeatureScopeSession session) { return new StaticImportsScope(parent, session, asAbstractFeatureCall(featureCall)); }
@Override protected List<IEObjectDescription> getAllLocalElements() { return getSession().getLocalElements(); }
/** * Create a composite scope that returns description from multiple other scopes without applying shadowing semantics to then. */ protected CompositeScope createCompositeScope(EObject featureCall, IScope parent, IFeatureScopeSession session) { return new CompositeScope(parent, session, asAbstractFeatureCall(featureCall)); }
/** * Create a scope that returns types, e.g. for member feature calls that are actually type references like * {@code java.lang.String}. * * @param featureCall the feature call that is currently processed by the scoping infrastructure * @param parentSegments the segments of the fully qualified type name that are already known. The queried element name will be appended to them. * @param parent the parent scope. Is never null. * @param session the currently known scope session. Is never null. */ protected IScope createTypeLiteralScope(EObject featureCall, QualifiedName parentSegments, IScope parent, IFeatureScopeSession session, IResolvedTypes resolvedTypes) { return new TypeLiteralScope(parent, session, asAbstractFeatureCall(featureCall), resolvedTypes, parentSegments); }
@Override public List<TypeBucket> getStaticallyImportedTypes() { if (staticallyImportedTypes != null) return staticallyImportedTypes; return staticallyImportedTypes = concatTypeBuckets(staticFeatureProviders, super.getStaticallyImportedTypes(), resolvedFeaturesProvider); }
@Override public List<TypeBucket> getStaticallyImportedExtensionTypes() { if (staticallyImportedExtensions != null) return staticallyImportedExtensions; return staticallyImportedExtensions = concatTypeBuckets(extensionProviders, super.getStaticallyImportedExtensionTypes(), resolvedFeaturesProvider); }