Re: Spirit X3 employee.cpp compile error

Larry Evans <[email protected]>
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
On 08/12/2016 07:53 AM, Vincent Virgilio wrote:
>
>
> On Aug 12, 2016, at 08:27 AM, Larry Evans <[email protected]> wrote:
>
>> On 08/12/2016 06:40 AM, Larry Evans wrote:
>> [snip]
>>>
>>>> GitHub: [email protected] <mailto:[email protected]>:boostorg/spirit.git
>>>>
>>>> Use the develop branch.
>>>> --}--cut here--
>>>>
>>> The 2 template arg rule code is actually in the x3-devel branch instead
>>> of the develop branch:
>>>
>>> https://github.com/boostorg/spirit/blob/x3-devel/include/boost/spirit/home/x3/nonterminal/rule.hpp#L80
>>>
>> [snip]
>> However, if you decide to use x3-devel, then the employee.cpp code
>> referenced in your OP needs to be modified so that the arguments
>> to BOOST_SPIRIT_DEFINE contain assignments instead of just
>> rule names. For example, see:
>>
>> https://github.com/boostorg/spirit/blob/x3-devel/example/x3/calc4.cpp#L218
>>
>> HTH.
>>
>> -regards,
>> Larry
>
> Hi Larry,
>
> Thanks for all the help so far.
>
> Why is BOOST_SPIRIT_DEFINE required if the rule declarations and
> definitions are already associated via assignment? In another small
> project, I was able to parse with an X3 grammar without that macro. In
> that case, very schematically, I had "auto const rule_name = rule<...>()
> = rule_def;"
>
[snip]
Hi Vincent,

I can only guess that the grammar in this small project had no
recursive rules like the calc4.cpp grammar I mentioned above.

That's only a guess; however, I *think* the whole purpose of
BOOST_SPIRIT_DEFINE is to allow mutually recursive rules, such as
that in calc4.cpp, *and* to avoid massive template names.
At least that's the conclusion I reach after reading
[email protected] reply to me here:

https://sourceforge.net/p/spirit/mailman/message/35271675/

HTH.

-regards,
Larry




------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.