From 419e76265ecbdf65e960e0624be006d31ed1e191 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Fri, 8 May 2020 18:28:19 +0200 Subject: Update solver language grammar First version, still needs TokenSource and Linker to work. --- .../language/solverLanguage/impl/IntervalImpl.java | 269 +++++++++++++++++++++ 1 file changed, 269 insertions(+) create mode 100644 Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/IntervalImpl.java (limited to 'Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/IntervalImpl.java') diff --git a/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/IntervalImpl.java b/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/IntervalImpl.java new file mode 100644 index 00000000..e6107ef8 --- /dev/null +++ b/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/IntervalImpl.java @@ -0,0 +1,269 @@ +/** + * generated by Xtext 2.21.0 + */ +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.viatra.solver.language.solverLanguage.Expression; +import org.eclipse.viatra.solver.language.solverLanguage.Interval; +import org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage; + +/** + * + * An implementation of the model object 'Interval'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class IntervalImpl extends ExpressionImpl implements Interval +{ + /** + * The cached value of the '{@link #getLowerBound() Lower Bound}' containment reference. + * + * + * @see #getLowerBound() + * @generated + * @ordered + */ + protected Expression lowerBound; + + /** + * The cached value of the '{@link #getUpperBound() Upper Bound}' containment reference. + * + * + * @see #getUpperBound() + * @generated + * @ordered + */ + protected Expression upperBound; + + /** + * + * + * @generated + */ + protected IntervalImpl() + { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return SolverLanguagePackage.Literals.INTERVAL; + } + + /** + * + * + * @generated + */ + @Override + public Expression getLowerBound() + { + return lowerBound; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetLowerBound(Expression newLowerBound, NotificationChain msgs) + { + Expression oldLowerBound = lowerBound; + lowerBound = newLowerBound; + if (eNotificationRequired()) + { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.INTERVAL__LOWER_BOUND, oldLowerBound, newLowerBound); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setLowerBound(Expression newLowerBound) + { + if (newLowerBound != lowerBound) + { + NotificationChain msgs = null; + if (lowerBound != null) + msgs = ((InternalEObject)lowerBound).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.INTERVAL__LOWER_BOUND, null, msgs); + if (newLowerBound != null) + msgs = ((InternalEObject)newLowerBound).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.INTERVAL__LOWER_BOUND, null, msgs); + msgs = basicSetLowerBound(newLowerBound, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.INTERVAL__LOWER_BOUND, newLowerBound, newLowerBound)); + } + + /** + * + * + * @generated + */ + @Override + public Expression getUpperBound() + { + return upperBound; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetUpperBound(Expression newUpperBound, NotificationChain msgs) + { + Expression oldUpperBound = upperBound; + upperBound = newUpperBound; + if (eNotificationRequired()) + { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.INTERVAL__UPPER_BOUND, oldUpperBound, newUpperBound); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setUpperBound(Expression newUpperBound) + { + if (newUpperBound != upperBound) + { + NotificationChain msgs = null; + if (upperBound != null) + msgs = ((InternalEObject)upperBound).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.INTERVAL__UPPER_BOUND, null, msgs); + if (newUpperBound != null) + msgs = ((InternalEObject)newUpperBound).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.INTERVAL__UPPER_BOUND, null, msgs); + msgs = basicSetUpperBound(newUpperBound, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.INTERVAL__UPPER_BOUND, newUpperBound, newUpperBound)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case SolverLanguagePackage.INTERVAL__LOWER_BOUND: + return basicSetLowerBound(null, msgs); + case SolverLanguagePackage.INTERVAL__UPPER_BOUND: + return basicSetUpperBound(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case SolverLanguagePackage.INTERVAL__LOWER_BOUND: + return getLowerBound(); + case SolverLanguagePackage.INTERVAL__UPPER_BOUND: + return getUpperBound(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case SolverLanguagePackage.INTERVAL__LOWER_BOUND: + setLowerBound((Expression)newValue); + return; + case SolverLanguagePackage.INTERVAL__UPPER_BOUND: + setUpperBound((Expression)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case SolverLanguagePackage.INTERVAL__LOWER_BOUND: + setLowerBound((Expression)null); + return; + case SolverLanguagePackage.INTERVAL__UPPER_BOUND: + setUpperBound((Expression)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case SolverLanguagePackage.INTERVAL__LOWER_BOUND: + return lowerBound != null; + case SolverLanguagePackage.INTERVAL__UPPER_BOUND: + return upperBound != null; + } + return super.eIsSet(featureID); + } + +} //IntervalImpl -- cgit v1.2.3-70-g09d2