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

Yang parser fails when extension is used between two revision statements

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 2406

    Description

      RFC6020 ABNF grammar says:

      revision-stmts = *(revision-stmt stmtsep)

      stmtsep = *(WSP / line-break / unknown-statement)

      Our YANG.g4 grammar says:

      revision_stmts : (revision_stmt )* (stmtsep)*;

      stmtsep : IDENTIFIER string? (stmtend | (LEFT_BRACE unknown_statement* RIGHT_BRACE));

      So, in our grammar unknown-statement can occur only after all revision statements, but in RFC grammar unknown-statement can occur also before or between two revision statements etc.

      For an example, parsing of following model fails:
      module my-module {
      namespace "my";
      prefix my;

      ...

      revision "2007-06-09"

      { description "Initial revision."; }

      my-prefix:my-extension 1;

      revision "2008-06-09"

      { description "Revision 2."; }

      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            pkajsa Peter Kajsa
            pkajsa Peter Kajsa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: