Turn YangStatementParserListenerImpl into a visitor 78/68678/8
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 25 Feb 2018 21:05:16 +0000 (22:05 +0100)
committerRobert Varga <nite@hq.sk>
Mon, 26 Feb 2018 00:07:51 +0000 (00:07 +0000)
commitc2ffa7e33fd6ad002d98fde3662c5e5a4d07e676
tree6d0a4b5df45c347178e0631dc199bbcf40544adf
parent21b79cc46d46612c0f325496b5efab42db1fe019
Turn YangStatementParserListenerImpl into a visitor

Rather than using a listener with two methods, which needs to keep
and re-lookup state, implement such visitStatement(). This allows us
to skip duplicate lookups and will allow us to completely eliminate
all state tracking.

As it turns out we do not need any visitor logic, because we are
always walking statements and descending into their children. Rework
logic to reflect that, eliminating the need for any statekeeping,
as we can track all of the state inline.

JIRA: YANGTOOLS-713
Change-Id: I22a289fdbb2d8ea1501dd4a8eacd7780afbf1c6c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/repo/StatementContextVisitor.java [new file with mode: 0644]
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/repo/YangStatementParserListenerImpl.java [deleted file]
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/repo/YangStatementStreamSource.java