Subject: [NGO] YANG and identifiers

From: Johan Rydberg <[email-masked]>
Date: Thu, 20 Dec 2007 18:18:53 +0100

While reading the YANG I-D one thing struck me as odd:

Some statements that refer to identifiers take a string as argument, and
not an identifier!  Why is this?  Example of such statements are 'key',
'unique' and 'prefix'.

~j

_______________________________________________
NGO mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/ngo

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 20 Dec 2007 18:27:04 +0100 (CET)

Hi,

[A general comment: yang specific questions should be sent to
[email-masked].]

> not an identifier!  Why is this?  Example of such statements are 'key',

This is because a YANG statement is defined as:

  statement = keyword [argument] (";" / "{" *statement "}")

The argument is always a string.  A string may or may not be
quoted, and the string can be concatenated etc.

In the ABNF grammar, you'll see e.g.

  prefix-stmt            = prefix-keyword sep prefix-str optsep stmtend

  prefix-str             = < a string which matches the rule
                             prefix >

  prefix                 = identifier

Which means that after tokenization (string concatenation etc), the
prefix argument must match the 'identifier' rule.

/martin