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

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

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

public final class AMethodCallTerm extends PTerm
{
    private PNonLeftRecTerm _nonLeftRecTerm_;
    private TPeriod _period_;
    private TIdentifier _identifier_;
    private TLPar _lPar_;
    private PTermList _termList_;
    private TRPar _rPar_;

    public AMethodCallTerm()
    {
    }

    public AMethodCallTerm(
        PNonLeftRecTerm _nonLeftRecTerm_,
        TPeriod _period_,
        TIdentifier _identifier_,
        TLPar _lPar_,
        PTermList _termList_,
        TRPar _rPar_)
    {
        setNonLeftRecTerm(_nonLeftRecTerm_);

        setPeriod(_period_);

        setIdentifier(_identifier_);

        setLPar(_lPar_);

        setTermList(_termList_);

        setRPar(_rPar_);

    }
    public Object clone()
    {
        return new AMethodCallTerm(
            (PNonLeftRecTerm) cloneNode(_nonLeftRecTerm_),
            (TPeriod) cloneNode(_period_),
            (TIdentifier) cloneNode(_identifier_),
            (TLPar) cloneNode(_lPar_),
            (PTermList) cloneNode(_termList_),
            (TRPar) cloneNode(_rPar_));
    }

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

    public PNonLeftRecTerm getNonLeftRecTerm()
    {
        return _nonLeftRecTerm_;
    }

    public void setNonLeftRecTerm(PNonLeftRecTerm node)
    {
        if(_nonLeftRecTerm_ != null)
        {
            _nonLeftRecTerm_.parent(null);
        }

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

            node.parent(this);
        }

        _nonLeftRecTerm_ = node;
    }

    public TPeriod getPeriod()
    {
        return _period_;
    }

    public void setPeriod(TPeriod node)
    {
        if(_period_ != null)
        {
            _period_.parent(null);
        }

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

            node.parent(this);
        }

        _period_ = node;
    }

    public TIdentifier getIdentifier()
    {
        return _identifier_;
    }

    public void setIdentifier(TIdentifier node)
    {
        if(_identifier_ != null)
        {
            _identifier_.parent(null);
        }

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

            node.parent(this);
        }

        _identifier_ = node;
    }

    public TLPar getLPar()
    {
        return _lPar_;
    }

    public void setLPar(TLPar node)
    {
        if(_lPar_ != null)
        {
            _lPar_.parent(null);
        }

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

            node.parent(this);
        }

        _lPar_ = node;
    }

    public PTermList getTermList()
    {
        return _termList_;
    }

    public void setTermList(PTermList node)
    {
        if(_termList_ != null)
        {
            _termList_.parent(null);
        }

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

            node.parent(this);
        }

        _termList_ = node;
    }

    public TRPar getRPar()
    {
        return _rPar_;
    }

    public void setRPar(TRPar node)
    {
        if(_rPar_ != null)
        {
            _rPar_.parent(null);
        }

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

            node.parent(this);
        }

        _rPar_ = node;
    }

    public String toString()
    {
        return ""
            + toString(_nonLeftRecTerm_)
            + toString(_period_)
            + toString(_identifier_)
            + toString(_lPar_)
            + toString(_termList_)
            + toString(_rPar_);
    }

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

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

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

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

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

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

    }

    void replaceChild(Node oldChild, Node newChild)
    {
        if(_nonLeftRecTerm_ == oldChild)
        {
            setNonLeftRecTerm((PNonLeftRecTerm) newChild);
            return;
        }

        if(_period_ == oldChild)
        {
            setPeriod((TPeriod) newChild);
            return;
        }

        if(_identifier_ == oldChild)
        {
            setIdentifier((TIdentifier) newChild);
            return;
        }

        if(_lPar_ == oldChild)
        {
            setLPar((TLPar) newChild);
            return;
        }

        if(_termList_ == oldChild)
        {
            setTermList((PTermList) newChild);
            return;
        }

        if(_rPar_ == oldChild)
        {
            setRPar((TRPar) newChild);
            return;
        }

    }
}
