Java Code Examples for org.eclipse.xtext.common.types.JvmIdentifiableElement#eIsProxy()

The following examples show how to use org.eclipse.xtext.common.types.JvmIdentifiableElement#eIsProxy() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SARLExpressionHelper.java    From sarl with Apache License 2.0 6 votes vote down vote up
@Override
public boolean hasSideEffects(XAbstractFeatureCall featureCall, boolean inspectContents) {
	if (super.hasSideEffects(featureCall, inspectContents)) {
		final JvmIdentifiableElement feature = featureCall.getFeature();
		// Several operations are not marked with @Pure but they have a clear semantic without border effects,
		// e.g. the "is", "get" functions.
		if (feature != null && !feature.eIsProxy() && feature instanceof JvmOperation) {
			final JvmOperation operation = (JvmOperation) feature;
			return this.nameValidator.isNamePatternForNotPureOperation(operation)
					|| !this.nameValidator.isNamePatternForPureOperation(operation)
					|| !hasPrimitiveParameters(operation);
		}
		return true;
	}
	return false;
}
 
Example 2
Source File: XbaseValidator.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
protected void checkIsValidConstructorArgument(XExpression argument, JvmType containerType) {
	TreeIterator<EObject> iterator = EcoreUtil2.eAll(argument);
	while(iterator.hasNext()) {
		EObject partOfArgumentExpression = iterator.next();
		if (partOfArgumentExpression instanceof XFeatureCall || partOfArgumentExpression instanceof XMemberFeatureCall) {				
			XAbstractFeatureCall featureCall = (XAbstractFeatureCall) partOfArgumentExpression;
			XExpression actualReceiver = featureCall.getActualReceiver();
			if(actualReceiver instanceof XFeatureCall && ((XFeatureCall)actualReceiver).getFeature() == containerType) {
				JvmIdentifiableElement feature = featureCall.getFeature();
				if (feature != null && !feature.eIsProxy()) {
					if (feature instanceof JvmField) {
						if (!((JvmField) feature).isStatic())
							error("Cannot refer to an instance field " + feature.getSimpleName() + " while explicitly invoking a constructor", 
									partOfArgumentExpression, null, INVALID_CONSTRUCTOR_ARGUMENT);
					} else if (feature instanceof JvmOperation) {
						if (!((JvmOperation) feature).isStatic())
							error("Cannot refer to an instance method while explicitly invoking a constructor", 
									partOfArgumentExpression, null, INVALID_CONSTRUCTOR_ARGUMENT);	
					}
				}
			}
		} else if(isLocalClassSemantics(partOfArgumentExpression)) {
			iterator.prune();
		}
	}
}
 
Example 3
Source File: ImplicitFirstArgument.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public boolean validate(IAcceptor<? super AbstractDiagnostic> result) {
	if (!getState().isInstanceContext()) {
		JvmIdentifiableElement implicitFeature = getFeature();
		if (implicitFeature instanceof JvmType) {
			JvmIdentifiableElement feature = getState().getResolvedTypes().getLinkedFeature(getOwner());
			if (feature == null || feature.eIsProxy() || !(feature instanceof JvmFeature))
				return true;
			String message = "Cannot make an implicit reference to this from a static context";
			AbstractDiagnostic diagnostic = new EObjectDiagnosticImpl(Severity.ERROR,
					IssueCodes.STATIC_ACCESS_TO_INSTANCE_MEMBER, message, getOwner(),
					XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE, -1, null);
			result.accept(diagnostic);
			return false;
		}
	}
	return super.validate(result);
}
 
Example 4
Source File: SARLOperationHelper.java    From sarl with Apache License 2.0 6 votes vote down vote up
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;
}
 
Example 5
Source File: XbaseValidator.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
@Check
public void checkDelegateConstructorIsFirst(XFeatureCall featureCall) {
	JvmIdentifiableElement feature = featureCall.getFeature();
	if (feature != null && !feature.eIsProxy() && feature instanceof JvmConstructor) {
		JvmIdentifiableElement container = logicalContainerProvider.getNearestLogicalContainer(featureCall);
		if (container != null) {
			if (container instanceof JvmConstructor) {
				XExpression body = logicalContainerProvider.getAssociatedExpression(container);
				if (body == featureCall)
					return;
				if (body instanceof XBlockExpression) {
					List<XExpression> expressions = ((XBlockExpression) body).getExpressions();
					if (expressions.isEmpty() || expressions.get(0) != featureCall) {
						error("Constructor call must be the first expression in a constructor", null, INVALID_CONSTRUCTOR_INVOCATION);
					}
				}
			} else {
				error("Constructor call must be the first expression in a constructor", null, INVALID_CONSTRUCTOR_INVOCATION);
			}
		}
	}
}
 
