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

package MONAViewer.monalanguage.node;

import MONAViewer.monalanguage.analysis.*;

public final class Start extends Node
{
    private PStart _base_;
    private EOF _eof_;

    public Start()
    {
    }

    public Start(
        PStart _base_,
        EOF _eof_)
    {
        setPStart(_base_);
        setEOF(_eof_);
    }

    public Object clone()
    {
        return new Start(
            (PStart) cloneNode(_base_),
            (EOF) cloneNode(_eof_));
    }

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

    public PStart getPStart()
    {
        return _base_;
    }
    public void setPStart(PStart node)
    {
        if(_base_ != null)
        {
            _base_.parent(null);
        }

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

            node.parent(this);
        }

        _base_ = node;
    }

    public EOF getEOF()
    {
        return _eof_;
    }
    public void setEOF(EOF node)
    {
        if(_eof_ != null)
        {
            _eof_.parent(null);
        }

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

            node.parent(this);
        }

        _eof_ = node;
    }

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

        if(_eof_ == child)
        {
            _eof_ = null;
            return;
        }
    }
    void replaceChild(Node oldChild, Node newChild)
    {
        if(_base_ == oldChild)
        {
            setPStart((PStart) newChild);
            return;
        }

        if(_eof_ == oldChild)
        {
            setEOF((EOF) newChild);
            return;
        }
    }

    public String toString()
    {
        return "" +
            toString(_base_) +
            toString(_eof_);
    }
}
