Re: X3 employee example with semantic actions
Maarten Verhage <[email protected]> Sun, 3 Jun 2018 12:31:52 +0000
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <AM5P192MB013137DD3C79220BA705318EBA600@AM5P192MB0131.EURP192.PROD.OUTLOOK.COM> |
>> On 06/02/2018 11:46 AM, Maarten Verhage wrote: >> [snip] >>> >>> For my application where I would like to 1) Parse a file 2) Modify a few >>> things and 3) write it back. I still think it is valueable to have the >>> option to get the two iterators of a rule match. So I can just std::copy >>> a >>> portion (described by a rule) of the file representation in memory, >>> rather >>> than having Spirit to interpret it. That will be higher performance does >>> it? >>> >> Would the code here: >> >> http://coliru.stacked-crooked.com/a/13c0d2050494a4d1 >> >> be close to what you want? >> >> -regards, >> Larry > > Hi Larry, Thanks for a jump-start on this one. Sure that will work in the > meantime. I appreciate your effort to write a complete example for this! > Still it would be so valueable if Context would just contain the starting > position as well. I hope Joel could help us on this one. > > Regards, Maarten The documentation page: "Annotations - Decorating the ASTs" makes use of the "position_tagged" base class for an ast. It claims to provide the positions into the input (with iterators) that corresponds to a given element in the AST. Maybe this does what I want. But I don't feel a need for an on_success function. I'm going to write a fresh message asking about this position_tagged and if I can use it without that concept of annotation which I still fail to understand what that means. Regards, Maarten ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot