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 AIfClause extends PIfClause
  {
      private PRootExpression _test_;
      private TThen _then_;
      private PClauseBody _clauseBody_;
  
      public AIfClause()
      {
          // Constructor
      }
  
      public AIfClause(
          @SuppressWarnings("hiding") PRootExpression _test_,
          @SuppressWarnings("hiding") TThen _then_,
          @SuppressWarnings("hiding") PClauseBody _clauseBody_)
      {
          // Constructor
          setTest(_test_);
  
          setThen(_then_);
  
          setClauseBody(_clauseBody_);
  
      }
  
      @Override
      public Object clone()
      {
          return new AIfClause(
              cloneNode(this._test_),
              cloneNode(this._then_),
              cloneNode(this._clauseBody_));
      }
  
      public void apply(Switch sw)
      {
          ((Analysis) sw).caseAIfClause(this);
      }
  
      public PRootExpression getTest()
      {
          return this._test_;
      }
  
      public void setTest(PRootExpression node)
      {
          if(this._test_ != null)
          {
              this._test_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._test_ = node;
      }
  
      public TThen getThen()
      {
          return this._then_;
      }
  
      public void setThen(TThen node)
      {
          if(this._then_ != null)
          {
              this._then_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._then_ = 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._test_)
              + toString(this._then_)
              + toString(this._clauseBody_);
      }
  
      @Override
      void removeChild(@SuppressWarnings("unused") Node child)
      {
          // Remove child
          if(this._test_ == child)
          {
              this._test_ = null;
              return;
          }
  
          if(this._then_ == child)
          {
              this._then_ = 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._test_ == oldChild)
          {
              setTest((PRootExpression) newChild);
              return;
          }
  
          if(this._then_ == oldChild)
          {
              setThen((TThen) newChild);
              return;
          }
  
          if(this._clauseBody_ == oldChild)
          {
              setClauseBody((PClauseBody) newChild);
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  }
  