Search in sources :

Example 1 with ExportDeclaration

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

the class FunctionDeclarationImpl method getExportedName.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public String getExportedName() {
    boolean _isExported = this.isExported();
    if (_isExported) {
        EObject _eContainer = this.eContainer();
        final ExportDeclaration exportDecl = ((ExportDeclaration) _eContainer);
        boolean _isDefaultExport = exportDecl.isDefaultExport();
        if (_isDefaultExport) {
            return "default";
        }
        final ExportableElement me = this;
        String _switchResult = null;
        boolean _matched = false;
        if (me instanceof NamedElement) {
            _matched = true;
            _switchResult = ((NamedElement) me).getName();
        }
        if (!_matched) {
            if (me instanceof IdentifiableElement) {
                _matched = true;
                _switchResult = ((IdentifiableElement) me).getName();
            }
        }
        return _switchResult;
    }
    return null;
}
Also used : ExportableElement(org.eclipse.n4js.n4JS.ExportableElement) EObject(org.eclipse.emf.ecore.EObject) InternalEObject(org.eclipse.emf.ecore.InternalEObject) IdentifiableElement(org.eclipse.n4js.ts.types.IdentifiableElement) ExportDeclaration(org.eclipse.n4js.n4JS.ExportDeclaration) NamedElement(org.eclipse.n4js.n4JS.NamedElement)

Example 2 with ExportDeclaration

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

the class FunctionDeclarationImpl method isToplevel.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public boolean isToplevel() {
    EObject _eContainer = this.eContainer();
    if ((_eContainer instanceof ExportDeclaration)) {
        EObject _eContainer_1 = this.eContainer().eContainer();
        return (_eContainer_1 instanceof Script);
    }
    EObject _eContainer_2 = this.eContainer();
    return (_eContainer_2 instanceof Script);
}
Also used : Script(org.eclipse.n4js.n4JS.Script) EObject(org.eclipse.emf.ecore.EObject) InternalEObject(org.eclipse.emf.ecore.InternalEObject) ExportDeclaration(org.eclipse.n4js.n4JS.ExportDeclaration)

Example 3 with ExportDeclaration

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

the class ExportedVariableStatementImpl method getExportedName.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public String getExportedName() {
    boolean _isExported = this.isExported();
    if (_isExported) {
        EObject _eContainer = this.eContainer();
        final ExportDeclaration exportDecl = ((ExportDeclaration) _eContainer);
        boolean _isDefaultExport = exportDecl.isDefaultExport();
        if (_isDefaultExport) {
            return "default";
        }
        final ExportableElement me = this;
        String _switchResult = null;
        boolean _matched = false;
        if (me instanceof NamedElement) {
            _matched = true;
            _switchResult = ((NamedElement) me).getName();
        }
        if (!_matched) {
            if (me instanceof IdentifiableElement) {
                _matched = true;
                _switchResult = ((IdentifiableElement) me).getName();
            }
        }
        return _switchResult;
    }
    return null;
}
Also used : ExportableElement(org.eclipse.n4js.n4JS.ExportableElement) EObject(org.eclipse.emf.ecore.EObject) InternalEObject(org.eclipse.emf.ecore.InternalEObject) IdentifiableElement(org.eclipse.n4js.ts.types.IdentifiableElement) ExportDeclaration(org.eclipse.n4js.n4JS.ExportDeclaration) NamedElement(org.eclipse.n4js.n4JS.NamedElement)

Example 4 with ExportDeclaration

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

the class AnnotationListImpl method getExportedName.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public String getExportedName() {
    boolean _isExported = this.isExported();
    if (_isExported) {
        EObject _eContainer = this.eContainer();
        final ExportDeclaration exportDecl = ((ExportDeclaration) _eContainer);
        boolean _isDefaultExport = exportDecl.isDefaultExport();
        if (_isDefaultExport) {
            return "default";
        }
        final ExportableElement me = this;
        String _switchResult = null;
        boolean _matched = false;
        if (me instanceof NamedElement) {
            _matched = true;
            _switchResult = ((NamedElement) me).getName();
        }
        if (!_matched) {
            if (me instanceof IdentifiableElement) {
                _matched = true;
                _switchResult = ((IdentifiableElement) me).getName();
            }
        }
        return _switchResult;
    }
    return null;
}
Also used : ExportableElement(org.eclipse.n4js.n4JS.ExportableElement) EObject(org.eclipse.emf.ecore.EObject) IdentifiableElement(org.eclipse.n4js.ts.types.IdentifiableElement) ExportDeclaration(org.eclipse.n4js.n4JS.ExportDeclaration) NamedElement(org.eclipse.n4js.n4JS.NamedElement)

Example 5 with ExportDeclaration

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

the class AnnotationListImpl method isToplevel.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public boolean isToplevel() {
    EObject _eContainer = this.eContainer();
    if ((_eContainer instanceof ExportDeclaration)) {
        EObject _eContainer_1 = this.eContainer().eContainer();
        return (_eContainer_1 instanceof Script);
    }
    EObject _eContainer_2 = this.eContainer();
    return (_eContainer_2 instanceof Script);
}
Also used : Script(org.eclipse.n4js.n4JS.Script) EObject(org.eclipse.emf.ecore.EObject) ExportDeclaration(org.eclipse.n4js.n4JS.ExportDeclaration)

Aggregations

ExportDeclaration (org.eclipse.n4js.n4JS.ExportDeclaration)24 EObject (org.eclipse.emf.ecore.EObject)20 InternalEObject (org.eclipse.emf.ecore.InternalEObject)13 ExportableElement (org.eclipse.n4js.n4JS.ExportableElement)8 Script (org.eclipse.n4js.n4JS.Script)8 Annotation (org.eclipse.n4js.n4JS.Annotation)7 IdentifiableElement (org.eclipse.n4js.ts.types.IdentifiableElement)7 NamedElement (org.eclipse.n4js.n4JS.NamedElement)6 ExportedVariableDeclaration (org.eclipse.n4js.n4JS.ExportedVariableDeclaration)3 ExportedVariableStatement (org.eclipse.n4js.n4JS.ExportedVariableStatement)3 FunctionDeclaration (org.eclipse.n4js.n4JS.FunctionDeclaration)3 VariableDeclaration (org.eclipse.n4js.n4JS.VariableDeclaration)3 Block (org.eclipse.n4js.n4JS.Block)2 CatchBlock (org.eclipse.n4js.n4JS.CatchBlock)2 ExportSpecifier (org.eclipse.n4js.n4JS.ExportSpecifier)2 Expression (org.eclipse.n4js.n4JS.Expression)2 FormalParameter (org.eclipse.n4js.n4JS.FormalParameter)2 LiteralOrComputedPropertyName (org.eclipse.n4js.n4JS.LiteralOrComputedPropertyName)2 N4FieldDeclaration (org.eclipse.n4js.n4JS.N4FieldDeclaration)2 ParameterizedCallExpression (org.eclipse.n4js.n4JS.ParameterizedCallExpression)2