public List<XExpression> getSyntacticArguments(XAbstractFeatureCall expression) { if (expression instanceof XFeatureCall) { return ((XFeatureCall) expression).getFeatureCallArguments(); } if (expression instanceof XMemberFeatureCall) { return ((XMemberFeatureCall) expression).getMemberCallArguments(); } if (expression instanceof XAssignment) { return Collections.singletonList(((XAssignment) expression).getValue()); } if (expression instanceof XBinaryOperation) { return Collections.singletonList(((XBinaryOperation) expression).getRightOperand()); } // explicit condition to make sure we thought about it if (expression instanceof XUnaryOperation) { return Collections.emptyList(); } if (expression instanceof XPostfixOperation) { return Collections.emptyList(); } return Collections.emptyList(); }
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); } } }
@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); } } }
protected boolean _isMultiParamInOwnLine(final XFeatureCall fc, final FormattableDocument doc) { final ILeafNode closingBracket = this._nodeModelAccess.nodeForKeyword(fc, ")"); HiddenLeafs _hiddenLeafsBefore = null; if (closingBracket!=null) { _hiddenLeafsBefore=this._hiddenLeafAccess.getHiddenLeafsBefore(closingBracket); } boolean _tripleNotEquals = (_hiddenLeafsBefore != null); if (_tripleNotEquals) { int _newLines = this._hiddenLeafAccess.getHiddenLeafsBefore(closingBracket).getNewLines(); return (_newLines > 0); } final Iterable<XExpression> params = this.explicitParams(fc.getFeatureCallArguments()); return ((IterableExtensions.size(params) > 1) && this.isEachExpressionInOwnLine(params)); }
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); } } }
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)) {
final List<XExpression> arguments = call.getFeatureCallArguments(); for (final IFormalParameterBuilder currentParam : sarlParams) { final XFeatureCall argumentSource = XbaseFactory.eINSTANCE.createXFeatureCall();