-
Notifications
You must be signed in to change notification settings - Fork 2
/
parse_result.hpp
49 lines (37 loc) · 1.18 KB
/
parse_result.hpp
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
47
48
49
#ifndef SQL_TEXT_PARSER_PARSE_RESULT_HPP
#define SQL_TEXT_PARSER_PARSE_RESULT_HPP
#include "sql/text/parser/config.hpp"
#include <sstream>
#include <string>
namespace sql { namespace text {
template<typename Attribute>
struct parse_result {
/* Indicates whether parsing was successful
*/
bool success;
/* Indicates whether the whole input string was consumed by the parser
*/
bool finished;
/* The number of characters that remain unparsed
*/
unsigned int remainder;
/* Parsed attribute
*/
Attribute attribute;
/* Diagnostic messages
*/
std::string messages;
/* Errors
*/
error_handler_type errors;
/* Parse result
*/
parse_result(bool success, bool finished,
unsigned int remainder, Attribute attribute,
std::string messages,
error_handler_type errors)
: success(success), finished(finished), remainder(remainder),
attribute(attribute), messages(messages), errors(errors) {}
};
}}
#endif //SQL_TEXT_PARSER_PARSE_RESULT_HPP