123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- #ifndef PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
- #define PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
- #if defined(_MSC_VER) || \
- (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
- (__GNUC__ >= 4))
- #pragma once
- #endif
- #include <ios>
- #include <memory>
- #include "yaml-cpp/dll.h"
- namespace YAML {
- class EventHandler;
- class Node;
- class Scanner;
- struct Directives;
- struct Token;
- class YAML_CPP_API Parser {
- public:
-
- Parser();
- Parser(const Parser&) = delete;
- Parser(Parser&&) = delete;
- Parser& operator=(const Parser&) = delete;
- Parser& operator=(Parser&&) = delete;
-
- explicit Parser(std::istream& in);
- ~Parser();
-
- explicit operator bool() const;
-
- void Load(std::istream& in);
-
- bool HandleNextDocument(EventHandler& eventHandler);
- void PrintTokens(std::ostream& out);
- private:
-
- void ParseDirectives();
- void HandleDirective(const Token& token);
-
- void HandleYamlDirective(const Token& token);
-
- void HandleTagDirective(const Token& token);
- private:
- std::unique_ptr<Scanner> m_pScanner;
- std::unique_ptr<Directives> m_pDirectives;
- };
- }
- #endif
|