Esempio n. 1
0
    inline void
    print_node_info(bool hit, int level, bool close, std::string const& name,
        IteratorT first, IteratorT last)
    {
        if (!name.empty())
        {
            for (int i = 0; i < level; ++i)
                BOOST_SPIRIT_DEBUG_OUT << "  ";
            if (close)
            {
                if (hit)
                    BOOST_SPIRIT_DEBUG_OUT << "/";
                else
                    BOOST_SPIRIT_DEBUG_OUT << "#";
            }
            BOOST_SPIRIT_DEBUG_OUT << name << ":\t\"";
            IteratorT iter = first;
            IteratorT ilast = last;
            for (int j = 0; j < BOOST_SPIRIT_DEBUG_PRINT_SOME; ++j)
            {
                if (iter == ilast)
                    break;

                token_printer(BOOST_SPIRIT_DEBUG_OUT, *iter);
                ++iter;
            }
            BOOST_SPIRIT_DEBUG_OUT << "\"\n";
        }
    }
Esempio n. 2
0
void nip::compiler::compile() {
	std::vector<nip::Token_t> tokens;
	std::chrono::nanoseconds time;
	std::tie(tokens, time) = nip::util::bench_func([&] { return tokenizer(); });
	*opt.error_stream << "Time to tokenize = " << nip::util::print_time(time) << '\n';

	token_printer(tokens, *opt.output_stream);

	time = nip::util::bench_func_void([&] { return parser.parse(tokens, token_caches); });
	*opt.error_stream << "Time to parse    = " << nip::util::print_time(time) << '\n';

	parser.print_metadata_functor_info();
}