Java 类org.eclipse.xtext.xbase.XPostfixOperation 实例源码

项目:xtext-extras    文件:FeatureLinkHelper.java   
public XExpression getSyntacticReceiver(XExpression expression) {
    if (expression instanceof XAbstractFeatureCall) {
        if (expression instanceof XFeatureCall) {
            return null;
        }
        if (expression instanceof XMemberFeatureCall) {
            return ((XMemberFeatureCall) expression).getMemberCallTarget();
        }
        if (expression instanceof XAssignment) {
            return ((XAssignment) expression).getAssignable();
        }
        if (expression instanceof XBinaryOperation) {
            return ((XBinaryOperation) expression).getLeftOperand();
        }
        if (expression instanceof XUnaryOperation) {
            return ((XUnaryOperation) expression).getOperand();
        }
        if (expression instanceof XPostfixOperation) {
            return ((XPostfixOperation) expression).getOperand();
        }
    }
    return null;
}
项目:xtext-extras    文件:FeatureLinkHelper.java   
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();
}
项目:xtext-extras    文件:XbaseValidator.java   
@Check
public void checkAssignment(XPostfixOperation postfixOperation) {
    if (expressionHelper.isGetAndAssign(postfixOperation)) {
        XExpression firstArgument = postfixOperation.getActualArguments().get(0);
        checkAssignment(firstArgument, false);
    }
}
项目:xtext-extras    文件:AmbiguousFeatureLinkingCandidate.java   
@Override
protected String getSyntaxDescriptions() {
    XExpression expression = getExpression();
    if (expression instanceof XBinaryOperation) {
        return "binary operation";
    } else if (expression instanceof XUnaryOperation) {
        return "unary operation";
    } else if (expression instanceof XPostfixOperation) {
        return "postfix operation";
    } else {
        return "feature call";
    }
}
项目:xtext-extras    文件:XbaseSyntacticSequencer.java   
protected boolean startsWithUnaryOperator(EObject obj) {
    if(obj instanceof XUnaryOperation)
        return true;
    if(obj instanceof XBinaryOperation)
        return startsWithUnaryOperator(((XBinaryOperation)obj).getLeftOperand());
    if(obj instanceof XPostfixOperation) {
        return startsWithUnaryOperator(((XPostfixOperation)obj).getOperand());
    }
    return false;
}
项目:xtext-extras    文件:XbaseFormatter.java   
protected void _format(final XPostfixOperation expr, @Extension final IFormattableDocument doc) {
  final Procedure1<IHiddenRegionFormatter> _function = (IHiddenRegionFormatter it) -> {
    it.noSpace();
  };
  doc.prepend(this.textRegionExtensions.regionFor(expr).feature(XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE), _function);
  doc.<XExpression>format(expr.getOperand());
}
项目:xtext-extras    文件:AbstractXbaseSemanticSequencer.java   
@Deprecated
protected void sequence_XPostfixOperation(EObject context, XPostfixOperation semanticObject) {
    sequence_XPostfixOperation(createContext(context, semanticObject), semanticObject);
}
项目:xtext-extras    文件:XExpressionHelper.java   
public boolean isGetAndAssign(XAbstractFeatureCall featureCall) {
    if (!(featureCall instanceof XPostfixOperation)) {
        return false;
    }
    if (isOperatorFromExtension(featureCall, OperatorMapping.MINUS_MINUS, DoubleExtensions.class)) {
        return true;
    }
    if (isOperatorFromExtension(featureCall, OperatorMapping.PLUS_PLUS, DoubleExtensions.class)) {
        return true;
    }
    if (isOperatorFromExtension(featureCall, OperatorMapping.MINUS_MINUS, FloatExtensions.class)) {
        return true;
    }
    if (isOperatorFromExtension(featureCall, OperatorMapping.PLUS_PLUS, FloatExtensions.class)) {
        return true;
    }
    if (isOperatorFromExtension(featureCall, OperatorMapping.MINUS_MINUS, LongExtensions.class)) {
        return true;
    }
    if (isOperatorFromExtension(featureCall, OperatorMapping.PLUS_PLUS, LongExtensions.class)) {
        return true;
    }
    if (isOperatorFromExtension(featureCall, OperatorMapping.MINUS_MINUS, IntegerExtensions.class)) {
        return true;
    }
    if (isOperatorFromExtension(featureCall, OperatorMapping.PLUS_PLUS, IntegerExtensions.class)) {
        return true;
    }
    if (isOperatorFromExtension(featureCall, OperatorMapping.MINUS_MINUS, ShortExtensions.class)) {
        return true;
    }
    if (isOperatorFromExtension(featureCall, OperatorMapping.PLUS_PLUS, ShortExtensions.class)) {
        return true;
    }
    if (isOperatorFromExtension(featureCall, OperatorMapping.MINUS_MINUS, CharacterExtensions.class)) {
        return true;
    }
    if (isOperatorFromExtension(featureCall, OperatorMapping.PLUS_PLUS, CharacterExtensions.class)) {
        return true;
    }
    if (isOperatorFromExtension(featureCall, OperatorMapping.MINUS_MINUS, ByteExtensions.class)) {
        return true;
    }
    if (isOperatorFromExtension(featureCall, OperatorMapping.PLUS_PLUS, ByteExtensions.class)) {
        return true;
    }
    return false;
}
项目:xtext-extras    文件:AbstractXbaseSemanticSequencer.java   
/**
 * Contexts:
 *     XExpression returns XPostfixOperation
 *     XAssignment returns XPostfixOperation
 *     XAssignment.XBinaryOperation_1_1_0_0_0 returns XPostfixOperation
 *     XOrExpression returns XPostfixOperation
 *     XOrExpression.XBinaryOperation_1_0_0_0 returns XPostfixOperation
 *     XAndExpression returns XPostfixOperation
 *     XAndExpression.XBinaryOperation_1_0_0_0 returns XPostfixOperation
 *     XEqualityExpression returns XPostfixOperation
 *     XEqualityExpression.XBinaryOperation_1_0_0_0 returns XPostfixOperation
 *     XRelationalExpression returns XPostfixOperation
 *     XRelationalExpression.XInstanceOfExpression_1_0_0_0_0 returns XPostfixOperation
 *     XRelationalExpression.XBinaryOperation_1_1_0_0_0 returns XPostfixOperation
 *     XOtherOperatorExpression returns XPostfixOperation
 *     XOtherOperatorExpression.XBinaryOperation_1_0_0_0 returns XPostfixOperation
 *     XAdditiveExpression returns XPostfixOperation
 *     XAdditiveExpression.XBinaryOperation_1_0_0_0 returns XPostfixOperation
 *     XMultiplicativeExpression returns XPostfixOperation
 *     XMultiplicativeExpression.XBinaryOperation_1_0_0_0 returns XPostfixOperation
 *     XUnaryOperation returns XPostfixOperation
 *     XCastedExpression returns XPostfixOperation
 *     XCastedExpression.XCastedExpression_1_0_0_0 returns XPostfixOperation
 *     XPostfixOperation returns XPostfixOperation
 *     XPostfixOperation.XPostfixOperation_1_0_0 returns XPostfixOperation
 *     XMemberFeatureCall returns XPostfixOperation
 *     XMemberFeatureCall.XAssignment_1_0_0_0_0 returns XPostfixOperation
 *     XMemberFeatureCall.XMemberFeatureCall_1_1_0_0_0 returns XPostfixOperation
 *     XPrimaryExpression returns XPostfixOperation
 *     XParenthesizedExpression returns XPostfixOperation
 *     XExpressionOrVarDeclaration returns XPostfixOperation
 *
 * Constraint:
 *     (operand=XPostfixOperation_XPostfixOperation_1_0_0 feature=[JvmIdentifiableElement|OpPostfix])
 */
