1

It seems the boost spirit Library has been designed with great caution on the symetry between the parsers and the generators. Provided a set of structures used to hold a data set, and a grammar (in its literal sens, not in the spirit sens), one should be able to write both a parser, and a generator.

Since spirit grammars contain both a grammar, and the structures used to hold the data in memory, would (or is) there be a way to, automatically, build a parser grammar from a generator grammar, and vice versa ? And if not, why ?

Something like:

karma::grammar<MyStruct> generator;
qi::grammar<MyStruct> parser = generator;
Heyji
  • 1,113
  • 8
  • 26

0 Answers0