summaryrefslogtreecommitdiff
path: root/odb/cxx-token.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-07-20 11:12:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-07-27 10:30:15 +0200
commit526f66e63f23afb40cc01550ca1a3a3592a84254 (patch)
treef17fd648c4c1e11838b413c6de91ff61693c0480 /odb/cxx-token.hxx
parent0a6a2fe64508497d287aa3341e667fe313912774 (diff)
Use cxx_lexer interface instead of pragma_lex() directly
This will allow us to use different kinds of cxx_lexer implementations in the future.
Diffstat (limited to 'odb/cxx-token.hxx')
-rw-r--r--odb/cxx-token.hxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/odb/cxx-token.hxx b/odb/cxx-token.hxx
index 193d122..6478fc1 100644
--- a/odb/cxx-token.hxx
+++ b/odb/cxx-token.hxx
@@ -8,10 +8,18 @@
#include <string>
#include <vector>
+#include <odb/gcc-fwd.hxx>
+
struct cxx_token
{
+ cxx_token (location_t l, unsigned int t): loc (l), type (t), node (0) {}
+
+ location_t loc; // Location of this token.
unsigned int type; // Untyped cpp_ttype.
- std::string literal; // Only used for name, string, number, etc.
+ std::string literal; // Only used for name, keyword, string, amd number.
+ tree node; // Tree node for the number. The number can be
+ // represented as either literal, tree node, or
+ // both, depending on which lexer was used.
};
typedef std::vector<cxx_token> cxx_tokens;