Questions tagged [boost-spirit-karma]

Any question related to boost spirit generators, which are part of the karma sub-library of the spirit Library. It is the pending tag of boost-spirit-qi dedicated to parsers (as opposed to generators)

For more information, the best is to look at boost spirit documentation

karma is the part of the boost spirit Library dedicated to generators. Generators are objects used to format information to be printed, according to a predefined formatting rule (which could be called a grammar). In the boost spirit Library, generators are opposed to parsers, which are reading printed information according to a given grammar.

51 questions
1
vote
1 answer

why does a constant string become a bool when used for input to variant?

I have condensed my problem to a (maybe not smallest) sample application below. The sample is a generic JSON parser. However, it exhibits two issues. 1. When none of the other options pass, it always outputs true or false when bool_ is an…
Brian Lloyd
  • 173
  • 7
1
vote
1 answer

Output of a boost::variant type using boost::spirit::karma

I'm trying to output parameters, they can either be a single parameter or a vector of parameters. The following code does not what I'd like it to do: #include #include #include #include…
Xoph
  • 459
  • 2
  • 10
1
vote
1 answer

Boost::spirit::karma: duplicate doesn't work within repeat or kleene star?

Here's a piece of very simple code that uses boost::spirit::karma to produce formatted output in the graphviz dot language: #include #include #include #include using namespace std; int…
kccqzy
  • 1,538
  • 1
  • 14
  • 22
1
vote
1 answer

boost::spirit::karma: using no_delimit with alternatives

I'm trying to turn off delimiting around a rule that includes the alternatives operator ('|'), but I'm getting a compile error about incompatible delimiters. As an example, I took the calc2_ast_dump.cpp example from boost, and modified the ast_node…
EHuhtala
  • 587
  • 3
  • 8
1
vote
1 answer

boost::spirit::karma semantic action assignment error

I'm trying to set karmas generator-value by a semantic action, however, it won't compile. I can't find the reson why, as I'm quite sure I use it as explained in the documentation. As I'm new to karma it's most likely I did some rookie mistake. A…
ickby
  • 222
  • 1
  • 9
0
votes
0 answers

Boost Spirit Karma repeat same output for every entry in a vector

Starting with a trivial problem, I chose to use boost::spirit::karma to turn it into something a little trickier. We have a map that maps entries of an enum class to vectors of ints, I'd like to produce output of the form Foo has 3 entries: Foo…
Xoph
  • 459
  • 2
  • 10
1 2 3
4