gpt4 book ai didi

org.eclipse.xtext.xbase.XAbstractFeatureCall.isPackageFragment()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 14:56:40 27 4
gpt4 key购买 nike

本文整理了Java中org.eclipse.xtext.xbase.XAbstractFeatureCall.isPackageFragment()方法的一些代码示例,展示了XAbstractFeatureCall.isPackageFragment()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XAbstractFeatureCall.isPackageFragment()方法的具体详情如下:
包路径:org.eclipse.xtext.xbase.XAbstractFeatureCall
类名称:XAbstractFeatureCall
方法名:isPackageFragment

XAbstractFeatureCall.isPackageFragment介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase

@Override
  public boolean createReferenceDescriptions(EObject from, URI exportedContainerURI, IAcceptor<IReferenceDescription> acceptor) {
    if (from instanceof XAbstractFeatureCall && ((XAbstractFeatureCall) from).isPackageFragment())
      return false;
    return super.createReferenceDescriptions(from, exportedContainerURI, acceptor);
  }
}

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase

protected IScope getTypeScope(XAbstractFeatureCall call, JvmType type) {
  if (call.isTypeLiteral() || call.isPackageFragment()) {
    return doGetTypeScope(call, type);
  }
  return getThisOrSuperScope(call, type);
}

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase.testing

