"vscode:/vscode.git/clone" did not exist on "d03ea00f9b21de06858d4d507265d1cb0e9ad9b2"
parser.h 739 Bytes
Newer Older
beder's avatar
beder committed
1
2
3
#pragma once

#include <ios>
4
5
6
#include <string>
#include <vector>
#include <map>
7
#include "node.h"
8
#include "parserstate.h"
beder's avatar
beder committed
9
10
11
12

namespace YAML
{
	class Node;
13
	class Scanner;
beder's avatar
beder committed
14
15
16
17
18
19
20

	class Parser
	{
	public:
		Parser(std::istream& in);
		~Parser();

21
22
		operator bool() const;

23
		void Load(std::istream& in);
24
		void GetNextDocument(Node& document);
25
26
27
28
29
30
31
		void PrintTokens(std::ostream& out);

	private:
		void ParseDirectives();
		void HandleDirective(const std::string& name, const std::vector <std::string>& params);
		void HandleYamlDirective(const std::vector <std::string>& params);
		void HandleTagDirective(const std::vector <std::string>& params);
beder's avatar
beder committed
32
33

	private:
34
		Scanner *m_pScanner;
35
		ParserState m_state;
beder's avatar
beder committed
36
37
	};
}