content: /* This file was generated by SableCC (http://www.sablecc.org/). */
  
  package com.abstratt.mdd.frontend.textuml.grammar.node;
  
  import com.abstratt.mdd.frontend.textuml.grammar.analysis.*;
  
  @SuppressWarnings("nls")
  public final class AElseRestIf extends PRestIf
  {
      private TElse _else_;
      private PClauseBody _clauseBody_;
  
      public AElseRestIf()
      {
          // Constructor
      }
  
      public AElseRestIf(
          @SuppressWarnings("hiding") TElse _else_,
          @SuppressWarnings("hiding") PClauseBody _clauseBody_)
      {
          // Constructor
          setElse(_else_);
  
          setClauseBody(_clauseBody_);
  
      }
  
      @Override
      public Object clone()
      {
          return new AElseRestIf(
              cloneNode(this._else_),
              cloneNode(this._clauseBody_));
      }
  
      public void apply(Switch sw)
      {
          ((Analysis) sw).caseAElseRestIf(this);
      }
  
      public TElse getElse()
      {
          return this._else_;
      }
  
      public void setElse(TElse node)
      {
          if(this._else_ != null)
          {
              this._else_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._else_ = node;
      }
  
      public PClauseBody getClauseBody()
      {
          return this._clauseBody_;
      }
  
      public void setClauseBody(PClauseBody node)
      {
          if(this._clauseBody_ != null)
          {
              this._clauseBody_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._clauseBody_ = node;
      }
  
      @Override
      public String toString()
      {
          return ""
              + toString(this._else_)
              + toString(this._clauseBody_);
      }
  
      @Override
      void removeChild(@SuppressWarnings("unused") Node child)
      {
          // Remove child
          if(this._else_ == child)
          {
              this._else_ = null;
              return;
          }
  
          if(this._clauseBody_ == child)
          {
              this._clauseBody_ = null;
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  
      @Override
      void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
      {
          // Replace child
          if(this._else_ == oldChild)
          {
              setElse((TElse) newChild);
              return;
          }
  
          if(this._clauseBody_ == oldChild)
          {
              setClauseBody((PClauseBody) newChild);
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  }
  