Re: [netmod] What does unknown-statement2 represent in YANG grammar?

Jernej Tuljak <jernej.tuljak@mg-soft.si> Thu, 16 May 2013 06:46 UTC

Return-Path: <jernej.tuljak@mg-soft.si>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7015B21F925A for <netmod@ietfa.amsl.com>; Wed, 15 May 2013 23:46:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[AWL=0.000, BAYES_00=-2.599]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 95tHyuKgaIHL for <netmod@ietfa.amsl.com>; Wed, 15 May 2013 23:46:07 -0700 (PDT)
Received: from gate.mg-soft.si (gate.mg-soft.si [212.30.73.66]) by ietfa.amsl.com (Postfix) with ESMTP id E9F8121F9253 for <netmod@ietf.org>; Wed, 15 May 2013 23:46:06 -0700 (PDT)
Received: from [10.0.0.222] (tp-x61t.mg-soft.si [10.0.0.222]) by gate.mg-soft.si (8.13.8/8.13.8) with ESMTP id r4G6k45M007787; Thu, 16 May 2013 08:46:05 +0200
Message-ID: <519480AC.5010900@mg-soft.com>
Date: Thu, 16 May 2013 08:46:04 +0200
From: Jernej Tuljak <jernej.tuljak@mg-soft.si>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Martin Bjorklund <mbj@tail-f.com>
References: <CABCOCHSCgje9qbNGr98CN2=wyAo3mAdK0NiEG9S2X2rug79AVA@mail.gmail.com> <19000633-4F04-4FFD-B598-5233DA6D5D17@nic.cz> <CABCOCHSZyydQRLyrKH12g_oesQcJaeWdNxUHgrCX3PY65MXYmg@mail.gmail.com> <20130515.192130.360606148.mbj@tail-f.com>
In-Reply-To: <20130515.192130.360606148.mbj@tail-f.com>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 8bit
Cc: netmod@ietf.org
Subject: Re: [netmod] What does unknown-statement2 represent in YANG grammar?
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/netmod>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 16 May 2013 06:46:11 -0000

Dne 15.5.2013 19:21, piše Martin Bjorklund:
> Andy Bierman <andy@yumaworks.com> wrote:
>> ...
>>
>>>> The extension (unknown) statement is in the ABNF.
>>> Yes, but this will also match statements that are not declared with the
>>> "extension" statement. For a compiler or any software, the "extension"
>>> statement provides little added value.
>>>
>>>
>> So you are proposing that the ABNF be changed so unknown-statement2 is a
>> choice between its current value and all possible YANG statements?
>> So if any arbitrary YANG statement is used out of context, it MUST
>> be used correctly?
> Yes.  This is what the current text in 7.17 tried to say:
>
>     Syntactically, the substatements MUST be YANG
>     statements, or also defined using "extension" statements.
>
> The first idea was to require that all substatements to an extension
> were also extensions.  But that would mean if you define some
> extension that need all container / leaf / list ... they would have to
> copy almost all core YANG stmts.  (for example, suppose we add a new
> "alarm" keyword in an extension module, and an alarm has data nodes as
> substmts.)
>
> So we said that it is ok to use core YANG statements, as long as they
> are used the way they are defined.  For a reader, it is much easier if
> a statement you know always follow the same rules, instead of having
> context sensitve syntax.

IMHO, this might be useful an is definitely easier to implement than 
what Andy suggests. Also, this way all possible statements have an 
implicit or explicit definition of their basic structure (keyword and 
argument at the very least) without having to rely on context.

Jernej

>
> /martin
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod