Subject: [YANG] Questions about submodule

From: Li Yan <[email-masked]>
Date: Fri, 18 Jan 2008 17:44:15 +0800

Hi,

o Sec 7.2.1 tells me that the "submodule" statement can contain the
"include" statement.

Does it imply that a submodule can be split further into multiple
submodules, and the separation is recursive?

I think splitting submodule would complicate the relationship between
submodules, and is not useful.

o A typo question

The following examples are from sec 7.1.10 and 7.2.3 respectively. I am
confused if the module/submodule name should be quoted.

module acme-system {

    .

    include acme-types;  //no quotes

    .

}

submodule acme-types {

    belongs-to "acme-system";  //in quotes

.

}

Yan

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

---

From: Martin Bjorklund <[email-masked]>
Date: Fri, 18 Jan 2008 11:15:05 +0100 (CET)

Hi Yan,

> submodules, and the separation is recursive?

Yes.  One use case for letting a submodule include another one is when
you split a larger module into submodules, and you want a submodule
with common types:

   main-module:  includes sub-a, sub-b, sub-common-types
   sub-a: includes sub-common-types
   sub-b: includes sub-common-types

> submodules, and is not useful.

In larger projects, this might actually be useful.  Instead of having
one big centralized module, we allow people to split the task into
submodules.  If the submodule becomes big enough, it might be useful
to split it into other submodules.  Even though I cannot see that 100
levels are ever used, I don't think we should add a rule which says
that you cannot nest more than 99 levels.

>     belongs-to "acme-system";  //in quotes

The argument to a statement is always a string.  Quotes MUST be used
if the string contains whitespaces etc, ane MAY be used otherwise (see
6.1.2 and 6.1.3).  So the examples above are both correct.

/martin

---

From: Balazs Lengyel <[email-masked]>
Date: Fri, 18 Jan 2008 11:15:24 +0100

Hello Yan,
See below!

Li Yan wrote:
> “include” statement.
[BALAZS]: Yes you can move parts of a sub-module into sub-sub-module. Currently there is no 
limit on the depth of such splitting. For big projects/module this is handy. I don't exactly 
understand what you mean by recursive.
>     belongs-to "acme-system";  //in quotes
[BALAZS]: Quoting is not needed here, but allowed. From the draft:
"If a string contains any whitespace characters, a semicolon (";"), curly braces ("{ }"), or 
comment sequences ("//", "/*", or "*/"), then it MUST be enclosed within double or single quotes."
regards Balazs

-- 
Balazs Lengyel                       Ericsson Hungary Ltd.
TSP System Manager
ECN: 831 7320                        Fax: +36 1 4377792
Tel: +36-1-437-7320     email: [email-masked]

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Fri, 18 Jan 2008 16:46:19 +0100

> that you cannot nest more than 99 levels.

I am not a big fan of introducing such arbitrary limits. A yang
compiler is not something that you need at NETCONF run time so memory
constraints etc. are not a big deal. We also have no limits for the
number of identifiers a module may define, the max. nesting of
containers and many other things. And I think this is goodness and we
should stick to this.

If people really want limits (I hope not), we should define minimums
that must be supported to be compliant, but leave the maximum open.
(Note that libsmi allocates everything dynamically so the limits are
 actually the available memory at run time; I would not like to move to
 a different implementation model just to be compliant to some rather
 arbitrarily choosen limits.)

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1, 28759 Bremen, Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>