Search in sources :

Example 1 with NewExpression

use of org.eclipse.n4js.n4JS.NewExpression in project n4js by eclipse.

the class InternalTypeSystem method applyRuleTypeSuperLiteral.

protected Result<TypeRef> applyRuleTypeSuperLiteral(final RuleEnvironment G, final RuleApplicationTrace _trace_, final SuperLiteral superLiteral) throws RuleFailedException {
    // output parameter
    TypeRef T = null;
    final N4MemberDeclaration containingMemberDecl = EcoreUtil2.<N4MemberDeclaration>getContainerOfType(superLiteral.eContainer(), N4MemberDeclaration.class);
    /* if (containingMemberDecl === null) { T = TypeRefsFactory.eINSTANCE.createUnknownTypeRef } else { val containingClass = (containingMemberDecl.eContainer as N4ClassDeclaration).definedType as TClass; val superClass = G.getDeclaredOrImplicitSuperType(containingClass) var effectiveSuperClass = superClass if( containingClass.isStaticPolyfill ) { effectiveSuperClass = G.getDeclaredOrImplicitSuperType( superClass as TClass ) } { superLiteral.eContainer instanceof ParameterizedPropertyAccessExpression || superLiteral.eContainer instanceof IndexedAccessExpression if(containingMemberDecl.static) T = effectiveSuperClass?.createConstructorTypeRef else T = effectiveSuperClass?.createTypeRef if (T !== null) T = TypeUtils.enforceNominalTyping(T) } or { superLiteral.eContainer instanceof ParameterizedCallExpression if(containingMemberDecl instanceof N4MethodDeclaration && containingMemberDecl.name == 'constructor') { val ctor = containerTypesHelper.fromContext(superLiteral.eResource).findConstructor(effectiveSuperClass); T = ctor?.createTypeRef } else { T = TypeRefsFactory.eINSTANCE.createUnknownTypeRef } } or { superLiteral.eContainer instanceof NewExpression } } or { T = TypeRefsFactory.eINSTANCE.createUnknownTypeRef } */
    {
        RuleFailedException previousFailure = null;
        try {
            if ((containingMemberDecl == null)) {
                T = TypeRefsFactory.eINSTANCE.createUnknownTypeRef();
            } else {
                EObject _eContainer = containingMemberDecl.eContainer();
                Type _definedType = ((N4ClassDeclaration) _eContainer).getDefinedType();
                final TClass containingClass = ((TClass) _definedType);
                final TClassifier superClass = RuleEnvironmentExtensions.getDeclaredOrImplicitSuperType(G, containingClass);
                TClassifier effectiveSuperClass = superClass;
                boolean _isStaticPolyfill = containingClass.isStaticPolyfill();
                if (_isStaticPolyfill) {
                    effectiveSuperClass = RuleEnvironmentExtensions.getDeclaredOrImplicitSuperType(G, ((TClass) superClass));
                }
                /* { superLiteral.eContainer instanceof ParameterizedPropertyAccessExpression || superLiteral.eContainer instanceof IndexedAccessExpression if(containingMemberDecl.static) T = effectiveSuperClass?.createConstructorTypeRef else T = effectiveSuperClass?.createTypeRef if (T !== null) T = TypeUtils.enforceNominalTyping(T) } or { superLiteral.eContainer instanceof ParameterizedCallExpression if(containingMemberDecl instanceof N4MethodDeclaration && containingMemberDecl.name == 'constructor') { val ctor = containerTypesHelper.fromContext(superLiteral.eResource).findConstructor(effectiveSuperClass); T = ctor?.createTypeRef } else { T = TypeRefsFactory.eINSTANCE.createUnknownTypeRef } } or { superLiteral.eContainer instanceof NewExpression } */
                {
                    try {
                        /* superLiteral.eContainer instanceof ParameterizedPropertyAccessExpression || superLiteral.eContainer instanceof IndexedAccessExpression */
                        if (!((superLiteral.eContainer() instanceof ParameterizedPropertyAccessExpression) || (superLiteral.eContainer() instanceof IndexedAccessExpression))) {
                            sneakyThrowRuleFailedException("superLiteral.eContainer instanceof ParameterizedPropertyAccessExpression || superLiteral.eContainer instanceof IndexedAccessExpression");
                        }
                        boolean _isStatic = containingMemberDecl.isStatic();
                        if (_isStatic) {
                            TypeRef _createConstructorTypeRef = null;
                            if (effectiveSuperClass != null) {
                                _createConstructorTypeRef = TypeUtils.createConstructorTypeRef(effectiveSuperClass);
                            }
                            T = _createConstructorTypeRef;
                        } else {
                            ParameterizedTypeRef _createTypeRef = null;
                            if (effectiveSuperClass != null) {
                                _createTypeRef = TypeUtils.createTypeRef(effectiveSuperClass);
                            }
                            T = _createTypeRef;
                        }
                        if ((T != null)) {
                            T = TypeUtils.enforceNominalTyping(T);
                        }
                    } catch (Exception e) {
                        previousFailure = extractRuleFailedException(e);
                        /* { superLiteral.eContainer instanceof ParameterizedCallExpression if(containingMemberDecl instanceof N4MethodDeclaration && containingMemberDecl.name == 'constructor') { val ctor = containerTypesHelper.fromContext(superLiteral.eResource).findConstructor(effectiveSuperClass); T = ctor?.createTypeRef } else { T = TypeRefsFactory.eINSTANCE.createUnknownTypeRef } } or { superLiteral.eContainer instanceof NewExpression } */
                        {
                            try {
                                EObject _eContainer_1 = superLiteral.eContainer();
                                /* superLiteral.eContainer instanceof ParameterizedCallExpression */
                                if (!(_eContainer_1 instanceof ParameterizedCallExpression)) {
                                    sneakyThrowRuleFailedException("superLiteral.eContainer instanceof ParameterizedCallExpression");
                                }
                                if (((containingMemberDecl instanceof N4MethodDeclaration) && Objects.equal(containingMemberDecl.getName(), "constructor"))) {
                                    final TMethod ctor = this.containerTypesHelper.fromContext(superLiteral.eResource()).findConstructor(effectiveSuperClass);
                                    ParameterizedTypeRef _createTypeRef_1 = null;
                                    if (ctor != null) {
                                        _createTypeRef_1 = TypeUtils.createTypeRef(ctor);
                                    }
                                    T = _createTypeRef_1;
                                } else {
                                    T = TypeRefsFactory.eINSTANCE.createUnknownTypeRef();
                                }
                            } catch (Exception e_1) {
                                previousFailure = extractRuleFailedException(e_1);
                                EObject _eContainer_2 = superLiteral.eContainer();
                                /* superLiteral.eContainer instanceof NewExpression */
                                if (!(_eContainer_2 instanceof NewExpression)) {
                                    sneakyThrowRuleFailedException("superLiteral.eContainer instanceof NewExpression");
                                }
                            }
                        }
                    }
                }
            }
        } catch (Exception e_2) {
            previousFailure = extractRuleFailedException(e_2);
            T = TypeRefsFactory.eINSTANCE.createUnknownTypeRef();
        }
    }
    return new Result<TypeRef>(T);
}
Also used : TClassifier(org.eclipse.n4js.ts.types.TClassifier) ParameterizedPropertyAccessExpression(org.eclipse.n4js.n4JS.ParameterizedPropertyAccessExpression) IndexedAccessExpression(org.eclipse.n4js.n4JS.IndexedAccessExpression) TMethod(org.eclipse.n4js.ts.types.TMethod) ThisTypeRef(org.eclipse.n4js.ts.typeRefs.ThisTypeRef) ParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef) BaseTypeRef(org.eclipse.n4js.ts.typeRefs.BaseTypeRef) FunctionTypeRef(org.eclipse.n4js.ts.typeRefs.FunctionTypeRef) ExistentialTypeRef(org.eclipse.n4js.ts.typeRefs.ExistentialTypeRef) BoundThisTypeRef(org.eclipse.n4js.ts.typeRefs.BoundThisTypeRef) StructuralTypeRef(org.eclipse.n4js.ts.typeRefs.StructuralTypeRef) TypeRef(org.eclipse.n4js.ts.typeRefs.TypeRef) TypeTypeRef(org.eclipse.n4js.ts.typeRefs.TypeTypeRef) StaticBaseTypeRef(org.eclipse.n4js.ts.typeRefs.StaticBaseTypeRef) ComposedTypeRef(org.eclipse.n4js.ts.typeRefs.ComposedTypeRef) UnknownTypeRef(org.eclipse.n4js.ts.typeRefs.UnknownTypeRef) NewExpression(org.eclipse.n4js.n4JS.NewExpression) ParameterizedCallExpression(org.eclipse.n4js.n4JS.ParameterizedCallExpression) N4MemberDeclaration(org.eclipse.n4js.n4JS.N4MemberDeclaration) RuleFailedException(org.eclipse.xsemantics.runtime.RuleFailedException) RuleFailedException(org.eclipse.xsemantics.runtime.RuleFailedException) Result(org.eclipse.xsemantics.runtime.Result) StructuralTypingResult(org.eclipse.n4js.typesystem.StructuralTypingResult) ParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef) Type(org.eclipse.n4js.ts.types.Type) PrimitiveType(org.eclipse.n4js.ts.types.PrimitiveType) VoidType(org.eclipse.n4js.ts.types.VoidType) AnyType(org.eclipse.n4js.ts.types.AnyType) ModuleNamespaceVirtualType(org.eclipse.n4js.ts.types.ModuleNamespaceVirtualType) NullType(org.eclipse.n4js.ts.types.NullType) UndefinedType(org.eclipse.n4js.ts.types.UndefinedType) ContainerType(org.eclipse.n4js.ts.types.ContainerType) TStructuralType(org.eclipse.n4js.ts.types.TStructuralType) EObject(org.eclipse.emf.ecore.EObject) N4MethodDeclaration(org.eclipse.n4js.n4JS.N4MethodDeclaration) TClass(org.eclipse.n4js.ts.types.TClass)

Example 2 with NewExpression

use of org.eclipse.n4js.n4JS.NewExpression in project n4js by eclipse.

