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. --- .../solverLanguage/impl/UnaryExpressionImpl.java | 270 +++++++++++++++++++++ 1 file changed, 270 insertions(+) create mode 100644 Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/UnaryExpressionImpl.java (limited to 'Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/UnaryExpressionImpl.java') diff --git a/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/UnaryExpressionImpl.java b/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/UnaryExpressionImpl.java new file mode 100644 index 00000000..ee5ebfbb --- /dev/null +++ b/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/impl/UnaryExpressionImpl.java @@ -0,0 +1,270 @@ +/** + * 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.SolverLanguagePackage; +import org.eclipse.viatra.solver.language.solverLanguage.UnaryExpression; +import org.eclipse.viatra.solver.language.solverLanguage.UnaryOp; + +/** + * + * An implementation of the model object 'Unary Expression'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class UnaryExpressionImpl extends ExpressionImpl implements UnaryExpression +{ + /** + * The default value of the '{@link #getOp() Op}' attribute. + * + * + * @see #getOp() + * @generated + * @ordered + */ + protected static final UnaryOp OP_EDEFAULT = UnaryOp.NEG; + + /** + * The cached value of the '{@link #getOp() Op}' attribute. + * + * + * @see #getOp() + * @generated + * @ordered + */ + protected UnaryOp op = OP_EDEFAULT; + + /** + * The cached value of the '{@link #getBody() Body}' containment reference. + * + * + * @see #getBody() + * @generated + * @ordered + */ + protected Expression body; + + /** + * + * + * @generated + */ + protected UnaryExpressionImpl() + { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return SolverLanguagePackage.Literals.UNARY_EXPRESSION; + } + + /** + * + * + * @generated + */ + @Override + public UnaryOp getOp() + { + return op; + } + + /** + * + * + * @generated + */ + @Override + public void setOp(UnaryOp newOp) + { + UnaryOp oldOp = op; + op = newOp == null ? OP_EDEFAULT : newOp; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.UNARY_EXPRESSION__OP, oldOp, op)); + } + + /** + * + * + * @generated + */ + @Override + public Expression getBody() + { + return body; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetBody(Expression newBody, NotificationChain msgs) + { + Expression oldBody = body; + body = newBody; + if (eNotificationRequired()) + { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.UNARY_EXPRESSION__BODY, oldBody, newBody); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setBody(Expression newBody) + { + if (newBody != body) + { + NotificationChain msgs = null; + if (body != null) + msgs = ((InternalEObject)body).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.UNARY_EXPRESSION__BODY, null, msgs); + if (newBody != null) + msgs = ((InternalEObject)newBody).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.UNARY_EXPRESSION__BODY, null, msgs); + msgs = basicSetBody(newBody, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.UNARY_EXPRESSION__BODY, newBody, newBody)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case SolverLanguagePackage.UNARY_EXPRESSION__BODY: + return basicSetBody(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case SolverLanguagePackage.UNARY_EXPRESSION__OP: + return getOp(); + case SolverLanguagePackage.UNARY_EXPRESSION__BODY: + return getBody(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case SolverLanguagePackage.UNARY_EXPRESSION__OP: + setOp((UnaryOp)newValue); + return; + case SolverLanguagePackage.UNARY_EXPRESSION__BODY: + setBody((Expression)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case SolverLanguagePackage.UNARY_EXPRESSION__OP: + setOp(OP_EDEFAULT); + return; + case SolverLanguagePackage.UNARY_EXPRESSION__BODY: + setBody((Expression)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case SolverLanguagePackage.UNARY_EXPRESSION__OP: + return op != OP_EDEFAULT; + case SolverLanguagePackage.UNARY_EXPRESSION__BODY: + return body != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() + { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (op: "); + result.append(op); + result.append(')'); + return result.toString(); + } + +} //UnaryExpressionImpl -- cgit v1.2.3-70-g09d2