
at this time, I try to separate the instances of spirit grammars into several files; this mean rewrite the functor parsers to grammars and move the implementation of grammar ctor into an own file. Anyway, this does not compile: --- header--- struct left_bracket_termated_string_parser : spirit::grammar<...> { template <typename ScannerT> struct definition { typedef sp::rule<ScannerT> rule_t; rule_t str; rule_t const& start() const { return str; } definition( const left_bracket_termated_string_parser& self ); }; }; const left_bracket_termated_string_parser sbt_str_p; ---- --- source --- template<> left_bracket_termated_string_parser::definitionsp::scanner::definition( const left_bracket_termated_string_parser& self ) { using namespace ::boost::spirit; using namespace ::phoenix; str = ( *( anychar_p - ch_p( '[' ) ) )[ self.result_ = construct_std::string( arg1, arg2 ) ] ; } ---- The error is: error: type/value mismatch at argument 1 in template parameter list for 'template<class ScannerT> struct left_bracket_termated_string_parser::definition' error: expected a type, got 'scanner' error: 'definition' is not a template function Anyway, does this help t reduce compile time. Thanks, Olaf