/**
 */
package de.ugoe.cs.swe.bnftools.ebnf.util;

import de.ugoe.cs.swe.bnftools.ebnf.*;

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 de.ugoe.cs.swe.bnftools.ebnf.EbnfPackage
 * @generated
 */
public class EbnfSwitch<T> extends Switch<T>
{
  /**
   * The cached model package
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected static EbnfPackage modelPackage;

  /**
   * Creates an instance of the switch.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EbnfSwitch()
  {
    if (modelPackage == null)
    {
      modelPackage = EbnfPackage.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 EbnfPackage.ETSI_BNF:
      {
        EtsiBnf etsiBnf = (EtsiBnf)theEObject;
        T result = caseEtsiBnf(etsiBnf);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.IMPORT_SECTION:
      {
        ImportSection importSection = (ImportSection)theEObject;
        T result = caseImportSection(importSection);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.BNF_ENTRY:
      {
        BnfEntry bnfEntry = (BnfEntry)theEObject;
        T result = caseBnfEntry(bnfEntry);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.DELTA_ENTRY:
      {
        DeltaEntry deltaEntry = (DeltaEntry)theEObject;
        T result = caseDeltaEntry(deltaEntry);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.MERGE_ENTRY:
      {
        MergeEntry mergeEntry = (MergeEntry)theEObject;
        T result = caseMergeEntry(mergeEntry);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.SECTION_HEADING:
      {
        SectionHeading sectionHeading = (SectionHeading)theEObject;
        T result = caseSectionHeading(sectionHeading);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.IMPORT:
      {
        Import import_ = (Import)theEObject;
        T result = caseImport(import_);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.RULE:
      {
        Rule rule = (Rule)theEObject;
        T result = caseRule(rule);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.EXT_RULE:
      {
        ExtRule extRule = (ExtRule)theEObject;
        T result = caseExtRule(extRule);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.MERGE_RULE:
      {
        MergeRule mergeRule = (MergeRule)theEObject;
        T result = caseMergeRule(mergeRule);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.GLOBAL_COMBINATOR:
      {
        GlobalCombinator globalCombinator = (GlobalCombinator)theEObject;
        T result = caseGlobalCombinator(globalCombinator);
        if (result == null) result = caseMergeRule(globalCombinator);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.RULE_COMBINATOR:
      {
        RuleCombinator ruleCombinator = (RuleCombinator)theEObject;
        T result = caseRuleCombinator(ruleCombinator);
        if (result == null) result = caseMergeRule(ruleCombinator);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.HOOK_COMBINATOR:
      {
        HookCombinator hookCombinator = (HookCombinator)theEObject;
        T result = caseHookCombinator(hookCombinator);
        if (result == null) result = caseMergeRule(hookCombinator);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.DEFINITION_LIST:
      {
        DefinitionList definitionList = (DefinitionList)theEObject;
        T result = caseDefinitionList(definitionList);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.SINGLE_DEFINITION:
      {
        SingleDefinition singleDefinition = (SingleDefinition)theEObject;
        T result = caseSingleDefinition(singleDefinition);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.TERM:
      {
        Term term = (Term)theEObject;
        T result = caseTerm(term);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.ATOM:
      {
        Atom atom = (Atom)theEObject;
        T result = caseAtom(atom);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.RULE_REFERENCE:
      {
        RuleReference ruleReference = (RuleReference)theEObject;
        T result = caseRuleReference(ruleReference);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.STRING_RULE:
      {
        StringRule stringRule = (StringRule)theEObject;
        T result = caseStringRule(stringRule);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.GROUPED_SEQUENCE:
      {
        GroupedSequence groupedSequence = (GroupedSequence)theEObject;
        T result = caseGroupedSequence(groupedSequence);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.OPTIONAL_SEQUENCE:
      {
        OptionalSequence optionalSequence = (OptionalSequence)theEObject;
        T result = caseOptionalSequence(optionalSequence);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case EbnfPackage.REPEATED_SEQUENCE:
      {
        RepeatedSequence repeatedSequence = (RepeatedSequence)theEObject;
        T result = caseRepeatedSequence(repeatedSequence);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      default: return defaultCase(theEObject);
    }
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Etsi Bnf</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>Etsi Bnf</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseEtsiBnf(EtsiBnf object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Import Section</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>Import Section</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseImportSection(ImportSection object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Bnf Entry</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>Bnf Entry</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseBnfEntry(BnfEntry object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Delta Entry</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>Delta Entry</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseDeltaEntry(DeltaEntry object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Merge Entry</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>Merge Entry</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseMergeEntry(MergeEntry object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Section Heading</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>Section Heading</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseSectionHeading(SectionHeading object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Import</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>Import</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseImport(Import object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Rule</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>Rule</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseRule(Rule object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Ext Rule</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>Ext Rule</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseExtRule(ExtRule object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Merge Rule</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>Merge Rule</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseMergeRule(MergeRule object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Global Combinator</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>Global Combinator</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseGlobalCombinator(GlobalCombinator object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Rule Combinator</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>Rule Combinator</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseRuleCombinator(RuleCombinator object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Hook Combinator</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>Hook Combinator</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseHookCombinator(HookCombinator object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Definition List</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>Definition List</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseDefinitionList(DefinitionList object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Single Definition</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>Single Definition</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseSingleDefinition(SingleDefinition object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Term</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>Term</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseTerm(Term object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Atom</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</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseAtom(Atom object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Rule Reference</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>Rule Reference</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseRuleReference(RuleReference object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>String Rule</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 Rule</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseStringRule(StringRule object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Grouped Sequence</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>Grouped Sequence</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseGroupedSequence(GroupedSequence object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Optional Sequence</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>Optional Sequence</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseOptionalSequence(OptionalSequence object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Repeated Sequence</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>Repeated Sequence</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseRepeatedSequence(RepeatedSequence 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;
  }

} //EbnfSwitch
