gpt4 book ai didi

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

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

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

XAbstractFeatureCall.getImplicitReceiver介绍

[英]Returns the value of the 'Implicit Receiver' containment reference. Returns the implicit receiver of the feature call if any. Otherwise null. May not be used during linking.
[中]返回“隐式接收器”包含引用的值。返回功能调用的隐式接收器(如果有)。否则null。链接过程中不能使用。

代码示例

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

protected XExpression getImplicitReceiver() {
  return getExpression().getImplicitReceiver();
}

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

@Override
  protected Iterator<? extends EObject> getEObjectChildren(EObject eObject) {
    if(eObject instanceof XAbstractFeatureCall){
      Iterable<EObject> result = eObject.eContents();
      XAbstractFeatureCall featureCall = (XAbstractFeatureCall) eObject;
      XExpression implicitReceiver = featureCall.getImplicitReceiver();
      if(implicitReceiver != null) 
        result = Iterables.concat(result, Collections.singleton(implicitReceiver));
      XExpression implicitFirstArgument = featureCall.getImplicitFirstArgument();
      if(implicitFirstArgument != null)
        result = Iterables.concat(result, Collections.singleton(implicitFirstArgument));
      return result.iterator();
    } else 
      return super.getEObjectChildren(eObject);
  }
};

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

protected boolean isExtensionWithImplicitFirstArgument(XAbstractFeatureCall featureCall) {
  XExpression implicitReceiver = featureCall.getImplicitReceiver();
  return implicitReceiver instanceof XAbstractFeatureCall
      && isExtension(((XAbstractFeatureCall) implicitReceiver).getFeature());
}

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

protected Object _assignValueTo(JvmOperation jvmOperation, XAbstractFeatureCall assignment, Object value,
    IEvaluationContext context, CancelIndicator indicator) {
  List<Object> argumentValues;
  if (assignment.getImplicitReceiver() != null 
      && assignment instanceof XAssignment 
      && ((XAssignment) assignment).getAssignable() != null) {
    XExpression implicitArgument = ((XAssignment) assignment).getAssignable();
    Object argResult = internalEvaluate(implicitArgument, context, indicator);
    JvmTypeReference firstParameterType = jvmOperation.getParameters().get(0).getParameterType();
    Object firstValue = coerceArgumentType(argResult, firstParameterType);
    JvmTypeReference secondParameterType = jvmOperation.getParameters().get(1).getParameterType();
    Object secondValue = coerceArgumentType(value, secondParameterType);
    argumentValues = Lists.newArrayList(firstValue, secondValue);
  } else {
    JvmTypeReference secondParameterType = jvmOperation.getParameters().get(0).getParameterType();
    Object coerced = coerceArgumentType(value, secondParameterType);
    argumentValues = Lists.newArrayList(coerced);
  }
  Object receiver = getReceiver(assignment, context, indicator);
  Object result = invokeOperation(jvmOperation, receiver, argumentValues, context, indicator);
  return result;
}

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

return false;
final XExpression implicit = call.getImplicitReceiver();
if (receiver == implicit) {
  output.add(thisKeyword.apply());

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

_matched=true;
this.assertExpressionTypeIsResolved(((XExpression)content), resolvedTypes);
XExpression _implicitReceiver = ((XAbstractFeatureCall)content).getImplicitReceiver();
boolean _tripleNotEquals = (_implicitReceiver != null);
if (_tripleNotEquals) {
 this.assertExpressionTypeIsResolved(((XAbstractFeatureCall)content).getImplicitReceiver(), resolvedTypes);

代码示例来源: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);
}

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