aconcat.java

来自「有关编译器的编译器.」· Java 代码 · 共 119 行

JAVA
119
字号
/* 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 AConcat extends PConcat{  private final LinkedList _unExps_ = new TypedLinkedList(new UnExps_Cast());  public AConcat()  {}  public AConcat(    List _unExps_)  {    {      this._unExps_.clear();      this._unExps_.addAll(_unExps_);    }  }  public AConcat(    XPUnExp _unExps_)  {    if(_unExps_ != null)    {      while(_unExps_ instanceof X1PUnExp)      {        this._unExps_.addFirst(((X1PUnExp) _unExps_).getPUnExp());        _unExps_ = ((X1PUnExp) _unExps_).getXPUnExp();      }      this._unExps_.addFirst(((X2PUnExp) _unExps_).getPUnExp());    }  }  public Object clone()  {    return new AConcat(             cloneList(_unExps_));  }  public void apply(Switch sw)  {    ((Analysis) sw).caseAConcat(this);  }  public LinkedList getUnExps()  {    return _unExps_;  }  public void setUnExps(List list)  {    _unExps_.clear();    _unExps_.addAll(list);  }  public String toString()  {    return ""           + toString(_unExps_);  }  void removeChild(Node child)  {    if(_unExps_.remove(child))    {      return;    }  }  void replaceChild(Node oldChild, Node newChild)  {    for(ListIterator i = _unExps_.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 UnExps_Cast implements Cast  {    public Object cast(Object o)    {      PUnExp node = (PUnExp) o;      if((node.parent() != null) &&          (node.parent() != AConcat.this))      {        node.parent().removeChild(node);      }      if((node.parent() == null) ||          (node.parent() != AConcat.this))      {        node.parent(AConcat.this);      }      return node;    }  }}

⌨️ 快捷键说明

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