Re: Parsing of a mapping between keys and values by X3 programming interface

Dan Bloomquist <[email protected]> Fri, 28 Sep 2018 13:11:31 -0700
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
SF Markus Elfring wrote:
>
>> If you do want to parse into 'map_type', you could:
> …
>>              auto pair = bsx::lexeme[(+bsa::alnum)] >> '=' >> bsx::lexeme[(+bsa::alnum)];
>>              bool r(bsx::phrase_parse(first, last, +pair, bsa::space, table));
> Why should I introduce such a variable when the example “RExpressions - Recursive ASTs!”
> can work already without it?

Hi Markus,
I wrote that because your attribute, line 38 of your code, _is_ a 
'map_type', and that would parse it. Without further ado, here it is 
working with the changes I suggested.

http://coliru.stacked-crooked.com/a/791e33c9c418e96f
Note, I've changed lines 38,65, and 69.

But if you are out to build a parser, I would start simple. Easier to 
see the forest.
http://coliru.stacked-crooked.com/a/3f2b150f250fdabb

Best, Dan.



_______________________________________________
Spirit-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spirit-general