Language Processing
v2.0

pj2
Class Parser.Node

Object
  extended by AbstractCollection<E>
      extended by AbstractList<Parser.Node>
          extended by Parser.Node
All Implemented Interfaces:
Iterable<Parser.Node>, Collection<Parser.Node>, List<Parser.Node>
Direct Known Subclasses:
Parser.Id, Parser.Level, Parser.Literal, Parser.Pattern, Parser.Rule, Parser.Sequence, Parser.Type
Enclosing class:
Parser

public abstract class Parser.Node
extends AbstractList<Parser.Node>

basic behavior for the grammar tree: an immutable List.


Field Summary
 int position
          position associated with node.
 
Fields inherited from class AbstractList
modCount
 
Constructor Summary
protected Parser.Node(int position)
           
 
Method Summary
 Parser.Node get(int index)
          needs to be overridden when there are descendants.
 int size()
          needs to be overridden when there are descendants.
abstract  void visit(Visitor visitor)
          implements divide and conquer for Visitor.
 
Methods inherited from class AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Field Detail

position

public final int position
position associated with node.

Constructor Detail

Parser.Node

protected Parser.Node(int position)
Method Detail

get

public Parser.Node get(int index)
needs to be overridden when there are descendants.

Specified by:
get in interface List<Parser.Node>
Specified by:
get in class AbstractList<Parser.Node>
Throws:
IndexOutOfBoundsException

size

public int size()
needs to be overridden when there are descendants.

Specified by:
size in interface Collection<Parser.Node>
Specified by:
size in interface List<Parser.Node>
Specified by:
size in class AbstractCollection<Parser.Node>
Returns:
0

visit

public abstract void visit(Visitor visitor)
implements divide and conquer for Visitor. Body must be visitor.visit(this);.



(c) 2008 Axel T. Schreiner