Re: X3 employee example with semantic actions

Maarten Verhage <[email protected]> Sun, 3 Jun 2018 14:54:39 +0000
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <AM5P192MB0131FB32D5B9699B64AE8B31BA600@AM5P192MB0131.EURP192.PROD.OUTLOOK.COM>
Hi Larry,

>>
>> 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.
>

I didn't realize I was on some "developers" documentation area of the 
boost.org website. I used google and that brought me here:

https://www.boost.org/doc/libs/develop/libs/spirit/doc/x3/html/index.html

I also tried the annotation.cpp file there but on my gcc 5.1.0 it did 
compile fine but the printing after
"Here's the 2nd employee" is just empty. I think you will find that. I also 
did a printf in the on_success function and that was called 10 times which 
is correct I assume, so something else went wrong.

>>
>> 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 ;)
>

I'm glad you put ;) along with that because I do consider myself a novice in 
Spirit. I posted it already with the title:
[Spirit-general] X3 iterators into the input for a matching rule

Regards, Maarten



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot