On 11/6/18 4:40 PM, Michael Powell via Boost-users wrote:
On Tue, Nov 6, 2018 at 5:01 PM Michael Powell
wrote: Hello,
I've got a couple of rules that are perplexing to me. First,
rule
id %= lexeme[qi::alpha >> *char_("A-Za-z0-9_")]; In and of itself, id is working fine. Then I've got a "full id":
rule
full_id %= id >> *(char_('.') >> id); Where:
struct full_id_t { std::string val; };
full_id_t::val is quite intentional for reasons elsewhere in the grammar.
The perplexity comes in, it seems lexeme is only shaving off the first word as the val.
For instance, parsing "two.oranges.red.test", I receive back "two" in the AST.
Perhaps I should defer specifying the lexeme part of id until later?
[snip] The following simplification:
https://coliru.stacked-crooked.com/a/1adacde1a472d7a7 shows the full_id_t has the full attributes; however, it does *not* join them with the '.' char. Instead, it's a vectorstd::string. Unfortunately, I don't know how to automatically combine into a single string, but maybe this simplification will give you a starting point to figure that out. -regards, Larry