Example 6
Source File: XAbstractFeatureCallImplCustom.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public boolean isStatic() {
	JvmIdentifiableElement element = getFeature();
	if (element != null && !element.eIsProxy()) {
		if (element instanceof JvmFeature && !(element instanceof JvmConstructor))
			return ((JvmFeature) element).isStatic();
	}
	return false;
}
 
Example 7
Source File: SARLHoverSerializer.java    From sarl with Apache License 2.0 5 votes vote down vote up
@Override
public String computeUnsugaredExpression(EObject object) {
	if (object instanceof XAbstractFeatureCall) {
		final XAbstractFeatureCall featureCall = (XAbstractFeatureCall) object;
		final JvmIdentifiableElement feature = featureCall.getFeature();
		if (feature instanceof JvmExecutable && !feature.eIsProxy()
				&& (featureCall.getImplicitReceiver() != null || featureCall.getImplicitFirstArgument() != null)
				&& !featureCall.isStatic()) {
			final XExpression receiver = featureCall.getActualReceiver();
			if (receiver instanceof XMemberFeatureCall) {
				final JvmIdentifiableElement memberFeature = ((XMemberFeatureCall) receiver).getFeature();
				final String name = memberFeature.getSimpleName();
				if (Utils.isNameForHiddenCapacityImplementationCallingMethod(name)) {
					final JvmOperation op = (JvmOperation) memberFeature;
					final StringBuilder result = new StringBuilder();
					result.append("getSkill(typeof("); //$NON-NLS-1$
					result.append(op.getReturnType().getSimpleName());
					result.append("))."); //$NON-NLS-1$
					result.append(feature.getSimpleName());
					result.append(computeArguments(featureCall));
					return result.toString();
				}
			}
		}
	}
	return super.computeUnsugaredExpression(object);
}
 
Example 8
Source File: SARLHighlightingCalculator.java    From sarl with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("checkstyle:all")
@Override
protected void computeFeatureCallHighlighting(XAbstractFeatureCall featureCall, IHighlightedPositionAcceptor acceptor) {
	super.computeFeatureCallHighlighting(featureCall, acceptor);

	JvmIdentifiableElement feature = featureCall.getFeature();
	if (feature != null && !feature.eIsProxy() && feature instanceof JvmOperation && !featureCall.isOperation()) {
		if (isCapacityMethodCall((JvmOperation) feature)) {
			highlightFeatureCall(featureCall, acceptor, SARLHighlightingStyles.CAPACITY_METHOD_INVOCATION);
		}
	}
}
 
Example 9
Source File: XtendValidator.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
protected boolean isDelegateConstructorCall(XExpression expression) {
	if(expression instanceof XFeatureCall) {
		JvmIdentifiableElement feature = ((XFeatureCall)expression).getFeature();
		return (feature != null && !feature.eIsProxy() && feature instanceof JvmConstructor);
	}
	return false;
}
 
Example 10
Source File: XtendHoverSerializer.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
public String computeUnsugaredExpression(EObject object) {
	if (object instanceof XAbstractFeatureCall) {
		StringBuilder stringBuilder = new StringBuilder();
		XAbstractFeatureCall featureCall = (XAbstractFeatureCall) object;
		JvmIdentifiableElement feature = featureCall.getFeature();
		if (feature != null && !feature.eIsProxy()) {
			// Static extensions which are no expliciteOperationCalls
			if (featureCall instanceof XMemberFeatureCall && feature instanceof JvmOperation && !((XMemberFeatureCall) featureCall).isExplicitOperationCall()) {
				JvmOperation jvmOperation = (JvmOperation) feature;
				if (jvmOperation.isStatic()) {
					return stringBuilder.append(getStaticCallDesugaredVersion(featureCall, jvmOperation)).toString();
				}
			}
			// Static calls with implicit receiver or implicit first argument
			if (featureCall.getImplicitReceiver() != null || featureCall.getImplicitFirstArgument() != null) {
				if (featureCall.isStatic()) {
					return stringBuilder.append(getStaticCallDesugaredVersion(featureCall, (JvmMember) feature)).toString();
				}
				XExpression receiver = featureCall.getActualReceiver();
				if (receiver instanceof XMemberFeatureCall) {
					stringBuilder.append(THIS).append(DELIMITER);
					stringBuilder.append(((XMemberFeatureCall) receiver).getFeature().getSimpleName()).append(DELIMITER);
				} else if (receiver instanceof XAbstractFeatureCall) {
					JvmIdentifiableElement receiverFeature = ((XAbstractFeatureCall) receiver).getFeature();
					if (receiverFeature == feature.eContainer()) {
						stringBuilder.append(THIS).append(DELIMITER);
					} else {
						stringBuilder.append(receiverFeature.getSimpleName()).append(DELIMITER);
					}
				}
				stringBuilder.append(feature.getSimpleName());
				if (feature instanceof JvmExecutable)
					stringBuilder.append(computeArguments(featureCall));
				return stringBuilder.toString();
			}
		}
	}
	return "";
}
 
Example 11
Source File: ConstantConditionsInterpreter.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
public JvmIdentifiableElement getFeature(final XAbstractFeatureCall call, final EvaluationContext context) {
  Object _eGet = call.eGet(XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE, false);
  JvmIdentifiableElement feature = ((JvmIdentifiableElement) _eGet);
  if (((feature == null) || feature.eIsProxy())) {
    feature = context.getResolvedTypes().getLinkedFeature(call);
  }
  return feature;
}
 
Example 12
Source File: TypeUsageCollector.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
protected JvmIdentifiableElement getReferencedElement(EObject owner, EReference reference) {
	JvmIdentifiableElement referencedThing = (JvmIdentifiableElement) owner.eGet(reference);
	if (referencedThing != null && owner instanceof XConstructorCall && referencedThing.eIsProxy()) {
		JvmIdentifiableElement potentiallyLinkedType = batchTypeResolver.resolveTypes(owner).getLinkedFeature((XConstructorCall)owner);
		if (potentiallyLinkedType != null && !potentiallyLinkedType.eIsProxy()) {
			referencedThing = potentiallyLinkedType;
		}
	}
	return referencedThing;
}
 
Example 13
Source File: XExpressionHelper.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
public boolean hasSideEffects(XAbstractFeatureCall featureCall, boolean inspectContents) {
	if (featureCall instanceof XBinaryOperation) {
		XBinaryOperation binaryOperation = (XBinaryOperation) featureCall;
		if (binaryOperation.isReassignFirstArgument()) {
			return true;
		}
	}
	if (featureCall instanceof XAssignment) {
		return true;
	}
	if (featureCall.isPackageFragment() || featureCall.isTypeLiteral()) {
		return false;
	}
	final JvmIdentifiableElement feature = featureCall.getFeature();
	if (feature == null || feature.eIsProxy())
		return true; // linking problems ... could be anything
	if (feature instanceof JvmConstructor) { //super() and this()
		return true;
	}
	if (feature instanceof JvmOperation) {
		JvmOperation jvmOperation = (JvmOperation) feature;
		if (findPureAnnotation(jvmOperation) == null) {
			return true;
		} else {
			if(inspectContents) {
				for (XExpression param : featureCall.getActualArguments()) {
					if (hasSideEffects(param))
						return true;
				}
			}
		}
	}
	return false;
}
 
Example 14
Source File: FeatureScopes.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Returns <code>true</code> if the linked receiver may be passed as an argument. Basically everything could
 * be passed as an argument except the linked receiver is null, a proxy or a reference to <code>super</code>.
 */
protected boolean isValidFeatureCallArgument(XExpression expression, JvmIdentifiableElement linkedReceiver, IFeatureScopeSession session) {
	if (linkedReceiver instanceof JvmType) {
		IEObjectDescription knownSuperType = session.getLocalElement(SUPER);
		if (knownSuperType != null && linkedReceiver == knownSuperType.getEObjectOrProxy()) {
			return false;
		}
	}
	return !(expression instanceof XAbstractFeatureCall) || linkedReceiver != null && !linkedReceiver.eIsProxy();
}
 
