Methods Summary |
---|
public void | addInputStream(persistence.antlr.TokenStream stream, java.lang.String key)
inputStreamNames.put(key, stream);
|
public persistence.antlr.TokenStream | getCurrentStream()Return the stream from tokens are being pulled at
the moment.
return input;
|
public persistence.antlr.TokenStream | getStream(java.lang.String sname)
TokenStream stream = (TokenStream)inputStreamNames.get(sname);
if (stream == null) {
throw new IllegalArgumentException("TokenStream " + sname + " not found");
}
return stream;
|
public persistence.antlr.Token | nextToken()
// return input.nextToken();
// keep looking for a token until you don't
// get a retry exception.
for (; ;) {
try {
return input.nextToken();
}
catch (TokenStreamRetryException r) {
// just retry "forever"
}
}
|
public persistence.antlr.TokenStream | pop()
TokenStream stream = (TokenStream)streamStack.pop();
select(stream);
return stream;
|
public void | push(persistence.antlr.TokenStream stream)
streamStack.push(input); // save current stream
select(stream);
|
public void | push(java.lang.String sname)
streamStack.push(input);
select(sname);
|
public void | retry()Abort recognition of current Token and try again.
A stream can push a new stream (for include files
for example, and then retry(), which will cause
the current stream to abort back to this.nextToken().
this.nextToken() then asks for a token from the
current stream, which is the new "substream."
throw new TokenStreamRetryException();
|
public void | select(persistence.antlr.TokenStream stream)Set the stream without pushing old stream
input = stream;
|
public void | select(java.lang.String sname)
input = getStream(sname);
|