Encapsulate YangStatementParserListenerImpl.walk()
As it turns out, the contract between YangStatementStreamSource
is one of walking a tree with a set of parameters. Make sure we
encapsulate this contract, so that it can be efficiently implemented
using a visitor.
This has the benefit of discarding unneeded state more quickly
and not retaining it past errors. It will also allow us to very
simply convert YangStatementParserListenerImpl into a visitor.
JIRA: YANGTOOLS-713
Change-Id: Iac8c4979fb31cb527788837b41d4bbf17ce4b3cf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>