aboutsummaryrefslogtreecommitdiff
path: root/xsde/type-map/parser.hxx
blob: 592e1f6207915864159af8fc2a40ae336f9b48a4 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// file      : xsde/type-map/parser.hxx
// author    : Boris Kolpackov <boris@codesynthesis.com>
// copyright : Copyright (c) 2007-2009 Code Synthesis Tools CC
// license   : GNU GPL v2 + exceptions; see accompanying LICENSE file

#ifndef XSDE_TYPE_MAP_PARSER_HXX
#define XSDE_TYPE_MAP_PARSER_HXX

#include <cult/types.hxx>

#include <type-map/type-map.hxx>
#include <type-map/lexer.hxx>

namespace TypeMap
{
  using namespace Cult::Types;
  typedef WideString String;

  class Parser
  {
  public:
    Parser (Lexer&, String const& path);

    // Merge parsed namespaces.
    //
    Boolean
    parse (Namespaces&);

  private:
    Boolean
    namespace_ (Namespaces&);

    Boolean
    include (Namespace&);

    Boolean
    type (Lexer::Token, Namespace&);

  private:
    Lexer& lex_;
    String path_;
    std::wostream& e;
  };
}

#endif // XSDE_TYPE_MAP_PARSER_HXX