⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aalts.java

📁 有关编译器的编译器.
💻 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 AAlts extends PAlts{  private PAlt _alt_;  private final LinkedList _alts_ = new TypedLinkedList(new Alts_Cast());  public AAlts()  {}  public AAlts(    PAlt _alt_,    List _alts_)  {    setAlt(_alt_);    {      this._alts_.clear();      this._alts_.addAll(_alts_);    }  }  public AAlts(    PAlt _alt_,    XPAltsTail _alts_)  {    setAlt(_alt_);    if(_alts_ != null)    {      while(_alts_ instanceof X1PAltsTail)      {        this._alts_.addFirst(((X1PAltsTail) _alts_).getPAltsTail());        _alts_ = ((X1PAltsTail) _alts_).getXPAltsTail();      }      this._alts_.addFirst(((X2PAltsTail) _alts_).getPAltsTail());    }  }  public Object clone()  {    return new AAlts(             (PAlt) cloneNode(_alt_),             cloneList(_alts_));  }  public void apply(Switch sw)  {    ((Analysis) sw).caseAAlts(this);  }  public PAlt getAlt()  {    return _alt_;  }  public void setAlt(PAlt node)  {    if(_alt_ != null)    {      _alt_.parent(null);    }    if(node != null)    {      if(node.parent() != null)      {        node.parent().removeChild(node);      }      node.parent(this);    }    _alt_ = node;  }  public LinkedList getAlts()  {    return _alts_;  }  public void setAlts(List list)  {    _alts_.clear();    _alts_.addAll(list);  }  public String toString()  {    return ""           + toString(_alt_)           + toString(_alts_);  }  void removeChild(Node child)  {    if(_alt_ == child)    {      _alt_ = null;      return;    }    if(_alts_.remove(child))    {      return;    }  }  void replaceChild(Node oldChild, Node newChild)  {    if(_alt_ == oldChild)    {      setAlt((PAlt) newChild);      return;    }    for(ListIterator i = _alts_.listIterator(); i.hasNext();)    {      if(i.next() == oldChild)      {        if(newChild != null)        {          i.set(newChild);          oldChild.parent(null);          return;        }        i.remove();        oldChild.parent(null);        return;      }    }  }  private class Alts_Cast implements Cast  {    public Object cast(Object o)    {      PAltsTail node = (PAltsTail) o;      if((node.parent() != null) &&          (node.parent() != AAlts.this))      {        node.parent().removeChild(node);      }      if((node.parent() == null) ||          (node.parent() != AAlts.this))      {        node.parent(AAlts.this);      }      return node;    }  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -