|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectBnfTokenizer
public class BnfTokenizer
A testbed for a tokenizer for BNF definitions. File StreamTokenizerAndTranslator.java Created on Jan 11, 2007
| Constructor Summary | |
|---|---|
BnfTokenizer()
Constructs a BnfTokenizer with no text to tokenize; must call
tokenize(String) before asking for tokens. |
|
BnfTokenizer(java.lang.String text)
Constructs a BnfTokenizer with specific initial text to tokenize. |
|
| Method Summary | |
|---|---|
java.lang.String |
nextToken()
Tokenizes BNF definitions and returns each token as a String, one token per call. |
void |
tokenize(java.lang.String text)
Sets the text to be turned into tokens by calls to nextToken(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BnfTokenizer()
BnfTokenizer with no text to tokenize; must call
tokenize(String) before asking for tokens.
public BnfTokenizer(java.lang.String text)
BnfTokenizer with specific initial text to tokenize.
text - The text to be tokenized.| Method Detail |
|---|
public void tokenize(java.lang.String text)
text - The text to be tokenized.
public java.lang.String nextToken()
throws java.lang.IllegalStateException
| Input characters | Returned string |
|---|---|
| <nonterminal> | <nonterminal> |
| terminal | nonterminal |
| "terminal" | nonterminal |
| + | + |
| ::= | ::= |
| | | | |
| \n | \n |
| (end of input) | EOF |
java.io.IOException - If unable to read the next token.
java.lang.IllegalStateException - If called without setting a string to
be tokenized.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||