Language Processing
v2.0

pj2
Class Parser.Pattern

Object
  extended by AbstractCollection<E>
      extended by AbstractList<Parser.Node>
          extended by Parser.Node
              extended by Parser.Pattern
All Implemented Interfaces:
Iterable<Parser.Node>, Collection<Parser.Node>, List<Parser.Node>
Enclosing class:
Parser

public class Parser.Pattern
extends Parser.Node

represents an optionally typed token terminal. All instances can be found in Parser.patterns.


Field Summary
 String name
          unique name, cannot be error.
 int token
          unique symbol number, index into Parser.yyNames.
 Parser.Type type
          type (if not null), assumed plain.
 String value
          internalized representation.
 
Fields inherited from class Parser.Node
position
 
Fields inherited from class AbstractList
modCount
 
Constructor Summary
protected Parser.Pattern(int position, Parser.Type type, String name, String value)
          assumed unique, new, and within range, adds itself to Parser.patterns and Parser.yyNames, manages Parser.defined.
 
Method Summary
 boolean noType()
          true if there is a null or void|(java.lang.)?
 String toString()
           
 void visit(Visitor visitor)
          implements divide and conquer for Visitor.
 
Methods inherited from class Parser.Node
get, size
 
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
 
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

type

public final Parser.Type type
type (if not null), assumed plain.


name

public final String name
unique name, cannot be error.


value

public final String value
internalized representation.


token

public final int token
unique symbol number, index into Parser.yyNames. Invalid if noType() is true.

Constructor Detail

Parser.Pattern

protected Parser.Pattern(int position,
                         Parser.Type type,
                         String name,
                         String value)
assumed unique, new, and within range, adds itself to Parser.patterns and Parser.yyNames, manages Parser.defined.

Parameters:
value - must be internalized.
Method Detail

noType

public boolean noType()
true if there is a null or void|(java.lang.)?Void type. Note that this zaps Void in imported packages.


visit

public void visit(Visitor visitor)
Description copied from class: Parser.Node
implements divide and conquer for Visitor. Body must be visitor.visit(this);.

Specified by:
visit in class Parser.Node

toString

public String toString()
Overrides:
toString in class AbstractCollection<Parser.Node>


(c) 2008 Axel T. Schreiner