Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-1372

Add support for purely-effective substatements

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: High High
    • 8.0.0
    • None
    • parser
    • None

      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.

        There are no Sub-Tasks for this issue.

            rovarga Robert Varga
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: