BUG-5222: Reuse substatements across phases
Now that we can address substatements accurately, we can reuse
the same statements instead of throwing them out and re-instantiating
them. We still need to switch the root if the YangVersion changes,
as the statement support objects need to be reemitted.
This removes the need for ContextBuilder and its subclasses, simply
because all required information is available when createDeclaredChild()
is called, bringing further simplification to StatementContextWriter.
Once that indirection is removed, the code flow is improved, which
flushed out a failure to validate when an extension requires an arugment,
hence the test models need update to pass validation.
A final effect of these changes is that StatementContextBase.declared
becomes superfluous, as it really is just a view over declared
substatements, which allows us to eliminate that field and instead
project a view of StatementMap's values.
Change-Id: I6fd3e2e2de41305457958673b77a72073215940e
Signed-off-by: Robert Varga <rovarga@cisco.com>
14 files changed: