How to use Boost::Spirit::Lex to lex a file without reading the whole file into memory first?
问题 I'm looking at writing a lexer using boost::spirit::lex, but all the examples I can find seem to assume that you've read the entire file into RAM first. I'd like to write a lexer that doesn't require the whole string to be in RAM, is that possible? Or do I need to use something else? I tried using istream_iterator, but boost gives me a compile error unless I use const char* as the iterator types. e.g. All the examples I can find basically do this: lex_functor_type< lex::lexertl::lexer<> > lex