sjm.parse
Class CollectionParser

java.lang.Object
  |
  +--sjm.parse.Parser
        |
        +--sjm.parse.CollectionParser
Direct Known Subclasses:
Alternation, Sequence

public abstract class CollectionParser
extends Parser

This class abstracts the behavior common to parsers that consist of a series of other parsers.

Version:
1.0
Author:
Steven J. Metsker

Field Summary
protected  java.util.Vector subparsers
          the parsers this parser is a collection of
 
Fields inherited from class sjm.parse.Parser
assembler, name
 
Constructor Summary
CollectionParser()
          Supports subclass constructors with no arguments.
CollectionParser(java.lang.String name)
          Supports subclass constructors with a name argument
 
Method Summary
 CollectionParser add(Parser e)
          Adds a parser to the collection.
 java.util.Vector getSubparsers()
          Return this parser's subparsers.
protected abstract  java.lang.String toStringSeparator()
          Helps to textually describe this CollectionParser.
protected  java.lang.String unvisitedString(java.util.Vector visited)
           
 
Methods inherited from class sjm.parse.Parser
accept, accept, add, best, bestMatch, completeMatch, elementClone, getName, match, matchAndAssemble, randomExpansion, randomInput, setAssembler, toString, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

subparsers

protected java.util.Vector subparsers
the parsers this parser is a collection of
Constructor Detail

CollectionParser

public CollectionParser()
Supports subclass constructors with no arguments.

CollectionParser

public CollectionParser(java.lang.String name)
Supports subclass constructors with a name argument
Parameters:
string - the name of this parser
Method Detail

add

public CollectionParser add(Parser e)
Adds a parser to the collection.
Parameters:
Parser - the parser to add
Returns:
this

getSubparsers

public java.util.Vector getSubparsers()
Return this parser's subparsers.
Returns:
Vector this parser's subparsers

toStringSeparator

protected abstract java.lang.String toStringSeparator()
Helps to textually describe this CollectionParser.

unvisitedString

protected java.lang.String unvisitedString(java.util.Vector visited)
Overrides:
unvisitedString in class Parser