()
| 86 | } |
| 87 | |
| 88 | func (p *Parser) reset() { |
| 89 | // Reset the lexer and parser before putting them back in the pool. |
| 90 | p.lexer.RemoveErrorListeners() |
| 91 | p.parser.RemoveErrorListeners() |
| 92 | p.lexer.SetInputStream(nil) |
| 93 | p.parser.SetInputStream(nil) |
| 94 | lexerPool.Put(p.lexer) |
| 95 | parserPool.Put(p.parser) |
| 96 | p.lexer = nil |
| 97 | p.parser = nil |
| 98 | } |
| 99 | |
| 100 | // SourceUnit consists of decls and clauses. |
| 101 | type SourceUnit struct { |
no outgoing calls
no test coverage detected