StmtContext.Mutable does not expose the ability to conjure purely-effective statements, i.e. those which are truly inferred from overall context and do not have a DeclaredStatement counterpart.
There are two use cases: implicit input/output statements in RPCs and Actions, which we cover through a rather ugly hack called StatementContextBase.appendImplicitSubstatement(). That part does still ends up creating a DeclaredStatement and also does not cover ModelStatement.argument() completely – for example it does not work for YANGTOOLS-1338, where the argument is a QName and we do not have a way to create a rawArgument String which would parse to what we need because we do not have the corresponding imports. Final deficiency is that it creates a SubstatementContext, i.e. having weird ties to declaration site.
Expose a new method StmtContext.Mutable, which will create a truly effective-only statements. The argument should be an ImplicitStatementAwareSubstatementContext (or similar, as that is a mouthful), which is an additional interface implemented by things like InputStatementSupport and can work without a DeclaredStatement instance.
- blocks
-
YANGTOOLS-1338 Generate ietf-restconf operations leaf statements
- Resolved
-
YANGTOOLS-1270 Instantiate EffectiveRevisionDate statements on linkage
- Confirmed
1.
|
Do not emit UndeclaredCaseStatements | Resolved | Robert Varga | |
2.
|
Remove ModelStatement.statementSource() | Resolved | Robert Varga |