There are plenty of parsers out there and usually you don't want to
reinvent the wheel.

Regarding flex and bison, I have worked with those tools and while they had
their time I think using them to create something by hand is very painful,
even for text protocols. I think the way to go are "parser combinators",
they are very flexible, intuitive and easy to use without any performance
penalty. Using nom (Rust's parser combinator) I have created an SDP parser
compatible with 8866 RFC in just 4 weekends:
https://github.com/Televiska/sdp-rs

/Filippos

On Sat, Aug 6, 2022, 4:37 AM Dale R. Worley <wor...@ariadne.com> wrote:

> massimiliano cialdi <massimiliano.cia...@powersoft.com> writes:
> > I would like to use a parser generator (like bison) or an SDP parser
> > already written. Could you give me a suggestion?
>
> Google gives me 400,000 hits for "sdp parser".  The first one is
> https://github.com/clux/sdp-transform "A simple parser/writer for SDP".
> There are likely to be others.
>
> > bison supports yacc-type grammars (essentially a BNF). Do you know of
> > a grammar translator from ABNF to BNF (even online)?
>
> I don't know of one.  OTOH, translating ABNF into BNF by hand is simple
> if you understand both.  And if you are going to do anything practical
> with your parser, you will need to make minor modifications, which will
> require that you understand well what your grammar is doing.
>
> So I would start with studying the ABNF documentation (RFC 5234 and
> possibly RFC 7405) and the Bison documentation.
>
> Dale
> _______________________________________________
> Sip-implementors mailing list
> Sip-implementors@lists.cs.columbia.edu
> https://lists.cs.columbia.edu/mailman/listinfo/sip-implementors
>
_______________________________________________
Sip-implementors mailing list
Sip-implementors@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/sip-implementors

Reply via email to