当前位置: 首页>>代码示例>>Java>>正文


Java XFeatureCall.getFeatureCallArguments方法代码示例

本文整理汇总了Java中org.eclipse.xtext.xbase.XFeatureCall.getFeatureCallArguments方法的典型用法代码示例。如果您正苦于以下问题:Java XFeatureCall.getFeatureCallArguments方法的具体用法?Java XFeatureCall.getFeatureCallArguments怎么用?Java XFeatureCall.getFeatureCallArguments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.xtext.xbase.XFeatureCall的用法示例。


在下文中一共展示了XFeatureCall.getFeatureCallArguments方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: _format

import org.eclipse.xtext.xbase.XFeatureCall; //导入方法依赖的package包/类
protected void _format(final XFeatureCall expr, @Extension final IFormattableDocument format) {
  this.formatFeatureCallTypeParameters(expr, format);
  boolean _isExplicitOperationCall = expr.isExplicitOperationCall();
  if (_isExplicitOperationCall) {
    final Procedure1<IHiddenRegionFormatter> _function = (IHiddenRegionFormatter it) -> {
      it.noSpace();
    };
    final ISemanticRegion open = format.prepend(this.textRegionExtensions.regionFor(expr).keyword(this.grammar.getXFeatureCallAccess().getExplicitOperationCallLeftParenthesisKeyword_3_0_0()), _function);
    final ISemanticRegion close = this.textRegionExtensions.regionFor(expr).keyword(this.grammar.getXFeatureCallAccess().getRightParenthesisKeyword_3_2());
    this.formatFeatureCallParams(expr.getFeatureCallArguments(), open, close, format);
  } else {
    EList<XExpression> _featureCallArguments = expr.getFeatureCallArguments();
    for (final XExpression arg : _featureCallArguments) {
      this.format(arg, format);
    }
  }
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:18,代码来源:XbaseFormatter.java

示例2: _format

import org.eclipse.xtext.xbase.XFeatureCall; //导入方法依赖的package包/类
protected void _format(final XFeatureCall expr, final FormattableDocument format) {
  this.formatFeatureCallTypeParameters(expr, format);
  boolean _isExplicitOperationCall = expr.isExplicitOperationCall();
  if (_isExplicitOperationCall) {
    final ILeafNode open = this._nodeModelAccess.nodeForKeyword(expr, "(");
    final Procedure1<FormattingDataInit> _function = (FormattingDataInit it) -> {
      it.noSpace();
    };
    Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> _prepend = this._formattingDataFactory.prepend(open, _function);
    format.operator_add(_prepend);
    boolean _isMultiParamInOwnLine = this.isMultiParamInOwnLine(expr, format);
    if (_isMultiParamInOwnLine) {
      this.formatFeatureCallParamsMultiline(open, expr.getFeatureCallArguments(), format);
    } else {
      this.formatFeatureCallParamsWrapIfNeeded(open, expr.getFeatureCallArguments(), format);
    }
  } else {
    EList<XExpression> _featureCallArguments = expr.getFeatureCallArguments();
    for (final XExpression arg : _featureCallArguments) {
      this.format(arg, format);
    }
  }
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:24,代码来源:XbaseFormatter2.java

示例3: checkConstructorArgumentsAreValid

import org.eclipse.xtext.xbase.XFeatureCall; //导入方法依赖的package包/类
@Check
public void checkConstructorArgumentsAreValid(XFeatureCall featureCall) {
	JvmIdentifiableElement feature = featureCall.getFeature();
	if (feature != null && !feature.eIsProxy() && feature instanceof JvmConstructor) {
		JvmType containerType = EcoreUtil2.getContainerOfType(logicalContainerProvider.getNearestLogicalContainer(featureCall), JvmType.class);
		for(XExpression argument: featureCall.getFeatureCallArguments()) {
			checkIsValidConstructorArgument(argument, containerType);
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:11,代码来源:XbaseValidator.java

示例4: sequence_XFeatureCall

import org.eclipse.xtext.xbase.XFeatureCall; //导入方法依赖的package包/类
/**
 * Constraint:
 *     (
 *         declaringType=[JvmDeclaredType|StaticQualifier]?
 *         (typeArguments+=JvmArgumentTypeReference typeArguments+=JvmArgumentTypeReference*)?
 *         feature=[JvmIdentifiableElement|IdOrSuper]
 *         (explicitOperationCall?='(' (featureCallArguments+=XShortClosure | (featureCallArguments+=XExpression featureCallArguments+=XExpression*))?)?
 *     )
 *     
 *
 * Features:
 *    feature[1, 1]
 *    typeArguments[0, *]
 *    featureCallArguments[1, *]
 *         EXCLUDE_IF_UNSET explicitOperationCall
 *    explicitOperationCall[0, 1]
 *         MANDATORY_IF_SET featureCallArguments
 *         EXCLUDE_IF_UNSET featureCallArguments
 *         MANDATORY_IF_SET featureCallArguments
 *         MANDATORY_IF_SET featureCallArguments
 *    declaringType[0, 1]
 */
@Override
protected void sequence_XFeatureCall(ISerializationContext context, XFeatureCall featureCall) {
	INodesForEObjectProvider nodes = createNodeProvider(featureCall);
	SequenceFeeder acceptor = createSequencerFeeder(context, featureCall, nodes);
	XFeatureCallElements featureCallElements = grammarAccess.getXFeatureCallAccess();

	// (typeArguments+=JvmArgumentTypeReference typeArguments+=JvmArgumentTypeReference*)?
	List<JvmTypeReference> typeArguments = featureCall.getTypeArguments();
	if (!typeArguments.isEmpty()) {
		acceptor.accept(featureCallElements.getTypeArgumentsJvmArgumentTypeReferenceParserRuleCall_1_1_0(), typeArguments.get(0), 0);
		for (int i = 1; i < typeArguments.size(); i++)
			acceptor.accept(featureCallElements.getTypeArgumentsJvmArgumentTypeReferenceParserRuleCall_1_2_1_0(), typeArguments.get(i), i);
	}

	// feature=[JvmIdentifiableElement|IdOrSuper]
	acceptor.accept(featureCallElements.getFeatureJvmIdentifiableElementIdOrSuperParserRuleCall_2_0_1(), featureCall.getFeature());

	// (explicitOperationCall?='(' (featureCallArguments+=XShortClosure | (featureCallArguments+=XExpression featureCallArguments+=XExpression*))?)? featureCallArguments+=XClosure?
	if (featureCall.isExplicitOperationCallOrBuilderSyntax()) {
		if (featureCall.isExplicitOperationCall())
			acceptor.accept(featureCallElements.getExplicitOperationCallLeftParenthesisKeyword_3_0_0());
		List<XExpression> arguments = featureCall.getFeatureCallArguments();
		if (!arguments.isEmpty()) {
			if (featureCall.isExplicitOperationCall() && isXShortClosureAndBuilderSyntax(arguments, XbasePackage.Literals.XFEATURE_CALL__FEATURE_CALL_ARGUMENTS, nodes)) {
				acceptor.accept(featureCallElements.getFeatureCallArgumentsXShortClosureParserRuleCall_3_1_0_0(), arguments.get(0), 0);
				acceptor.accept(featureCallElements.getFeatureCallArgumentsXClosureParserRuleCall_4_0(), arguments.get(1), 1);
			} else if (featureCall.isExplicitOperationCall() && isXShortClosure(featureCall, XbasePackage.Literals.XFEATURE_CALL__FEATURE_CALL_ARGUMENTS, nodes)) {
				acceptor.accept(featureCallElements.getFeatureCallArgumentsXShortClosureParserRuleCall_3_1_0_0(), arguments.get(0), 0);
			} else {
				int diff = 0;
				if (isBuilderSyntax(featureCall, XbasePackage.Literals.XFEATURE_CALL__FEATURE_CALL_ARGUMENTS, featureCall.isExplicitOperationCall(), nodes)) {
					diff = 1;
				}
				if (featureCall.isExplicitOperationCall()) {
					if (arguments.size() - diff > 0)
						acceptor.accept(featureCallElements.getFeatureCallArgumentsXExpressionParserRuleCall_3_1_1_0_0(), arguments.get(0), 0);
					for (int i = 1; i < arguments.size() - diff; i++)
						acceptor.accept(featureCallElements.getFeatureCallArgumentsXExpressionParserRuleCall_3_1_1_1_1_0(), arguments.get(i), i);
				}
				if (diff != 0) {
					int lastIdx = arguments.size() - 1;
					acceptor.accept(featureCallElements.getFeatureCallArgumentsXClosureParserRuleCall_4_0(), arguments.get(lastIdx), lastIdx);
				}
			}
		}
	}
	acceptor.finish();
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:71,代码来源:XbaseSemanticSequencer.java


注:本文中的org.eclipse.xtext.xbase.XFeatureCall.getFeatureCallArguments方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。