Refactor YANG statement parser structure 45/92045/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 11 Aug 2020 08:47:25 +0000 (10:47 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 11 Aug 2020 15:35:18 +0000 (17:35 +0200)
commitdc3c6c7929ac24bd6a4a34b91320086199f89672
tree2e57086c04eb7259e8693f15e227e359c1ddb80a
parentbfa48f01ef8a2cc5b1abd9eafadda687e53bbd27
Refactor YANG statement parser structure

Current definition leads to leading whitespace being considered
a part of the statement. This leads to misleading line/character
being reported as the start of the statement.

Fix this by introducing a top-level 'file', which encapsulates
at least one statement with its leading/trailing whitespace. The
other parts then come together naturally.

JIRA: YANGTOOLS-1129
Change-Id: I9f725b09eae6f8acf4397c97c60f99caaade798b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit b462288cc6e678b9350551c64ecda96196ebe8b4)
yang/yang-parser-rfc7950/src/main/antlr/org/opendaylight/yangtools/antlrv4/code/gen/YangStatementParser.g4
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/repo/YangStatementStreamSource.java