Example 15
Source File: IdentifiableSimpleNameProvider.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
public /* @Nullable */ String getSimpleName(JvmIdentifiableElement element) {
	if (element == null || element.eIsProxy()) {
		return null;
	}
	if (element instanceof JvmFeature) {
		return ((JvmFeature) element).getSimpleName();
	}
	if (element instanceof JvmFormalParameter) {
		return ((JvmFormalParameter) element).getName();
	}
	if (element instanceof XVariableDeclaration) {
		return ((XVariableDeclaration) element).getName();
	}
	return element.getSimpleName();
}
 
Example 16
Source File: XbaseValidator.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@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);
		}
	}
}
 
Example 17
Source File: XAbstractFeatureCallImplCustom.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void setFeature(JvmIdentifiableElement newFeature) {
	isLinked = newFeature != null && !newFeature.eIsProxy();
	super.setFeature(newFeature);
}
 
Example 18
Source File: XbaseHighlightingCalculator.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
protected void computeFeatureCallHighlighting(XAbstractFeatureCall featureCall, IHighlightedPositionAcceptor acceptor) {
	JvmIdentifiableElement feature = featureCall.getFeature();
	if (feature != null && !feature.eIsProxy()) {
		
		if (feature instanceof XVariableDeclaration) {
			if (!SPECIAL_FEATURE_NAMES.contains(((XVariableDeclaration) feature).getName())) {
				// highlighting of special identifiers is done separately, so it's omitted here 
				highlightFeatureCall(featureCall, acceptor, LOCAL_VARIABLE);
				
				if (!((XVariableDeclaration) feature).isWriteable()) {
					highlightFeatureCall(featureCall, acceptor, LOCAL_FINAL_VARIABLE);
				}
			}
			
		} else if (feature instanceof JvmFormalParameter) {
			if (!SPECIAL_FEATURE_NAMES.contains(((JvmFormalParameter) feature).getName())) {
				// highlighting of special identifiers is done separately, so it's omitted here 
				final EObject eContainingFeature = feature.eContainingFeature();
				
				if (eContainingFeature == TypesPackage.Literals.JVM_EXECUTABLE__PARAMETERS
						|| eContainingFeature == XbasePackage.Literals.XCLOSURE__DECLARED_FORMAL_PARAMETERS) {
					// which is the case for constructors and methods
					highlightFeatureCall(featureCall, acceptor, PARAMETER_VARIABLE);
				} else {
					// covers parameters of for and template expr FOR loops, as well as switch statements
					highlightFeatureCall(featureCall, acceptor, LOCAL_VARIABLE);
					highlightFeatureCall(featureCall, acceptor, LOCAL_FINAL_VARIABLE);
				}
			}
			
		} else if (feature instanceof JvmTypeParameter) {
			highlightFeatureCall(featureCall, acceptor, TYPE_VARIABLE);
			
		} else if (feature instanceof JvmField) {
			highlightFeatureCall(featureCall, acceptor, FIELD);
			
			if (((JvmField) feature).isStatic()) {
				highlightFeatureCall(featureCall, acceptor, STATIC_FIELD);
				
				if (((JvmField) feature).isFinal()) {
					highlightFeatureCall(featureCall, acceptor, STATIC_FINAL_FIELD);
				}
			}
			
		} else if (feature instanceof JvmOperation && !featureCall.isOperation()) {
			JvmOperation jvmOperation = (JvmOperation) feature;
			
			highlightFeatureCall(featureCall, acceptor, METHOD);
			
			if (jvmOperation.isAbstract()) {
				highlightFeatureCall(featureCall, acceptor, ABSTRACT_METHOD_INVOCATION);
			}
			
			if (jvmOperation.isStatic()) {
				highlightFeatureCall(featureCall, acceptor, STATIC_METHOD_INVOCATION);
			}
			
			if (featureCall.isExtension() || isExtensionWithImplicitFirstArgument(featureCall)) {
				highlightFeatureCall(featureCall, acceptor, EXTENSION_METHOD_INVOCATION);
			}
			
		} else if (feature instanceof JvmDeclaredType) {
			highlightReferenceJvmType(acceptor, featureCall, XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE, feature);
		}
		
		if(feature instanceof JvmAnnotationTarget && DeprecationUtil.isTransitivelyDeprecated((JvmAnnotationTarget)feature)){
			highlightFeatureCall(featureCall, acceptor, DEPRECATED_MEMBERS);
		}
	}
}
 
