/** | |
* * Copyright (c) 2008 Daniel Varro | |
* * All rights reserved. This program and the accompanying materials | |
* * are made available under the terms of the Eclipse Public License v1.0 | |
* * which accompanies this distribution, and is available at | |
* * http://www.eclipse.org/legal/epl-v10.html | |
* * | |
* * Contributors: | |
* * Daniel Varro - initial API and implementation | |
* | |
* | |
* $Id$ | |
*/ | |
package org.eclipse.viatra2.gtasm.typerules.impl; | |
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; | |
import org.eclipse.viatra2.gtasm.typerules.BinaryTypeJudgement; | |
import org.eclipse.viatra2.gtasm.typerules.CustomTypeJudgement; | |
import org.eclipse.viatra2.gtasm.typerules.RuleSet; | |
import org.eclipse.viatra2.gtasm.typerules.TypeJudgement; | |
import org.eclipse.viatra2.gtasm.typerules.TypeRule; | |
import org.eclipse.viatra2.gtasm.typerules.TyperulesFactory; | |
import org.eclipse.viatra2.gtasm.typerules.TyperulesPackage; | |
import org.eclipse.viatra2.gtasm.typerules.UnaryTypeJudgement; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model <b>Package</b>. | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public class TyperulesPackageImpl extends EPackageImpl implements TyperulesPackage { | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass ruleSetEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass typeJudgementEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass unaryTypeJudgementEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass binaryTypeJudgementEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass typeRuleEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass customTypeJudgementEClass = 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 org.eclipse.viatra2.gtasm.typerules.TyperulesPackage#eNS_URI | |
* @see #init() | |
* @generated | |
*/ | |
private TyperulesPackageImpl() { | |
super(eNS_URI, TyperulesFactory.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. Simple | |
* dependencies are satisfied by calling this method on all | |
* dependent packages before doing anything else. This method drives | |
* initialization for interdependent packages directly, in parallel | |
* with this package, itself. | |
* <p>Of this package and its interdependencies, all packages which | |
* have not yet been registered by their URI values are first created | |
* and registered. The packages are then initialized in two steps: | |
* meta-model objects for all of the packages are created before any | |
* are initialized, since one package's meta-model objects may refer to | |
* those of another. | |
* <p>Invocation of this method will not affect any packages that have | |
* already been initialized. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #eNS_URI | |
* @see #createPackageContents() | |
* @see #initializePackageContents() | |
* @generated | |
*/ | |
public static TyperulesPackage init() { | |
if (isInited) return (TyperulesPackage)EPackage.Registry.INSTANCE.getEPackage(TyperulesPackage.eNS_URI); | |
// Obtain or create and register package | |
TyperulesPackageImpl theTyperulesPackage = (TyperulesPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof TyperulesPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new TyperulesPackageImpl()); | |
isInited = true; | |
// Create package meta-data objects | |
theTyperulesPackage.createPackageContents(); | |
// Initialize created meta-data | |
theTyperulesPackage.initializePackageContents(); | |
// Mark meta-data to indicate it can't be changed | |
theTyperulesPackage.freeze(); | |
return theTyperulesPackage; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getRuleSet() { | |
return ruleSetEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EReference getRuleSet_Extends() { | |
return (EReference)ruleSetEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EReference getRuleSet_Typerules() { | |
return (EReference)ruleSetEClass.getEStructuralFeatures().get(1); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getTypeJudgement() { | |
return typeJudgementEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getTypeJudgement_IsValid() { | |
return (EAttribute)typeJudgementEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getTypeJudgement_Result() { | |
return (EAttribute)typeJudgementEClass.getEStructuralFeatures().get(1); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getTypeJudgement_Name() { | |
return (EAttribute)typeJudgementEClass.getEStructuralFeatures().get(2); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getUnaryTypeJudgement() { | |
return unaryTypeJudgementEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getUnaryTypeJudgement_Operand() { | |
return (EAttribute)unaryTypeJudgementEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getBinaryTypeJudgement() { | |
return binaryTypeJudgementEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getBinaryTypeJudgement_FirstOperand() { | |
return (EAttribute)binaryTypeJudgementEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getBinaryTypeJudgement_SecondOperand() { | |
return (EAttribute)binaryTypeJudgementEClass.getEStructuralFeatures().get(1); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getTypeRule() { | |
return typeRuleEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EReference getTypeRule_Judgements() { | |
return (EReference)typeRuleEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getTypeRule_Operator() { | |
return (EAttribute)typeRuleEClass.getEStructuralFeatures().get(1); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getCustomTypeJudgement() { | |
return customTypeJudgementEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getCustomTypeJudgement_Operands() { | |
return (EAttribute)customTypeJudgementEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public TyperulesFactory getTyperulesFactory() { | |
return (TyperulesFactory)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 | |
ruleSetEClass = createEClass(RULE_SET); | |
createEReference(ruleSetEClass, RULE_SET__EXTENDS); | |
createEReference(ruleSetEClass, RULE_SET__TYPERULES); | |
typeJudgementEClass = createEClass(TYPE_JUDGEMENT); | |
createEAttribute(typeJudgementEClass, TYPE_JUDGEMENT__IS_VALID); | |
createEAttribute(typeJudgementEClass, TYPE_JUDGEMENT__RESULT); | |
createEAttribute(typeJudgementEClass, TYPE_JUDGEMENT__NAME); | |
unaryTypeJudgementEClass = createEClass(UNARY_TYPE_JUDGEMENT); | |
createEAttribute(unaryTypeJudgementEClass, UNARY_TYPE_JUDGEMENT__OPERAND); | |
binaryTypeJudgementEClass = createEClass(BINARY_TYPE_JUDGEMENT); | |
createEAttribute(binaryTypeJudgementEClass, BINARY_TYPE_JUDGEMENT__FIRST_OPERAND); | |
createEAttribute(binaryTypeJudgementEClass, BINARY_TYPE_JUDGEMENT__SECOND_OPERAND); | |
typeRuleEClass = createEClass(TYPE_RULE); | |
createEReference(typeRuleEClass, TYPE_RULE__JUDGEMENTS); | |
createEAttribute(typeRuleEClass, TYPE_RULE__OPERATOR); | |
customTypeJudgementEClass = createEClass(CUSTOM_TYPE_JUDGEMENT); | |
createEAttribute(customTypeJudgementEClass, CUSTOM_TYPE_JUDGEMENT__OPERANDS); | |
} | |
/** | |
* <!-- 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); | |
// Create type parameters | |
// Set bounds for type parameters | |
// Add supertypes to classes | |
unaryTypeJudgementEClass.getESuperTypes().add(this.getTypeJudgement()); | |
binaryTypeJudgementEClass.getESuperTypes().add(this.getTypeJudgement()); | |
customTypeJudgementEClass.getESuperTypes().add(this.getTypeJudgement()); | |
// Initialize classes and features; add operations and parameters | |
initEClass(ruleSetEClass, RuleSet.class, "RuleSet", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | |
initEReference(getRuleSet_Extends(), this.getRuleSet(), null, "extends", null, 0, 1, RuleSet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEReference(getRuleSet_Typerules(), this.getTypeRule(), null, "typerules", null, 0, -1, RuleSet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEClass(typeJudgementEClass, TypeJudgement.class, "TypeJudgement", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | |
initEAttribute(getTypeJudgement_IsValid(), ecorePackage.getEBoolean(), "isValid", "true", 0, 1, TypeJudgement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEAttribute(getTypeJudgement_Result(), ecorePackage.getEString(), "result", null, 0, 1, TypeJudgement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEAttribute(getTypeJudgement_Name(), ecorePackage.getEString(), "name", null, 0, 1, TypeJudgement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEClass(unaryTypeJudgementEClass, UnaryTypeJudgement.class, "UnaryTypeJudgement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | |
initEAttribute(getUnaryTypeJudgement_Operand(), ecorePackage.getEString(), "operand", null, 0, 1, UnaryTypeJudgement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEClass(binaryTypeJudgementEClass, BinaryTypeJudgement.class, "BinaryTypeJudgement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | |
initEAttribute(getBinaryTypeJudgement_FirstOperand(), ecorePackage.getEString(), "firstOperand", null, 0, 1, BinaryTypeJudgement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEAttribute(getBinaryTypeJudgement_SecondOperand(), ecorePackage.getEString(), "secondOperand", null, 0, 1, BinaryTypeJudgement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEClass(typeRuleEClass, TypeRule.class, "TypeRule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | |
initEReference(getTypeRule_Judgements(), this.getTypeJudgement(), null, "judgements", null, 0, -1, TypeRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEAttribute(getTypeRule_Operator(), ecorePackage.getEString(), "operator", null, 0, 1, TypeRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEClass(customTypeJudgementEClass, CustomTypeJudgement.class, "CustomTypeJudgement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | |
initEAttribute(getCustomTypeJudgement_Operands(), ecorePackage.getEString(), "operands", null, 0, -1, CustomTypeJudgement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
// Create resource | |
createResource(eNS_URI); | |
} | |
} //TyperulesPackageImpl |