protected void sequence_XPostfixOperation(ISerializationContext context, XPostfixOperation semanticObject) {
    if (errorAcceptor != null) {
        if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XPOSTFIX_OPERATION__OPERAND) == ValueTransient.YES)
            errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, XbasePackage.Literals.XPOSTFIX_OPERATION__OPERAND));
        if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE) == ValueTransient.YES)
            errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE));
    }
    SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
    feeder.accept(grammarAccess.getXPostfixOperationAccess().getXPostfixOperationOperandAction_1_0_0(), semanticObject.getOperand());
    feeder.accept(grammarAccess.getXPostfixOperationAccess().getFeatureJvmIdentifiableElementOpPostfixParserRuleCall_1_0_1_0_1(), semanticObject.eGet(XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE, false));
    feeder.finish();
}
项目:dsl-devkit    文件:AbstractCheckSemanticSequencer.java   
/**
 * Constraint:
 *     (operand=XPostfixOperation_XPostfixOperation_1_0_0 feature=[JvmIdentifiableElement|OpPostfix])
 */
protected void sequence_XPostfixOperation(EObject context, XPostfixOperation semanticObject) {
    genericSequencer.createSequence(context, semanticObject);
}
项目:dsl-devkit    文件:AbstractCheckCfgSemanticSequencer.java   
/**
 * Constraint:
 *     (operand=XPostfixOperation_XPostfixOperation_1_0_0 feature=[JvmIdentifiableElement|OpPostfix])
 */
protected void sequence_XPostfixOperation(EObject context, XPostfixOperation semanticObject) {
    genericSequencer.createSequence(context, semanticObject);
}