Robert Wilton <[email protected]> wrote:
> Hi,
> 
> I was looking the Yang 1.1 ABNF Grammar, and noticed various places
> where the rules are specified as the directive "a string that matches
> the rule XXX", e.g.
> 
>    yang-version-arg-str = < a string that matches the rule
>                            yang-version-arg >
> 
>    yang-version-arg    = "1"
> 
> 
> It was slightly unclear to me exactly what is meant by this.
> 
> Am I right in understanding that the only valid text that would match
> yang-version-arg-str would be the 3 character sequence *"1"*

No.

> or is it
> more nuanced that this?

Yes.

First of all the abnf-rule

  yang-version-arg = "1"

matches a single character 1 (not three characters).

Next, YANG has a very regular syntax that all statements follow:

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

The argument in this rule is a string.  A string in YANG can be
specified in several ways:

   unqouted, e.g.:    foo
   quoted, e.g.:      'foo' or "foo"
   concatenated, e.g: "f" + "oo"

This cannot be expressed directly in ABNF.  So when the YANG grammar
says "a string that matches the rule..." it means that the "expanded"
string matches the rule.

So e.g., this is all legal:

    config false;
    config "false";
    config 'f' + "alse";


/martin

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

Reply via email to