Example 19
Source File: CreateMemberQuickfixes.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void addQuickfixes(Issue issue, IssueResolutionAcceptor issueResolutionAcceptor,
		IXtextDocument xtextDocument, XtextResource resource, EObject referenceOwner, EReference unresolvedReference)
		throws Exception {
	if (referenceOwner instanceof XAbstractFeatureCall) {
		XAbstractFeatureCall call = (XAbstractFeatureCall) referenceOwner;
		
		String newMemberName = (issue.getData() != null && issue.getData().length > 0) ? issue.getData()[0] : null;
		if(newMemberName != null) {
			if (call instanceof XMemberFeatureCall) {
				if(!call.isExplicitOperationCallOrBuilderSyntax()) { 
					newFieldQuickfix(newMemberName, call, issue, issueResolutionAcceptor);
					newGetterQuickfixes(newMemberName, call, issue, issueResolutionAcceptor);
				}
				newMethodQuickfixes(newMemberName, call, issue, issueResolutionAcceptor);
				
			} else if(call instanceof XFeatureCall) {
				if(!call.isExplicitOperationCallOrBuilderSyntax()) {
					if(logicalContainerProvider.getNearestLogicalContainer(call) instanceof JvmExecutable)
						newLocalVariableQuickfix(newMemberName, call, issue, issueResolutionAcceptor);
					newFieldQuickfix(newMemberName, call, issue, issueResolutionAcceptor);
					newGetterQuickfixes(newMemberName, call, issue, issueResolutionAcceptor);
				}
				newMethodQuickfixes(newMemberName, call, issue, issueResolutionAcceptor);
				
			} else if (call instanceof XAssignment) {
				newSetterQuickfix(issue, issueResolutionAcceptor, newMemberName, call);
				XAssignment assigment = (XAssignment) call;
				if(assigment.getAssignable() == null) {
					newLocalVariableQuickfix(newMemberName, call, issue, issueResolutionAcceptor);
					newFieldQuickfix(newMemberName, call, issue, issueResolutionAcceptor);
				} else if (isThis(assigment)) {
					newFieldQuickfix(newMemberName, call, issue, issueResolutionAcceptor);
				}
			}
		} 
		if (call.isOperation()) {
			JvmIdentifiableElement feature = call.getFeature();
			if(feature.eIsProxy()) {
				String operatorMethodName = getOperatorMethodName(call);
				if(operatorMethodName != null) 
					newMethodQuickfixes(operatorMethodName, call, issue, issueResolutionAcceptor);
			}
		}
		if(call instanceof XFeatureCall && call.getFeature() instanceof JvmConstructor) {
			newConstructorQuickfix(issue, issueResolutionAcceptor, (XFeatureCall) call);
		}
	}
	if(referenceOwner instanceof XConstructorCall) {
		newConstructorQuickfix(issue, issueResolutionAcceptor, (XConstructorCall) referenceOwner);
	}
}
 
Example 20
Source File: XbaseSemanticSequencer.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Constraint:
 *     (
 *         (leftOperand=XAdditiveExpression_XBinaryOperation_1_0_0_0 feature=[JvmIdentifiableElement|OpAdd] rightOperand=XMultiplicativeExpression) | 
 *         (leftOperand=XMultiplicativeExpression_XBinaryOperation_1_0_0_0 feature=[JvmIdentifiableElement|OpMulti] rightOperand=XUnaryOperation) | 
 *         (leftOperand=XOtherOperatorExpression_XBinaryOperation_1_0_0_0 feature=[JvmIdentifiableElement|OpOther] rightOperand=XAdditiveExpression) | 
 *         (leftOperand=XRelationalExpression_XBinaryOperation_1_1_0_0_0 feature=[JvmIdentifiableElement|OpCompare] rightOperand=XOtherOperatorExpression) | 
 *         (leftOperand=XEqualityExpression_XBinaryOperation_1_0_0_0 feature=[JvmIdentifiableElement|OpEquality] rightOperand=XRelationalExpression) | 
 *         (leftOperand=XAndExpression_XBinaryOperation_1_0_0_0 feature=[JvmIdentifiableElement|OpAnd] rightOperand=XEqualityExpression) | 
 *         (leftOperand=XOrExpression_XBinaryOperation_1_0_0_0 feature=[JvmIdentifiableElement|OpOr] rightOperand=XAndExpression) | 
 *         (leftOperand=XAssignment_XBinaryOperation_1_1_0_0_0 feature=[JvmIdentifiableElement|OpMultiAssign] rightOperand=XAssignment)
 *     )
 */
