Re: Generic protocol builder/parser




"rossum" <rossum48@xxxxxxxxxxxx> wrote in message
news:2nob145o2nupvul5kqsoe1d36s8cj1gst7@xxxxxxxxxx
On Mon, 28 Apr 2008 07:10:43 -0700 (PDT), oshaer@xxxxxxx wrote:

Hello everyone.

In my work many people (including me) need to write a parser and/or a
builder for a certain application-layer protocol.
We work with both ASCII and binary protocols. The protocols are
usually dynamic and have many variations according to certain
parameters.

Each programmer implements the needed componenet independently, in a
different style, using different concepts.

Is it reasonable to try and suggest a generic framework for parsing
and building various protocols?
Do you have any suggestions for a concept?
Do you know of any existing framework or tool that might help?

Thanks.
Oshaer.
Have a look at yacc (and similar) which seems to be a reasonable match
to your requirement. BNF-style input and a parser in C as output.

Coolest parser IMO is SLK (use Flex for lexer:)

http://home.earthlink.net/~slkpg/

works intimately and scaleable with C, C++ Java and C#, ( not minging ugly
macro munging like YACC)

Uses LL(k) grammars ... the Only grammars for the true grammar aesthete.

regards
Andy Little





.



Relevant Pages

  • Parser generator for package based protocols
    ... I work with a lot of different package based communication protocols ... a way where tokens are separated by delimiter characters. ... before the token and generate a parser that will give me a parse tree ...
    (comp.compilers)
  • Re: Parser generator for package based protocols
    ... protocols are normally in the form of header+data where the header ... Your input IMO deserves an scannerless parser, or a multi-level grammar, ... allows the tokens to be defined by the length information in the data ...
    (comp.compilers)
  • Re: Generic protocol builder/parser
    ... We work with both ASCII and binary protocols. ... Is it reasonable to try and suggest a generic framework for parsing ... Have a look at yacc which seems to be a reasonable match ... BNF-style input and a parser in C as output. ...
    (comp.programming)
  • Re: prefix for yacc/bison
    ... The grammars that yacc accepts are a subset ... the parser mechanisms to their hearts content. ... means a bounded lookahead bottom-up machine. ...
    (alt.os.linux)