项目: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
项目: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,FloatExtensions.class)) {
return true;
}
if (isOperatorFromExtension(featureCall,LongExtensions.class)) {
return true;
}
if (isOperatorFromExtension(featureCall,IntegerExtensions.class)) {
return true;
}
if (isOperatorFromExtension(featureCall,ShortExtensions.class)) {
return true;
}
if (isOperatorFromExtension(featureCall,CharacterExtensions.class)) {
return true;
}
if (isOperatorFromExtension(featureCall,ByteExtensions.class)) {
return true;
}
if (isOperatorFromExtension(featureCall,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);
}
/**
* Constraint:
* (operand=XPostfixOperation_XPostfixOperation_1_0_0 feature=[JvmIdentifiableElement|OpPostfix])
*/
protected void sequence_XPostfixOperation(EObject context,semanticObject);
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。