Logo Search packages:      
Sourcecode: sablecc version File versions  Download package

AOperationSet.java

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

package org.sablecc.sablecc.node;

import java.util.*;
import org.sablecc.sablecc.analysis.*;

public final class AOperationSet extends PSet
{
  private TLBkt _lBkt_;
  private PBasic _left_;
  private PBinOp _binOp_;
  private PBasic _right_;
  private TRBkt _rBkt_;

  public AOperationSet()
  {}

  public AOperationSet(
    TLBkt _lBkt_,
    PBasic _left_,
    PBinOp _binOp_,
    PBasic _right_,
    TRBkt _rBkt_)
  {
    setLBkt(_lBkt_);

    setLeft(_left_);

    setBinOp(_binOp_);

    setRight(_right_);

    setRBkt(_rBkt_);

  }
  public Object clone()
  {
    return new AOperationSet(
             (TLBkt) cloneNode(_lBkt_),
             (PBasic) cloneNode(_left_),
             (PBinOp) cloneNode(_binOp_),
             (PBasic) cloneNode(_right_),
             (TRBkt) cloneNode(_rBkt_));
  }

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

  public TLBkt getLBkt()
  {
    return _lBkt_;
  }

  public void setLBkt(TLBkt node)
  {
    if(_lBkt_ != null)
    {
      _lBkt_.parent(null);
    }

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

      node.parent(this);
    }

    _lBkt_ = node;
  }

  public PBasic getLeft()
  {
    return _left_;
  }

  public void setLeft(PBasic node)
  {
    if(_left_ != null)
    {
      _left_.parent(null);
    }

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

      node.parent(this);
    }

    _left_ = node;
  }

  public PBinOp getBinOp()
  {
    return _binOp_;
  }

  public void setBinOp(PBinOp node)
  {
    if(_binOp_ != null)
    {
      _binOp_.parent(null);
    }

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

      node.parent(this);
    }

    _binOp_ = node;
  }

  public PBasic getRight()
  {
    return _right_;
  }

  public void setRight(PBasic node)
  {
    if(_right_ != null)
    {
      _right_.parent(null);
    }

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

      node.parent(this);
    }

    _right_ = node;
  }

  public TRBkt getRBkt()
  {
    return _rBkt_;
  }

  public void setRBkt(TRBkt node)
  {
    if(_rBkt_ != null)
    {
      _rBkt_.parent(null);
    }

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

      node.parent(this);
    }

    _rBkt_ = node;
  }

  public String toString()
  {
    return ""
           + toString(_lBkt_)
           + toString(_left_)
           + toString(_binOp_)
           + toString(_right_)
           + toString(_rBkt_);
  }

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

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

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

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

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

  }

  void replaceChild(Node oldChild, Node newChild)
  {
    if(_lBkt_ == oldChild)
    {
      setLBkt((TLBkt) newChild);
      return;
    }

    if(_left_ == oldChild)
    {
      setLeft((PBasic) newChild);
      return;
    }

    if(_binOp_ == oldChild)
    {
      setBinOp((PBinOp) newChild);
      return;
    }

    if(_right_ == oldChild)
    {
      setRight((PBasic) newChild);
      return;
    }

    if(_rBkt_ == oldChild)
    {
      setRBkt((TRBkt) newChild);
      return;
    }

  }
}

Generated by  Doxygen 1.6.0   Back to index