/* 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 AThisNonLeftRecTerm extends PNonLeftRecTerm
{
    private TThis _this_;

    public AThisNonLeftRecTerm()
    {
    }

    public AThisNonLeftRecTerm(
        TThis _this_)
    {
        setThis(_this_);

    }
    public Object clone()
    {
        return new AThisNonLeftRecTerm(
            (TThis) cloneNode(_this_));
    }

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

    public TThis getThis()
    {
        return _this_;
    }

    public void setThis(TThis node)
    {
        if(_this_ != null)
        {
            _this_.parent(null);
        }

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

            node.parent(this);
        }

        _this_ = node;
    }

    public String toString()
    {
        return ""
            + toString(_this_);
    }

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

    }

    void replaceChild(Node oldChild, Node newChild)
    {
        if(_this_ == oldChild)
        {
            setThis((TThis) newChild);
            return;
        }

    }
}
