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

package uk.co.zonetora.fj.ast.node;

import uk.co.zonetora.fj.ast.analysis.*;

public final class X1PCommaTerm extends XPCommaTerm
{
    private XPCommaTerm _xPCommaTerm_;
    private PCommaTerm _pCommaTerm_;

    public X1PCommaTerm()
    {
    }

    public X1PCommaTerm(
        XPCommaTerm _xPCommaTerm_,
        PCommaTerm _pCommaTerm_)
    {
        setXPCommaTerm(_xPCommaTerm_);
        setPCommaTerm(_pCommaTerm_);
    }

    public Object clone()
    {
        throw new RuntimeException("Unsupported Operation");
    }

    public void apply(Switch sw)
    {
        throw new RuntimeException("Switch not supported.");
    }

    public XPCommaTerm getXPCommaTerm()
    {
        return _xPCommaTerm_;
    }

    public void setXPCommaTerm(XPCommaTerm node)
    {
        if(_xPCommaTerm_ != null)
        {
            _xPCommaTerm_.parent(null);
        }

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

            node.parent(this);
        }

        _xPCommaTerm_ = node;
    }

    public PCommaTerm getPCommaTerm()
    {
        return _pCommaTerm_;
    }

    public void setPCommaTerm(PCommaTerm node)
    {
        if(_pCommaTerm_ != null)
        {
            _pCommaTerm_.parent(null);
        }

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

            node.parent(this);
        }

        _pCommaTerm_ = node;
    }

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

        if(_pCommaTerm_ == child)
        {
            _pCommaTerm_ = null;
        }
    }

    void replaceChild(Node oldChild, Node newChild)
    {
    }

    public String toString()
    {
        return "" +
            toString(_xPCommaTerm_) +
            toString(_pCommaTerm_);
    }
}
