external libraries: yaml-cpp version bump
[supercollider.git] / external_libraries / yaml-cpp-0.3.0 / src / singledocparser.h
blob3798dccf25d75bf0aba710e6b8108fcc1751e8f6
1 #ifndef SINGLEDOCPARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2 #define SINGLEDOCPARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
4 #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
5 #pragma once
6 #endif
9 #include "yaml-cpp/anchor.h"
10 #include "yaml-cpp/noncopyable.h"
11 #include <string>
12 #include <map>
13 #include <memory>
15 namespace YAML
17 struct Directives;
18 struct Mark;
19 struct Token;
20 class CollectionStack;
21 class EventHandler;
22 class Node;
23 class Scanner;
25 class SingleDocParser: private noncopyable
27 public:
28 SingleDocParser(Scanner& scanner, const Directives& directives);
29 ~SingleDocParser();
31 void HandleDocument(EventHandler& eventHandler);
33 private:
34 void HandleNode(EventHandler& eventHandler);
36 void HandleSequence(EventHandler& eventHandler);
37 void HandleBlockSequence(EventHandler& eventHandler);
38 void HandleFlowSequence(EventHandler& eventHandler);
40 void HandleMap(EventHandler& eventHandler);
41 void HandleBlockMap(EventHandler& eventHandler);
42 void HandleFlowMap(EventHandler& eventHandler);
43 void HandleCompactMap(EventHandler& eventHandler);
44 void HandleCompactMapWithNoKey(EventHandler& eventHandler);
46 void ParseProperties(std::string& tag, anchor_t& anchor);
47 void ParseTag(std::string& tag);
48 void ParseAnchor(anchor_t& anchor);
50 anchor_t RegisterAnchor(const std::string& name);
51 anchor_t LookupAnchor(const Mark& mark, const std::string& name) const;
53 private:
54 Scanner& m_scanner;
55 const Directives& m_directives;
56 std::auto_ptr<CollectionStack> m_pCollectionStack;
58 typedef std::map<std::string, anchor_t> Anchors;
59 Anchors m_anchors;
61 anchor_t m_curAnchor;
65 #endif // SINGLEDOCPARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66