From 6c876cf3280ba63d6077656476c2fc692e4bb1ff Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 28 Nov 2010 13:56:07 +0200 Subject: Qualify all unqualified name components in pointer types This this necessary since they may not resolve in the typedef that we generate in namespace odb. --- odb/cxx-lexer.hxx | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 odb/cxx-lexer.hxx (limited to 'odb/cxx-lexer.hxx') diff --git a/odb/cxx-lexer.hxx b/odb/cxx-lexer.hxx new file mode 100644 index 0000000..107f92b --- /dev/null +++ b/odb/cxx-lexer.hxx @@ -0,0 +1,45 @@ +// file : odb/cxx-lexer.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v3; see accompanying LICENSE file + +#ifndef ODB_CXX_LEXER_HXX +#define ODB_CXX_LEXER_HXX + +#include + +#include + +// A C++ keyword. This is an extension to libcpp token types. +// +#define CPP_KEYWORD ((cpp_ttype) (N_TTYPES + 1)) + +// A thin wrapper around cpp_reader for lexing C++ code fragments. +// +class cxx_lexer +{ +public: + cxx_lexer (); + ~cxx_lexer (); + +public: + struct invalid_input {}; + + void + start (std::string const&); + + cpp_ttype + next (std::string& token); + +public: + static char const* token_spelling[N_TTYPES + 1]; + +private: + std::string data_; + std::string buf_; + line_maps line_map_; + cpp_reader* reader_; + cpp_callbacks* callbacks_; +}; + +#endif // ODB_CXX_LEXER_HXX -- cgit v1.1