Logo Search packages:      
Sourcecode: sablecc version File versions  Download package

AHelperDef.java

/* This file was generated by SableCC (http://www.sablecc.org/). */

package org.sablecc.sablecc.node;

import java.util.*;
import org.sablecc.sablecc.analysis.*;

public final class AHelperDef extends PHelperDef
{
  private TId _id_;
  private TEqual _equal_;
  private PRegExp _regExp_;
  private TSemicolon _semicolon_;

  public AHelperDef()
  {}

  public AHelperDef(
    TId _id_,
    TEqual _equal_,
    PRegExp _regExp_,
    TSemicolon _semicolon_)
  {
    setId(_id_);

    setEqual(_equal_);

    setRegExp(_regExp_);

    setSemicolon(_semicolon_);

  }
  public Object clone()
  {
    return new AHelperDef(
             (TId) cloneNode(_id_),
             (TEqual) cloneNode(_equal_),
             (PRegExp) cloneNode(_regExp_),
             (TSemicolon) cloneNode(_semicolon_));
  }

  public void apply(Switch sw)
  {
    ((Analysis) sw).caseAHelperDef(this);
  }

  public TId getId()
  {
    return _id_;
  }

  public void setId(TId node)
  {
    if(_id_ != null)
    {
      _id_.parent(null);
    }

    if(node != null)
    {
      if(node.parent() != null)
      {
        node.parent().removeChild(node);
      }

      node.parent(this);
    }

    _id_ = node;
  }

  public TEqual getEqual()
  {
    return _equal_;
  }

  public void setEqual(TEqual node)
  {
    if(_equal_ != null)
    {
      _equal_.parent(null);
    }

    if(node != null)
    {
      if(node.parent() != null)
      {
        node.parent().removeChild(node);
      }

      node.parent(this);
    }

    _equal_ = node;
  }

  public PRegExp getRegExp()
  {
    return _regExp_;
  }

  public void setRegExp(PRegExp node)
  {
    if(_regExp_ != null)
    {
      _regExp_.parent(null);
    }

    if(node != null)
    {
      if(node.parent() != null)
      {
        node.parent().removeChild(node);
      }

      node.parent(this);
    }

    _regExp_ = node;
  }

  public TSemicolon getSemicolon()
  {
    return _semicolon_;
  }

  public void setSemicolon(TSemicolon node)
  {
    if(_semicolon_ != null)
    {
      _semicolon_.parent(null);
    }

    if(node != null)
    {
      if(node.parent() != null)
      {
        node.parent().removeChild(node);
      }

      node.parent(this);
    }

    _semicolon_ = node;
  }

  public String toString()
  {
    return ""
           + toString(_id_)
           + toString(_equal_)
           + toString(_regExp_)
           + toString(_semicolon_);
  }

  void removeChild(Node child)
  {
    if(_id_ == child)
    {
      _id_ = null;
      return;
    }

    if(_equal_ == child)
    {
      _equal_ = null;
      return;
    }

    if(_regExp_ == child)
    {
      _regExp_ = null;
      return;
    }

    if(_semicolon_ == child)
    {
      _semicolon_ = null;
      return;
    }

  }

  void replaceChild(Node oldChild, Node newChild)
  {
    if(_id_ == oldChild)
    {
      setId((TId) newChild);
      return;
    }

    if(_equal_ == oldChild)
    {
      setEqual((TEqual) newChild);
      return;
    }

    if(_regExp_ == oldChild)
    {
      setRegExp((PRegExp) newChild);
      return;
    }

    if(_semicolon_ == oldChild)
    {
      setSemicolon((TSemicolon) newChild);
      return;
    }

  }
}

Generated by  Doxygen 1.6.0   Back to index