Re: compare of 2 existing methods to implement grammar recursion

Larry Evans <[email protected]>
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
On 07/30/2016 01:47 PM, Larry Evans wrote:
> On 07/29/2016 10:31 AM, Larry Evans wrote:
>> The repository:
>>    https://github.com/boostorg/spirit/tree/develop
>> has toy.cpp here:
>>    */workbench/x3/toy/toy.cpp
>> which connects the rule with it's rule_definition using
>> the context; however, it's not clear from the code how
>> to connect multiple rule's withe their rule_definition's.
>>
>> In contrast:
>>
>>    */include/boost/spirit/home/x3/nonterminal/rule.hpp
>>
>> uses the BOOST_SPIRIT_DEFINE macro to do this, as illustrated by:
>>
>>    */example/x3/calc/calc1.cpp
>>
>> The gist:
>>
>>    https://gist.github.com/cppljevans/3634cc4e8ad4da81531608e6aa847de5
>>
>> shows both methods except, in contrast to toy.cpp, it uses
>> make_defns to link multiple rule's with their definitions.

OOPS, apparently the idea of make_defns (which makes a mapping
from the rule to it's definition) had already been tried here:

https://gist.github.com/jamboree/11133291

where it's called rule_map.

However, the file given in that gist:

boost/spirit/home/x3/nonterminal/grammar.hpp

is not present here:

https://github.com/djowel/spirit_x3/tree/master/include/boost/spirit/home/x3/nonterminal

The history for this directory:

https://github.com/djowel/spirit_x3/commits/master/include/boost/spirit/home/x3/nonterminal

mentions nothing about grammar.hpp.

Would someone explain why this idea was not used?

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