Re: Parsing of a mapping between keys and values by X3 programming interface
SF Markus Elfring via Spirit-general <[email protected]> Fri, 28 Sep 2018 22:56:02 +0200
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <[email protected]> |
>>> 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? … > I wrote that because your attribute, line 38 of your code, _is_ a 'map_type', Yes. - I hoped to receive the desired input in such a kind of data structure. > and that would parse it. The above search pattern was moved from an other source code place. > 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. Thanks for this very nice feedback. I find it interesting that a few adjustments around “structures::map_type ⇒ structures::settings” resulted in a working program. My data type expectations might be still different for this use case. Will it become easier to resolve similar software design mismatches? > But if you are out to build a parser, I would start simple. There are variations possible based on similar search patterns. > Easier to see the forest. I have noticed development challenges for the mapping of specific syntax elements to concrete C++ attributes. I am curious if remaining open issues can be clarified better somehow. > http://coliru.stacked-crooked.com/a/3f2b150f250fdabb This is also another nice small source code example. Regards, Markus _______________________________________________ Spirit-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/spirit-general