Search in sources :

Example 21 with XImportDeclaration

use of org.eclipse.xtext.xtype.XImportDeclaration in project xtext-xtend by eclipse.

the class ParserTest method testImport_03.

@Test
public void testImport_03() throws Exception {
    XImportDeclaration importDeclaration = importDeclaration("import static java.util.Collections. * // foobar");
    assertNotNull(importDeclaration);
    assertEquals("java.util.Collections", importDeclaration.getImportedTypeName());
    assertTrue(importDeclaration.isWildcard());
    assertTrue(importDeclaration.isStatic());
    assertFalse(importDeclaration.isExtension());
}
Also used : XImportDeclaration(org.eclipse.xtext.xtype.XImportDeclaration) Test(org.junit.Test)

Example 22 with XImportDeclaration

use of org.eclipse.xtext.xtype.XImportDeclaration in project xtext-xtend by eclipse.

the class ParserTest method testImport_04.

@Test
public void testImport_04() throws Exception {
    XImportDeclaration importDeclaration = importDeclaration("import static extension java.lang.reflect.\nArrays.*");
    assertNotNull(importDeclaration);
    assertEquals("java.lang.reflect.Arrays", importDeclaration.getImportedTypeName());
    assertTrue(importDeclaration.isWildcard());
    assertTrue(importDeclaration.isStatic());
    assertTrue(importDeclaration.isExtension());
}
Also used : XImportDeclaration(org.eclipse.xtext.xtype.XImportDeclaration) Test(org.junit.Test)

Example 23 with XImportDeclaration

use of org.eclipse.xtext.xtype.XImportDeclaration in project xtext-xtend by eclipse.

the class ParserTest method testBug367949.

@Test
public void testBug367949() throws Exception {
    XImportDeclaration importDeclaration = importDeclaration("import org.eclipse.xtext.^create");
    assertNotNull(importDeclaration);
    assertEquals("org.eclipse.xtext.create", importDeclaration.getImportedTypeName());
}
Also used : XImportDeclaration(org.eclipse.xtext.xtype.XImportDeclaration) Test(org.junit.Test)

Example 24 with XImportDeclaration

use of org.eclipse.xtext.xtype.XImportDeclaration in project xtext-eclipse by eclipse.

the class XbaseHyperLinkHelper method createHyperlinksByOffset.

@Override
public void createHyperlinksByOffset(final XtextResource resource, final int offset, final IHyperlinkAcceptor acceptor) {
    final EObject element = getEObjectAtOffsetHelper().resolveElementAt(resource, offset);
    if (element instanceof XImportDeclaration) {
        XImportDeclaration importDeclaration = (XImportDeclaration) element;
        if (importDeclaration.isStatic() && !importDeclaration.isWildcard()) {
            final ITextRegion textRegion = getTextRegion(importDeclaration, offset);
            if (textRegion != null) {
                final Region region = new Region(textRegion.getOffset(), textRegion.getLength());
                Iterable<JvmFeature> _allFeatures = staticImpMemberProvider.getAllFeatures(importDeclaration);
                for (final JvmFeature feature : _allFeatures) {
                    this.createHyperlinksTo(resource, region, feature, acceptor);
                }
            }
        }
    }
    super.createHyperlinksByOffset(resource, offset, acceptor);
    if (canShowMany(acceptor)) {
        if (element instanceof XVariableDeclaration) {
            XVariableDeclaration variableDeclaration = (XVariableDeclaration) element;
            ILeafNode node = NodeModelUtils.findLeafNodeAtOffset(resource.getParseResult().getRootNode(), offset);
            if (isNameNode(element, XbasePackage.Literals.XVARIABLE_DECLARATION__NAME, node) && variableDeclaration.getType() == null) {
                addOpenInferredTypeHyperlink(resource, variableDeclaration, node, acceptor);
            }
        }
        if (element instanceof JvmFormalParameter) {
            JvmFormalParameter param = (JvmFormalParameter) element;
            ILeafNode node = NodeModelUtils.findLeafNodeAtOffset(resource.getParseResult().getRootNode(), offset);
            if (isNameNode(element, TypesPackage.Literals.JVM_FORMAL_PARAMETER__NAME, node) && param.getParameterType() == null) {
                addOpenInferredTypeHyperlink(resource, param, node, acceptor);
            }
        }
    }
    createHyperlinksInJavaDoc(resource, offset, acceptor);
}
Also used : XVariableDeclaration(org.eclipse.xtext.xbase.XVariableDeclaration) ILeafNode(org.eclipse.xtext.nodemodel.ILeafNode) JvmFeature(org.eclipse.xtext.common.types.JvmFeature) JvmFormalParameter(org.eclipse.xtext.common.types.JvmFormalParameter) ITextRegion(org.eclipse.xtext.util.ITextRegion) EObject(org.eclipse.emf.ecore.EObject) Region(org.eclipse.jface.text.Region) TextRegion(org.eclipse.xtext.util.TextRegion) ITextRegion(org.eclipse.xtext.util.ITextRegion) XImportDeclaration(org.eclipse.xtext.xtype.XImportDeclaration)

Example 25 with XImportDeclaration

use of org.eclipse.xtext.xtype.XImportDeclaration in project dsl-devkit by dsldevkit.

the class AbstractFormatSemanticSequencer method sequence.

@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
    EPackage epackage = semanticObject.eClass().getEPackage();
    ParserRule rule = context.getParserRule();
    Action action = context.getAssignedAction();
    Set<Parameter> parameters = context.getEnabledBooleanParameters();
    if (epackage == FormatPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case FormatPackage.COLUMN_LOCATOR:
                sequence_ColumnLocator(context, (ColumnLocator) semanticObject);
                return;
            case FormatPackage.CONSTANT:
                sequence_Constant(context, (Constant) semanticObject);
                return;
            case FormatPackage.CONTEXT_FREE_DIRECTIVE:
                sequence_ContextFreeDirective(context, (ContextFreeDirective) semanticObject);
                return;
            case FormatPackage.FORMAT_CONFIGURATION:
                sequence_FormatConfiguration(context, (FormatConfiguration) semanticObject);
                return;
            case FormatPackage.GRAMMAR_ELEMENT_LOOKUP:
                sequence_GrammarElementLookup(context, (GrammarElementLookup) semanticObject);
                return;
            case FormatPackage.GRAMMAR_ELEMENT_REFERENCE:
                sequence_GrammarElementReference(context, (GrammarElementReference) semanticObject);
                return;
            case FormatPackage.GRAMMAR_RULE:
                sequence_GrammarRule(context, (GrammarRule) semanticObject);
                return;
            case FormatPackage.GROUP_BLOCK:
                sequence_GroupBlock(context, (GroupBlock) semanticObject);
                return;
            case FormatPackage.INDENT_LOCATOR:
                sequence_IndentLocator(context, (IndentLocator) semanticObject);
                return;
            case FormatPackage.INT_VALUE:
                sequence_IntValue(context, (IntValue) semanticObject);
                return;
            case FormatPackage.KEYWORD_PAIR:
                sequence_KeywordPair(context, (KeywordPair) semanticObject);
                return;
            case FormatPackage.LINEWRAP_LOCATOR:
                sequence_LinewrapLocator(context, (LinewrapLocator) semanticObject);
                return;
            case FormatPackage.MATCHER:
                sequence_Matcher(context, (Matcher) semanticObject);
                return;
            case FormatPackage.MATCHER_LIST:
                sequence_MatcherList(context, (MatcherList) semanticObject);
                return;
            case FormatPackage.NO_FORMAT_LOCATOR:
                sequence_NoFormatLocator(context, (NoFormatLocator) semanticObject);
                return;
            case FormatPackage.OFFSET_LOCATOR:
                sequence_OffsetLocator(context, (OffsetLocator) semanticObject);
                return;
            case FormatPackage.RIGHT_PADDING_LOCATOR:
                sequence_RightPaddingLocator(context, (RightPaddingLocator) semanticObject);
                return;
            case FormatPackage.SPACE_LOCATOR:
                sequence_SpaceLocator(context, (SpaceLocator) semanticObject);
                return;
            case FormatPackage.SPECIFIC_DIRECTIVE:
                sequence_SpecificDirective(context, (SpecificDirective) semanticObject);
                return;
            case FormatPackage.STRING_VALUE:
                sequence_StringValue(context, (StringValue) semanticObject);
                return;
            case FormatPackage.WILDCARD_RULE:
                sequence_WildcardRule(context, (WildcardRule) semanticObject);
                return;
        }
    else if (epackage == TypesPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case TypesPackage.JVM_FORMAL_PARAMETER:
                if (rule == grammarAccess.getFullJvmFormalParameterRule()) {
                    sequence_FullJvmFormalParameter(context, (JvmFormalParameter) semanticObject);
                    return;
                } else if (rule == grammarAccess.getJvmFormalParameterRule()) {
                    sequence_JvmFormalParameter(context, (JvmFormalParameter) semanticObject);
                    return;
                } else
                    break;
            case TypesPackage.JVM_GENERIC_ARRAY_TYPE_REFERENCE:
                sequence_JvmTypeReference(context, (JvmGenericArrayTypeReference) semanticObject);
                return;
            case TypesPackage.JVM_INNER_TYPE_REFERENCE:
                sequence_JvmParameterizedTypeReference(context, (JvmInnerTypeReference) semanticObject);
                return;
            case TypesPackage.JVM_LOWER_BOUND:
                if (rule == grammarAccess.getJvmLowerBoundAndedRule()) {
                    sequence_JvmLowerBoundAnded(context, (JvmLowerBound) semanticObject);
                    return;
                } else if (rule == grammarAccess.getJvmLowerBoundRule()) {
                    sequence_JvmLowerBound(context, (JvmLowerBound) semanticObject);
                    return;
                } else
                    break;
            case TypesPackage.JVM_PARAMETERIZED_TYPE_REFERENCE:
                if (action == grammarAccess.getJvmParameterizedTypeReferenceAccess().getJvmInnerTypeReferenceOuterAction_1_4_0_0_0()) {
                    sequence_JvmParameterizedTypeReference_JvmInnerTypeReference_1_4_0_0_0(context, (JvmParameterizedTypeReference) semanticObject);
                    return;
                } else if (rule == grammarAccess.getJvmTypeReferenceRule() || action == grammarAccess.getJvmTypeReferenceAccess().getJvmGenericArrayTypeReferenceComponentTypeAction_0_1_0_0() || rule == grammarAccess.getJvmParameterizedTypeReferenceRule() || rule == grammarAccess.getJvmArgumentTypeReferenceRule()) {
                    sequence_JvmParameterizedTypeReference(context, (JvmParameterizedTypeReference) semanticObject);
                    return;
                } else
                    break;
            case TypesPackage.JVM_TYPE_PARAMETER:
                sequence_JvmTypeParameter(context, (JvmTypeParameter) semanticObject);
                return;
            case TypesPackage.JVM_UPPER_BOUND:
                if (rule == grammarAccess.getJvmUpperBoundAndedRule()) {
                    sequence_JvmUpperBoundAnded(context, (JvmUpperBound) semanticObject);
                    return;
                } else if (rule == grammarAccess.getJvmUpperBoundRule()) {
                    sequence_JvmUpperBound(context, (JvmUpperBound) semanticObject);
                    return;
                } else
                    break;
            case TypesPackage.JVM_WILDCARD_TYPE_REFERENCE:
                sequence_JvmWildcardTypeReference(context, (JvmWildcardTypeReference) semanticObject);
                return;
        }
    else if (epackage == XAnnotationsPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case XAnnotationsPackage.XANNOTATION:
                sequence_XAnnotation(context, (XAnnotation) semanticObject);
                return;
            case XAnnotationsPackage.XANNOTATION_ELEMENT_VALUE_PAIR:
                sequence_XAnnotationElementValuePair(context, (XAnnotationElementValuePair) semanticObject);
                return;
        }
    else if (epackage == XbasePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case XbasePackage.XASSIGNMENT:
                sequence_XAssignment_XMemberFeatureCall(context, (XAssignment) semanticObject);
                return;
            case XbasePackage.XBASIC_FOR_LOOP_EXPRESSION:
                sequence_XBasicForLoopExpression(context, (XBasicForLoopExpression) semanticObject);
                return;
            case XbasePackage.XBINARY_OPERATION:
                sequence_XAdditiveExpression_XAndExpression_XAssignment_XEqualityExpression_XMultiplicativeExpression_XOrExpression_XOtherOperatorExpression_XRelationalExpression(context, (XBinaryOperation) semanticObject);
                return;
            case XbasePackage.XBLOCK_EXPRESSION:
                if (rule == grammarAccess.getXAnnotationElementValueOrCommaListRule() || action == grammarAccess.getXAnnotationElementValueOrCommaListAccess().getXListLiteralElementsAction_1_1_0() || rule == grammarAccess.getXAnnotationElementValueRule() || rule == grammarAccess.getXAnnotationOrExpressionRule() || rule == grammarAccess.getXExpressionRule() || rule == grammarAccess.getXAssignmentRule() || action == grammarAccess.getXAssignmentAccess().getXBinaryOperationLeftOperandAction_1_1_0_0_0() || rule == grammarAccess.getXOrExpressionRule() || action == grammarAccess.getXOrExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXAndExpressionRule() || action == grammarAccess.getXAndExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXEqualityExpressionRule() || action == grammarAccess.getXEqualityExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXRelationalExpressionRule() || action == grammarAccess.getXRelationalExpressionAccess().getXInstanceOfExpressionExpressionAction_1_0_0_0_0() || action == grammarAccess.getXRelationalExpressionAccess().getXBinaryOperationLeftOperandAction_1_1_0_0_0() || rule == grammarAccess.getXOtherOperatorExpressionRule() || action == grammarAccess.getXOtherOperatorExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXAdditiveExpressionRule() || action == grammarAccess.getXAdditiveExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXMultiplicativeExpressionRule() || action == grammarAccess.getXMultiplicativeExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXUnaryOperationRule() || rule == grammarAccess.getXCastedExpressionRule() || action == grammarAccess.getXCastedExpressionAccess().getXCastedExpressionTargetAction_1_0_0_0() || rule == grammarAccess.getXPostfixOperationRule() || action == grammarAccess.getXPostfixOperationAccess().getXPostfixOperationOperandAction_1_0_0() || rule == grammarAccess.getXMemberFeatureCallRule() || action == grammarAccess.getXMemberFeatureCallAccess().getXAssignmentAssignableAction_1_0_0_0_0() || action == grammarAccess.getXMemberFeatureCallAccess().getXMemberFeatureCallMemberCallTargetAction_1_1_0_0_0() || rule == grammarAccess.getXPrimaryExpressionRule() || rule == grammarAccess.getXParenthesizedExpressionRule() || rule == grammarAccess.getXBlockExpressionRule() || rule == grammarAccess.getXExpressionOrVarDeclarationRule()) {
                    sequence_XBlockExpression(context, (XBlockExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getXExpressionInClosureRule()) {
                    sequence_XExpressionInClosure(context, (XBlockExpression) semanticObject);
                    return;
                } else
                    break;
            case XbasePackage.XBOOLEAN_LITERAL:
                sequence_XBooleanLiteral(context, (XBooleanLiteral) semanticObject);
                return;
            case XbasePackage.XCASE_PART:
                sequence_XCasePart(context, (XCasePart) semanticObject);
                return;
            case XbasePackage.XCASTED_EXPRESSION:
                sequence_XCastedExpression(context, (XCastedExpression) semanticObject);
                return;
            case XbasePackage.XCATCH_CLAUSE:
                sequence_XCatchClause(context, (XCatchClause) semanticObject);
                return;
            case XbasePackage.XCLOSURE:
                if (rule == grammarAccess.getXAnnotationElementValueOrCommaListRule() || action == grammarAccess.getXAnnotationElementValueOrCommaListAccess().getXListLiteralElementsAction_1_1_0() || rule == grammarAccess.getXAnnotationElementValueRule() || rule == grammarAccess.getXAnnotationOrExpressionRule() || rule == grammarAccess.getXExpressionRule() || rule == grammarAccess.getXAssignmentRule() || action == grammarAccess.getXAssignmentAccess().getXBinaryOperationLeftOperandAction_1_1_0_0_0() || rule == grammarAccess.getXOrExpressionRule() || action == grammarAccess.getXOrExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXAndExpressionRule() || action == grammarAccess.getXAndExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXEqualityExpressionRule() || action == grammarAccess.getXEqualityExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXRelationalExpressionRule() || action == grammarAccess.getXRelationalExpressionAccess().getXInstanceOfExpressionExpressionAction_1_0_0_0_0() || action == grammarAccess.getXRelationalExpressionAccess().getXBinaryOperationLeftOperandAction_1_1_0_0_0() || rule == grammarAccess.getXOtherOperatorExpressionRule() || action == grammarAccess.getXOtherOperatorExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXAdditiveExpressionRule() || action == grammarAccess.getXAdditiveExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXMultiplicativeExpressionRule() || action == grammarAccess.getXMultiplicativeExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXUnaryOperationRule() || rule == grammarAccess.getXCastedExpressionRule() || action == grammarAccess.getXCastedExpressionAccess().getXCastedExpressionTargetAction_1_0_0_0() || rule == grammarAccess.getXPostfixOperationRule() || action == grammarAccess.getXPostfixOperationAccess().getXPostfixOperationOperandAction_1_0_0() || rule == grammarAccess.getXMemberFeatureCallRule() || action == grammarAccess.getXMemberFeatureCallAccess().getXAssignmentAssignableAction_1_0_0_0_0() || action == grammarAccess.getXMemberFeatureCallAccess().getXMemberFeatureCallMemberCallTargetAction_1_1_0_0_0() || rule == grammarAccess.getXPrimaryExpressionRule() || rule == grammarAccess.getXLiteralRule() || rule == grammarAccess.getXClosureRule() || rule == grammarAccess.getXParenthesizedExpressionRule() || rule == grammarAccess.getXExpressionOrVarDeclarationRule()) {
                    sequence_XClosure(context, (XClosure) semanticObject);
                    return;
                } else if (rule == grammarAccess.getXShortClosureRule()) {
                    sequence_XShortClosure(context, (XClosure) semanticObject);
                    return;
                } else
                    break;
            case XbasePackage.XCONSTRUCTOR_CALL:
                sequence_XConstructorCall(context, (XConstructorCall) semanticObject);
                return;
            case XbasePackage.XDO_WHILE_EXPRESSION:
                sequence_XDoWhileExpression(context, (XDoWhileExpression) semanticObject);
                return;
            case XbasePackage.XFEATURE_CALL:
                sequence_XFeatureCall(context, (XFeatureCall) semanticObject);
                return;
            case XbasePackage.XFOR_LOOP_EXPRESSION:
                sequence_XForLoopExpression(context, (XForLoopExpression) semanticObject);
                return;
            case XbasePackage.XIF_EXPRESSION:
                sequence_XIfExpression(context, (XIfExpression) semanticObject);
                return;
            case XbasePackage.XINSTANCE_OF_EXPRESSION:
                sequence_XRelationalExpression(context, (XInstanceOfExpression) semanticObject);
                return;
            case XbasePackage.XLIST_LITERAL:
                if (rule == grammarAccess.getXAnnotationElementValueOrCommaListRule()) {
                    sequence_XAnnotationElementValueOrCommaList_XListLiteral(context, (XListLiteral) semanticObject);
                    return;
                } else if (rule == grammarAccess.getXAnnotationElementValueRule()) {
                    sequence_XAnnotationElementValue_XListLiteral(context, (XListLiteral) semanticObject);
                    return;
                } else if (action == grammarAccess.getXAnnotationElementValueOrCommaListAccess().getXListLiteralElementsAction_1_1_0() || rule == grammarAccess.getXAnnotationOrExpressionRule() || rule == grammarAccess.getXExpressionRule() || rule == grammarAccess.getXAssignmentRule() || action == grammarAccess.getXAssignmentAccess().getXBinaryOperationLeftOperandAction_1_1_0_0_0() || rule == grammarAccess.getXOrExpressionRule() || action == grammarAccess.getXOrExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXAndExpressionRule() || action == grammarAccess.getXAndExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXEqualityExpressionRule() || action == grammarAccess.getXEqualityExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXRelationalExpressionRule() || action == grammarAccess.getXRelationalExpressionAccess().getXInstanceOfExpressionExpressionAction_1_0_0_0_0() || action == grammarAccess.getXRelationalExpressionAccess().getXBinaryOperationLeftOperandAction_1_1_0_0_0() || rule == grammarAccess.getXOtherOperatorExpressionRule() || action == grammarAccess.getXOtherOperatorExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXAdditiveExpressionRule() || action == grammarAccess.getXAdditiveExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXMultiplicativeExpressionRule() || action == grammarAccess.getXMultiplicativeExpressionAccess().getXBinaryOperationLeftOperandAction_1_0_0_0() || rule == grammarAccess.getXUnaryOperationRule() || rule == grammarAccess.getXCastedExpressionRule() || action == grammarAccess.getXCastedExpressionAccess().getXCastedExpressionTargetAction_1_0_0_0() || rule == grammarAccess.getXPostfixOperationRule() || action == grammarAccess.getXPostfixOperationAccess().getXPostfixOperationOperandAction_1_0_0() || rule == grammarAccess.getXMemberFeatureCallRule() || action == grammarAccess.getXMemberFeatureCallAccess().getXAssignmentAssignableAction_1_0_0_0_0() || action == grammarAccess.getXMemberFeatureCallAccess().getXMemberFeatureCallMemberCallTargetAction_1_1_0_0_0() || rule == grammarAccess.getXPrimaryExpressionRule() || rule == grammarAccess.getXLiteralRule() || rule == grammarAccess.getXCollectionLiteralRule() || rule == grammarAccess.getXListLiteralRule() || rule == grammarAccess.getXParenthesizedExpressionRule() || rule == grammarAccess.getXExpressionOrVarDeclarationRule()) {
                    sequence_XListLiteral(context, (XListLiteral) semanticObject);
                    return;
                } else
                    break;
            case XbasePackage.XMEMBER_FEATURE_CALL:
                sequence_XMemberFeatureCall(context, (XMemberFeatureCall) semanticObject);
                return;
            case XbasePackage.XNULL_LITERAL:
                sequence_XNullLiteral(context, (XNullLiteral) semanticObject);
                return;
            case XbasePackage.XNUMBER_LITERAL:
                sequence_XNumberLiteral(context, (XNumberLiteral) semanticObject);
                return;
            case XbasePackage.XPOSTFIX_OPERATION:
                sequence_XPostfixOperation(context, (XPostfixOperation) semanticObject);
                return;
            case XbasePackage.XRETURN_EXPRESSION:
                sequence_XReturnExpression(context, (XReturnExpression) semanticObject);
                return;
            case XbasePackage.XSET_LITERAL:
                sequence_XSetLiteral(context, (XSetLiteral) semanticObject);
                return;
            case XbasePackage.XSTRING_LITERAL:
                sequence_XStringLiteral(context, (XStringLiteral) semanticObject);
                return;
            case XbasePackage.XSWITCH_EXPRESSION:
                sequence_XSwitchExpression(context, (XSwitchExpression) semanticObject);
                return;
            case XbasePackage.XSYNCHRONIZED_EXPRESSION:
                sequence_XSynchronizedExpression(context, (XSynchronizedExpression) semanticObject);
                return;
            case XbasePackage.XTHROW_EXPRESSION:
                sequence_XThrowExpression(context, (XThrowExpression) semanticObject);
                return;
            case XbasePackage.XTRY_CATCH_FINALLY_EXPRESSION:
                sequence_XTryCatchFinallyExpression(context, (XTryCatchFinallyExpression) semanticObject);
                return;
            case XbasePackage.XTYPE_LITERAL:
                sequence_XTypeLiteral(context, (XTypeLiteral) semanticObject);
                return;
            case XbasePackage.XUNARY_OPERATION:
                sequence_XUnaryOperation(context, (XUnaryOperation) semanticObject);
                return;
            case XbasePackage.XVARIABLE_DECLARATION:
                sequence_XVariableDeclaration(context, (XVariableDeclaration) semanticObject);
                return;
            case XbasePackage.XWHILE_EXPRESSION:
                sequence_XWhileExpression(context, (XWhileExpression) semanticObject);
                return;
        }
    else if (epackage == XtypePackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case XtypePackage.XFUNCTION_TYPE_REF:
                sequence_XFunctionTypeRef(context, (XFunctionTypeRef) semanticObject);
                return;
            case XtypePackage.XIMPORT_DECLARATION:
                sequence_XImportDeclaration(context, (XImportDeclaration) semanticObject);
                return;
            case XtypePackage.XIMPORT_SECTION:
                sequence_XImportSection(context, (XImportSection) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) XAnnotationElementValuePair(org.eclipse.xtext.xbase.annotations.xAnnotations.XAnnotationElementValuePair) Action(org.eclipse.xtext.Action) KeywordPair(com.avaloq.tools.ddk.xtext.format.format.KeywordPair) RightPaddingLocator(com.avaloq.tools.ddk.xtext.format.format.RightPaddingLocator) XFunctionTypeRef(org.eclipse.xtext.xtype.XFunctionTypeRef) Matcher(com.avaloq.tools.ddk.xtext.format.format.Matcher) XClosure(org.eclipse.xtext.xbase.XClosure) XImportSection(org.eclipse.xtext.xtype.XImportSection) Constant(com.avaloq.tools.ddk.xtext.format.format.Constant) GroupBlock(com.avaloq.tools.ddk.xtext.format.format.GroupBlock) GrammarRule(com.avaloq.tools.ddk.xtext.format.format.GrammarRule) ContextFreeDirective(com.avaloq.tools.ddk.xtext.format.format.ContextFreeDirective) XListLiteral(org.eclipse.xtext.xbase.XListLiteral) EPackage(org.eclipse.emf.ecore.EPackage) LinewrapLocator(com.avaloq.tools.ddk.xtext.format.format.LinewrapLocator) MatcherList(com.avaloq.tools.ddk.xtext.format.format.MatcherList) FormatConfiguration(com.avaloq.tools.ddk.xtext.format.format.FormatConfiguration) SpecificDirective(com.avaloq.tools.ddk.xtext.format.format.SpecificDirective) XAnnotation(org.eclipse.xtext.xbase.annotations.xAnnotations.XAnnotation) StringValue(com.avaloq.tools.ddk.xtext.format.format.StringValue) IntValue(com.avaloq.tools.ddk.xtext.format.format.IntValue) XBlockExpression(org.eclipse.xtext.xbase.XBlockExpression) OffsetLocator(com.avaloq.tools.ddk.xtext.format.format.OffsetLocator) JvmLowerBound(org.eclipse.xtext.common.types.JvmLowerBound) ColumnLocator(com.avaloq.tools.ddk.xtext.format.format.ColumnLocator) GrammarElementReference(com.avaloq.tools.ddk.xtext.format.format.GrammarElementReference) NoFormatLocator(com.avaloq.tools.ddk.xtext.format.format.NoFormatLocator) XImportDeclaration(org.eclipse.xtext.xtype.XImportDeclaration) JvmUpperBound(org.eclipse.xtext.common.types.JvmUpperBound) WildcardRule(com.avaloq.tools.ddk.xtext.format.format.WildcardRule) JvmFormalParameter(org.eclipse.xtext.common.types.JvmFormalParameter) JvmFormalParameter(org.eclipse.xtext.common.types.JvmFormalParameter) JvmTypeParameter(org.eclipse.xtext.common.types.JvmTypeParameter) Parameter(org.eclipse.xtext.Parameter) GrammarElementLookup(com.avaloq.tools.ddk.xtext.format.format.GrammarElementLookup) SpaceLocator(com.avaloq.tools.ddk.xtext.format.format.SpaceLocator) JvmParameterizedTypeReference(org.eclipse.xtext.common.types.JvmParameterizedTypeReference) IndentLocator(com.avaloq.tools.ddk.xtext.format.format.IndentLocator)

Aggregations

XImportDeclaration (org.eclipse.xtext.xtype.XImportDeclaration)34 JvmDeclaredType (org.eclipse.xtext.common.types.JvmDeclaredType)8 XImportSection (org.eclipse.xtext.xtype.XImportSection)8 JvmType (org.eclipse.xtext.common.types.JvmType)6 JvmTypeParameter (org.eclipse.xtext.common.types.JvmTypeParameter)6 Test (org.junit.Test)6 JvmParameterizedTypeReference (org.eclipse.xtext.common.types.JvmParameterizedTypeReference)5 EObject (org.eclipse.emf.ecore.EObject)4 EPackage (org.eclipse.emf.ecore.EPackage)4 Action (org.eclipse.xtext.Action)4 Parameter (org.eclipse.xtext.Parameter)4 ParserRule (org.eclipse.xtext.ParserRule)4 JvmLowerBound (org.eclipse.xtext.common.types.JvmLowerBound)4 JvmUpperBound (org.eclipse.xtext.common.types.JvmUpperBound)4 ITextRegion (org.eclipse.xtext.util.ITextRegion)4 XBlockExpression (org.eclipse.xtext.xbase.XBlockExpression)4 XClosure (org.eclipse.xtext.xbase.XClosure)4 XFunctionTypeRef (org.eclipse.xtext.xtype.XFunctionTypeRef)4 JvmFormalParameter (org.eclipse.xtext.common.types.JvmFormalParameter)3 List (java.util.List)2