| /******************************************************************************* |
| * Copyright (c) 2016, 2019 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 example3.kiamacs.impl; |
| |
| import example3.kiamaas.KiamaasPackage; |
| import example3.kiamacs.BaseCS; |
| import example3.kiamacs.KiamacsFactory; |
| import example3.kiamacs.KiamacsPackage; |
| import example3.kiamacs.NodeCS; |
| import example3.kiamacs.NumCS; |
| import example3.kiamacs.PlusCS; |
| import example3.kiamacs.TopCS; |
| |
| import org.eclipse.emf.ecore.EAttribute; |
| 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 plusCSEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass numCSEClass = 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 example3.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 getPlusCS() { |
| return plusCSEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EReference getPlusCS_Left() { |
| return (EReference)plusCSEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EReference getPlusCS_Right() { |
| return (EReference)plusCSEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EClass getNumCS() { |
| return numCSEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EAttribute getNumCS_Value() { |
| return (EAttribute)numCSEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- 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); |
| |
| plusCSEClass = createEClass(PLUS_CS); |
| createEReference(plusCSEClass, PLUS_CS__LEFT); |
| createEReference(plusCSEClass, PLUS_CS__RIGHT); |
| |
| numCSEClass = createEClass(NUM_CS); |
| createEAttribute(numCSEClass, NUM_CS__VALUE); |
| |
| 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()); |
| plusCSEClass.getESuperTypes().add(this.getNodeCS()); |
| numCSEClass.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(plusCSEClass, PlusCS.class, "PlusCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getPlusCS_Left(), this.getNodeCS(), null, "left", null, 0, 1, PlusCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getPlusCS_Right(), this.getNodeCS(), null, "right", null, 0, 1, PlusCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(numCSEClass, NumCS.class, "NumCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEAttribute(getNumCS_Value(), ecorePackage.getEInt(), "value", null, 0, 1, NumCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(baseCSEClass, BaseCS.class, "BaseCS", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getBaseCS_Ast(), theKiamaasPackage.getNode(), 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 |