blob: ac04e647e621ef90009037bb211ef1e4cee1dfa5 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2016, 2018 Willink Transformations and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* E.D.Willink - initial API and implementation
*******************************************************************************/
/**
*/
package example4.kiamacs.impl;
import example4.kiamaas.KiamaasPackage;
import example4.kiamacs.BaseCS;
import example4.kiamacs.CompositeCS;
import example4.kiamacs.KiamacsFactory;
import example4.kiamacs.KiamacsPackage;
import example4.kiamacs.LeafCS;
import example4.kiamacs.NodeCS;
import example4.kiamacs.TopCS;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.impl.EPackageImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class KiamacsPackageImpl extends EPackageImpl implements KiamacsPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass topCSEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass nodeCSEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass compositeCSEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass leafCSEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass baseCSEClass = null;
/**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
* <p>Note: the correct way to create the package is via the static
* factory method {@link #init init()}, which also performs
* initialization of the package, or returns the registered package,
* if one already exists.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.emf.ecore.EPackage.Registry
* @see example4.kiamacs.KiamacsPackage#eNS_URI
* @see #init()
* @generated
*/
private KiamacsPackageImpl() {
super(eNS_URI, KiamacsFactory.eINSTANCE);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static boolean isInited = false;
/**
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
*
* <p>This method is used to initialize {@link KiamacsPackage#eINSTANCE} when that field is accessed.
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #eNS_URI
* @see #createPackageContents()
* @see #initializePackageContents()
* @generated
*/
public static KiamacsPackage init() {
if (isInited) return (KiamacsPackage)EPackage.Registry.INSTANCE.getEPackage(KiamacsPackage.eNS_URI);
// Obtain or create and register package
Object registeredKiamacsPackage = EPackage.Registry.INSTANCE.get(eNS_URI);
KiamacsPackageImpl theKiamacsPackage = registeredKiamacsPackage instanceof KiamacsPackageImpl ? (KiamacsPackageImpl)registeredKiamacsPackage : new KiamacsPackageImpl();
isInited = true;
// Initialize simple dependencies
KiamaasPackage.eINSTANCE.eClass();
// Create package meta-data objects
theKiamacsPackage.createPackageContents();
// Initialize created meta-data
theKiamacsPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theKiamacsPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(KiamacsPackage.eNS_URI, theKiamacsPackage);
return theKiamacsPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EClass getTopCS() {
return topCSEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EReference getTopCS_Node() {
return (EReference)topCSEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EClass getNodeCS() {
return nodeCSEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EClass getCompositeCS() {
return compositeCSEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EReference getCompositeCS_Child() {
return (EReference)compositeCSEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EClass getLeafCS() {
return leafCSEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EClass getBaseCS() {
return baseCSEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EReference getBaseCS_Ast() {
return (EReference)baseCSEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public KiamacsFactory getKiamacsFactory() {
return (KiamacsFactory)getEFactoryInstance();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private boolean isCreated = false;
/**
* Creates the meta-model objects for the package. This method is
* guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void createPackageContents() {
if (isCreated) return;
isCreated = true;
// Create classes and their features
topCSEClass = createEClass(TOP_CS);
createEReference(topCSEClass, TOP_CS__NODE);
nodeCSEClass = createEClass(NODE_CS);
compositeCSEClass = createEClass(COMPOSITE_CS);
createEReference(compositeCSEClass, COMPOSITE_CS__CHILD);
leafCSEClass = createEClass(LEAF_CS);
baseCSEClass = createEClass(BASE_CS);
createEReference(baseCSEClass, BASE_CS__AST);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private boolean isInitialized = false;
/**
* Complete the initialization of the package and its meta-model. This
* method is guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void initializePackageContents() {
if (isInitialized) return;
isInitialized = true;
// Initialize package
setName(eNAME);
setNsPrefix(eNS_PREFIX);
setNsURI(eNS_URI);
// Obtain other dependent packages
KiamaasPackage theKiamaasPackage = (KiamaasPackage)EPackage.Registry.INSTANCE.getEPackage(KiamaasPackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
topCSEClass.getESuperTypes().add(this.getBaseCS());
nodeCSEClass.getESuperTypes().add(this.getBaseCS());
compositeCSEClass.getESuperTypes().add(this.getNodeCS());
leafCSEClass.getESuperTypes().add(this.getNodeCS());
// Initialize classes, features, and operations; add parameters
initEClass(topCSEClass, TopCS.class, "TopCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getTopCS_Node(), this.getNodeCS(), null, "node", null, 1, 1, TopCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(nodeCSEClass, NodeCS.class, "NodeCS", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(compositeCSEClass, CompositeCS.class, "CompositeCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getCompositeCS_Child(), this.getNodeCS(), null, "child", null, 0, 1, CompositeCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(leafCSEClass, LeafCS.class, "LeafCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(baseCSEClass, BaseCS.class, "BaseCS", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getBaseCS_Ast(), theKiamaasPackage.getElement(), null, "ast", null, 0, 1, BaseCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Create resource
createResource(eNS_URI);
}
} //KiamacsPackageImpl