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

package soot.jimple.parser.node;

import soot.jimple.parser.analysis.*;

@SuppressWarnings("nls")
public final class AUnopExpression extends PExpression
{
    private PUnopExpr _unopExpr_;

    public AUnopExpression()
    {
        // Constructor
    }

    public AUnopExpression(
        @SuppressWarnings("hiding") PUnopExpr _unopExpr_)
    {
        // Constructor
        setUnopExpr(_unopExpr_);

    }

    @Override
    public Object clone()
    {
        return new AUnopExpression(
            cloneNode(this._unopExpr_));
    }

    @Override
    public void apply(Switch sw)
    {
        ((Analysis) sw).caseAUnopExpression(this);
    }

    public PUnopExpr getUnopExpr()
    {
        return this._unopExpr_;
    }

    public void setUnopExpr(PUnopExpr node)
    {
        if(this._unopExpr_ != null)
        {
            this._unopExpr_.parent(null);
        }

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

            node.parent(this);
        }

        this._unopExpr_ = node;
    }

    @Override
    public String toString()
    {
        return ""
            + toString(this._unopExpr_);
    }

    @Override
    void removeChild(@SuppressWarnings("unused") Node child)
    {
        // Remove child
        if(this._unopExpr_ == child)
        {
            this._unopExpr_ = null;
            return;
        }

        throw new RuntimeException("Not a child.");
    }

    @Override
    void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
    {
        // Replace child
        if(this._unopExpr_ == oldChild)
        {
            setUnopExpr((PUnopExpr) newChild);
            return;
        }

        throw new RuntimeException("Not a child.");
    }
}
