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.
|
Field Summary |
protected java.util.Vector |
subparsers
the parsers this parser is a collection of |
|
Constructor Summary |
CollectionParser()
Supports subclass constructors with no arguments. |
CollectionParser(java.lang.String name)
Supports subclass constructors with a name argument |
| 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 |
subparsers
protected java.util.Vector subparsers
- the parsers this parser is a collection of
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
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