本文整理汇总了Java中org.eclipse.xtext.xbase.XPostfixOperation类的典型用法代码示例。如果您正苦于以下问题:Java XPostfixOperation类的具体用法?Java XPostfixOperation怎么用?Java XPostfixOperation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XPostfixOperation类属于org.eclipse.xtext.xbase包,在下文中一共展示了XPostfixOperation类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSyntacticReceiver
import org.eclipse.xtext.xbase.XPostfixOperation; //导入依赖的package包/类
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;
}
示例2: getSyntacticArguments
import org.eclipse.xtext.xbase.XPostfixOperation; //导入依赖的package包/类
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();
}
示例3: checkAssignment
import org.eclipse.xtext.xbase.XPostfixOperation; //导入依赖的package包/类
@Check
public void checkAssignment(XPostfixOperation postfixOperation) {
if (expressionHelper.isGetAndAssign(postfixOperation)) {
XExpression firstArgument = postfixOperation.getActualArguments().get(0);
checkAssignment(firstArgument, false);
}
}
示例4: getSyntaxDescriptions
import org.eclipse.xtext.xbase.XPostfixOperation; //导入依赖的package包/类
@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";
}
}
示例5: startsWithUnaryOperator
import org.eclipse.xtext.xbase.XPostfixOperation; //导入依赖的package包/类
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;
}
示例6: _format
import org.eclipse.xtext.xbase.XPostfixOperation; //导入依赖的package包/类
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());
}
示例7: sequence_XPostfixOperation
import org.eclipse.xtext.xbase.XPostfixOperation; //导入依赖的package包/类
@Deprecated
protected void sequence_XPostfixOperation(EObject context, XPostfixOperation semanticObject) {
sequence_XPostfixOperation(createContext(context, semanticObject), semanticObject);
}
示例8: isGetAndAssign
import org.eclipse.xtext.xbase.XPostfixOperation; //导入依赖的package包/类
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;
}
示例9: sequence_XPostfixOperation
import org.eclipse.xtext.xbase.XPostfixOperation; //导入依赖的package包/类
/**
* Constraint:
* (operand=XPostfixOperation_XPostfixOperation_1_0_0 feature=[JvmIdentifiableElement|OpPostfix])
*/
protected void sequence_XPostfixOperation(EObject context, XPostfixOperation semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}