summaryrefslogtreecommitdiff
path: root/xsd/type-map/parser.hxx
blob: 038d2ecef6d714998f8526814fad5a823295800c (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      : xsd/type-map/parser.hxx
// author    : Boris Kolpackov <boris@codesynthesis.com>
// copyright : Copyright (c) 2007-2010 Code Synthesis Tools CC
// license   : GNU GPL v2 + exceptions; see accompanying LICENSE file

#ifndef XSD_TYPE_MAP_PARSER_HXX
#define XSD_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 // XSD_TYPE_MAP_PARSER_HXX