Re: X3 employee example with semantic actions
Larry Evans <[email protected]> Sun, 3 Jun 2018 09:32:40 -0500
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <[email protected]> |
On 06/03/2018 07:31 AM, Maarten Verhage wrote: >>> 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. Could you provide a link to that page. I tried scanning the main topics here: https://www.boost.org/doc/libs/1_67_0/libs/spirit/doc/html/index.html and it's not obvious to me where this "Annotations - Decorating the ASTs" page might be. > > 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. Waiting for that. I'm unfamiliar with position_tagged and would appreciation some education ;) > > Regards, Maarten > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot