/** */ package org.archstudio.prolog.xtext.prolog.util; import org.archstudio.prolog.xtext.prolog.*; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.util.Switch; /** * <!-- begin-user-doc --> * The <b>Switch</b> for the model's inheritance hierarchy. * It supports the call {@link #doSwitch(EObject) doSwitch(object)} * to invoke the <code>caseXXX</code> method for each class of the model, * starting with the actual class of the object * and proceeding up the inheritance hierarchy * until a non-null result is returned, * which is the result of the switch. * <!-- end-user-doc --> * @see org.archstudio.prolog.xtext.prolog.PrologPackage * @generated */ public class PrologSwitch<T> extends Switch<T> { /** * The cached model package * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected static PrologPackage modelPackage; /** * Creates an instance of the switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public PrologSwitch() { if (modelPackage == null) { modelPackage = PrologPackage.eINSTANCE; } } /** * Checks whether this is a switch for the given package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @parameter ePackage the package in question. * @return whether this is a switch for the given package. * @generated */ @Override protected boolean isSwitchFor(EPackage ePackage) { return ePackage == modelPackage; } /** * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the first non-null result returned by a <code>caseXXX</code> call. * @generated */ @Override protected T doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { case PrologPackage.MODEL: { Model model = (Model)theEObject; T result = caseModel(model); if (result == null) result = defaultCase(theEObject); return result; } case PrologPackage.EXPRESSION: { Expression expression = (Expression)theEObject; T result = caseExpression(expression); if (result == null) result = defaultCase(theEObject); return result; } case PrologPackage.UNARY_EXPRESSION: { UnaryExpression unaryExpression = (UnaryExpression)theEObject; T result = caseUnaryExpression(unaryExpression); if (result == null) result = caseExpression(unaryExpression); if (result == null) result = defaultCase(theEObject); return result; } case PrologPackage.ATOM_EXPRESSION: { AtomExpression atomExpression = (AtomExpression)theEObject; T result = caseAtomExpression(atomExpression); if (result == null) result = caseExpression(atomExpression); if (result == null) result = defaultCase(theEObject); return result; } case PrologPackage.VARIABLE_EXPRESSION: { VariableExpression variableExpression = (VariableExpression)theEObject; T result = caseVariableExpression(variableExpression); if (result == null) result = caseExpression(variableExpression); if (result == null) result = defaultCase(theEObject); return result; } case PrologPackage.STRING_EXPRESSION: { StringExpression stringExpression = (StringExpression)theEObject; T result = caseStringExpression(stringExpression); if (result == null) result = caseExpression(stringExpression); if (result == null) result = defaultCase(theEObject); return result; } case PrologPackage.NUMBER_EXPRESSION: { NumberExpression numberExpression = (NumberExpression)theEObject; T result = caseNumberExpression(numberExpression); if (result == null) result = caseExpression(numberExpression); if (result == null) result = defaultCase(theEObject); return result; } case PrologPackage.LIST_EXPRESSION: { ListExpression listExpression = (ListExpression)theEObject; T result = caseListExpression(listExpression); if (result == null) result = caseExpression(listExpression); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } } /** * Returns the result of interpreting the object as an instance of '<em>Model</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Model</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseModel(Model object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Expression</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Expression</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseExpression(Expression object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Unary Expression</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Unary Expression</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseUnaryExpression(UnaryExpression object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Atom Expression</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Atom Expression</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseAtomExpression(AtomExpression object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Variable Expression</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Variable Expression</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseVariableExpression(VariableExpression object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>String Expression</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>String Expression</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseStringExpression(StringExpression object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Number Expression</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Number Expression</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseNumberExpression(NumberExpression object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>List Expression</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>List Expression</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseListExpression(ListExpression object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch, but this is the last case anyway. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>EObject</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated */ @Override public T defaultCase(EObject object) { return null; } } //PrologSwitch