aboutsummaryrefslogtreecommitdiff
path: root/odb/cxx-token.hxx
blob: 20b08e42dd18a72ea7a332f8f50dd509e07668c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// file      : odb/cxx-token.hxx
// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
// license   : GNU GPL v3; see accompanying LICENSE file

#ifndef ODB_CXX_TOKEN_HXX
#define ODB_CXX_TOKEN_HXX

#include <string>
#include <vector>

#include <odb/gcc-fwd.hxx>

struct cxx_token
{
  cxx_token (location_t l,
             unsigned int t,
             std::string const& lt = std::string (),
             tree n = 0)
      : loc (l), type (t), literal (lt), node (n) {}

  location_t loc;      // Location of this token.
  unsigned int type;   // Untyped cpp_ttype.
  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;

#endif // ODB_CXX_TOKEN_HXX