Subject: [netmod] ABNF for YANG comments

From: Andy Bierman <[email-masked]>
Date: Sun, 06 Jul 2008 10:06:02 -0700

Hi,

I don't see any ABNF describing YANG comments, e.g.:

    /*
     * this is a comment
     */

    // so is this

There is one sentence in Appendix D:

    This grammar assumes that the scanner replaces YANG comments with a
    single space character.

Does the ABNF need a formal definition of all the comment variants?

=============================

The 'smidump -f yang' output puts a comment before the 'module' keyword.
Both pyang and yangdump accept comments anywhere in the file,
but I don't think the ABNF reflects that:

[yang-00, pg 128, para 4]

OLD:
   module-stmt            = module-keyword sep identifier-str optsep

NEW:
   module-stmt            = optsep module-keyword sep identifier-str optsep
                            ^^^^^^

(The current ABNF properly accounts for any trailing whitespace.)

Andy

_______________________________________________
netmod mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netmod

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 07 Jul 2008 22:50:39 +0200 (CEST)

[2nd attempt]

> Does the ABNF need a formal definition of all the comment variants?

I don't think it's possible to define this *within* the same grammar
as we use to define the statements.  For example, this is valid:

   module "f" + /* c1 */ 'o' + // c2
          'o' {
       ...
   }

Thanks; fixed.  (same fix applied for submodule-stmt).

/martin