Subject: snmpconf BNF errors in policy MIB

From: Pablo Halpern <[email-masked]>
Date: Tue, 07 Nov 2000 12:17:48 -0500

This post is NOT part of my series addressing general language issues. This 
message is intended to address specific errors I found in the language as 
specified in the BNF.

First, the BNF in the document is far from complete. The text implies that 
the BNF is a subset of the language and that the rest of the language is 
supplied by the ANSI/ISO C standard. It does not make it clear exactly how 
the subset described is intended to mesh with the rest of C. Since the 
subset in question is less than 1/3 of the C standard, I suggest that we 
specify the ENTIRE language in BNF, rather than trying to describe deltas 
from the C standard. The entire C syntax is only about 10 pages of BNF, so 
our mini-C could be described in 3 or 4 pages at most. I'm willing to do 
this work, if desired. I can even run it through YACC to ensure that it is 
complete and unambiguous. (Steve Waldbusser: want to give me a crack at it?)

Even if we don't describe the entire language in BNF, there are important 
errors in the existing syntax. I don't have time to list every detail, but 
here are some highlights:

1. The language depends on char*, yet there is no way to declare a variable 
of type char*.

2. The syntax allows constructs like

         if (while(for( i = 0; i < 10; ++i) ; ))) j = if (i > 9) x = 5;

    In other words, an expression is allowed to have loops and 
if-conditionals in it. This is not C (although it is valid in other 
languages, including Perl). If we do want to allow such things (useful, but 
very not-C), we must describe the semantics.

3. There is no switch statement. Don't we want a switch statement? I think 
we do.

Again, I'm willing to take a crack at tightening this up, but I don't want 
to overlap with someone else's work or step on anybody's toes.

- Pablo
---------------------------------------------------------------------
Pablo Halpern                                    [email-masked]
http://www.halpernwightsoftware.com

---

From: Jon Saperia <[email-masked]>
Date: Fri, 10 Nov 2000 12:08:01 -0500

> complete and unambiguous. (Steve Waldbusser: want to give me a crack at it?)

Hi Pablo,

I do not think I saw a reply from Steve on this one. I like your suggestion
of doing a BNF. If you can do this soon, and publish it we could talk about
it at the next IETF, the second week of December.

/jon