Adding getTokenSource in BufferedTokenStream

This commit is contained in:
hkff 2015-10-21 14:15:57 +02:00
parent 8abc1106f7
commit 0e09f8b659
3 changed files with 8 additions and 2 deletions

View File

@ -260,6 +260,10 @@ BufferedTokenStream.prototype.setTokenSource = function(tokenSource) {
this.index = -1;
};
BufferedTokenStream.prototype.getTokenSource = function() {
return this.tokenSource;
};
// Given a starting index, return the index of the next token on channel.
// Return i if tokens[i] is on channel. Return -1 if there are no tokens
// on channel between i and EOF.

View File

@ -217,7 +217,8 @@ class BufferedTokenStream(TokenStream):
self.tokens = []
self.index = -1
def getTokenSource(self):
return self.tokenSource
# Given a starting index, return the index of the next token on channel.
# Return i if tokens[i] is on channel. Return -1 if there are no tokens

View File

@ -220,7 +220,8 @@ class BufferedTokenStream(TokenStream):
self.tokens = []
self.index = -1
def getTokenSource(self):
return self.tokenSource
# Given a starting index, return the index of the next token on channel.
# Return i if tokens[i] is on channel. Return -1 if there are no tokens