Class PJ.Rhs

  extended by java.util.AbstractCollection
      extended by java.util.AbstractList
          extended by java.util.ArrayList
              extended by pj.PJ.Rhs
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, RandomAccess, Dump.Helper
Direct Known Subclasses:
PJ.Action, PJ.Collect
Enclosing class:

protected abstract class PJ.Rhs
extends ArrayList
implements Dump.Helper

List<Leaf> represents one right hand side of a PJ.Rule, flattens.

See Also:
Serialized Form

Field Summary
protected  Object optPrec
          %prec token or null.
Fields inherited from class java.util.AbstractList
Constructor Summary
protected PJ.Rhs(ArrayList items, Object optPrec)
Method Summary
protected abstract  void action(PrintWriter out)
          subclass responsibility: create action.
 boolean factory(PrintWriter out, PJ.IdInfo ii, boolean flatten)
          contribute to factory, can be overwritten in subclass.
 void lex(PrintWriter out)
          delegate to Leaf.
 void prolog(PrintWriter out, PJ.IdInfo i)
          contribute to prolog, can be overwritten in subclass.
 void rules(PrintWriter out)
          create right hand side and action if PJ.typed.
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface pj.Dump.Helper
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList

Field Detail


protected final Object optPrec
%prec token or null.

Constructor Detail


protected PJ.Rhs(ArrayList items,
                 Object optPrec)
Method Detail


public void lex(PrintWriter out)
delegate to Leaf.


public boolean factory(PrintWriter out,
                       PJ.IdInfo ii,
                       boolean flatten)
contribute to factory, can be overwritten in subclass.

true (default) unless action is left abstract.


public void prolog(PrintWriter out,
                   PJ.IdInfo i)
contribute to prolog, can be overwritten in subclass.


public void rules(PrintWriter out)
create right hand side and action if PJ.typed.


protected abstract void action(PrintWriter out)
subclass responsibility: create action.