On Mon, Jul 20, 2009 at 3:37 AM, Avi Bahra
I am using boost spirit 1.39. On gcc the compilation times are acceptable. However on AIX with v10.1 compiler, it fails to even compile. After 24hrs waiting, I gave up.
Ok I realise that the grammer needs to split. Is there any _small_ examples out there, that demonstrates this technique for a beginner ?
In my case I have one grammer and ~70 rules. Take the following rule:
rule
identifier ; identifier = lexeme_d [ (alnum_p || ch_p('_')) >> *(alnum_p || ch_p('_')) ] [ identifier.name = construct_std::string(arg1, arg2) ] ; What is the technique for converting it into a grammer, that is separately compiled ?
Also how would I reference it again, without including the header file, from another rule
dotPath = ( str_p(".") >> +( str_p("/") >> identifier ) ) [ dotPath.name = construct_std::string(arg1, arg2) ] ;
Any help would greatly appreciated.
First, you should use Boost Trunk, it compiles quite noticeably faster. Second, look in the Spirit examples directly with Boost Trunk, in the QI subdirectory, the mini_c directory has an example of just that.