Subject: [Tools-discuss] ABNF parser generator

From: Cullen Jennings <[email-masked]>
Date: Thu, 11 Jun 2009 16:42:49 -0600

Hi All,

I just wanted to forward to the tools list some work that folks are  
doing on an ABNF code generator. The draft is at

draft-kim-abnf-codegen

I'll let the authors of this tell you more about it but it seemed like  
this list might have some of the people that would find this  
interesting.

Cullen

---

From: Munjo Yu <[email-masked]>
Date: Mon, 15 Jun 2009 12:12:11 -0400

Thanks Cullen.

Here is some background for the draft.

Many Internet applications, like VOIP and instant messaging clients,
involve processing network protocol messages.
 A key part of this processing is to decode(parse) messages as they
are received from the network, and
to encode attributes into messages. As message decoding/encoding
represent the front line of interaction
between the application and the outside world, the correctness of
decoding/encoding is crucial; any bugs
in decoding/encoding can prevent the application from doing its tasks.
Poor performance in decoding message
can be a bottleneck of the application. In the context of in-network
application such as proxies, where achieving
high throughput is essential, decoding must also be efficient.
Hand-written(fully or partially) network message processing code has
still been dominant but has become
increasingly error-prone. Especially, implementing a correct and
efficient network protocol message decoder is
a difficult task. Hand-written code is typically error-prone and
difficult to maintain.
To address these problems, not surprisingly, some code generators have
been built and used.
They support various languages and the "completeness" level of their
generated code varies from bare minimum
to complete. One observation is that no c code generator which
generates "complete" decoding/encoding C code
was caught by our radar. C language is the most popular language in
the network protocol implementation, and yet
no complete ABNF code generator. So, we developed our own ABNF code
generator and for that, had to
use some extensions to the existing ABNF rules since the standard ABNF
is not complete for code generation, by design.

The draft describes those extensions. One thing I have to note, is
that we had to use the historically controversial
feature that was dropped from the standard after all the discussion.
That is non-sequential group notation. Without
this feature, it would not have been possible to generate "complete"
code. Some attributes can come in any order
with varying multiplicity in the message header, for instance. Without
this feature, the user would have to edit
generated code to cope with this kind of situation. Without complete
code generation, one cannot enforce full control
over message decoding/encoding layer to make sure bug-free and high performance.

Any questions and comments will be priceless for us!

Thanks,
-Munjo Yu, VineGen Inc

On Thu, Jun 11, 2009 at 6:42 PM, Cullen Jennings<[email-masked]> wrote:
>
> Hi All,
>
> I just wanted to forward to the tools list some work that folks are doing on
> an ABNF code generator. The draft is at
>
> draft-kim-abnf-codegen
>
> I'll let the authors of this tell you more about it but it seemed like this
> list might have some of the people that would find this interesting.
>
> Cullen
>
>