the class N4JSSemanticSequencer 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 == N4JSPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case N4JSPackage.ADDITIVE_EXPRESSION:
                sequence_AdditiveExpression(context, (AdditiveExpression) semanticObject);
                return;
            case N4JSPackage.ANNOTATION:
                sequence_AnnotationNoAtSign(context, (Annotation) semanticObject);
                return;
            case N4JSPackage.ANNOTATION_LIST:
                sequence_AnnotationList(context, (AnnotationList) semanticObject);
                return;
            case N4JSPackage.ARGUMENT:
                sequence_Argument(context, (Argument) semanticObject);
                return;
            case N4JSPackage.ARRAY_BINDING_PATTERN:
                sequence_ArrayBindingPattern(context, (ArrayBindingPattern) semanticObject);
                return;
            case N4JSPackage.ARRAY_ELEMENT:
                sequence_ArrayElement(context, (ArrayElement) semanticObject);
                return;
            case N4JSPackage.ARRAY_LITERAL:
                sequence_ArrayLiteral(context, (ArrayLiteral) semanticObject);
                return;
            case N4JSPackage.ARRAY_PADDING:
                sequence_ArrayPadding(context, (ArrayPadding) semanticObject);
                return;
            case N4JSPackage.ARROW_FUNCTION:
                sequence_ArrowExpression_ColonSepReturnTypeRef_StrictFormalParameters(context, (ArrowFunction) semanticObject);
                return;
            case N4JSPackage.ASSIGNMENT_EXPRESSION:
                sequence_AssignmentExpression(context, (AssignmentExpression) semanticObject);
                return;
            case N4JSPackage.AWAIT_EXPRESSION:
                sequence_AwaitExpression(context, (AwaitExpression) semanticObject);
                return;
            case N4JSPackage.BINARY_BITWISE_EXPRESSION:
                if (rule == grammarAccess.getBitwiseANDExpressionRule() || action == grammarAccess.getBitwiseANDExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0()) {
                    sequence_BitwiseANDExpression(context, (BinaryBitwiseExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getBitwiseORExpressionRule() || action == grammarAccess.getBitwiseORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalANDExpressionRule() || action == grammarAccess.getLogicalANDExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalORExpressionRule() || action == grammarAccess.getLogicalORExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getConditionalExpressionRule() || action == grammarAccess.getConditionalExpressionAccess().getConditionalExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getAssignmentExpressionRule() || action == grammarAccess.getAssignmentExpressionAccess().getAssignmentExpressionLhsAction_4_1_0_0_0() || rule == grammarAccess.getExpressionRule() || action == grammarAccess.getExpressionAccess().getCommaExpressionExprsAction_1_0()) {
                    sequence_BitwiseANDExpression_BitwiseORExpression_BitwiseXORExpression(context, (BinaryBitwiseExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getBitwiseXORExpressionRule() || action == grammarAccess.getBitwiseXORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0()) {
                    sequence_BitwiseANDExpression_BitwiseXORExpression(context, (BinaryBitwiseExpression) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.BINARY_INT_LITERAL:
                sequence_BinaryIntLiteral(context, (BinaryIntLiteral) semanticObject);
                return;
            case N4JSPackage.BINARY_LOGICAL_EXPRESSION:
                if (rule == grammarAccess.getLogicalANDExpressionRule() || action == grammarAccess.getLogicalANDExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0()) {
                    sequence_LogicalANDExpression(context, (BinaryLogicalExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getLogicalORExpressionRule() || action == grammarAccess.getLogicalORExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getConditionalExpressionRule() || action == grammarAccess.getConditionalExpressionAccess().getConditionalExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getAssignmentExpressionRule() || action == grammarAccess.getAssignmentExpressionAccess().getAssignmentExpressionLhsAction_4_1_0_0_0() || rule == grammarAccess.getExpressionRule() || action == grammarAccess.getExpressionAccess().getCommaExpressionExprsAction_1_0()) {
                    sequence_LogicalANDExpression_LogicalORExpression(context, (BinaryLogicalExpression) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.BINDING_ELEMENT:
                if (rule == grammarAccess.getBindingElementRule()) {
                    sequence_BindingElementImpl(context, (BindingElement) semanticObject);
                    return;
                } else if (rule == grammarAccess.getBindingRestElementRule()) {
                    sequence_BindingElementImpl_BindingRestElement(context, (BindingElement) semanticObject);
                    return;
                } else if (rule == grammarAccess.getElisionRule()) {
                    sequence_Elision(context, (BindingElement) semanticObject);
                    return;
                } else if (rule == grammarAccess.getSingleNameBindingRule()) {
                    sequence_SingleNameBinding(context, (BindingElement) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.BINDING_PROPERTY:
                sequence_BindingProperty(context, (BindingProperty) semanticObject);
                return;
            case N4JSPackage.BLOCK:
                if (rule == grammarAccess.getBlockMinusBracesRule()) {
                    sequence_BlockMinusBraces(context, (Block) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScriptElementRule() || rule == grammarAccess.getBlockRule() || rule == grammarAccess.getRootStatementRule() || rule == grammarAccess.getStatementRule()) {
                    sequence_Block(context, (Block) semanticObject);
                    return;
                } else if (rule == grammarAccess.getExpressionDisguisedAsBlockRule()) {
                    sequence_ExpressionDisguisedAsBlock(context, (Block) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.BOOLEAN_LITERAL:
                sequence_BooleanLiteral(context, (BooleanLiteral) semanticObject);
                return;
            case N4JSPackage.BREAK_STATEMENT:
                sequence_BreakStatement(context, (BreakStatement) semanticObject);
                return;
            case N4JSPackage.CASE_CLAUSE:
                sequence_CaseClause(context, (CaseClause) semanticObject);
                return;
            case N4JSPackage.CAST_EXPRESSION:
                sequence_CastExpression(context, (CastExpression) semanticObject);
                return;
            case N4JSPackage.CATCH_BLOCK:
                sequence_CatchBlock(context, (CatchBlock) semanticObject);
                return;
            case N4JSPackage.CATCH_VARIABLE:
                sequence_BogusTypeRefFragment_CatchVariable_ColonSepDeclaredTypeRef(context, (CatchVariable) semanticObject);
                return;
            case N4JSPackage.COMMA_EXPRESSION:
                sequence_Expression(context, (CommaExpression) semanticObject);
                return;
            case N4JSPackage.CONDITIONAL_EXPRESSION:
                sequence_ConditionalExpression(context, (ConditionalExpression) semanticObject);
                return;
            case N4JSPackage.CONTINUE_STATEMENT:
                sequence_ContinueStatement(context, (ContinueStatement) semanticObject);
                return;
            case N4JSPackage.DEBUGGER_STATEMENT:
                sequence_DebuggerStatement(context, (DebuggerStatement) semanticObject);
                return;
            case N4JSPackage.DEFAULT_CLAUSE:
                sequence_DefaultClause(context, (DefaultClause) semanticObject);
                return;
            case N4JSPackage.DEFAULT_IMPORT_SPECIFIER:
                sequence_DefaultImportSpecifier(context, (DefaultImportSpecifier) semanticObject);
                return;
            case N4JSPackage.DO_STATEMENT:
                sequence_DoStatement(context, (DoStatement) semanticObject);
                return;
            case N4JSPackage.DOUBLE_LITERAL:
                sequence_DoubleLiteral(context, (DoubleLiteral) semanticObject);
                return;
            case N4JSPackage.EMPTY_STATEMENT:
                sequence_EmptyStatement(context, (EmptyStatement) semanticObject);
                return;
            case N4JSPackage.EQUALITY_EXPRESSION:
                sequence_EqualityExpression(context, (EqualityExpression) semanticObject);
                return;
            case N4JSPackage.EXPORT_DECLARATION:
                if (rule == grammarAccess.getAnnotatedScriptElementRule()) {
                    sequence_AnnotatedScriptElement_ExportClause_ExportDeclarationImpl_ExportFromClause(context, (ExportDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScriptElementRule()) {
                    sequence_AnnotatedScriptElement_ExportClause_ExportDeclaration_ExportDeclarationImpl_ExportFromClause(context, (ExportDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getExportDeclarationRule()) {
                    sequence_ExportClause_ExportDeclaration_ExportDeclarationImpl_ExportFromClause(context, (ExportDeclaration) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.EXPORT_SPECIFIER:
                sequence_ExportSpecifier(context, (ExportSpecifier) semanticObject);
                return;
            case N4JSPackage.EXPORTED_VARIABLE_BINDING:
                sequence_ExportedVariableBinding(context, (ExportedVariableBinding) semanticObject);
                return;
            case N4JSPackage.EXPORTED_VARIABLE_DECLARATION:
                sequence_ColonSepDeclaredTypeRef_ExportedVariableDeclaration_VariableDeclarationImpl(context, (ExportedVariableDeclaration) semanticObject);
                return;
            case N4JSPackage.EXPORTED_VARIABLE_STATEMENT:
                if (rule == grammarAccess.getAnnotatedExportableElementRule()) {
                    sequence_AnnotatedExportableElement(context, (ExportedVariableStatement) semanticObject);
                    return;
                } else if (rule == grammarAccess.getExportableElementRule()) {
                    sequence_AnnotatedExportableElement_ExportedVariableStatement(context, (ExportedVariableStatement) semanticObject);
                    return;
                } else if (rule == grammarAccess.getExportedVariableStatementRule()) {
                    sequence_ExportedVariableStatement(context, (ExportedVariableStatement) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.EXPRESSION_ANNOTATION_LIST:
                sequence_ExpressionAnnotationList(context, (ExpressionAnnotationList) semanticObject);
                return;
            case N4JSPackage.EXPRESSION_STATEMENT:
                if (rule == grammarAccess.getAssignmentExpressionStatementRule()) {
                    sequence_AssignmentExpressionStatement(context, (ExpressionStatement) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScriptElementRule() || rule == grammarAccess.getRootStatementRule() || rule == grammarAccess.getStatementRule() || rule == grammarAccess.getExpressionStatementRule()) {
                    sequence_ExpressionStatement(context, (ExpressionStatement) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.FINALLY_BLOCK:
                sequence_FinallyBlock(context, (FinallyBlock) semanticObject);
                return;
            case N4JSPackage.FOR_STATEMENT:
                sequence_ForStatement(context, (ForStatement) semanticObject);
                return;
            case N4JSPackage.FORMAL_PARAMETER:
                if (rule == grammarAccess.getFormalParameterRule()) {
                    sequence_BindingElementFragment_BogusTypeRefFragment_ColonSepDeclaredTypeRef_FormalParameter(context, (FormalParameter) semanticObject);
                    return;
                } else if (rule == grammarAccess.getBindingIdentifierAsFormalParameterRule()) {
                    sequence_BindingIdentifierAsFormalParameter(context, (FormalParameter) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.FUNCTION_DECLARATION:
                if (rule == grammarAccess.getExportableElementRule()) {
                    sequence_AnnotatedExportableElement_AsyncNoTrailingLineBreak_ColonSepReturnTypeRef_FunctionBody_FunctionDeclaration_FunctionHeader_FunctionImpl_StrictFormalParameters_TypeVariables(context, (FunctionDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAnnotatedExportableElementRule()) {
                    sequence_AnnotatedExportableElement_AsyncNoTrailingLineBreak_ColonSepReturnTypeRef_FunctionBody_FunctionHeader_FunctionImpl_StrictFormalParameters_TypeVariables(context, (FunctionDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getStatementRule()) {
                    sequence_AnnotatedFunctionDeclaration_AsyncNoTrailingLineBreak_ColonSepReturnTypeRef_FunctionBody_FunctionDeclaration_FunctionHeader_FunctionImpl_StrictFormalParameters_TypeVariables(context, (FunctionDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAnnotatedFunctionDeclarationRule()) {
                    sequence_AnnotatedFunctionDeclaration_AsyncNoTrailingLineBreak_ColonSepReturnTypeRef_FunctionBody_FunctionHeader_FunctionImpl_StrictFormalParameters_TypeVariables(context, (FunctionDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScriptElementRule()) {
                    sequence_AnnotatedScriptElement_AsyncNoTrailingLineBreak_ColonSepReturnTypeRef_FunctionBody_FunctionDeclaration_FunctionHeader_FunctionImpl_StrictFormalParameters_TypeVariables(context, (FunctionDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAnnotatedScriptElementRule()) {
                    sequence_AnnotatedScriptElement_AsyncNoTrailingLineBreak_ColonSepReturnTypeRef_FunctionBody_FunctionHeader_FunctionImpl_StrictFormalParameters_TypeVariables(context, (FunctionDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getFunctionDeclarationRule() || rule == grammarAccess.getRootStatementRule()) {
                    sequence_AsyncNoTrailingLineBreak_ColonSepReturnTypeRef_FunctionBody_FunctionDeclaration_FunctionHeader_FunctionImpl_StrictFormalParameters_TypeVariables(context, (FunctionDeclaration) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.FUNCTION_EXPRESSION:
                if (rule == grammarAccess.getPrimaryExpressionRule() || rule == grammarAccess.getLeftHandSideExpressionRule() || action == grammarAccess.getLeftHandSideExpressionAccess().getParameterizedCallExpressionTargetAction_1_0() || rule == grammarAccess.getMemberExpressionRule() || action == grammarAccess.getMemberExpressionAccess().getIndexedAccessExpressionTargetAction_2_1_0_0() || action == grammarAccess.getMemberExpressionAccess().getParameterizedPropertyAccessExpressionTargetAction_2_1_1_0() || action == grammarAccess.getMemberExpressionAccess().getTaggedTemplateStringTargetAction_2_1_2_0() || rule == grammarAccess.getPostfixExpressionRule() || action == grammarAccess.getPostfixExpressionAccess().getPostfixExpressionExpressionAction_1_0_0() || rule == grammarAccess.getCastExpressionRule() || action == grammarAccess.getCastExpressionAccess().getCastExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getUnaryExpressionRule() || rule == grammarAccess.getMultiplicativeExpressionRule() || action == grammarAccess.getMultiplicativeExpressionAccess().getMultiplicativeExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getAdditiveExpressionRule() || action == grammarAccess.getAdditiveExpressionAccess().getAdditiveExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getShiftExpressionRule() || action == grammarAccess.getShiftExpressionAccess().getShiftExpressionLhsAction_1_0_0() || rule == grammarAccess.getRelationalExpressionRule() || action == grammarAccess.getRelationalExpressionAccess().getRelationalExpressionLhsAction_1_0_0() || rule == grammarAccess.getEqualityExpressionRule() || action == grammarAccess.getEqualityExpressionAccess().getEqualityExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseANDExpressionRule() || action == grammarAccess.getBitwiseANDExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseXORExpressionRule() || action == grammarAccess.getBitwiseXORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseORExpressionRule() || action == grammarAccess.getBitwiseORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalANDExpressionRule() || action == grammarAccess.getLogicalANDExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalORExpressionRule() || action == grammarAccess.getLogicalORExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getConditionalExpressionRule() || action == grammarAccess.getConditionalExpressionAccess().getConditionalExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getAssignmentExpressionRule() || action == grammarAccess.getAssignmentExpressionAccess().getAssignmentExpressionLhsAction_4_1_0_0_0() || rule == grammarAccess.getExpressionRule() || action == grammarAccess.getExpressionAccess().getCommaExpressionExprsAction_1_0()) {
                    sequence_AnnotatedExpression_AsyncFunctionExpression_AsyncNoTrailingLineBreak_ColonSepReturnTypeRef_FunctionBody_FunctionExpression_FunctionHeader_FunctionImpl_StrictFormalParameters_TypeVariables(context, (FunctionExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAnnotatedExpressionRule()) {
                    sequence_AnnotatedExpression_AsyncNoTrailingLineBreak_ColonSepReturnTypeRef_FunctionBody_FunctionHeader_FunctionImpl_StrictFormalParameters_TypeVariables(context, (FunctionExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAsyncFunctionExpressionRule()) {
                    sequence_AsyncFunctionExpression_ColonSepReturnTypeRef_FunctionBody_FunctionHeader_StrictFormalParameters_TypeVariables(context, (FunctionExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getFunctionExpressionRule()) {
                    sequence_ColonSepReturnTypeRef_FunctionBody_FunctionExpression_FunctionHeader_FunctionImpl_StrictFormalParameters_TypeVariables(context, (FunctionExpression) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.HEX_INT_LITERAL:
                sequence_HexIntLiteral(context, (HexIntLiteral) semanticObject);
                return;
            case N4JSPackage.IDENTIFIER_REF:
                if (rule == grammarAccess.getPrimaryExpressionRule() || rule == grammarAccess.getIdentifierRefRule() || rule == grammarAccess.getLeftHandSideExpressionRule() || action == grammarAccess.getLeftHandSideExpressionAccess().getParameterizedCallExpressionTargetAction_1_0() || rule == grammarAccess.getMemberExpressionRule() || action == grammarAccess.getMemberExpressionAccess().getIndexedAccessExpressionTargetAction_2_1_0_0() || action == grammarAccess.getMemberExpressionAccess().getParameterizedPropertyAccessExpressionTargetAction_2_1_1_0() || action == grammarAccess.getMemberExpressionAccess().getTaggedTemplateStringTargetAction_2_1_2_0() || rule == grammarAccess.getPostfixExpressionRule() || action == grammarAccess.getPostfixExpressionAccess().getPostfixExpressionExpressionAction_1_0_0() || rule == grammarAccess.getCastExpressionRule() || action == grammarAccess.getCastExpressionAccess().getCastExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getUnaryExpressionRule() || rule == grammarAccess.getMultiplicativeExpressionRule() || action == grammarAccess.getMultiplicativeExpressionAccess().getMultiplicativeExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getAdditiveExpressionRule() || action == grammarAccess.getAdditiveExpressionAccess().getAdditiveExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getShiftExpressionRule() || action == grammarAccess.getShiftExpressionAccess().getShiftExpressionLhsAction_1_0_0() || rule == grammarAccess.getRelationalExpressionRule() || action == grammarAccess.getRelationalExpressionAccess().getRelationalExpressionLhsAction_1_0_0() || rule == grammarAccess.getEqualityExpressionRule() || action == grammarAccess.getEqualityExpressionAccess().getEqualityExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseANDExpressionRule() || action == grammarAccess.getBitwiseANDExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseXORExpressionRule() || action == grammarAccess.getBitwiseXORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseORExpressionRule() || action == grammarAccess.getBitwiseORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalANDExpressionRule() || action == grammarAccess.getLogicalANDExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalORExpressionRule() || action == grammarAccess.getLogicalORExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getConditionalExpressionRule() || action == grammarAccess.getConditionalExpressionAccess().getConditionalExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getAssignmentExpressionRule() || action == grammarAccess.getAssignmentExpressionAccess().getAssignmentExpressionLhsAction_4_1_0_0_0() || rule == grammarAccess.getExpressionRule() || action == grammarAccess.getExpressionAccess().getCommaExpressionExprsAction_1_0() || rule == grammarAccess.getJSXElementNameExpressionRule() || action == grammarAccess.getJSXElementNameExpressionAccess().getParameterizedPropertyAccessExpressionTargetAction_1_0()) {
                    sequence_IdentifierRef(context, (IdentifierRef) semanticObject);
                    return;
                } else if (rule == grammarAccess.getLetIdentifierRefRule()) {
                    sequence_LetIdentifierRef(context, (IdentifierRef) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.IF_STATEMENT:
                sequence_IfStatement(context, (IfStatement) semanticObject);
                return;
            case N4JSPackage.IMPORT_DECLARATION:
                if (rule == grammarAccess.getAnnotatedScriptElementRule()) {
                    sequence_AnnotatedScriptElement_ImportClause_ImportDeclarationImpl_ImportSpecifiersExceptDefault(context, (ImportDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScriptElementRule()) {
                    sequence_AnnotatedScriptElement_ImportClause_ImportDeclaration_ImportDeclarationImpl_ImportSpecifiersExceptDefault(context, (ImportDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getImportDeclarationRule()) {
                    sequence_ImportClause_ImportDeclaration_ImportDeclarationImpl_ImportSpecifiersExceptDefault(context, (ImportDeclaration) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.INDEXED_ACCESS_EXPRESSION:
                if (action == grammarAccess.getLeftHandSideExpressionAccess().getParameterizedCallExpressionTargetAction_1_2_0_0() || action == grammarAccess.getLeftHandSideExpressionAccess().getIndexedAccessExpressionTargetAction_1_2_1_0() || action == grammarAccess.getLeftHandSideExpressionAccess().getParameterizedPropertyAccessExpressionTargetAction_1_2_2_0() || action == grammarAccess.getLeftHandSideExpressionAccess().getTaggedTemplateStringTargetAction_1_2_3_0_0()) {
                    sequence_IndexedAccessExpressionTail_LeftHandSideExpression_IndexedAccessExpression_1_2_1_0_ParameterizedCallExpression_1_2_0_0_ParameterizedPropertyAccessExpression_1_2_2_0_TaggedTemplateString_1_2_3_0_0(context, (IndexedAccessExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getLeftHandSideExpressionRule() || rule == grammarAccess.getPostfixExpressionRule() || action == grammarAccess.getPostfixExpressionAccess().getPostfixExpressionExpressionAction_1_0_0() || rule == grammarAccess.getCastExpressionRule() || action == grammarAccess.getCastExpressionAccess().getCastExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getUnaryExpressionRule() || rule == grammarAccess.getMultiplicativeExpressionRule() || action == grammarAccess.getMultiplicativeExpressionAccess().getMultiplicativeExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getAdditiveExpressionRule() || action == grammarAccess.getAdditiveExpressionAccess().getAdditiveExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getShiftExpressionRule() || action == grammarAccess.getShiftExpressionAccess().getShiftExpressionLhsAction_1_0_0() || rule == grammarAccess.getRelationalExpressionRule() || action == grammarAccess.getRelationalExpressionAccess().getRelationalExpressionLhsAction_1_0_0() || rule == grammarAccess.getEqualityExpressionRule() || action == grammarAccess.getEqualityExpressionAccess().getEqualityExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseANDExpressionRule() || action == grammarAccess.getBitwiseANDExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseXORExpressionRule() || action == grammarAccess.getBitwiseXORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseORExpressionRule() || action == grammarAccess.getBitwiseORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalANDExpressionRule() || action == grammarAccess.getLogicalANDExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalORExpressionRule() || action == grammarAccess.getLogicalORExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getConditionalExpressionRule() || action == grammarAccess.getConditionalExpressionAccess().getConditionalExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getAssignmentExpressionRule() || action == grammarAccess.getAssignmentExpressionAccess().getAssignmentExpressionLhsAction_4_1_0_0_0() || rule == grammarAccess.getExpressionRule() || action == grammarAccess.getExpressionAccess().getCommaExpressionExprsAction_1_0()) {
                    sequence_IndexedAccessExpressionTail_LeftHandSideExpression_MemberExpression(context, (IndexedAccessExpression) semanticObject);
                    return;
                } else if (action == grammarAccess.getLeftHandSideExpressionAccess().getParameterizedCallExpressionTargetAction_1_0() || rule == grammarAccess.getMemberExpressionRule()) {
                    sequence_IndexedAccessExpressionTail_MemberExpression(context, (IndexedAccessExpression) semanticObject);
                    return;
                } else if (action == grammarAccess.getMemberExpressionAccess().getIndexedAccessExpressionTargetAction_1_3_3_0_0() || action == grammarAccess.getMemberExpressionAccess().getParameterizedPropertyAccessExpressionTargetAction_1_3_3_1_0() || action == grammarAccess.getMemberExpressionAccess().getTaggedTemplateStringTargetAction_1_3_3_2_0()) {
                    sequence_IndexedAccessExpressionTail_MemberExpression_IndexedAccessExpression_1_3_3_0_0_ParameterizedPropertyAccessExpression_1_3_3_1_0_TaggedTemplateString_1_3_3_2_0(context, (IndexedAccessExpression) semanticObject);
                    return;
                } else if (action == grammarAccess.getMemberExpressionAccess().getIndexedAccessExpressionTargetAction_2_1_0_0() || action == grammarAccess.getMemberExpressionAccess().getParameterizedPropertyAccessExpressionTargetAction_2_1_1_0() || action == grammarAccess.getMemberExpressionAccess().getTaggedTemplateStringTargetAction_2_1_2_0()) {
                    sequence_IndexedAccessExpressionTail_MemberExpression_IndexedAccessExpression_2_1_0_0_ParameterizedPropertyAccessExpression_2_1_1_0_TaggedTemplateString_2_1_2_0(context, (IndexedAccessExpression) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.INT_LITERAL:
                sequence_IntLiteral(context, (IntLiteral) semanticObject);
                return;
            case N4JSPackage.JSX_ELEMENT:
                sequence_JSXAttributes_JSXClosingElement_JSXElement(context, (JSXElement) semanticObject);
                return;
            case N4JSPackage.JSX_ELEMENT_NAME:
                sequence_JSXElementName(context, (JSXElementName) semanticObject);
                return;
            case N4JSPackage.JSX_EXPRESSION:
                sequence_JSXExpression(context, (JSXExpression) semanticObject);
                return;
            case N4JSPackage.JSX_PROPERTY_ATTRIBUTE:
                sequence_JSXPropertyAttribute(context, (JSXPropertyAttribute) semanticObject);
                return;
            case N4JSPackage.JSX_SPREAD_ATTRIBUTE:
                sequence_JSXSpreadAttribute(context, (JSXSpreadAttribute) semanticObject);
                return;
            case N4JSPackage.LABELLED_STATEMENT:
                sequence_LabelledStatement(context, (LabelledStatement) semanticObject);
                return;
            case N4JSPackage.LEGACY_OCTAL_INT_LITERAL:
                sequence_LegacyOctalIntLiteral(context, (LegacyOctalIntLiteral) semanticObject);
                return;
            case N4JSPackage.LITERAL_ANNOTATION_ARGUMENT:
                sequence_LiteralAnnotationArgument(context, (LiteralAnnotationArgument) semanticObject);
                return;
            case N4JSPackage.LITERAL_OR_COMPUTED_PROPERTY_NAME:
                sequence_LiteralOrComputedPropertyName(context, (LiteralOrComputedPropertyName) semanticObject);
                return;
            case N4JSPackage.MULTIPLICATIVE_EXPRESSION:
                sequence_MultiplicativeExpression(context, (MultiplicativeExpression) semanticObject);
                return;
            case N4JSPackage.N4_CLASS_DECLARATION:
                if (rule == grammarAccess.getExportableElementRule()) {
                    sequence_AnnotatedExportableElement_ClassExtendsClause_ClassImplementsList_Members_N4ClassDeclaration_TypeVariables_VersionDeclaration(context, (N4ClassDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAnnotatedExportableElementRule()) {
                    sequence_AnnotatedExportableElement_ClassExtendsClause_ClassImplementsList_Members_TypeVariables(context, (N4ClassDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScriptElementRule()) {
                    sequence_AnnotatedScriptElement_ClassExtendsClause_ClassImplementsList_Members_N4ClassDeclaration_TypeVariables_VersionDeclaration(context, (N4ClassDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAnnotatedScriptElementRule()) {
                    sequence_AnnotatedScriptElement_ClassExtendsClause_ClassImplementsList_Members_TypeVariables_VersionDeclaration(context, (N4ClassDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getN4ClassDeclarationRule()) {
                    sequence_ClassExtendsClause_ClassImplementsList_Members_N4ClassDeclaration_TypeVariables_VersionDeclaration(context, (N4ClassDeclaration) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.N4_CLASS_EXPRESSION:
                if (rule == grammarAccess.getAnnotatedExpressionRule()) {
                    sequence_AnnotatedExpression_ClassExtendsClause_ClassImplementsList_Members(context, (N4ClassExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPrimaryExpressionRule() || rule == grammarAccess.getLeftHandSideExpressionRule() || action == grammarAccess.getLeftHandSideExpressionAccess().getParameterizedCallExpressionTargetAction_1_0() || rule == grammarAccess.getMemberExpressionRule() || action == grammarAccess.getMemberExpressionAccess().getIndexedAccessExpressionTargetAction_2_1_0_0() || action == grammarAccess.getMemberExpressionAccess().getParameterizedPropertyAccessExpressionTargetAction_2_1_1_0() || action == grammarAccess.getMemberExpressionAccess().getTaggedTemplateStringTargetAction_2_1_2_0() || rule == grammarAccess.getPostfixExpressionRule() || action == grammarAccess.getPostfixExpressionAccess().getPostfixExpressionExpressionAction_1_0_0() || rule == grammarAccess.getCastExpressionRule() || action == grammarAccess.getCastExpressionAccess().getCastExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getUnaryExpressionRule() || rule == grammarAccess.getMultiplicativeExpressionRule() || action == grammarAccess.getMultiplicativeExpressionAccess().getMultiplicativeExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getAdditiveExpressionRule() || action == grammarAccess.getAdditiveExpressionAccess().getAdditiveExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getShiftExpressionRule() || action == grammarAccess.getShiftExpressionAccess().getShiftExpressionLhsAction_1_0_0() || rule == grammarAccess.getRelationalExpressionRule() || action == grammarAccess.getRelationalExpressionAccess().getRelationalExpressionLhsAction_1_0_0() || rule == grammarAccess.getEqualityExpressionRule() || action == grammarAccess.getEqualityExpressionAccess().getEqualityExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseANDExpressionRule() || action == grammarAccess.getBitwiseANDExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseXORExpressionRule() || action == grammarAccess.getBitwiseXORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseORExpressionRule() || action == grammarAccess.getBitwiseORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalANDExpressionRule() || action == grammarAccess.getLogicalANDExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalORExpressionRule() || action == grammarAccess.getLogicalORExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getConditionalExpressionRule() || action == grammarAccess.getConditionalExpressionAccess().getConditionalExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getAssignmentExpressionRule() || action == grammarAccess.getAssignmentExpressionAccess().getAssignmentExpressionLhsAction_4_1_0_0_0() || rule == grammarAccess.getExpressionRule() || action == grammarAccess.getExpressionAccess().getCommaExpressionExprsAction_1_0()) {
                    sequence_AnnotatedExpression_ClassExtendsClause_ClassImplementsList_Members_N4ClassExpression(context, (N4ClassExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getN4ClassExpressionRule()) {
                    sequence_ClassExtendsClause_ClassImplementsList_Members_N4ClassExpression(context, (N4ClassExpression) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.N4_ENUM_DECLARATION:
                if (rule == grammarAccess.getAnnotatedExportableElementRule()) {
                    sequence_AnnotatedExportableElement(context, (N4EnumDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getExportableElementRule()) {
                    sequence_AnnotatedExportableElement_N4EnumDeclaration_VersionDeclaration(context, (N4EnumDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScriptElementRule()) {
                    sequence_AnnotatedScriptElement_N4EnumDeclaration_VersionDeclaration(context, (N4EnumDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAnnotatedScriptElementRule()) {
                    sequence_AnnotatedScriptElement_VersionDeclaration(context, (N4EnumDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getN4EnumDeclarationRule()) {
                    sequence_N4EnumDeclaration_VersionDeclaration(context, (N4EnumDeclaration) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.N4_ENUM_LITERAL:
                sequence_N4EnumLiteral(context, (N4EnumLiteral) semanticObject);
                return;
            case N4JSPackage.N4_FIELD_DECLARATION:
                if (rule == grammarAccess.getAnnotatedN4MemberDeclarationRule()) {
                    sequence_AnnotatedN4MemberDeclaration_BogusTypeRefFragment_ColonSepDeclaredTypeRef_FieldDeclarationImpl(context, (N4FieldDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getN4MemberDeclarationRule()) {
                    sequence_AnnotatedN4MemberDeclaration_BogusTypeRefFragment_ColonSepDeclaredTypeRef_FieldDeclarationImpl_N4FieldDeclaration(context, (N4FieldDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getN4FieldDeclarationRule()) {
                    sequence_BogusTypeRefFragment_ColonSepDeclaredTypeRef_FieldDeclarationImpl_N4FieldDeclaration(context, (N4FieldDeclaration) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.N4_GETTER_DECLARATION:
                if (rule == grammarAccess.getAnnotatedN4MemberDeclarationRule()) {
                    sequence_AnnotatedN4MemberDeclaration_BogusTypeRefFragment_ColonSepDeclaredTypeRef_GetterHeader(context, (N4GetterDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getN4MemberDeclarationRule()) {
                    sequence_AnnotatedN4MemberDeclaration_BogusTypeRefFragment_ColonSepDeclaredTypeRef_GetterHeader_N4GetterDeclaration(context, (N4GetterDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getN4GetterDeclarationRule()) {
                    sequence_BogusTypeRefFragment_ColonSepDeclaredTypeRef_GetterHeader_N4GetterDeclaration(context, (N4GetterDeclaration) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.N4_INTERFACE_DECLARATION:
                if (rule == grammarAccess.getExportableElementRule()) {
                    sequence_AnnotatedExportableElement_InterfaceExtendsList_Members_N4InterfaceDeclaration_TypeVariables_VersionDeclaration(context, (N4InterfaceDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAnnotatedExportableElementRule()) {
                    sequence_AnnotatedExportableElement_InterfaceExtendsList_Members_TypeVariables(context, (N4InterfaceDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getScriptElementRule()) {
                    sequence_AnnotatedScriptElement_InterfaceExtendsList_Members_N4InterfaceDeclaration_TypeVariables_VersionDeclaration(context, (N4InterfaceDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAnnotatedScriptElementRule()) {
                    sequence_AnnotatedScriptElement_InterfaceExtendsList_Members_TypeVariables_VersionDeclaration(context, (N4InterfaceDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getN4InterfaceDeclarationRule()) {
                    sequence_InterfaceExtendsList_Members_N4InterfaceDeclaration_TypeVariables_VersionDeclaration(context, (N4InterfaceDeclaration) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.N4_MEMBER_ANNOTATION_LIST:
                sequence_N4MemberAnnotationList(context, (N4MemberAnnotationList) semanticObject);
                return;
            case N4JSPackage.N4_METHOD_DECLARATION:
                if (rule == grammarAccess.getN4MemberDeclarationRule()) {
                    sequence_AnnotatedN4MemberDeclaration_AsyncNoTrailingLineBreak_BogusTypeRefFragment_ColonSepReturnTypeRef_MethodParamsReturnAndBody_N4MethodDeclaration_StrictFormalParameters_TypeVariables(context, (N4MethodDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAnnotatedN4MemberDeclarationRule()) {
                    sequence_AnnotatedN4MemberDeclaration_AsyncNoTrailingLineBreak_BogusTypeRefFragment_ColonSepReturnTypeRef_MethodParamsReturnAndBody_StrictFormalParameters_TypeVariables(context, (N4MethodDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getN4MethodDeclarationRule()) {
                    sequence_AsyncNoTrailingLineBreak_BogusTypeRefFragment_ColonSepReturnTypeRef_MethodParamsReturnAndBody_N4MethodDeclaration_StrictFormalParameters_TypeVariables(context, (N4MethodDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getN4CallableConstructorDeclarationRule()) {
                    sequence_ColonSepReturnTypeRef_MethodParamsReturnAndBody_StrictFormalParameters(context, (N4MethodDeclaration) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.N4_SETTER_DECLARATION:
                if (rule == grammarAccess.getAnnotatedN4MemberDeclarationRule()) {
                    sequence_AnnotatedN4MemberDeclaration(context, (N4SetterDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getN4MemberDeclarationRule()) {
                    sequence_AnnotatedN4MemberDeclaration_N4SetterDeclaration(context, (N4SetterDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getN4SetterDeclarationRule()) {
                    sequence_N4SetterDeclaration(context, (N4SetterDeclaration) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.NAMED_IMPORT_SPECIFIER:
                sequence_NamedImportSpecifier(context, (NamedImportSpecifier) semanticObject);
                return;
            case N4JSPackage.NAMESPACE_IMPORT_SPECIFIER:
                sequence_NamespaceImportSpecifier(context, (NamespaceImportSpecifier) semanticObject);
                return;
            case N4JSPackage.NEW_EXPRESSION:
                if (action == grammarAccess.getMemberExpressionAccess().getIndexedAccessExpressionTargetAction_1_3_3_0_0() || action == grammarAccess.getMemberExpressionAccess().getParameterizedPropertyAccessExpressionTargetAction_1_3_3_1_0() || action == grammarAccess.getMemberExpressionAccess().getTaggedTemplateStringTargetAction_1_3_3_2_0()) {
                    sequence_Arguments_ConcreteTypeArguments_MemberExpression_IndexedAccessExpression_1_3_3_0_0_ParameterizedPropertyAccessExpression_1_3_3_1_0_TaggedTemplateString_1_3_3_2_0(context, (NewExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getLeftHandSideExpressionRule() || action == grammarAccess.getLeftHandSideExpressionAccess().getParameterizedCallExpressionTargetAction_1_0() || rule == grammarAccess.getMemberExpressionRule() || rule == grammarAccess.getPostfixExpressionRule() || action == grammarAccess.getPostfixExpressionAccess().getPostfixExpressionExpressionAction_1_0_0() || rule == grammarAccess.getCastExpressionRule() || action == grammarAccess.getCastExpressionAccess().getCastExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getUnaryExpressionRule() || rule == grammarAccess.getMultiplicativeExpressionRule() || action == grammarAccess.getMultiplicativeExpressionAccess().getMultiplicativeExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getAdditiveExpressionRule() || action == grammarAccess.getAdditiveExpressionAccess().getAdditiveExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getShiftExpressionRule() || action == grammarAccess.getShiftExpressionAccess().getShiftExpressionLhsAction_1_0_0() || rule == grammarAccess.getRelationalExpressionRule() || action == grammarAccess.getRelationalExpressionAccess().getRelationalExpressionLhsAction_1_0_0() || rule == grammarAccess.getEqualityExpressionRule() || action == grammarAccess.getEqualityExpressionAccess().getEqualityExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseANDExpressionRule() || action == grammarAccess.getBitwiseANDExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseXORExpressionRule() || action == grammarAccess.getBitwiseXORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseORExpressionRule() || action == grammarAccess.getBitwiseORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalANDExpressionRule() || action == grammarAccess.getLogicalANDExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalORExpressionRule() || action == grammarAccess.getLogicalORExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getConditionalExpressionRule() || action == grammarAccess.getConditionalExpressionAccess().getConditionalExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getAssignmentExpressionRule() || action == grammarAccess.getAssignmentExpressionAccess().getAssignmentExpressionLhsAction_4_1_0_0_0() || rule == grammarAccess.getExpressionRule() || action == grammarAccess.getExpressionAccess().getCommaExpressionExprsAction_1_0()) {
                    sequence_Arguments_ConcreteTypeArguments_MemberExpression(context, (NewExpression) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.NEW_TARGET:
                sequence_MemberExpression(context, (NewTarget) semanticObject);
                return;
            case N4JSPackage.NULL_LITERAL:
                sequence_NullLiteral(context, (NullLiteral) semanticObject);
                return;
            case N4JSPackage.OBJECT_BINDING_PATTERN:
                sequence_ObjectBindingPattern(context, (ObjectBindingPattern) semanticObject);
                return;
            case N4JSPackage.OBJECT_LITERAL:
                sequence_ObjectLiteral(context, (ObjectLiteral) semanticObject);
                return;
            case N4JSPackage.OCTAL_INT_LITERAL:
                sequence_OctalIntLiteral(context, (OctalIntLiteral) semanticObject);
                return;
            case N4JSPackage.PARAMETERIZED_CALL_EXPRESSION:
                if (rule == grammarAccess.getLeftHandSideExpressionRule() || rule == grammarAccess.getPostfixExpressionRule() || action == grammarAccess.getPostfixExpressionAccess().getPostfixExpressionExpressionAction_1_0_0() || rule == grammarAccess.getCastExpressionRule() || action == grammarAccess.getCastExpressionAccess().getCastExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getUnaryExpressionRule() || rule == grammarAccess.getMultiplicativeExpressionRule() || action == grammarAccess.getMultiplicativeExpressionAccess().getMultiplicativeExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getAdditiveExpressionRule() || action == grammarAccess.getAdditiveExpressionAccess().getAdditiveExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getShiftExpressionRule() || action == grammarAccess.getShiftExpressionAccess().getShiftExpressionLhsAction_1_0_0() || rule == grammarAccess.getRelationalExpressionRule() || action == grammarAccess.getRelationalExpressionAccess().getRelationalExpressionLhsAction_1_0_0() || rule == grammarAccess.getEqualityExpressionRule() || action == grammarAccess.getEqualityExpressionAccess().getEqualityExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseANDExpressionRule() || action == grammarAccess.getBitwiseANDExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseXORExpressionRule() || action == grammarAccess.getBitwiseXORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseORExpressionRule() || action == grammarAccess.getBitwiseORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalANDExpressionRule() || action == grammarAccess.getLogicalANDExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalORExpressionRule() || action == grammarAccess.getLogicalORExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getConditionalExpressionRule() || action == grammarAccess.getConditionalExpressionAccess().getConditionalExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getAssignmentExpressionRule() || action == grammarAccess.getAssignmentExpressionAccess().getAssignmentExpressionLhsAction_4_1_0_0_0() || rule == grammarAccess.getExpressionRule() || action == grammarAccess.getExpressionAccess().getCommaExpressionExprsAction_1_0()) {
                    sequence_Arguments_ConcreteTypeArguments_LeftHandSideExpression_ParameterizedCallExpression(context, (ParameterizedCallExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPrimaryExpressionRule() || rule == grammarAccess.getParameterizedCallExpressionRule() || action == grammarAccess.getLeftHandSideExpressionAccess().getParameterizedCallExpressionTargetAction_1_0() || rule == grammarAccess.getMemberExpressionRule() || action == grammarAccess.getMemberExpressionAccess().getIndexedAccessExpressionTargetAction_2_1_0_0() || action == grammarAccess.getMemberExpressionAccess().getParameterizedPropertyAccessExpressionTargetAction_2_1_1_0() || action == grammarAccess.getMemberExpressionAccess().getTaggedTemplateStringTargetAction_2_1_2_0()) {
                    sequence_Arguments_ConcreteTypeArguments_ParameterizedCallExpression(context, (ParameterizedCallExpression) semanticObject);
                    return;
                } else if (action == grammarAccess.getLeftHandSideExpressionAccess().getParameterizedCallExpressionTargetAction_1_2_0_0() || action == grammarAccess.getLeftHandSideExpressionAccess().getIndexedAccessExpressionTargetAction_1_2_1_0() || action == grammarAccess.getLeftHandSideExpressionAccess().getParameterizedPropertyAccessExpressionTargetAction_1_2_2_0() || action == grammarAccess.getLeftHandSideExpressionAccess().getTaggedTemplateStringTargetAction_1_2_3_0_0()) {
                    sequence_Arguments_LeftHandSideExpression_IndexedAccessExpression_1_2_1_0_ParameterizedCallExpression_1_2_0_0_ParameterizedPropertyAccessExpression_1_2_2_0_TaggedTemplateString_1_2_3_0_0(context, (ParameterizedCallExpression) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.PARAMETERIZED_PROPERTY_ACCESS_EXPRESSION:
                if (rule == grammarAccess.getJSXElementNameExpressionRule() || action == grammarAccess.getJSXElementNameExpressionAccess().getParameterizedPropertyAccessExpressionTargetAction_1_0()) {
                    sequence_ConcreteTypeArguments_JSXElementNameExpression_ParameterizedPropertyAccessExpressionTail(context, (ParameterizedPropertyAccessExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getLeftHandSideExpressionRule() || rule == grammarAccess.getPostfixExpressionRule() || action == grammarAccess.getPostfixExpressionAccess().getPostfixExpressionExpressionAction_1_0_0() || rule == grammarAccess.getCastExpressionRule() || action == grammarAccess.getCastExpressionAccess().getCastExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getUnaryExpressionRule() || rule == grammarAccess.getMultiplicativeExpressionRule() || action == grammarAccess.getMultiplicativeExpressionAccess().getMultiplicativeExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getAdditiveExpressionRule() || action == grammarAccess.getAdditiveExpressionAccess().getAdditiveExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getShiftExpressionRule() || action == grammarAccess.getShiftExpressionAccess().getShiftExpressionLhsAction_1_0_0() || rule == grammarAccess.getRelationalExpressionRule() || action == grammarAccess.getRelationalExpressionAccess().getRelationalExpressionLhsAction_1_0_0() || rule == grammarAccess.getEqualityExpressionRule() || action == grammarAccess.getEqualityExpressionAccess().getEqualityExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseANDExpressionRule() || action == grammarAccess.getBitwiseANDExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseXORExpressionRule() || action == grammarAccess.getBitwiseXORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseORExpressionRule() || action == grammarAccess.getBitwiseORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalANDExpressionRule() || action == grammarAccess.getLogicalANDExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalORExpressionRule() || action == grammarAccess.getLogicalORExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getConditionalExpressionRule() || action == grammarAccess.getConditionalExpressionAccess().getConditionalExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getAssignmentExpressionRule() || action == grammarAccess.getAssignmentExpressionAccess().getAssignmentExpressionLhsAction_4_1_0_0_0() || rule == grammarAccess.getExpressionRule() || action == grammarAccess.getExpressionAccess().getCommaExpressionExprsAction_1_0()) {
                    sequence_ConcreteTypeArguments_LeftHandSideExpression_MemberExpression_ParameterizedPropertyAccessExpressionTail(context, (ParameterizedPropertyAccessExpression) semanticObject);
                    return;
                } else if (action == grammarAccess.getLeftHandSideExpressionAccess().getParameterizedCallExpressionTargetAction_1_2_0_0() || action == grammarAccess.getLeftHandSideExpressionAccess().getIndexedAccessExpressionTargetAction_1_2_1_0() || action == grammarAccess.getLeftHandSideExpressionAccess().getParameterizedPropertyAccessExpressionTargetAction_1_2_2_0() || action == grammarAccess.getLeftHandSideExpressionAccess().getTaggedTemplateStringTargetAction_1_2_3_0_0()) {
                    sequence_ConcreteTypeArguments_LeftHandSideExpression_ParameterizedPropertyAccessExpressionTail_IndexedAccessExpression_1_2_1_0_ParameterizedCallExpression_1_2_0_0_ParameterizedPropertyAccessExpression_1_2_2_0_TaggedTemplateString_1_2_3_0_0(context, (ParameterizedPropertyAccessExpression) semanticObject);
                    return;
                } else if (action == grammarAccess.getMemberExpressionAccess().getIndexedAccessExpressionTargetAction_1_3_3_0_0() || action == grammarAccess.getMemberExpressionAccess().getParameterizedPropertyAccessExpressionTargetAction_1_3_3_1_0() || action == grammarAccess.getMemberExpressionAccess().getTaggedTemplateStringTargetAction_1_3_3_2_0()) {
                    sequence_ConcreteTypeArguments_MemberExpression_ParameterizedPropertyAccessExpressionTail_IndexedAccessExpression_1_3_3_0_0_ParameterizedPropertyAccessExpression_1_3_3_1_0_TaggedTemplateString_1_3_3_2_0(context, (ParameterizedPropertyAccessExpression) semanticObject);
                    return;
                } else if (action == grammarAccess.getMemberExpressionAccess().getIndexedAccessExpressionTargetAction_2_1_0_0() || action == grammarAccess.getMemberExpressionAccess().getParameterizedPropertyAccessExpressionTargetAction_2_1_1_0() || action == grammarAccess.getMemberExpressionAccess().getTaggedTemplateStringTargetAction_2_1_2_0()) {
                    sequence_ConcreteTypeArguments_MemberExpression_ParameterizedPropertyAccessExpressionTail_IndexedAccessExpression_2_1_0_0_ParameterizedPropertyAccessExpression_2_1_1_0_TaggedTemplateString_2_1_2_0(context, (ParameterizedPropertyAccessExpression) semanticObject);
                    return;
                } else if (action == grammarAccess.getLeftHandSideExpressionAccess().getParameterizedCallExpressionTargetAction_1_0() || rule == grammarAccess.getMemberExpressionRule()) {
                    sequence_ConcreteTypeArguments_MemberExpression_ParameterizedPropertyAccessExpressionTail(context, (ParameterizedPropertyAccessExpression) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.PAREN_EXPRESSION:
                sequence_ParenExpression(context, (ParenExpression) semanticObject);
                return;
            case N4JSPackage.POSTFIX_EXPRESSION:
                sequence_PostfixExpression(context, (PostfixExpression) semanticObject);
                return;
            case N4JSPackage.PROMISIFY_EXPRESSION:
                sequence_PromisifyExpression(context, (PromisifyExpression) semanticObject);
                return;
            case N4JSPackage.PROPERTY_ASSIGNMENT_ANNOTATION_LIST:
                sequence_PropertyAssignmentAnnotationList(context, (PropertyAssignmentAnnotationList) semanticObject);
                return;
            case N4JSPackage.PROPERTY_GETTER_DECLARATION:
                if (rule == grammarAccess.getAnnotatedPropertyAssignmentRule()) {
                    sequence_AnnotatedPropertyAssignment_BogusTypeRefFragment_ColonSepDeclaredTypeRef_GetterHeader(context, (PropertyGetterDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPropertyAssignmentRule()) {
                    sequence_AnnotatedPropertyAssignment_BogusTypeRefFragment_ColonSepDeclaredTypeRef_GetterHeader_PropertyGetterDeclaration(context, (PropertyGetterDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPropertyGetterDeclarationRule()) {
                    sequence_BogusTypeRefFragment_ColonSepDeclaredTypeRef_GetterHeader_PropertyGetterDeclaration(context, (PropertyGetterDeclaration) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.PROPERTY_METHOD_DECLARATION:
                if (rule == grammarAccess.getPropertyAssignmentRule()) {
                    sequence_AnnotatedPropertyAssignment_MethodParamsAndBody_PropertyMethodDeclaration_StrictFormalParameters_TypeVariables(context, (PropertyMethodDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getAnnotatedPropertyAssignmentRule()) {
                    sequence_AnnotatedPropertyAssignment_MethodParamsAndBody_StrictFormalParameters_TypeVariables(context, (PropertyMethodDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPropertyMethodDeclarationRule()) {
                    sequence_MethodParamsAndBody_PropertyMethodDeclaration_StrictFormalParameters_TypeVariables(context, (PropertyMethodDeclaration) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.PROPERTY_NAME_VALUE_PAIR:
                if (rule == grammarAccess.getAnnotatedPropertyAssignmentRule()) {
                    sequence_AnnotatedPropertyAssignment(context, (PropertyNameValuePair) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPropertyAssignmentRule()) {
                    sequence_AnnotatedPropertyAssignment_PropertyNameValuePair(context, (PropertyNameValuePair) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPropertyNameValuePairRule()) {
                    sequence_PropertyNameValuePair(context, (PropertyNameValuePair) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.PROPERTY_NAME_VALUE_PAIR_SINGLE_NAME:
                if (rule == grammarAccess.getAnnotatedPropertyAssignmentRule()) {
                    sequence_AnnotatedPropertyAssignment(context, (PropertyNameValuePairSingleName) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPropertyAssignmentRule()) {
                    sequence_AnnotatedPropertyAssignment_PropertyNameValuePairSingleName(context, (PropertyNameValuePairSingleName) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPropertyNameValuePairSingleNameRule()) {
                    sequence_PropertyNameValuePairSingleName(context, (PropertyNameValuePairSingleName) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.PROPERTY_SETTER_DECLARATION:
                if (rule == grammarAccess.getAnnotatedPropertyAssignmentRule()) {
                    sequence_AnnotatedPropertyAssignment(context, (PropertySetterDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPropertyAssignmentRule()) {
                    sequence_AnnotatedPropertyAssignment_PropertySetterDeclaration(context, (PropertySetterDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getPropertySetterDeclarationRule()) {
                    sequence_PropertySetterDeclaration(context, (PropertySetterDeclaration) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.REGULAR_EXPRESSION_LITERAL:
                sequence_RegularExpressionLiteral(context, (RegularExpressionLiteral) semanticObject);
                return;
            case N4JSPackage.RELATIONAL_EXPRESSION:
                sequence_RelationalExpression(context, (RelationalExpression) semanticObject);
                return;
            case N4JSPackage.RETURN_STATEMENT:
                sequence_ReturnStatement(context, (ReturnStatement) semanticObject);
                return;
            case N4JSPackage.SCIENTIFIC_INT_LITERAL:
                sequence_ScientificIntLiteral(context, (ScientificIntLiteral) semanticObject);
                return;
            case N4JSPackage.SCRIPT:
                sequence_Script(context, (Script) semanticObject);
                return;
            case N4JSPackage.SHIFT_EXPRESSION:
                sequence_ShiftExpression(context, (ShiftExpression) semanticObject);
                return;
            case N4JSPackage.STRING_LITERAL:
                sequence_StringLiteral(context, (StringLiteral) semanticObject);
                return;
            case N4JSPackage.SUPER_LITERAL:
                sequence_SuperLiteral(context, (SuperLiteral) semanticObject);
                return;
            case N4JSPackage.SWITCH_STATEMENT:
                sequence_SwitchStatement(context, (SwitchStatement) semanticObject);
                return;
            case N4JSPackage.TAGGED_TEMPLATE_STRING:
                if (action == grammarAccess.getLeftHandSideExpressionAccess().getParameterizedCallExpressionTargetAction_1_2_0_0() || action == grammarAccess.getLeftHandSideExpressionAccess().getIndexedAccessExpressionTargetAction_1_2_1_0() || action == grammarAccess.getLeftHandSideExpressionAccess().getParameterizedPropertyAccessExpressionTargetAction_1_2_2_0() || action == grammarAccess.getLeftHandSideExpressionAccess().getTaggedTemplateStringTargetAction_1_2_3_0_0()) {
                    sequence_LeftHandSideExpression_IndexedAccessExpression_1_2_1_0_ParameterizedCallExpression_1_2_0_0_ParameterizedPropertyAccessExpression_1_2_2_0_TaggedTemplateString_1_2_3_0_0(context, (TaggedTemplateString) semanticObject);
                    return;
                } else if (rule == grammarAccess.getLeftHandSideExpressionRule() || rule == grammarAccess.getPostfixExpressionRule() || action == grammarAccess.getPostfixExpressionAccess().getPostfixExpressionExpressionAction_1_0_0() || rule == grammarAccess.getCastExpressionRule() || action == grammarAccess.getCastExpressionAccess().getCastExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getUnaryExpressionRule() || rule == grammarAccess.getMultiplicativeExpressionRule() || action == grammarAccess.getMultiplicativeExpressionAccess().getMultiplicativeExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getAdditiveExpressionRule() || action == grammarAccess.getAdditiveExpressionAccess().getAdditiveExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getShiftExpressionRule() || action == grammarAccess.getShiftExpressionAccess().getShiftExpressionLhsAction_1_0_0() || rule == grammarAccess.getRelationalExpressionRule() || action == grammarAccess.getRelationalExpressionAccess().getRelationalExpressionLhsAction_1_0_0() || rule == grammarAccess.getEqualityExpressionRule() || action == grammarAccess.getEqualityExpressionAccess().getEqualityExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseANDExpressionRule() || action == grammarAccess.getBitwiseANDExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseXORExpressionRule() || action == grammarAccess.getBitwiseXORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getBitwiseORExpressionRule() || action == grammarAccess.getBitwiseORExpressionAccess().getBinaryBitwiseExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalANDExpressionRule() || action == grammarAccess.getLogicalANDExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getLogicalORExpressionRule() || action == grammarAccess.getLogicalORExpressionAccess().getBinaryLogicalExpressionLhsAction_1_0_0_0() || rule == grammarAccess.getConditionalExpressionRule() || action == grammarAccess.getConditionalExpressionAccess().getConditionalExpressionExpressionAction_1_0_0_0() || rule == grammarAccess.getAssignmentExpressionRule() || action == grammarAccess.getAssignmentExpressionAccess().getAssignmentExpressionLhsAction_4_1_0_0_0() || rule == grammarAccess.getExpressionRule() || action == grammarAccess.getExpressionAccess().getCommaExpressionExprsAction_1_0()) {
                    sequence_LeftHandSideExpression_MemberExpression(context, (TaggedTemplateString) semanticObject);
                    return;
                } else if (action == grammarAccess.getMemberExpressionAccess().getIndexedAccessExpressionTargetAction_1_3_3_0_0() || action == grammarAccess.getMemberExpressionAccess().getParameterizedPropertyAccessExpressionTargetAction_1_3_3_1_0() || action == grammarAccess.getMemberExpressionAccess().getTaggedTemplateStringTargetAction_1_3_3_2_0()) {
                    sequence_MemberExpression_IndexedAccessExpression_1_3_3_0_0_ParameterizedPropertyAccessExpression_1_3_3_1_0_TaggedTemplateString_1_3_3_2_0(context, (TaggedTemplateString) semanticObject);
                    return;
                } else if (action == grammarAccess.getMemberExpressionAccess().getIndexedAccessExpressionTargetAction_2_1_0_0() || action == grammarAccess.getMemberExpressionAccess().getParameterizedPropertyAccessExpressionTargetAction_2_1_1_0() || action == grammarAccess.getMemberExpressionAccess().getTaggedTemplateStringTargetAction_2_1_2_0()) {
                    sequence_MemberExpression_IndexedAccessExpression_2_1_0_0_ParameterizedPropertyAccessExpression_2_1_1_0_TaggedTemplateString_2_1_2_0(context, (TaggedTemplateString) semanticObject);
                    return;
                } else if (action == grammarAccess.getLeftHandSideExpressionAccess().getParameterizedCallExpressionTargetAction_1_0() || rule == grammarAccess.getMemberExpressionRule()) {
                    sequence_MemberExpression(context, (TaggedTemplateString) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.TEMPLATE_LITERAL:
                sequence_TemplateLiteral(context, (TemplateLiteral) semanticObject);
                return;
            case N4JSPackage.TEMPLATE_SEGMENT:
                if (rule == grammarAccess.getNoSubstitutionTemplateRule()) {
                    sequence_NoSubstitutionTemplate(context, (TemplateSegment) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTemplateHeadRule()) {
                    sequence_TemplateHead(context, (TemplateSegment) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTemplateMiddleRule()) {
                    sequence_TemplateMiddle(context, (TemplateSegment) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTemplateTailRule()) {
                    sequence_TemplateTail(context, (TemplateSegment) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.THIS_LITERAL:
                sequence_ThisLiteral(context, (ThisLiteral) semanticObject);
                return;
            case N4JSPackage.THROW_STATEMENT:
                sequence_ThrowStatement(context, (ThrowStatement) semanticObject);
                return;
            case N4JSPackage.TRY_STATEMENT:
                sequence_TryStatement(context, (TryStatement) semanticObject);
                return;
            case N4JSPackage.TYPE_REF_ANNOTATION_ARGUMENT:
                sequence_TypeRefAnnotationArgument(context, (TypeRefAnnotationArgument) semanticObject);
                return;
            case N4JSPackage.UNARY_EXPRESSION:
                sequence_UnaryExpression(context, (UnaryExpression) semanticObject);
                return;
            case N4JSPackage.VARIABLE_BINDING:
                if (rule == grammarAccess.getVariableDeclarationOrBindingRule() && (ImmutableSet.of(grammarAccess.getVariableDeclarationOrBindingRule().getParameters().get(0), grammarAccess.getVariableDeclarationOrBindingRule().getParameters().get(1)).equals(parameters) || ImmutableSet.of(grammarAccess.getVariableDeclarationOrBindingRule().getParameters().get(0)).equals(parameters) || ImmutableSet.of(grammarAccess.getVariableDeclarationOrBindingRule().getParameters().get(1)).equals(parameters) || parameters.isEmpty()) || rule == grammarAccess.getVariableBindingRule() && (ImmutableSet.of(grammarAccess.getVariableBindingRule().getParameters().get(0), grammarAccess.getVariableBindingRule().getParameters().get(1)).equals(parameters) || ImmutableSet.of(grammarAccess.getVariableBindingRule().getParameters().get(0)).equals(parameters) || ImmutableSet.of(grammarAccess.getVariableBindingRule().getParameters().get(1)).equals(parameters) || parameters.isEmpty())) {
                    sequence_VariableBinding$OptionalInit$false$(context, (VariableBinding) semanticObject);
                    return;
                } else if (rule == grammarAccess.getVariableDeclarationOrBindingRule() && (ImmutableSet.of(grammarAccess.getVariableDeclarationOrBindingRule().getParameters().get(0), grammarAccess.getVariableDeclarationOrBindingRule().getParameters().get(1), grammarAccess.getVariableDeclarationOrBindingRule().getParameters().get(2)).equals(parameters) || ImmutableSet.of(grammarAccess.getVariableDeclarationOrBindingRule().getParameters().get(0), grammarAccess.getVariableDeclarationOrBindingRule().getParameters().get(2)).equals(parameters) || ImmutableSet.of(grammarAccess.getVariableDeclarationOrBindingRule().getParameters().get(1), grammarAccess.getVariableDeclarationOrBindingRule().getParameters().get(2)).equals(parameters) || ImmutableSet.of(grammarAccess.getVariableDeclarationOrBindingRule().getParameters().get(2)).equals(parameters)) || rule == grammarAccess.getVariableBindingRule() && (ImmutableSet.of(grammarAccess.getVariableBindingRule().getParameters().get(0), grammarAccess.getVariableBindingRule().getParameters().get(1), grammarAccess.getVariableBindingRule().getParameters().get(2)).equals(parameters) || ImmutableSet.of(grammarAccess.getVariableBindingRule().getParameters().get(0), grammarAccess.getVariableBindingRule().getParameters().get(2)).equals(parameters) || ImmutableSet.of(grammarAccess.getVariableBindingRule().getParameters().get(1), grammarAccess.getVariableBindingRule().getParameters().get(2)).equals(parameters) || ImmutableSet.of(grammarAccess.getVariableBindingRule().getParameters().get(2)).equals(parameters))) {
                    sequence_VariableBinding(context, (VariableBinding) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.VARIABLE_DECLARATION:
                if (rule == grammarAccess.getBindingIdentifierAsVariableDeclarationRule()) {
                    sequence_BindingIdentifierAsVariableDeclaration(context, (VariableDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getVariableDeclarationOrBindingRule() || rule == grammarAccess.getVariableDeclarationRule() && (ImmutableSet.of(grammarAccess.getVariableDeclarationRule().getParameters().get(0), grammarAccess.getVariableDeclarationRule().getParameters().get(1), grammarAccess.getVariableDeclarationRule().getParameters().get(2)).equals(parameters) || ImmutableSet.of(grammarAccess.getVariableDeclarationRule().getParameters().get(0), grammarAccess.getVariableDeclarationRule().getParameters().get(2)).equals(parameters) || ImmutableSet.of(grammarAccess.getVariableDeclarationRule().getParameters().get(1), grammarAccess.getVariableDeclarationRule().getParameters().get(2)).equals(parameters) || ImmutableSet.of(grammarAccess.getVariableDeclarationRule().getParameters().get(2)).equals(parameters))) {
                    sequence_ColonSepDeclaredTypeRef_VariableDeclaration_VariableDeclarationImpl(context, (VariableDeclaration) semanticObject);
                    return;
                } else if (rule == grammarAccess.getVariableDeclarationRule() && (ImmutableSet.of(grammarAccess.getVariableDeclarationRule().getParameters().get(0), grammarAccess.getVariableDeclarationRule().getParameters().get(1)).equals(parameters) || ImmutableSet.of(grammarAccess.getVariableDeclarationRule().getParameters().get(0)).equals(parameters) || ImmutableSet.of(grammarAccess.getVariableDeclarationRule().getParameters().get(1)).equals(parameters) || parameters.isEmpty())) {
                    sequence_VariableDeclaration$AllowType$false$_VariableDeclarationImpl(context, (VariableDeclaration) semanticObject);
                    return;
                } else
                    break;
            case N4JSPackage.VARIABLE_STATEMENT:
                sequence_VariableStatement(context, (VariableStatement) semanticObject);
                return;
            case N4JSPackage.VERSIONED_IDENTIFIER_REF:
                sequence_IdentifierRef_VersionRequest(context, (VersionedIdentifierRef) semanticObject);
                return;
            case N4JSPackage.WHILE_STATEMENT:
                sequence_WhileStatement(context, (WhileStatement) semanticObject);
                return;
            case N4JSPackage.WITH_STATEMENT:
                sequence_WithStatement(context, (WithStatement) semanticObject);
                return;
            case N4JSPackage.YIELD_EXPRESSION:
                sequence_YieldExpression(context, (YieldExpression) semanticObject);
                return;
        }
    else if (epackage == TypeRefsPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case TypeRefsPackage.FUNCTION_TYPE_EXPRESSION:
                if (rule == grammarAccess.getTypeRefForCastRule()) {
                    sequence_ArrowFunctionTypeExpression_ColonSepReturnTypeRef_FunctionTypeExpressionOLD_TAnonymousFormalParameterList(context, (FunctionTypeExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefRule() || action == grammarAccess.getTypeRefAccess().getUnionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getIntersectionTypeExpressionRule() || action == grammarAccess.getIntersectionTypeExpressionAccess().getIntersectionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getPrimaryTypeExpressionRule() || rule == grammarAccess.getTypeArgumentRule()) {
                    sequence_ArrowFunctionTypeExpression_ColonSepReturnTypeRef_FunctionTypeExpressionOLD_TAnonymousFormalParameterList_TypeRefWithModifiers(context, (FunctionTypeExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getArrowFunctionTypeExpressionRule()) {
                    sequence_ArrowFunctionTypeExpression_TAnonymousFormalParameterList(context, (FunctionTypeExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefWithoutModifiersRule() || rule == grammarAccess.getFunctionTypeExpressionOLDRule()) {
                    sequence_ColonSepReturnTypeRef_FunctionTypeExpressionOLD_TAnonymousFormalParameterList(context, (FunctionTypeExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefWithModifiersRule()) {
                    sequence_ColonSepReturnTypeRef_FunctionTypeExpressionOLD_TAnonymousFormalParameterList_TypeRefWithModifiers(context, (FunctionTypeExpression) semanticObject);
                    return;
                } else
                    break;
            case TypeRefsPackage.INTERSECTION_TYPE_EXPRESSION:
                if (rule == grammarAccess.getTypeRefForCastRule() || rule == grammarAccess.getTypeRefWithoutModifiersRule() || rule == grammarAccess.getTypeRefFunctionTypeExpressionRule() || rule == grammarAccess.getIntersectionTypeExpressionOLDRule()) {
                    sequence_IntersectionTypeExpressionOLD(context, (IntersectionTypeExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefWithModifiersRule()) {
                    sequence_IntersectionTypeExpressionOLD_TypeRefWithModifiers(context, (IntersectionTypeExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefRule() || action == grammarAccess.getTypeRefAccess().getUnionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getIntersectionTypeExpressionRule() || action == grammarAccess.getIntersectionTypeExpressionAccess().getIntersectionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getPrimaryTypeExpressionRule() || rule == grammarAccess.getTypeArgumentRule()) {
                    sequence_IntersectionTypeExpression_IntersectionTypeExpressionOLD_TypeRefWithModifiers(context, (IntersectionTypeExpression) semanticObject);
                    return;
                } else
                    break;
            case TypeRefsPackage.PARAMETERIZED_TYPE_REF:
                if (rule == grammarAccess.getArrayTypeRefRule()) {
                    sequence_ArrayTypeRef(context, (ParameterizedTypeRef) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefForCastRule() || rule == grammarAccess.getTypeRefFunctionTypeExpressionRule()) {
                    sequence_ArrayTypeRef_TypeAndTypeArguments_TypeArguments(context, (ParameterizedTypeRef) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefRule() || action == grammarAccess.getTypeRefAccess().getUnionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getIntersectionTypeExpressionRule() || action == grammarAccess.getIntersectionTypeExpressionAccess().getIntersectionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getPrimaryTypeExpressionRule() || rule == grammarAccess.getTypeArgumentRule()) {
                    sequence_ArrayTypeRef_TypeAndTypeArguments_TypeArguments_TypeRefWithModifiers_TypeRefWithoutModifiers(context, (ParameterizedTypeRef) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeArgInTypeTypeRefRule() || rule == grammarAccess.getParameterizedTypeRefRule() || rule == grammarAccess.getParameterizedTypeRefNominalRule() || rule == grammarAccess.getTypeAndTypeArgumentsRule()) {
                    sequence_TypeAndTypeArguments_TypeArguments(context, (ParameterizedTypeRef) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefWithModifiersRule()) {
                    sequence_TypeAndTypeArguments_TypeArguments_TypeRefWithModifiers_TypeRefWithoutModifiers(context, (ParameterizedTypeRef) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefWithoutModifiersRule()) {
                    sequence_TypeAndTypeArguments_TypeArguments_TypeRefWithoutModifiers(context, (ParameterizedTypeRef) semanticObject);
                    return;
                } else
                    break;
            case TypeRefsPackage.PARAMETERIZED_TYPE_REF_STRUCTURAL:
                if (rule == grammarAccess.getTypeRefForCastRule() || rule == grammarAccess.getTypeRefFunctionTypeExpressionRule() || rule == grammarAccess.getParameterizedTypeRefRule() || rule == grammarAccess.getParameterizedTypeRefStructuralRule()) {
                    sequence_ParameterizedTypeRefStructural_TStructMemberList_TypeArguments(context, (ParameterizedTypeRefStructural) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefRule() || action == grammarAccess.getTypeRefAccess().getUnionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getIntersectionTypeExpressionRule() || action == grammarAccess.getIntersectionTypeExpressionAccess().getIntersectionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getPrimaryTypeExpressionRule() || rule == grammarAccess.getTypeRefWithModifiersRule() || rule == grammarAccess.getTypeArgumentRule()) {
                    sequence_ParameterizedTypeRefStructural_TStructMemberList_TypeArguments_TypeRefWithModifiers_TypeRefWithoutModifiers(context, (ParameterizedTypeRefStructural) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefWithoutModifiersRule()) {
                    sequence_ParameterizedTypeRefStructural_TStructMemberList_TypeArguments_TypeRefWithoutModifiers(context, (ParameterizedTypeRefStructural) semanticObject);
                    return;
                } else
                    break;
            case TypeRefsPackage.THIS_TYPE_REF_NOMINAL:
                if (rule == grammarAccess.getTypeRefForCastRule() || rule == grammarAccess.getTypeArgInTypeTypeRefRule() || rule == grammarAccess.getThisTypeRefRule() || rule == grammarAccess.getThisTypeRefNominalRule()) {
                    sequence_ThisTypeRefNominal(context, (ThisTypeRefNominal) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefRule() || action == grammarAccess.getTypeRefAccess().getUnionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getIntersectionTypeExpressionRule() || action == grammarAccess.getIntersectionTypeExpressionAccess().getIntersectionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getPrimaryTypeExpressionRule() || rule == grammarAccess.getTypeRefWithModifiersRule() || rule == grammarAccess.getTypeArgumentRule()) {
                    sequence_ThisTypeRefNominal_TypeRefWithModifiers_TypeRefWithoutModifiers(context, (ThisTypeRefNominal) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefWithoutModifiersRule()) {
                    sequence_ThisTypeRefNominal_TypeRefWithoutModifiers(context, (ThisTypeRefNominal) semanticObject);
                    return;
                } else
                    break;
            case TypeRefsPackage.THIS_TYPE_REF_STRUCTURAL:
                if (rule == grammarAccess.getTypeRefForCastRule() || rule == grammarAccess.getThisTypeRefRule() || rule == grammarAccess.getThisTypeRefStructuralRule()) {
                    sequence_TStructMemberList_ThisTypeRefStructural(context, (ThisTypeRefStructural) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefRule() || action == grammarAccess.getTypeRefAccess().getUnionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getIntersectionTypeExpressionRule() || action == grammarAccess.getIntersectionTypeExpressionAccess().getIntersectionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getPrimaryTypeExpressionRule() || rule == grammarAccess.getTypeRefWithModifiersRule() || rule == grammarAccess.getTypeArgumentRule()) {
                    sequence_TStructMemberList_ThisTypeRefStructural_TypeRefWithModifiers_TypeRefWithoutModifiers(context, (ThisTypeRefStructural) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefWithoutModifiersRule()) {
                    sequence_TStructMemberList_ThisTypeRefStructural_TypeRefWithoutModifiers(context, (ThisTypeRefStructural) semanticObject);
                    return;
                } else
                    break;
            case TypeRefsPackage.TYPE_TYPE_REF:
                if (rule == grammarAccess.getTypeRefRule() || action == grammarAccess.getTypeRefAccess().getUnionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getIntersectionTypeExpressionRule() || action == grammarAccess.getIntersectionTypeExpressionAccess().getIntersectionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getPrimaryTypeExpressionRule() || rule == grammarAccess.getTypeRefWithModifiersRule() || rule == grammarAccess.getTypeArgumentRule()) {
                    sequence_TypeRefWithModifiers_TypeTypeRef(context, (TypeTypeRef) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefForCastRule() || rule == grammarAccess.getTypeRefWithoutModifiersRule() || rule == grammarAccess.getTypeRefFunctionTypeExpressionRule() || rule == grammarAccess.getTypeTypeRefRule()) {
                    sequence_TypeTypeRef(context, (TypeTypeRef) semanticObject);
                    return;
                } else
                    break;
            case TypeRefsPackage.UNION_TYPE_EXPRESSION:
                if (rule == grammarAccess.getTypeRefWithModifiersRule()) {
                    sequence_TypeRefWithModifiers_UnionTypeExpressionOLD(context, (UnionTypeExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefRule() || action == grammarAccess.getTypeRefAccess().getUnionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getIntersectionTypeExpressionRule() || action == grammarAccess.getIntersectionTypeExpressionAccess().getIntersectionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getPrimaryTypeExpressionRule() || rule == grammarAccess.getTypeArgumentRule()) {
                    sequence_TypeRef_TypeRefWithModifiers_UnionTypeExpressionOLD(context, (UnionTypeExpression) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefForCastRule() || rule == grammarAccess.getTypeRefWithoutModifiersRule() || rule == grammarAccess.getTypeRefFunctionTypeExpressionRule() || rule == grammarAccess.getUnionTypeExpressionOLDRule()) {
                    sequence_UnionTypeExpressionOLD(context, (UnionTypeExpression) semanticObject);
                    return;
                } else
                    break;
            case TypeRefsPackage.VERSIONED_PARAMETERIZED_TYPE_REF:
                if (rule == grammarAccess.getTypeRefRule() || action == grammarAccess.getTypeRefAccess().getUnionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getIntersectionTypeExpressionRule() || action == grammarAccess.getIntersectionTypeExpressionAccess().getIntersectionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getPrimaryTypeExpressionRule() || rule == grammarAccess.getTypeRefWithModifiersRule() || rule == grammarAccess.getTypeArgumentRule()) {
                    sequence_TypeAndTypeArguments_TypeArguments_TypeRefWithModifiers_TypeRefWithoutModifiers_VersionRequest(context, (VersionedParameterizedTypeRef) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefWithoutModifiersRule()) {
                    sequence_TypeAndTypeArguments_TypeArguments_TypeRefWithoutModifiers_VersionRequest(context, (VersionedParameterizedTypeRef) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefForCastRule() || rule == grammarAccess.getTypeRefFunctionTypeExpressionRule() || rule == grammarAccess.getTypeArgInTypeTypeRefRule() || rule == grammarAccess.getParameterizedTypeRefRule() || rule == grammarAccess.getParameterizedTypeRefNominalRule() || rule == grammarAccess.getTypeAndTypeArgumentsRule()) {
                    sequence_TypeAndTypeArguments_TypeArguments_VersionRequest(context, (VersionedParameterizedTypeRef) semanticObject);
                    return;
                } else
                    break;
            case TypeRefsPackage.VERSIONED_PARAMETERIZED_TYPE_REF_STRUCTURAL:
                if (rule == grammarAccess.getTypeRefRule() || action == grammarAccess.getTypeRefAccess().getUnionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getIntersectionTypeExpressionRule() || action == grammarAccess.getIntersectionTypeExpressionAccess().getIntersectionTypeExpressionTypeRefsAction_1_0() || rule == grammarAccess.getPrimaryTypeExpressionRule() || rule == grammarAccess.getTypeRefWithModifiersRule() || rule == grammarAccess.getTypeArgumentRule()) {
                    sequence_ParameterizedTypeRefStructural_TStructMemberList_TypeArguments_TypeRefWithModifiers_TypeRefWithoutModifiers_VersionRequest(context, (VersionedParameterizedTypeRefStructural) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefWithoutModifiersRule()) {
                    sequence_ParameterizedTypeRefStructural_TStructMemberList_TypeArguments_TypeRefWithoutModifiers_VersionRequest(context, (VersionedParameterizedTypeRefStructural) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeRefForCastRule() || rule == grammarAccess.getTypeRefFunctionTypeExpressionRule() || rule == grammarAccess.getParameterizedTypeRefRule() || rule == grammarAccess.getParameterizedTypeRefStructuralRule()) {
                    sequence_ParameterizedTypeRefStructural_TStructMemberList_TypeArguments_VersionRequest(context, (VersionedParameterizedTypeRefStructural) semanticObject);
                    return;
                } else
                    break;
            case TypeRefsPackage.WILDCARD:
                if (rule == grammarAccess.getWildcardNewNotationRule()) {
                    sequence_WildcardNewNotation(context, (Wildcard) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeArgInTypeTypeRefRule() || rule == grammarAccess.getWildcardRule()) {
                    sequence_Wildcard(context, (Wildcard) semanticObject);
                    return;
                } else if (rule == grammarAccess.getTypeArgumentRule()) {
                    sequence_Wildcard_WildcardNewNotation(context, (Wildcard) semanticObject);
                    return;
                } else
                    break;
        }
    else if (epackage == TypesPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case TypesPackage.TANONYMOUS_FORMAL_PARAMETER:
                sequence_ColonSepTypeRef_DefaultFormalParameter_TAnonymousFormalParameter(context, (TAnonymousFormalParameter) semanticObject);
                return;
            case TypesPackage.TFORMAL_PARAMETER:
                sequence_ColonSepTypeRef_DefaultFormalParameter_TFormalParameter(context, (TFormalParameter) semanticObject);
                return;
            case TypesPackage.TSTRUCT_FIELD:
                sequence_ColonSepTypeRef_TStructField(context, (TStructField) semanticObject);
                return;
            case TypesPackage.TSTRUCT_GETTER:
                sequence_ColonSepDeclaredTypeRef_TStructGetter(context, (TStructGetter) semanticObject);
                return;
            case TypesPackage.TSTRUCT_METHOD:
                sequence_ColonSepReturnTypeRef_TAnonymousFormalParameterList_TStructMethod_TypeVariables(context, (TStructMethod) semanticObject);
                return;
            case TypesPackage.TSTRUCT_SETTER:
                sequence_TStructSetter(context, (TStructSetter) semanticObject);
                return;
            case TypesPackage.TYPE_VARIABLE:
                sequence_TypeVariable(context, (TypeVariable) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : BindingElement(org.eclipse.n4js.n4JS.BindingElement) LabelledStatement(org.eclipse.n4js.n4JS.LabelledStatement) N4GetterDeclaration(org.eclipse.n4js.n4JS.N4GetterDeclaration) EmptyStatement(org.eclipse.n4js.n4JS.EmptyStatement) N4SetterDeclaration(org.eclipse.n4js.n4JS.N4SetterDeclaration) TFormalParameter(org.eclipse.n4js.ts.types.TFormalParameter) TStructField(org.eclipse.n4js.ts.types.TStructField) IfStatement(org.eclipse.n4js.n4JS.IfStatement) DefaultClause(org.eclipse.n4js.n4JS.DefaultClause) TryStatement(org.eclipse.n4js.n4JS.TryStatement) Wildcard(org.eclipse.n4js.ts.typeRefs.Wildcard) TypeVariable(org.eclipse.n4js.ts.types.TypeVariable) ThisTypeRefStructural(org.eclipse.n4js.ts.typeRefs.ThisTypeRefStructural) ReturnStatement(org.eclipse.n4js.n4JS.ReturnStatement) MultiplicativeExpression(org.eclipse.n4js.n4JS.MultiplicativeExpression) VersionedParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.VersionedParameterizedTypeRef) JSXElement(org.eclipse.n4js.n4JS.JSXElement) AdditiveExpression(org.eclipse.n4js.n4JS.AdditiveExpression) RelationalExpression(org.eclipse.n4js.n4JS.RelationalExpression) ThisLiteral(org.eclipse.n4js.n4JS.ThisLiteral) FunctionTypeExpression(org.eclipse.n4js.ts.typeRefs.FunctionTypeExpression) ExportedVariableBinding(org.eclipse.n4js.n4JS.ExportedVariableBinding) NewExpression(org.eclipse.n4js.n4JS.NewExpression) ParameterizedCallExpression(org.eclipse.n4js.n4JS.ParameterizedCallExpression) VersionedParameterizedTypeRefStructural(org.eclipse.n4js.ts.typeRefs.VersionedParameterizedTypeRefStructural) TStructSetter(org.eclipse.n4js.ts.types.TStructSetter) ArrayLiteral(org.eclipse.n4js.n4JS.ArrayLiteral) WithStatement(org.eclipse.n4js.n4JS.WithStatement) TStructGetter(org.eclipse.n4js.ts.types.TStructGetter) StringLiteral(org.eclipse.n4js.n4JS.StringLiteral) CatchBlock(org.eclipse.n4js.n4JS.CatchBlock) ParenExpression(org.eclipse.n4js.n4JS.ParenExpression) DoubleLiteral(org.eclipse.n4js.n4JS.DoubleLiteral) NullLiteral(org.eclipse.n4js.n4JS.NullLiteral) PropertySetterDeclaration(org.eclipse.n4js.n4JS.PropertySetterDeclaration) TemplateSegment(org.eclipse.n4js.n4JS.TemplateSegment) ExportedVariableDeclaration(org.eclipse.n4js.n4JS.ExportedVariableDeclaration) ArrayBindingPattern(org.eclipse.n4js.n4JS.ArrayBindingPattern) CaseClause(org.eclipse.n4js.n4JS.CaseClause) ExportSpecifier(org.eclipse.n4js.n4JS.ExportSpecifier) PromisifyExpression(org.eclipse.n4js.n4JS.PromisifyExpression) SuperLiteral(org.eclipse.n4js.n4JS.SuperLiteral) WhileStatement(org.eclipse.n4js.n4JS.WhileStatement) N4ClassDeclaration(org.eclipse.n4js.n4JS.N4ClassDeclaration) TStructMethod(org.eclipse.n4js.ts.types.TStructMethod) CommaExpression(org.eclipse.n4js.n4JS.CommaExpression) OctalIntLiteral(org.eclipse.n4js.n4JS.OctalIntLiteral) LegacyOctalIntLiteral(org.eclipse.n4js.n4JS.LegacyOctalIntLiteral) PropertyMethodDeclaration(org.eclipse.n4js.n4JS.PropertyMethodDeclaration) ForStatement(org.eclipse.n4js.n4JS.ForStatement) ContinueStatement(org.eclipse.n4js.n4JS.ContinueStatement) N4FieldDeclaration(org.eclipse.n4js.n4JS.N4FieldDeclaration) JSXPropertyAttribute(org.eclipse.n4js.n4JS.JSXPropertyAttribute) Annotation(org.eclipse.n4js.n4JS.Annotation) BreakStatement(org.eclipse.n4js.n4JS.BreakStatement) PropertyAssignmentAnnotationList(org.eclipse.n4js.n4JS.PropertyAssignmentAnnotationList) VariableStatement(org.eclipse.n4js.n4JS.VariableStatement) ExportedVariableStatement(org.eclipse.n4js.n4JS.ExportedVariableStatement) DefaultImportSpecifier(org.eclipse.n4js.n4JS.DefaultImportSpecifier) ImportDeclaration(org.eclipse.n4js.n4JS.ImportDeclaration) TFormalParameter(org.eclipse.n4js.ts.types.TFormalParameter) FormalParameter(org.eclipse.n4js.n4JS.FormalParameter) TAnonymousFormalParameter(org.eclipse.n4js.ts.types.TAnonymousFormalParameter) Parameter(org.eclipse.xtext.Parameter) ExportedVariableStatement(org.eclipse.n4js.n4JS.ExportedVariableStatement) VariableBinding(org.eclipse.n4js.n4JS.VariableBinding) ExportedVariableBinding(org.eclipse.n4js.n4JS.ExportedVariableBinding) DebuggerStatement(org.eclipse.n4js.n4JS.DebuggerStatement) ParameterizedPropertyAccessExpression(org.eclipse.n4js.n4JS.ParameterizedPropertyAccessExpression) ParserRule(org.eclipse.xtext.ParserRule) RegularExpressionLiteral(org.eclipse.n4js.n4JS.RegularExpressionLiteral) HexIntLiteral(org.eclipse.n4js.n4JS.HexIntLiteral) PropertyNameValuePair(org.eclipse.n4js.n4JS.PropertyNameValuePair) ExpressionAnnotationList(org.eclipse.n4js.n4JS.ExpressionAnnotationList) EPackage(org.eclipse.emf.ecore.EPackage) SwitchStatement(org.eclipse.n4js.n4JS.SwitchStatement) LegacyOctalIntLiteral(org.eclipse.n4js.n4JS.LegacyOctalIntLiteral) IntLiteral(org.eclipse.n4js.n4JS.IntLiteral) OctalIntLiteral(org.eclipse.n4js.n4JS.OctalIntLiteral) HexIntLiteral(org.eclipse.n4js.n4JS.HexIntLiteral) ScientificIntLiteral(org.eclipse.n4js.n4JS.ScientificIntLiteral) LegacyOctalIntLiteral(org.eclipse.n4js.n4JS.LegacyOctalIntLiteral) BinaryIntLiteral(org.eclipse.n4js.n4JS.BinaryIntLiteral) LiteralOrComputedPropertyName(org.eclipse.n4js.n4JS.LiteralOrComputedPropertyName) N4EnumLiteral(org.eclipse.n4js.n4JS.N4EnumLiteral) EqualityExpression(org.eclipse.n4js.n4JS.EqualityExpression) ArrayElement(org.eclipse.n4js.n4JS.ArrayElement) BindingProperty(org.eclipse.n4js.n4JS.BindingProperty) VersionedIdentifierRef(org.eclipse.n4js.n4JS.VersionedIdentifierRef) IdentifierRef(org.eclipse.n4js.n4JS.IdentifierRef) IndexedAccessExpression(org.eclipse.n4js.n4JS.IndexedAccessExpression) Script(org.eclipse.n4js.n4JS.Script) NamedImportSpecifier(org.eclipse.n4js.n4JS.NamedImportSpecifier) VersionedParameterizedTypeRefStructural(org.eclipse.n4js.ts.typeRefs.VersionedParameterizedTypeRefStructural) ParameterizedTypeRefStructural(org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRefStructural) FinallyBlock(org.eclipse.n4js.n4JS.FinallyBlock) ConditionalExpression(org.eclipse.n4js.n4JS.ConditionalExpression) NewTarget(org.eclipse.n4js.n4JS.NewTarget) ShiftExpression(org.eclipse.n4js.n4JS.ShiftExpression) ExportDeclaration(org.eclipse.n4js.n4JS.ExportDeclaration) TypeRefAnnotationArgument(org.eclipse.n4js.n4JS.TypeRefAnnotationArgument) ScientificIntLiteral(org.eclipse.n4js.n4JS.ScientificIntLiteral) ParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef) VersionedParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.VersionedParameterizedTypeRef) TAnonymousFormalParameter(org.eclipse.n4js.ts.types.TAnonymousFormalParameter) BinaryBitwiseExpression(org.eclipse.n4js.n4JS.BinaryBitwiseExpression) ArrayPadding(org.eclipse.n4js.n4JS.ArrayPadding) JSXSpreadAttribute(org.eclipse.n4js.n4JS.JSXSpreadAttribute) N4MethodDeclaration(org.eclipse.n4js.n4JS.N4MethodDeclaration) PropertyGetterDeclaration(org.eclipse.n4js.n4JS.PropertyGetterDeclaration) CatchBlock(org.eclipse.n4js.n4JS.CatchBlock) Block(org.eclipse.n4js.n4JS.Block) FinallyBlock(org.eclipse.n4js.n4JS.FinallyBlock) ObjectBindingPattern(org.eclipse.n4js.n4JS.ObjectBindingPattern) IntersectionTypeExpression(org.eclipse.n4js.ts.typeRefs.IntersectionTypeExpression) PostfixExpression(org.eclipse.n4js.n4JS.PostfixExpression) CastExpression(org.eclipse.n4js.n4JS.CastExpression) N4InterfaceDeclaration(org.eclipse.n4js.n4JS.N4InterfaceDeclaration) Action(org.eclipse.xtext.Action) JSXElementName(org.eclipse.n4js.n4JS.JSXElementName) Argument(org.eclipse.n4js.n4JS.Argument) LiteralAnnotationArgument(org.eclipse.n4js.n4JS.LiteralAnnotationArgument) TypeRefAnnotationArgument(org.eclipse.n4js.n4JS.TypeRefAnnotationArgument) DoStatement(org.eclipse.n4js.n4JS.DoStatement) JSXExpression(org.eclipse.n4js.n4JS.JSXExpression) BooleanLiteral(org.eclipse.n4js.n4JS.BooleanLiteral) VersionedIdentifierRef(org.eclipse.n4js.n4JS.VersionedIdentifierRef) PropertyNameValuePairSingleName(org.eclipse.n4js.n4JS.PropertyNameValuePairSingleName) UnaryExpression(org.eclipse.n4js.n4JS.UnaryExpression) AwaitExpression(org.eclipse.n4js.n4JS.AwaitExpression) FunctionDeclaration(org.eclipse.n4js.n4JS.FunctionDeclaration) LiteralAnnotationArgument(org.eclipse.n4js.n4JS.LiteralAnnotationArgument) BinaryLogicalExpression(org.eclipse.n4js.n4JS.BinaryLogicalExpression) FunctionExpression(org.eclipse.n4js.n4JS.FunctionExpression) AssignmentExpression(org.eclipse.n4js.n4JS.AssignmentExpression) TypeTypeRef(org.eclipse.n4js.ts.typeRefs.TypeTypeRef) VariableDeclaration(org.eclipse.n4js.n4JS.VariableDeclaration) ExportedVariableDeclaration(org.eclipse.n4js.n4JS.ExportedVariableDeclaration) ThrowStatement(org.eclipse.n4js.n4JS.ThrowStatement) TFormalParameter(org.eclipse.n4js.ts.types.TFormalParameter) FormalParameter(org.eclipse.n4js.n4JS.FormalParameter) TAnonymousFormalParameter(org.eclipse.n4js.ts.types.TAnonymousFormalParameter) ObjectLiteral(org.eclipse.n4js.n4JS.ObjectLiteral) YieldExpression(org.eclipse.n4js.n4JS.YieldExpression) NamespaceImportSpecifier(org.eclipse.n4js.n4JS.NamespaceImportSpecifier) ArrowFunction(org.eclipse.n4js.n4JS.ArrowFunction) UnionTypeExpression(org.eclipse.n4js.ts.typeRefs.UnionTypeExpression) N4EnumDeclaration(org.eclipse.n4js.n4JS.N4EnumDeclaration) ThisTypeRefNominal(org.eclipse.n4js.ts.typeRefs.ThisTypeRefNominal) N4MemberAnnotationList(org.eclipse.n4js.n4JS.N4MemberAnnotationList) AnnotationList(org.eclipse.n4js.n4JS.AnnotationList) ExpressionAnnotationList(org.eclipse.n4js.n4JS.ExpressionAnnotationList) N4MemberAnnotationList(org.eclipse.n4js.n4JS.N4MemberAnnotationList) PropertyAssignmentAnnotationList(org.eclipse.n4js.n4JS.PropertyAssignmentAnnotationList) ExpressionStatement(org.eclipse.n4js.n4JS.ExpressionStatement) N4ClassExpression(org.eclipse.n4js.n4JS.N4ClassExpression) TaggedTemplateString(org.eclipse.n4js.n4JS.TaggedTemplateString) TemplateLiteral(org.eclipse.n4js.n4JS.TemplateLiteral) CatchVariable(org.eclipse.n4js.n4JS.CatchVariable) BinaryIntLiteral(org.eclipse.n4js.n4JS.BinaryIntLiteral)

Example 3 with NewExpression

use of org.eclipse.n4js.n4JS.NewExpression in project n4js by eclipse.

the class InternalTypeSystem method applyRuleExpectedTypeOfArgument.

protected Result<TypeRef> applyRuleExpectedTypeOfArgument(final RuleEnvironment G, final RuleApplicationTrace _trace_, final Argument argument, final Expression argumentExpression) throws RuleFailedException {
    // output parameter
    TypeRef T = null;
    final EObject expr = argument.eContainer();
    if ((expr instanceof NewExpression)) {
        boolean _contains = ((NewExpression) expr).getArguments().contains(argument);
        boolean _not = (!_contains);
        if (_not) {
        } else {
            /* G |- expr.callee : var TypeTypeRef ctorTypeRef */
            Expression _callee = ((NewExpression) expr).getCallee();
            TypeTypeRef ctorTypeRef = null;
            Result<TypeRef> result = typeInternal(G, _trace_, _callee);
            checkAssignableTo(result.getFirst(), TypeTypeRef.class);
            ctorTypeRef = (TypeTypeRef) result.getFirst();
            TypeRef typeRefOfInstanceToCreate = this.typeSystemHelper.createTypeRefFromStaticType(G, ctorTypeRef, ((TypeArgument[]) Conversions.unwrapArray(((NewExpression) expr).getTypeArgs(), TypeArgument.class)));
            Type _declaredType = typeRefOfInstanceToCreate.getDeclaredType();
            ContainerType<?> typeOfInstanceToCreate = ((ContainerType<?>) _declaredType);
            final RuleEnvironment G2 = RuleEnvironmentExtensions.wrap(G);
            this.typeSystemHelper.addSubstitutions(G2, typeRefOfInstanceToCreate);
            RuleEnvironmentExtensions.addThisType(G2, typeRefOfInstanceToCreate);
            TMethod ctor = this.containerTypesHelper.fromContext(((NewExpression) expr).eResource()).findConstructor(typeOfInstanceToCreate);
            TFormalParameter _fparForArgIdx = null;
            if (ctor != null) {
                _fparForArgIdx = ctor.getFparForArgIdx(ECollections.indexOf(((NewExpression) expr).getArguments(), argument, 0));
            }
            final TFormalParameter fpar = _fparForArgIdx;
            if ((fpar == null)) {
                T = TypeRefsFactory.eINSTANCE.createUnknownTypeRef();
            } else {
                final TypeRef paramType = fpar.getTypeRef();
                if ((paramType == null)) {
                    T = RuleEnvironmentExtensions.anyTypeRef(G2);
                } else {
                    /* G2 |- paramType ~> T */
                    Result<TypeArgument> result_1 = substTypeVariablesInternal(G2, _trace_, paramType);
                    checkAssignableTo(result_1.getFirst(), TypeRef.class);
                    T = (TypeRef) result_1.getFirst();
                }
            }
        }
    } else {
        if ((expr instanceof ParameterizedCallExpression)) {
            boolean _contains_1 = ((ParameterizedCallExpression) expr).getArguments().contains(argument);
            /* expr.arguments.contains(argument) */
            if (!_contains_1) {
                sneakyThrowRuleFailedException("expr.arguments.contains(argument)");
            }
            /* G |- expr.target : var TypeRef targetTypeRef */
            Expression _target = ((ParameterizedCallExpression) expr).getTarget();
            TypeRef targetTypeRef = null;
            Result<TypeRef> result_2 = typeInternal(G, _trace_, _target);
            checkAssignableTo(result_2.getFirst(), TypeRef.class);
            targetTypeRef = (TypeRef) result_2.getFirst();
            if ((targetTypeRef instanceof FunctionTypeExprOrRef)) {
                final FunctionTypeExprOrRef F = ((FunctionTypeExprOrRef) targetTypeRef);
                final int argIndex = ECollections.indexOf(((ParameterizedCallExpression) expr).getArguments(), argument, 0);
                final TFormalParameter fpar_1 = F.getFparForArgIdx(argIndex);
                if ((fpar_1 == null)) {
                    T = TypeRefsFactory.eINSTANCE.createUnknownTypeRef();
                } else {
                    final TypeRef paramType_1 = fpar_1.getTypeRef();
                    if ((paramType_1 == null)) {
                        T = RuleEnvironmentExtensions.anyTypeRef(G);
                    } else {
                        final RuleEnvironment G2_1 = RuleEnvironmentExtensions.wrap(G);
                        this.typeSystemHelper.addSubstitutions(G2_1, ((ParameterizedCallExpression) expr), F);
                        Expression _target_1 = ((ParameterizedCallExpression) expr).getTarget();
                        if ((_target_1 instanceof SuperLiteral)) {
                            N4ClassDeclaration _containerOfType = EcoreUtil2.<N4ClassDeclaration>getContainerOfType(expr, N4ClassDeclaration.class);
                            Type _definedType = null;
                            if (_containerOfType != null) {
                                _definedType = _containerOfType.getDefinedType();
                            }
                            final Type containingClass = _definedType;
                            if ((containingClass instanceof TClass)) {
                                RuleEnvironmentExtensions.addThisType(G2_1, TypeExtensions.ref(containingClass));
                                ParameterizedTypeRef _superClassRef = ((TClass) containingClass).getSuperClassRef();
                                boolean _tripleNotEquals = (_superClassRef != null);
                                if (_tripleNotEquals) {
                                    this.typeSystemHelper.addSubstitutions(G2_1, ((TClass) containingClass).getSuperClassRef());
                                }
                                if ((paramType_1 instanceof ThisTypeRefStructural)) {
                                    RuleEnvironmentExtensions.addThisType(G2_1, ((TClass) containingClass).getSuperClassRef());
                                }
                            }
                        }
                        /* G2 |- paramType ~> T */
                        Result<TypeArgument> result_3 = substTypeVariablesInternal(G2_1, _trace_, paramType_1);
                        checkAssignableTo(result_3.getFirst(), TypeRef.class);
                        T = (TypeRef) result_3.getFirst();
                    }
                }
            } else {
                T = TypeRefsFactory.eINSTANCE.createUnknownTypeRef();
            }
        }
    }
    return new Result<TypeRef>(T);
}
Also used : TMethod(org.eclipse.n4js.ts.types.TMethod) ThisTypeRef(org.eclipse.n4js.ts.typeRefs.ThisTypeRef) ParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef) BaseTypeRef(org.eclipse.n4js.ts.typeRefs.BaseTypeRef) FunctionTypeRef(org.eclipse.n4js.ts.typeRefs.FunctionTypeRef) ExistentialTypeRef(org.eclipse.n4js.ts.typeRefs.ExistentialTypeRef) BoundThisTypeRef(org.eclipse.n4js.ts.typeRefs.BoundThisTypeRef) StructuralTypeRef(org.eclipse.n4js.ts.typeRefs.StructuralTypeRef) TypeRef(org.eclipse.n4js.ts.typeRefs.TypeRef) TypeTypeRef(org.eclipse.n4js.ts.typeRefs.TypeTypeRef) StaticBaseTypeRef(org.eclipse.n4js.ts.typeRefs.StaticBaseTypeRef) ComposedTypeRef(org.eclipse.n4js.ts.typeRefs.ComposedTypeRef) UnknownTypeRef(org.eclipse.n4js.ts.typeRefs.UnknownTypeRef) NewExpression(org.eclipse.n4js.n4JS.NewExpression) ParameterizedCallExpression(org.eclipse.n4js.n4JS.ParameterizedCallExpression) TypeArgument(org.eclipse.n4js.ts.typeRefs.TypeArgument) SuperLiteral(org.eclipse.n4js.n4JS.SuperLiteral) N4ClassDeclaration(org.eclipse.n4js.n4JS.N4ClassDeclaration) Result(org.eclipse.xsemantics.runtime.Result) StructuralTypingResult(org.eclipse.n4js.typesystem.StructuralTypingResult) TFormalParameter(org.eclipse.n4js.ts.types.TFormalParameter) ParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef) Type(org.eclipse.n4js.ts.types.Type) PrimitiveType(org.eclipse.n4js.ts.types.PrimitiveType) VoidType(org.eclipse.n4js.ts.types.VoidType) AnyType(org.eclipse.n4js.ts.types.AnyType) ModuleNamespaceVirtualType(org.eclipse.n4js.ts.types.ModuleNamespaceVirtualType) NullType(org.eclipse.n4js.ts.types.NullType) UndefinedType(org.eclipse.n4js.ts.types.UndefinedType) ContainerType(org.eclipse.n4js.ts.types.ContainerType) TStructuralType(org.eclipse.n4js.ts.types.TStructuralType) BinaryBitwiseExpression(org.eclipse.n4js.n4JS.BinaryBitwiseExpression) AssignmentExpression(org.eclipse.n4js.n4JS.AssignmentExpression) IndexedAccessExpression(org.eclipse.n4js.n4JS.IndexedAccessExpression) UnionTypeExpression(org.eclipse.n4js.ts.typeRefs.UnionTypeExpression) FunctionExpression(org.eclipse.n4js.n4JS.FunctionExpression) PromisifyExpression(org.eclipse.n4js.n4JS.PromisifyExpression) UnaryExpression(org.eclipse.n4js.n4JS.UnaryExpression) ParenExpression(org.eclipse.n4js.n4JS.ParenExpression) ParameterizedCallExpression(org.eclipse.n4js.n4JS.ParameterizedCallExpression) AdditiveExpression(org.eclipse.n4js.n4JS.AdditiveExpression) PostfixExpression(org.eclipse.n4js.n4JS.PostfixExpression) YieldExpression(org.eclipse.n4js.n4JS.YieldExpression) ConditionalExpression(org.eclipse.n4js.n4JS.ConditionalExpression) FunctionTypeExpression(org.eclipse.n4js.ts.typeRefs.FunctionTypeExpression) RelationalExpression(org.eclipse.n4js.n4JS.RelationalExpression) NewExpression(org.eclipse.n4js.n4JS.NewExpression) IntersectionTypeExpression(org.eclipse.n4js.ts.typeRefs.IntersectionTypeExpression) AwaitExpression(org.eclipse.n4js.n4JS.AwaitExpression) CommaExpression(org.eclipse.n4js.n4JS.CommaExpression) Expression(org.eclipse.n4js.n4JS.Expression) CastExpression(org.eclipse.n4js.n4JS.CastExpression) BinaryLogicalExpression(org.eclipse.n4js.n4JS.BinaryLogicalExpression) EqualityExpression(org.eclipse.n4js.n4JS.EqualityExpression) ShiftExpression(org.eclipse.n4js.n4JS.ShiftExpression) ParameterizedPropertyAccessExpression(org.eclipse.n4js.n4JS.ParameterizedPropertyAccessExpression) MultiplicativeExpression(org.eclipse.n4js.n4JS.MultiplicativeExpression) N4ClassExpression(org.eclipse.n4js.n4JS.N4ClassExpression) EObject(org.eclipse.emf.ecore.EObject) ThisTypeRefStructural(org.eclipse.n4js.ts.typeRefs.ThisTypeRefStructural) TypeTypeRef(org.eclipse.n4js.ts.typeRefs.TypeTypeRef) RuleEnvironment(org.eclipse.xsemantics.runtime.RuleEnvironment) FunctionTypeExprOrRef(org.eclipse.n4js.ts.typeRefs.FunctionTypeExprOrRef) TClass(org.eclipse.n4js.ts.types.TClass)

Example 4 with NewExpression

use of org.eclipse.n4js.n4JS.NewExpression in project n4js by eclipse.

the class InternalTypeSystem method applyRuleTypeNewExpression.

protected Result<TypeRef> applyRuleTypeNewExpression(final RuleEnvironment G, final RuleApplicationTrace _trace_, final NewExpression e) throws RuleFailedException {
    // output parameter
    TypeRef T = null;
    /* G |- e.callee: T */
    Expression _callee = e.getCallee();
    Result<TypeRef> result = typeInternal(G, _trace_, _callee);
    checkAssignableTo(result.getFirst(), TypeRef.class);
    T = (TypeRef) result.getFirst();
    if ((T instanceof TypeTypeRef)) {
        T = this.typeSystemHelper.createTypeRefFromStaticType(G, ((TypeTypeRef) T), ((TypeArgument[]) Conversions.unwrapArray(e.getTypeArgs(), TypeArgument.class)));
    }
    return new Result<TypeRef>(T);
}
Also used : BinaryBitwiseExpression(org.eclipse.n4js.n4JS.BinaryBitwiseExpression) AssignmentExpression(org.eclipse.n4js.n4JS.AssignmentExpression) IndexedAccessExpression(org.eclipse.n4js.n4JS.IndexedAccessExpression) UnionTypeExpression(org.eclipse.n4js.ts.typeRefs.UnionTypeExpression) FunctionExpression(org.eclipse.n4js.n4JS.FunctionExpression) PromisifyExpression(org.eclipse.n4js.n4JS.PromisifyExpression) UnaryExpression(org.eclipse.n4js.n4JS.UnaryExpression) ParenExpression(org.eclipse.n4js.n4JS.ParenExpression) ParameterizedCallExpression(org.eclipse.n4js.n4JS.ParameterizedCallExpression) AdditiveExpression(org.eclipse.n4js.n4JS.AdditiveExpression) PostfixExpression(org.eclipse.n4js.n4JS.PostfixExpression) YieldExpression(org.eclipse.n4js.n4JS.YieldExpression) ConditionalExpression(org.eclipse.n4js.n4JS.ConditionalExpression) FunctionTypeExpression(org.eclipse.n4js.ts.typeRefs.FunctionTypeExpression) RelationalExpression(org.eclipse.n4js.n4JS.RelationalExpression) NewExpression(org.eclipse.n4js.n4JS.NewExpression) IntersectionTypeExpression(org.eclipse.n4js.ts.typeRefs.IntersectionTypeExpression) AwaitExpression(org.eclipse.n4js.n4JS.AwaitExpression) CommaExpression(org.eclipse.n4js.n4JS.CommaExpression) Expression(org.eclipse.n4js.n4JS.Expression) CastExpression(org.eclipse.n4js.n4JS.CastExpression) BinaryLogicalExpression(org.eclipse.n4js.n4JS.BinaryLogicalExpression) EqualityExpression(org.eclipse.n4js.n4JS.EqualityExpression) ShiftExpression(org.eclipse.n4js.n4JS.ShiftExpression) ParameterizedPropertyAccessExpression(org.eclipse.n4js.n4JS.ParameterizedPropertyAccessExpression) MultiplicativeExpression(org.eclipse.n4js.n4JS.MultiplicativeExpression) N4ClassExpression(org.eclipse.n4js.n4JS.N4ClassExpression) ThisTypeRef(org.eclipse.n4js.ts.typeRefs.ThisTypeRef) ParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef) BaseTypeRef(org.eclipse.n4js.ts.typeRefs.BaseTypeRef) FunctionTypeRef(org.eclipse.n4js.ts.typeRefs.FunctionTypeRef) ExistentialTypeRef(org.eclipse.n4js.ts.typeRefs.ExistentialTypeRef) BoundThisTypeRef(org.eclipse.n4js.ts.typeRefs.BoundThisTypeRef) StructuralTypeRef(org.eclipse.n4js.ts.typeRefs.StructuralTypeRef) TypeRef(org.eclipse.n4js.ts.typeRefs.TypeRef) TypeTypeRef(org.eclipse.n4js.ts.typeRefs.TypeTypeRef) StaticBaseTypeRef(org.eclipse.n4js.ts.typeRefs.StaticBaseTypeRef) ComposedTypeRef(org.eclipse.n4js.ts.typeRefs.ComposedTypeRef) UnknownTypeRef(org.eclipse.n4js.ts.typeRefs.UnknownTypeRef) TypeTypeRef(org.eclipse.n4js.ts.typeRefs.TypeTypeRef) TypeArgument(org.eclipse.n4js.ts.typeRefs.TypeArgument) Result(org.eclipse.xsemantics.runtime.Result) StructuralTypingResult(org.eclipse.n4js.typesystem.StructuralTypingResult)

Aggregations

IndexedAccessExpression (org.eclipse.n4js.n4JS.IndexedAccessExpression)4 NewExpression (org.eclipse.n4js.n4JS.NewExpression)4 ParameterizedCallExpression (org.eclipse.n4js.n4JS.ParameterizedCallExpression)4 ParameterizedPropertyAccessExpression (org.eclipse.n4js.n4JS.ParameterizedPropertyAccessExpression)4 ParameterizedTypeRef (org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef)4 TypeTypeRef (org.eclipse.n4js.ts.typeRefs.TypeTypeRef)4 AdditiveExpression (org.eclipse.n4js.n4JS.AdditiveExpression)3 AssignmentExpression (org.eclipse.n4js.n4JS.AssignmentExpression)3 AwaitExpression (org.eclipse.n4js.n4JS.AwaitExpression)3 BinaryBitwiseExpression (org.eclipse.n4js.n4JS.BinaryBitwiseExpression)3 BinaryLogicalExpression (org.eclipse.n4js.n4JS.BinaryLogicalExpression)3 CastExpression (org.eclipse.n4js.n4JS.CastExpression)3 CommaExpression (org.eclipse.n4js.n4JS.CommaExpression)3 ConditionalExpression (org.eclipse.n4js.n4JS.ConditionalExpression)3 EqualityExpression (org.eclipse.n4js.n4JS.EqualityExpression)3 FunctionExpression (org.eclipse.n4js.n4JS.FunctionExpression)3 MultiplicativeExpression (org.eclipse.n4js.n4JS.MultiplicativeExpression)3 N4ClassExpression (org.eclipse.n4js.n4JS.N4ClassExpression)3 ParenExpression (org.eclipse.n4js.n4JS.ParenExpression)3 PostfixExpression (org.eclipse.n4js.n4JS.PostfixExpression)3