1

I need to create a parser for a protocol encoded in ABNF format. I am inclined to use boost::spirit for this task. I read documentation but I'm still not sure what is the most effective way to do it.

As far as I understand it is better to create a lexer for all the terminal symbols and use qi to parse input. Is that right?

Nikolay Kovalenko
  • 1,767
  • 2
  • 13
  • 14
  • There's no arguing about taste, but if my opinion means anything to you, I'd usually not use Spirit with a Lexer. If you need that, better not use the library that is geared towards rapid prototyping and convenience. Spirit X3 doesn't even have a lexer anymore. – sehe Nov 01 '17 at 10:37
  • See for a relevant example https://stackoverflow.com/questions/45220323/recursive-bnf-rule-using-boost-spirit/45224789#45224789 – sehe Nov 01 '17 at 10:39
  • This is actually a sort of duplicate https://stackoverflow.com/questions/32801103/spirit-parser-segfaults – sehe Nov 01 '17 at 10:41
  • thanks for the hints, sehe – Nikolay Kovalenko Nov 01 '17 at 11:58

0 Answers0