pj
Class PJ.Rhs

java.lang.Object
  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:
PJ

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
modCount
 
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
dump
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

optPrec

protected final Object optPrec
%prec token or null.

Constructor Detail

PJ.Rhs

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

lex

public void lex(PrintWriter out)
delegate to Leaf.


factory

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

Returns:
true (default) unless action is left abstract.

prolog

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


rules

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


action

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