Organization of a parser project using boost spirit x3

Exagon <[email protected]>
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
I am currently using boos spirit x3 to implement a DSL which compiles to C
code.
Right now my parser is header only, so a rule in a .hpp look loke this:

typedef x3::rule<struct rule_class, ast::RuleAttr> rule_type;

const rule_type rule = "rule";

auto const rule_def = "foo" >> "bar" >> "baz";

BOOST_SPIRIT_DEFINE(rule)


In a lot of examples I am looking through BOOST_SPIRIT_INSTATNIATE, and
BOOST_SPIRIT_DECLARE is used and the parser is spilted into different files.

Whats best practice when building a parser using spirit x3? 
How should I use BOOST_SPIRIT_INSTATNIATE, BOOST_SPIRIT_DECLARE and
BOOST_SPIRIT_DEFINE?
And how should I splitt my parser in different files?

\Exagon



--
View this message in context: http://boost.2283326.n4.nabble.com/Organization-of-a-parser-project-using-boost-spirit-x3-tp4689127.html
Sent from the spirit-general mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
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.