boolean _xifexpression = false;
if ((expression instanceof XAbstractFeatureCall)) {
 _xifexpression = (((XAbstractFeatureCall)expression).isPackageFragment() || (type != null));
} else {
 _xifexpression = (type != null);

代码示例来源:origin: io.sarl.lang/io.sarl.lang

private static boolean isLocalExpression(XAbstractFeatureCall expression, ISideEffectContext context, boolean dereference) {
  if (expression.isTypeLiteral() || expression.isPackageFragment()) {
    return false;
  }
  final JvmIdentifiableElement feature = expression.getFeature();
  if (feature != null && (feature.eIsProxy() || isExternalFeature(feature))) {
    return false;
  }
  if (feature instanceof XVariableDeclaration) {
    if (dereference) {
      final XVariableDeclaration variable = (XVariableDeclaration) feature;
      for (final XExpression value : context.getVariableValues(variable.getIdentifier())) {
        if (!isLocalExpression(value, context, dereference)) {
          return false;
        }
      }
    }
  }
  return true;
}

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase.ide

@Override
protected boolean highlightElement(EObject object, IHighlightedPositionAcceptor acceptor, CancelIndicator cancelIndicator) {
  if (object instanceof XAbstractFeatureCall) {
    if (((XAbstractFeatureCall) object).isPackageFragment()) {
      return true;
    }
    if (SPECIAL_FEATURE_NAMES.contains(((XAbstractFeatureCall) object).getConcreteSyntaxFeatureName())) {
      return false;
    }
    operationCanceledManager.checkCanceled(cancelIndicator);
    computeFeatureCallHighlighting((XAbstractFeatureCall) object, acceptor);
  } else if (object instanceof JvmTypeParameter) {
    highlightTypeParameter((JvmTypeParameter) object, acceptor);
  } else if (object instanceof JvmFormalParameter) {
    highlightFormalParameter((JvmFormalParameter) object, acceptor);
  } else if (object instanceof XVariableDeclaration) {
    highlightVariableDeclaration((XVariableDeclaration) object, acceptor);
  } else if (object instanceof XNumberLiteral) {
    highlightNumberLiterals((XNumberLiteral) object, acceptor);
  } else if (object instanceof XConstructorCall) {
    highlightConstructorCall((XConstructorCall) object, acceptor);
  } else if (object instanceof XAnnotation) {
    // Handle XAnnotation in a special way because we want the @ highlighted too
    highlightAnnotation((XAnnotation) object, acceptor);
  } else {
    computeReferencedJvmTypeHighlighting(acceptor, object, cancelIndicator);
  }
  return false;
}

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase

protected IScope doGetTypeScope(XMemberFeatureCall call, JvmType type) {
  if (call.isPackageFragment()) {
    if (type instanceof JvmDeclaredType) {
      int segmentIndex = countSegments(call);
      String packageName = ((JvmDeclaredType) type).getPackageName();
      List<String> splitted = Strings.split(packageName, '.');
      String segment = splitted.get(segmentIndex);
      return new SingletonScope(EObjectDescription.create(segment, type), IScope.NULLSCOPE);
    }
    return IScope.NULLSCOPE;
  } else {
    if (type instanceof JvmDeclaredType && ((JvmDeclaredType) type).getDeclaringType() == null) {
      return new SingletonScope(EObjectDescription.create(type.getSimpleName(), type), IScope.NULLSCOPE);
    } else {
      XAbstractFeatureCall target = (XAbstractFeatureCall) call.getMemberCallTarget();
      if (target.isPackageFragment()) {
        String qualifiedName = type.getQualifiedName();
        int dot = qualifiedName.lastIndexOf('.');
        String simpleName = qualifiedName.substring(dot + 1);
        return new SingletonScope(EObjectDescription.create(simpleName, type), IScope.NULLSCOPE);
      } else {
        return new SingletonScope(EObjectDescription.create(type.getSimpleName(), type), IScope.NULLSCOPE);	
      }
    }
  }
}

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase

return true;
if (featureCall.isPackageFragment() || featureCall.isTypeLiteral()) {
  return false;

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase

public XAbstractFeatureCall getRootTypeLiteral(XAbstractFeatureCall featureCall) {
  if (featureCall.isTypeLiteral()) {
    return featureCall;
  }
  if (featureCall.isPackageFragment()) {
    return getRootTypeLiteral((XAbstractFeatureCall) featureCall.eContainer());
  }
  if (featureCall.getFeature() == null || featureCall.getFeature().eIsProxy()) {
    // syntactic check
    if (featureCall instanceof XFeatureCall || featureCall instanceof XMemberFeatureCall) {
      if (!isPotentialTypeLiteral(featureCall, null)) {
        return null;
      }
      if (featureCall instanceof XMemberFeatureCall) {
        return doGetRootTypeLiteral((XMemberFeatureCall) featureCall);
      }
      if (featureCall instanceof XFeatureCall) {
        if (featureCall.eContainingFeature() == XbasePackage.Literals.XMEMBER_FEATURE_CALL__MEMBER_CALL_TARGET) {
          return doGetRootTypeLiteral((XMemberFeatureCall) featureCall.eContainer());
        }
      }
    }
  }
  return null;
}

代码示例来源:origin: io.sarl.lang/io.sarl.lang

return false;
if (expression.isTypeLiteral() || expression.isPackageFragment()) {
  return false;

代码示例来源:origin: org.eclipse.xtend/org.eclipse.xtend.core

boolean _matched = false;
if (sourceCandidate instanceof XAbstractFeatureCall) {
 boolean _isPackageFragment = ((XAbstractFeatureCall)sourceCandidate).isPackageFragment();
 if (_isPackageFragment) {
  _matched=true;

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase

if (featureCall.isTypeLiteral() || featureCall.isPackageFragment()) {
  return false;

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase

protected IFeatureLinkingCandidate createResolvedLink(XAbstractFeatureCall featureCall, JvmIdentifiableElement resolvedTo) {
  ExpressionAwareStackedResolvedTypes resolvedTypes = this.resolvedTypes.pushTypes(featureCall);
  ExpressionTypeComputationState state = createExpressionComputationState(featureCall, resolvedTypes);
  
  FeatureLinkHelper helper = new FeatureLinkHelper();
  XExpression syntacticReceiver = helper.getSyntacticReceiver(featureCall);
  if (syntacticReceiver != null) {
    AbstractTypeComputationState child = state.withNonVoidExpectation();
    child.computeTypes(syntacticReceiver);
  }
  XExpression implicitReceiver = featureCall.getImplicitReceiver();
  if (implicitReceiver != null) {
    AbstractTypeComputationState child = state.withNonVoidExpectation();
    child.computeTypes(implicitReceiver);
  }
  XExpression implicitFirstArgument = featureCall.getImplicitFirstArgument();
  if (implicitFirstArgument != null) {
    AbstractTypeComputationState child = state.withNonVoidExpectation();
    child.computeTypes(implicitFirstArgument);
  }
  if (featureCall.isTypeLiteral() || featureCall.isPackageFragment()) {
    return new ResolvedTypeLiteral(featureCall, resolvedTo, getSingleExpectation(state), state);
  }
  return new ResolvedFeature(featureCall, resolvedTo, helper, getSingleExpectation(state), state);
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com