diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-02-12 13:40:27 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-02-12 13:40:27 +0200 |
commit | c5db2b9db6c8c707c745c5920a4179e6e6b2772c (patch) | |
tree | 4b64764bf2904046061ebb8df8452f18469ecd77 /cli/runtime-header.cxx | |
parent | 8fe7185f10bec5cc6462354a9af7bafa01dd7d79 (diff) |
Add support for generating vector<string> scanner (--generate-vector-scanner)
Diffstat (limited to 'cli/runtime-header.cxx')
-rw-r--r-- | cli/runtime-header.cxx | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/cli/runtime-header.cxx b/cli/runtime-header.cxx index 98a2e5d..50281fa 100644 --- a/cli/runtime-header.cxx +++ b/cli/runtime-header.cxx @@ -292,6 +292,37 @@ generate_runtime_header (context& ctx) << "bool erase_;" << "};"; + // vector_scanner + // + if (ctx.options.generate_vector_scanner ()) + { + os << "class vector_scanner: public scanner" + << "{" + << "public:" << endl + << "vector_scanner (const std::vector<std::string>&, " << + "std::size_t start = 0);" + << endl + << "std::size_t" << endl + << "end () const;" + << endl + << "virtual bool" << endl + << "more ();" + << endl + << "virtual const char*" << endl + << "peek ();" + << endl + << "virtual const char*" << endl + << "next ();" + << endl + << "virtual void" << endl + << "skip ();" + << endl + << "private:" << endl + << "const std::vector<std::string>& v_;" + << "std::size_t i_;" + << "};"; + } + // argv_file_scanner // if (ctx.options.generate_file_scanner ()) |