Re: X3 employee example with semantic actions
Maarten Verhage <[email protected]> Thu, 7 Jun 2018 09:09:28 +0000
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <AM5P192MB0131231764D85C8DFB67F764BA640@AM5P192MB0131.EURP192.PROD.OUTLOOK.COM> |
> >----- Original Message ----- >From: Seth >To: Spirit General Mailing List >Sent: Thursday, June 07, 2018 08:31 >Subject: Re: [Spirit-general] X3 employee example with semantic actions > > >On 05-06-18 20:38, Maarten Verhage wrote: > >In the meantime I've learned by fortunate accident that the parser >directive >**raw** will provide me the iterator range I'm after >"fortunate accident" :) I presume, then, that was when I posted it in reply >to you on this mailing list? > >On 03-06-18 23:09, Seth wrote: > >On 03-06-18 16:23, Maarten Verhage wrote: > >Dear people, > >My application goal is as follows: > >1) parse an ascii file, >2) modify a few things, >3) write it back. > >However the file has portions that I just don’t need to modify. For these >portions I just want Spirit to provide me two iterators into the original >input so I can std::copy that portion to a memory area that will become my >new file. > >Separate idea: >https://stackoverflow.com/questions/36994539/boost-spirit-x3-parser-which-produces-offsets-into-the-original->string/37003186#37003186 > >Keep in mind you can have several semantic actions, so > > raw [ (int >> ':' >> double) [store_values] ] >[store_iterator_range]) > >is perfectly fine Hi Seth, You know I did not give you credit for it because I failed to pick the idea up from your message.Yes you did mention the raw directive but it was buried inside a code fragment in which you demonstrated that you can have multiple semantic actions. So an communication approach like the following: "Hey, Maarten, for your goal of having these two iterators you should use the raw parser directive. That is exactly invented for this." works much better at least with me. I do appeciate your effort to give me the right suggestion, however. Regards, Maarten ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Spirit-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/spirit-general