Subject: [netmod] Query on YANG ABNF Grammar

From: Dhirendra Trivedi <[email-masked]>
Date: Thu, 11 May 2017 17:31:14 +0530

Hi All,

As per sec 7.15 of RFC 6020, augment's taget node MUST be either a
container,
list, choice, case, input, output or notification node.
So that means rpc's input stanza can also be augmented and i tried
augmenting
rpc's input stanza ( turing-machine.yang is being referred, available @
https://github.com/mbj4668/pyang/blob/master/doc/tutorial/examples/turing-machine.yang
)

augment "/tm:initialize/tm:input" {
     leaf foo {type string;}
}

And i could see that pyang's tree output plugin shows rpc's input stanza
has been
augmented successfully.

For augment, YANG ABNF grammer is

   augment-arg         = absolute-schema-nodeid

   absolute-schema-nodeid = 1*("/" node-identifier)

    node-identifier     = [prefix ":"] identifier

   ;; An identifier MUST NOT start with (('X'|'x') ('M'|'m') ('L'|'l'))

   identifier          = (ALPHA / "_")*(ALPHA / DIGIT / "_" / "-" / ".")

In the above example "input" has been taken as identifier,
though its YANG keyword.

input-keyword       = 'input'

not sure if i am missing some fine point here.

Regards,
Dhirendra

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 11 May 2017 14:09:02 +0200 (CEST)

> In the above example "input" has been taken as identifier,

The statement is:

  augment "/tm:initialize/tm:input" { ... }

This is a keyword (augment) with a string argument.  Inside thsi
string, you will find the word "input".  It is not parsed as a keyword
here.

/martin