sjm.parse.tokens
Class QuotedString
java.lang.Object
|
+--sjm.parse.Parser
|
+--sjm.parse.Terminal
|
+--sjm.parse.tokens.QuotedString
- public class QuotedString
- extends Terminal
A QuotedString matches a quoted string, like "this one"
from a token assembly.
|
Method Summary |
protected boolean |
qualifies(java.lang.Object o)
Returns true if an assembly's next element is a quoted
string. |
java.util.Vector |
randomExpansion(int maxDepth,
int depth)
Create a set with one random quoted string (with 2 to
6 characters). |
java.lang.String |
unvisitedString(java.util.Vector visited)
Returns a textual description of this parser. |
| Methods inherited from class sjm.parse.Parser |
accept,
add,
best,
bestMatch,
completeMatch,
elementClone,
getName,
matchAndAssemble,
randomInput,
setAssembler,
toString,
toString |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
QuotedString
public QuotedString()
qualifies
protected boolean qualifies(java.lang.Object o)
- Returns true if an assembly's next element is a quoted
string.
- Overrides:
- qualifies in class Terminal
- Parameters:
object - an element from a assembly- Returns:
- true, if a assembly's next element is a quoted
string, like "chubby cherubim".
randomExpansion
public java.util.Vector randomExpansion(int maxDepth,
int depth)
- Create a set with one random quoted string (with 2 to
6 characters).
- Overrides:
- randomExpansion in class Terminal
unvisitedString
public java.lang.String unvisitedString(java.util.Vector visited)
- Returns a textual description of this parser.
- Overrides:
- unvisitedString in class Terminal
- Parameters:
vector - a list of parsers already printed in
this description- Returns:
- string a textual description of this parser
- See Also:
Parser.toString()