Subject: [YANG] 7.1.5 import statement

From: Andy Bierman <[email-masked]>
Date: Wed, 09 Jan 2008 08:34:19 -0800

Hi,

This section does not say anything about whether it is an
error to import a non-existent module, if it is not used.
The pyang program reports this as a fatal error.

This gets into implementation details a little.
A well-formed import that never gets used should be a warning.
Consider implementations that do not actually find and compile
the module for an import clause until the first time the prefix is used.

The text needs to be clarified either way.

Andy

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

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Wed, 9 Jan 2008 18:22:01 +0100

> the module for an import clause until the first time the prefix is used.

I expect a compiler to complain if an import can not be found and I
expect a compiler to generate a warning if there is an import that is
not used. In general, we don't talk much about warnings so we might
choose to leave the generation of a warning for unused imports also an
implementation detail.

/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/>

---

From: Andy Bierman <[email-masked]>
Date: Wed, 09 Jan 2008 09:35:15 -0800

> choose to leave the generation of a warning for unused imports also an

Fine.  One compiler complains and continues, and another complains
and exits.

It would be nice if DM writers who invest time and money in YANG
know what 'valid YANG' is, so they know what tools should accept or not.
But we should not over-specify the DML, such as defining compiler warnings.

Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Wed, 09 Jan 2008 20:27:00 +0100 (CET)

Andy Bierman <[email-masked]> wrote:
> know what 'valid YANG' is,

The problem is that in this case it depends on the environment (a file
cannot be found).  So when my tool exits it doesn't say that the
module is invalid YANG.

/martin

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Wed, 9 Jan 2008 23:07:20 +0100

> cannot be found).  So when my tool exits it doesn't say that the

I believe all listed imports must resolve to a valid YANG module in
order to parse a given YANG module successfully. This should be part
of the language definition.

What actually happens if a parser hits an unresolvable import is
implementation specific. Some implementations may choose to stop
immediately when they hit an unresolvable import while others may
choose to complain loudly and try to continue as far as they get.

/js