|
Generic Interpreter 0.9 Public API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gi.Lexicon
This class implements a Lexicon
.
Method Summary | |
Object |
grab(BufferedReader source)
Grabs a terminal from a source character stream using this Lexicon . |
String |
word()
Returns the word most recently grabbed using this Lexicon . |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public Object grab(BufferedReader source) throws gi.Lexicon.Exception
Grabs a terminal from a source character stream using this Lexicon
. The variable returned by word()
is set to the longest nonempty prefix of the remaining source characters matching an Expression
in this Lexicon
. If no nonempty prefix matches an Expression
, a Lexicon.Exception
is thrown. If the longest matching prefix matches more than one Expression
, the terminal associated with the Expression
most recently constructed is returned. Blocks until a character is available, an I/O error occurs, or the end of the source stream is reached.
source
- the source character stream.source
.gi.Lexicon.Exception
- if an I/O or lexical error occurs.public String word()
Returns the word most recently grabbed using this Lexicon
.
grab(source)
.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |