Added GetTokenSourceCharStreamPair method to lexer. Needed when customising lexer eg. to create a python style block sensitive lexer.

This commit is contained in:
Gary Miller 2016-11-29 13:27:49 +11:00
parent 763669ffc7
commit 2b69dd7c18
1 changed files with 4 additions and 0 deletions

View File

@ -282,6 +282,10 @@ func (b *BaseLexer) setInputStream(input CharStream) {
b.tokenFactorySourcePair = &TokenSourceCharStreamPair{b, b.input}
}
func (b *BaseLexer) GetTokenSourceCharStreamPair() *TokenSourceCharStreamPair {
return b.tokenFactorySourcePair
}
// By default does not support multiple emits per NextToken invocation
// for efficiency reasons. Subclass and override l method, NextToken,
// and GetToken (to push tokens into a list and pull from that list