Re: X3 employee example with semantic actions
Maarten Verhage <[email protected]> Tue, 5 Jun 2018 18:38:33 +0000
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <AM5P192MB01316760D35B9CF767E8ACFCBA660@AM5P192MB0131.EURP192.PROD.OUTLOOK.COM> |
----- Original Message ----- From: "Larry Evans" <[email protected]> To: <[email protected]> Sent: Tuesday, June 05, 2018 18:43 Subject: Re: [Spirit-general] X3 employee example with semantic actions > On 06/03/2018 09:03 PM, Joel de Guzman wrote: >> On 04/06/2018 5:41 AM, Seth wrote: >>> On 03-06-18 23:34, Maarten Verhage wrote: >>>> Sure I'm willing to learn. But where can I find the compiler examples >>>> you >>>> mentioned? >>> >>> look for `position_tagged` and `annotate_on_success` in e.g. >>> https://github.com/boostorg/spirit/blob/develop/example/x3/rexpr/rexpr_full/rexpr/rexpr_def.hpp >> >> Also check out the new examples (in devel) and the updated docs! >> >> Regards, > Joel, > > I was able to build the docs, but only after I'd built quickbook. > Couldn't there be specified a dependency of spirit docs on quickbook. > > After reading the docs briefly, I attempted an > as-close-as-possible ast annotation version of: > > https://gist.github.com/cppljevans/0f4351f127c2e651d8094877a9510e5a#file-x3-employee-beg_end_attr_actions-cpp > > That ast annotation implementation is here: > > https://gist.github.com/cppljevans/0f4351f127c2e651d8094877a9510e5a#file-x3-employee-annot_attr-cpp > > when run, it shows the attributes includes *both* the delimiters to the > input but also the actual employee::{age,first_name,last_name,salary} > attributes. I thought Maarten was wanting to avoid that, > > Maarten, is that right? > > -regards, > Larry Hi Larry, In an earlier message I explained I wasn't able to run the annotation example properly as it did not print the specific employee indicated with ast[1] I believe. I'm unsure if your terms of delimiters to the input is the same as my wording of two interators into the input of a parsed result. If so them yes I'm only after that. And then for some other rules I would like to have an actual parsed value in Context _attr. In the meantime I've learned by fortunate accident that the parser directive **raw** will provide me the iterator range I'm after. As a general remark on this. It is nice if you can immediately understand the facilities provided in a documentation page like the Parser Directives. If you don't little effort is made to properly present the ideas behind these facilities. Maybe the Spirit developers are annoyed by what they might consider as naive questions about obvious things in this mailing list. While I believe that if you improve the documentation and explain for with purpose you provide facilities people can much faster understand it, and the amount of "stupid" questions can be heavily reduced. Regards, Maarten ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot