[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [YANG] YANG syntax



Martin Bjorklund wrote:
> Hi,
> 
>....
>> - Can a submodule use definitions from its parent module - automatically
>> or via "include"?
> 
> No.  You can never include a module (just submodules).
> 

Should there be some new text explaining some submodule details more clearly:

  - submodules must be self-contained -- if a foreign symbol is
    encountered (e.g., type or grouping name) then it must be
    found through the import or include mechanisms.

  - since a sub-module can never import or include its parent(s),
    it cannot use any definitions from those files.

  - the one exception to this rule is the module prefix, which
    may optionally be used within its submodules.  (This means
    a compiler parsing a sub-module must also partially parse
    the top module, via the belongs-to clause, to get the module prefix).

  - all submodule definitions are conceptually at the 'top' level, even if
    they are located in deeply nested submodules.  The submodule structure
    may be hierarchical, but the exported definitions are associated only
    with the module, not the submodule.  The 'export tree' is the conceptual
    union of the module and all submodules.


Andy


_______________________________________________
YANG mailing list
YANG at ietf.org
https://www.ietf.org/mailman/listinfo/yang