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/LetBindingImpl.java | 391 +++++++++++++++++++++ 1 file changed, 391 insertions(+) create mode 100644 Application/org.eclipse.viatra.solver.language.model/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/LetBindingImpl.java (limited to 'Application/org.eclipse.viatra.solver.language.model/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/LetBindingImpl.java') diff --git a/Application/org.eclipse.viatra.solver.language.model/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/LetBindingImpl.java b/Application/org.eclipse.viatra.solver.language.model/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/LetBindingImpl.java new file mode 100644 index 00000000..1f724c55 --- /dev/null +++ b/Application/org.eclipse.viatra.solver.language.model/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/LetBindingImpl.java @@ -0,0 +1,391 @@ +/** + */ +package org.eclipse.viatra.solver.language.solverLanguage.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.viatra.solver.language.solverLanguage.Expression; +import org.eclipse.viatra.solver.language.solverLanguage.LetBinding; +import org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage; +import org.eclipse.viatra.solver.language.solverLanguage.Symbol; +import org.eclipse.viatra.solver.language.solverLanguage.Variable; + +/** + * + * An implementation of the model object 'Let Binding'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class LetBindingImpl extends MinimalEObjectImpl.Container implements LetBinding { + /** + * The cached value of the '{@link #getValue() Value}' containment reference. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected Expression value; + + /** + * The cached value of the '{@link #getVariable() Variable}' containment reference. + * + * + * @see #getVariable() + * @generated + * @ordered + */ + protected Variable variable; + + /** + * 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 cached value of the '{@link #getType() Type}' reference. + * + * + * @see #getType() + * @generated + * @ordered + */ + protected Symbol type; + + /** + * + * + * @generated + */ + protected LetBindingImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return SolverLanguagePackage.Literals.LET_BINDING; + } + + /** + * + * + * @generated + */ + public Expression getValue() { + return value; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetValue(Expression newValue, NotificationChain msgs) { + Expression oldValue = value; + value = newValue; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + SolverLanguagePackage.LET_BINDING__VALUE, oldValue, newValue); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setValue(Expression newValue) { + if (newValue != value) { + NotificationChain msgs = null; + if (value != null) + msgs = ((InternalEObject) value).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.LET_BINDING__VALUE, null, msgs); + if (newValue != null) + msgs = ((InternalEObject) newValue).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.LET_BINDING__VALUE, null, msgs); + msgs = basicSetValue(newValue, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.LET_BINDING__VALUE, newValue, + newValue)); + } + + /** + * + * + * @generated + */ + public Variable getVariable() { + return variable; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetVariable(Variable newVariable, NotificationChain msgs) { + Variable oldVariable = variable; + variable = newVariable; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + SolverLanguagePackage.LET_BINDING__VARIABLE, oldVariable, newVariable); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setVariable(Variable newVariable) { + if (newVariable != variable) { + NotificationChain msgs = null; + if (variable != null) + msgs = ((InternalEObject) variable).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.LET_BINDING__VARIABLE, null, msgs); + if (newVariable != null) + msgs = ((InternalEObject) newVariable).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.LET_BINDING__VARIABLE, null, msgs); + msgs = basicSetVariable(newVariable, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.LET_BINDING__VARIABLE, + newVariable, newVariable)); + } + + /** + * + * + * @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.LET_BINDING__NAME, oldName, + name)); + } + + /** + * + * + * @generated + */ + public Symbol getType() { + if (type != null && type.eIsProxy()) { + InternalEObject oldType = (InternalEObject) type; + type = (Symbol) eResolveProxy(oldType); + if (type != oldType) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, SolverLanguagePackage.LET_BINDING__TYPE, + oldType, type)); + } + } + return type; + } + + /** + * + * + * @generated + */ + public Symbol basicGetType() { + return type; + } + + /** + * + * + * @generated + */ + public void setType(Symbol newType) { + Symbol oldType = type; + type = newType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.LET_BINDING__TYPE, oldType, + type)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case SolverLanguagePackage.LET_BINDING__VALUE: + return basicSetValue(null, msgs); + case SolverLanguagePackage.LET_BINDING__VARIABLE: + return basicSetVariable(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case SolverLanguagePackage.LET_BINDING__VALUE: + return getValue(); + case SolverLanguagePackage.LET_BINDING__VARIABLE: + return getVariable(); + case SolverLanguagePackage.LET_BINDING__NAME: + return getName(); + case SolverLanguagePackage.LET_BINDING__TYPE: + if (resolve) + return getType(); + return basicGetType(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case SolverLanguagePackage.LET_BINDING__VALUE: + setValue((Expression) newValue); + return; + case SolverLanguagePackage.LET_BINDING__VARIABLE: + setVariable((Variable) newValue); + return; + case SolverLanguagePackage.LET_BINDING__NAME: + setName((String) newValue); + return; + case SolverLanguagePackage.LET_BINDING__TYPE: + setType((Symbol) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case SolverLanguagePackage.LET_BINDING__VALUE: + setValue((Expression) null); + return; + case SolverLanguagePackage.LET_BINDING__VARIABLE: + setVariable((Variable) null); + return; + case SolverLanguagePackage.LET_BINDING__NAME: + setName(NAME_EDEFAULT); + return; + case SolverLanguagePackage.LET_BINDING__TYPE: + setType((Symbol) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case SolverLanguagePackage.LET_BINDING__VALUE: + return value != null; + case SolverLanguagePackage.LET_BINDING__VARIABLE: + return variable != null; + case SolverLanguagePackage.LET_BINDING__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case SolverLanguagePackage.LET_BINDING__TYPE: + return type != null; + } + 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(')'); + return result.toString(); + } + +} //LetBindingImpl -- cgit v1.2.3-70-g09d2