|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectcom.ibm.able.rules.AbleARLTokenStreamCache
This class is a specialized TokenStream that caches the contents of each token as it is obtained from the specified input stream, and can be used anywhere an ANTLR TokenStream can be used.
The contents of the cache can be obtained as a String or as a byte array. The latter might be useful in creating an input stream to pass to an ABLE lexer/parser to reparse the original stream.
| Field Summary | |
|---|---|
protected int |
myLine
The current line in the input stream that is being parsed. |
protected java.lang.String |
myPref
Prefix to the current line. |
protected java.lang.StringBuffer |
myStringBuffer
The cached input stream, created from the individual tokens as each token is obtained from the input stream. |
protected antlr.TokenStream |
myTokenStream
The 'real' input stream from which tokens are obtained; passed in through the constructor, and must never be null. |
| Constructor Summary | |
|---|---|
AbleARLTokenStreamCache(antlr.TokenStream theTokenStream)
Creates a new token stream cache. |
|
| Method Summary | |
|---|---|
byte[] |
getBytes()
Retrieves the current token cache as a byte array, which subsequently can be used to create an InputStream which can be used to reparse the stream. |
java.lang.String |
getString()
Retrieves the current token cache as a string. |
int |
length()
Retrieves the length of the current token cache. |
antlr.Token |
nextToken()
Obtains and returns the next token from the input stream. |
java.lang.String |
toString()
Retrieves the contents of the object as a string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected antlr.TokenStream myTokenStream
protected java.lang.StringBuffer myStringBuffer
protected int myLine
protected java.lang.String myPref
| Constructor Detail |
public AbleARLTokenStreamCache(antlr.TokenStream theTokenStream)
theTokenStream - The input stream from which tokens are to be obtained
and cached.| Method Detail |
public antlr.Token nextToken()
throws antlr.TokenStreamException
nextToken in interface antlr.TokenStreamantlr.TokenStreamExceptionpublic java.lang.String getString()
public byte[] getBytes()
public int length()
public java.lang.String toString()
|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||