@Override
protected void sequence_XAdditiveExpression_XAndExpression_XAssignment_XEqualityExpression_XMultiplicativeExpression_XOrExpression_XOtherOperatorExpression_XRelationalExpression(ISerializationContext context, XBinaryOperation operation) {
	INodesForEObjectProvider nodes = createNodeProvider(operation);
	SequenceFeeder acceptor = createSequencerFeeder(context, operation, nodes);
	XAdditiveExpressionElements opAdd = grammarAccess.getXAdditiveExpressionAccess();
	XMultiplicativeExpressionElements opMulti = grammarAccess.getXMultiplicativeExpressionAccess();
	XOtherOperatorExpressionElements opOther = grammarAccess.getXOtherOperatorExpressionAccess();
	XRelationalExpressionElements opCompare = grammarAccess.getXRelationalExpressionAccess();
	XEqualityExpressionElements opEquality = grammarAccess.getXEqualityExpressionAccess();
	XAndExpressionElements opAnd = grammarAccess.getXAndExpressionAccess();
	XOrExpressionElements opOr = grammarAccess.getXOrExpressionAccess();
	XAssignmentElements opMultiAssign = grammarAccess.getXAssignmentAccess();
	
	JvmIdentifiableElement feature = operation.getFeature();
	Set<String> operatorNames = Sets.newHashSet();
	if (feature.eIsProxy()) {
		List<INode> ops = NodeModelUtils.findNodesForFeature(operation, XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE);
		for (INode o : ops)
			operatorNames.add(NodeModelUtils.getTokenText(o));
	} else {
		IScope scope = scopeProvider.getScope(operation, XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE);
		for (IEObjectDescription desc : scope.getElements(feature))
			operatorNames.add(qualifiedNameConverter.toString(desc.getName()));
	}
	ICompositeNode featureNode = (ICompositeNode) nodes.getNodeForSingelValue(XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE, operation.getFeature());
	String featureToken;
	
	if((featureToken = getValidOperator(operation, opAdd.getFeatureJvmIdentifiableElementOpAddParserRuleCall_1_0_0_1_0_1(), operatorNames, featureNode)) != null) {
		acceptor.accept(opAdd.getXBinaryOperationLeftOperandAction_1_0_0_0(), operation.getLeftOperand());
		acceptor.accept(opAdd.getFeatureJvmIdentifiableElementOpAddParserRuleCall_1_0_0_1_0_1(), operation.getFeature(), featureToken, featureNode);
		acceptor.accept(opAdd.getRightOperandXMultiplicativeExpressionParserRuleCall_1_1_0(), operation.getRightOperand());
	} else if((featureToken = getValidOperator(operation, opMulti.getFeatureJvmIdentifiableElementOpMultiParserRuleCall_1_0_0_1_0_1(), operatorNames, featureNode)) != null) {
		acceptor.accept(opMulti.getXBinaryOperationLeftOperandAction_1_0_0_0(), operation.getLeftOperand());
		acceptor.accept(opMulti.getFeatureJvmIdentifiableElementOpMultiParserRuleCall_1_0_0_1_0_1(), operation.getFeature(), featureToken, featureNode);
		acceptor.accept(opMulti.getRightOperandXUnaryOperationParserRuleCall_1_1_0(), operation.getRightOperand());
	} else if((featureToken = getValidOperator(operation, opOther.getFeatureJvmIdentifiableElementOpOtherParserRuleCall_1_0_0_1_0_1(), operatorNames, featureNode)) != null) {
		acceptor.accept(opOther.getXBinaryOperationLeftOperandAction_1_0_0_0(), operation.getLeftOperand());
		acceptor.accept(opOther.getFeatureJvmIdentifiableElementOpOtherParserRuleCall_1_0_0_1_0_1(), operation.getFeature(), featureToken, featureNode);
		acceptor.accept(opOther.getRightOperandXAdditiveExpressionParserRuleCall_1_1_0(), operation.getRightOperand());
	} else if((featureToken = getValidOperator(operation, opCompare.getFeatureJvmIdentifiableElementOpCompareParserRuleCall_1_1_0_0_1_0_1(), operatorNames, featureNode)) != null) {
		acceptor.accept(opCompare.getXBinaryOperationLeftOperandAction_1_1_0_0_0(), operation.getLeftOperand());
		acceptor.accept(opCompare.getFeatureJvmIdentifiableElementOpCompareParserRuleCall_1_1_0_0_1_0_1(), operation.getFeature(), featureToken, featureNode);
		acceptor.accept(opCompare.getRightOperandXOtherOperatorExpressionParserRuleCall_1_1_1_0(), operation.getRightOperand());
	} else if((featureToken = getValidOperator(operation, opEquality.getFeatureJvmIdentifiableElementOpEqualityParserRuleCall_1_0_0_1_0_1(), operatorNames, featureNode)) != null) {
		acceptor.accept(opEquality.getXBinaryOperationLeftOperandAction_1_0_0_0(), operation.getLeftOperand());
		acceptor.accept(opEquality.getFeatureJvmIdentifiableElementOpEqualityParserRuleCall_1_0_0_1_0_1(), operation.getFeature(), featureToken, featureNode);
		acceptor.accept(opEquality.getRightOperandXRelationalExpressionParserRuleCall_1_1_0(), operation.getRightOperand());
	} else if((featureToken = getValidOperator(operation, opAnd.getFeatureJvmIdentifiableElementOpAndParserRuleCall_1_0_0_1_0_1(), operatorNames, featureNode)) != null) {
		acceptor.accept(opAnd.getXBinaryOperationLeftOperandAction_1_0_0_0(), operation.getLeftOperand());
		acceptor.accept(opAnd.getFeatureJvmIdentifiableElementOpAndParserRuleCall_1_0_0_1_0_1(), operation.getFeature(), featureToken, featureNode);
		acceptor.accept(opAnd.getRightOperandXEqualityExpressionParserRuleCall_1_1_0(), operation.getRightOperand());
	} else if((featureToken = getValidOperator(operation, opOr.getFeatureJvmIdentifiableElementOpOrParserRuleCall_1_0_0_1_0_1(), operatorNames, featureNode)) != null) {
		acceptor.accept(opOr.getXBinaryOperationLeftOperandAction_1_0_0_0(), operation.getLeftOperand());
		acceptor.accept(opOr.getFeatureJvmIdentifiableElementOpOrParserRuleCall_1_0_0_1_0_1(), operation.getFeature(), featureToken, featureNode);
		acceptor.accept(opOr.getRightOperandXAndExpressionParserRuleCall_1_1_0(), operation.getRightOperand());
	} else if((featureToken = getValidOperator(operation, opMultiAssign.getFeatureJvmIdentifiableElementOpMultiAssignParserRuleCall_1_1_0_0_1_0_1(), operatorNames, featureNode)) != null) {
		acceptor.accept(opMultiAssign.getXBinaryOperationLeftOperandAction_1_1_0_0_0(), operation.getLeftOperand());
		acceptor.accept(opMultiAssign.getFeatureJvmIdentifiableElementOpMultiAssignParserRuleCall_1_1_0_0_1_0_1(), operation.getFeature(), featureToken, featureNode);
		acceptor.accept(opMultiAssign.getRightOperandXAssignmentParserRuleCall_1_1_1_0(), operation.getRightOperand());
	} else if (errorAcceptor != null) {
		errorAcceptor.accept(new SerializationDiagnostic(OPERATOR_NOT_SUPPORTED, operation, context, grammarAccess.getGrammar(), "Operator "+operatorNames+" is not supported."));
	} 
	acceptor.finish();
}