content: /* This file was generated by SableCC (http://www.sablecc.org/). */
  
  package com.abstratt.mdd.frontend.textuml.grammar.node;
  
  import java.util.*;
  import com.abstratt.mdd.frontend.textuml.grammar.analysis.*;
  
  @SuppressWarnings("nls")
  public final class AExpressionList extends PExpressionList
  {
      private PExpressionListElement _expressionListElement_;
      private final LinkedList<PExpressionListTail> _expressionListTail_ = new LinkedList<PExpressionListTail>();
  
      public AExpressionList()
      {
          // Constructor
      }
  
      public AExpressionList(
          @SuppressWarnings("hiding") PExpressionListElement _expressionListElement_,
          @SuppressWarnings("hiding") List<PExpressionListTail> _expressionListTail_)
      {
          // Constructor
          setExpressionListElement(_expressionListElement_);
  
          setExpressionListTail(_expressionListTail_);
  
      }
  
      @Override
      public Object clone()
      {
          return new AExpressionList(
              cloneNode(this._expressionListElement_),
              cloneList(this._expressionListTail_));
      }
  
      public void apply(Switch sw)
      {
          ((Analysis) sw).caseAExpressionList(this);
      }
  
      public PExpressionListElement getExpressionListElement()
      {
          return this._expressionListElement_;
      }
  
      public void setExpressionListElement(PExpressionListElement node)
      {
          if(this._expressionListElement_ != null)
          {
              this._expressionListElement_.parent(null);
          }
  
          if(node != null)
          {
              if(node.parent() != null)
              {
                  node.parent().removeChild(node);
              }
  
              node.parent(this);
          }
  
          this._expressionListElement_ = node;
      }
  
      public LinkedList<PExpressionListTail> getExpressionListTail()
      {
          return this._expressionListTail_;
      }
  
      public void setExpressionListTail(List<PExpressionListTail> list)
      {
          this._expressionListTail_.clear();
          this._expressionListTail_.addAll(list);
          for(PExpressionListTail e : list)
          {
              if(e.parent() != null)
              {
                  e.parent().removeChild(e);
              }
  
              e.parent(this);
          }
      }
  
      @Override
      public String toString()
      {
          return ""
              + toString(this._expressionListElement_)
              + toString(this._expressionListTail_);
      }
  
      @Override
      void removeChild(@SuppressWarnings("unused") Node child)
      {
          // Remove child
          if(this._expressionListElement_ == child)
          {
              this._expressionListElement_ = null;
              return;
          }
  
          if(this._expressionListTail_.remove(child))
          {
              return;
          }
  
          throw new RuntimeException("Not a child.");
      }
  
      @Override
      void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
      {
          // Replace child
          if(this._expressionListElement_ == oldChild)
          {
              setExpressionListElement((PExpressionListElement) newChild);
              return;
          }
  
          for(ListIterator<PExpressionListTail> i = this._expressionListTail_.listIterator(); i.hasNext();)
          {
              if(i.next() == oldChild)
              {
                  if(newChild != null)
                  {
                      i.set((PExpressionListTail) newChild);
                      newChild.parent(this);
                      oldChild.parent(null);
                      return;
                  }
  
                  i.remove();
                  oldChild.parent(null);
                  return;
              }
          }
  
          throw new RuntimeException("Not a child.");
      }
  }
  