From 42c58bbeead1dae09c51f47abc8e10dfbb9c3f9f Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Tue, 23 Jun 2020 15:17:00 +0200 Subject: New configuration language parser WIP --- .../solverLanguage/impl/ClassDeclarationImpl.java | 371 +++++++++++++++++++++ 1 file changed, 371 insertions(+) create mode 100644 Application/org.eclipse.viatra.solver.language.model/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/ClassDeclarationImpl.java (limited to 'Application/org.eclipse.viatra.solver.language.model/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/ClassDeclarationImpl.java') diff --git a/Application/org.eclipse.viatra.solver.language.model/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/ClassDeclarationImpl.java b/Application/org.eclipse.viatra.solver.language.model/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/ClassDeclarationImpl.java new file mode 100644 index 00000000..a9bfeab7 --- /dev/null +++ b/Application/org.eclipse.viatra.solver.language.model/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/ClassDeclarationImpl.java @@ -0,0 +1,371 @@ +/** + */ +package org.eclipse.viatra.solver.language.solverLanguage.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import org.eclipse.viatra.solver.language.solverLanguage.ClassDeclaration; +import org.eclipse.viatra.solver.language.solverLanguage.Field; +import org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage; +import org.eclipse.viatra.solver.language.solverLanguage.Symbol; + +/** + * + * An implementation of the model object 'Class Declaration'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class ClassDeclarationImpl extends StatementImpl implements ClassDeclaration { + /** + * The cached value of the '{@link #getFields() Fields}' containment reference list. + * + * + * @see #getFields() + * @generated + * @ordered + */ + protected EList fields; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #isAbstract() Abstract}' attribute. + * + * + * @see #isAbstract() + * @generated + * @ordered + */ + protected static final boolean ABSTRACT_EDEFAULT = false; + + /** + * The cached value of the '{@link #isAbstract() Abstract}' attribute. + * + * + * @see #isAbstract() + * @generated + * @ordered + */ + protected boolean abstract_ = ABSTRACT_EDEFAULT; + + /** + * The cached value of the '{@link #getSupertypes() Supertypes}' reference list. + * + * + * @see #getSupertypes() + * @generated + * @ordered + */ + protected EList supertypes; + + /** + * The default value of the '{@link #isRoot() Root}' attribute. + * + * + * @see #isRoot() + * @generated + * @ordered + */ + protected static final boolean ROOT_EDEFAULT = false; + + /** + * The cached value of the '{@link #isRoot() Root}' attribute. + * + * + * @see #isRoot() + * @generated + * @ordered + */ + protected boolean root = ROOT_EDEFAULT; + + /** + * + * + * @generated + */ + protected ClassDeclarationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return SolverLanguagePackage.Literals.CLASS_DECLARATION; + } + + /** + * + * + * @generated + */ + public EList getFields() { + if (fields == null) { + fields = new EObjectContainmentEList(Field.class, this, + SolverLanguagePackage.CLASS_DECLARATION__FIELDS); + } + return fields; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.CLASS_DECLARATION__NAME, + oldName, name)); + } + + /** + * + * + * @generated + */ + public boolean isAbstract() { + return abstract_; + } + + /** + * + * + * @generated + */ + public void setAbstract(boolean newAbstract) { + boolean oldAbstract = abstract_; + abstract_ = newAbstract; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.CLASS_DECLARATION__ABSTRACT, + oldAbstract, abstract_)); + } + + /** + * + * + * @generated + */ + public EList getSupertypes() { + if (supertypes == null) { + supertypes = new EObjectResolvingEList(Symbol.class, this, + SolverLanguagePackage.CLASS_DECLARATION__SUPERTYPES); + } + return supertypes; + } + + /** + * + * + * @generated + */ + public boolean isRoot() { + return root; + } + + /** + * + * + * @generated + */ + public void setRoot(boolean newRoot) { + boolean oldRoot = root; + root = newRoot; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.CLASS_DECLARATION__ROOT, + oldRoot, root)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case SolverLanguagePackage.CLASS_DECLARATION__FIELDS: + return ((InternalEList) getFields()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case SolverLanguagePackage.CLASS_DECLARATION__FIELDS: + return getFields(); + case SolverLanguagePackage.CLASS_DECLARATION__NAME: + return getName(); + case SolverLanguagePackage.CLASS_DECLARATION__ABSTRACT: + return isAbstract(); + case SolverLanguagePackage.CLASS_DECLARATION__SUPERTYPES: + return getSupertypes(); + case SolverLanguagePackage.CLASS_DECLARATION__ROOT: + return isRoot(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case SolverLanguagePackage.CLASS_DECLARATION__FIELDS: + getFields().clear(); + getFields().addAll((Collection) newValue); + return; + case SolverLanguagePackage.CLASS_DECLARATION__NAME: + setName((String) newValue); + return; + case SolverLanguagePackage.CLASS_DECLARATION__ABSTRACT: + setAbstract((Boolean) newValue); + return; + case SolverLanguagePackage.CLASS_DECLARATION__SUPERTYPES: + getSupertypes().clear(); + getSupertypes().addAll((Collection) newValue); + return; + case SolverLanguagePackage.CLASS_DECLARATION__ROOT: + setRoot((Boolean) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case SolverLanguagePackage.CLASS_DECLARATION__FIELDS: + getFields().clear(); + return; + case SolverLanguagePackage.CLASS_DECLARATION__NAME: + setName(NAME_EDEFAULT); + return; + case SolverLanguagePackage.CLASS_DECLARATION__ABSTRACT: + setAbstract(ABSTRACT_EDEFAULT); + return; + case SolverLanguagePackage.CLASS_DECLARATION__SUPERTYPES: + getSupertypes().clear(); + return; + case SolverLanguagePackage.CLASS_DECLARATION__ROOT: + setRoot(ROOT_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case SolverLanguagePackage.CLASS_DECLARATION__FIELDS: + return fields != null && !fields.isEmpty(); + case SolverLanguagePackage.CLASS_DECLARATION__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case SolverLanguagePackage.CLASS_DECLARATION__ABSTRACT: + return abstract_ != ABSTRACT_EDEFAULT; + case SolverLanguagePackage.CLASS_DECLARATION__SUPERTYPES: + return supertypes != null && !supertypes.isEmpty(); + case SolverLanguagePackage.CLASS_DECLARATION__ROOT: + return root != ROOT_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(", abstract: "); + result.append(abstract_); + result.append(", root: "); + result.append(root); + result.append(')'); + return result.toString(); + } + +} //ClassDeclarationImpl -- cgit v1.2.3-70-g09d2