blob: 5bf1b2624ca0cc06c42ebe10caeea734f957971b [file] [log] [blame]
Václav Kubernát195eeea2018-05-18 13:52:36 +02001/*
2 * Copyright (C) 2018 CESNET, https://photonics.cesnet.cz/
3 * Copyright (C) 2018 FIT CVUT, https://fit.cvut.cz/
4 *
5 * Written by Václav Kubernát <kubervac@fit.cvut.cz>
6 *
7*/
8
Václav Kubernát48fc3832018-05-28 14:21:22 +02009#include "schema.hpp"
Václav Kubernát195eeea2018-05-18 13:52:36 +020010struct ParserContext {
Václav Kubernát2eaceb82018-10-08 19:56:30 +020011 ParserContext(const Schema& schema, const schemaPath_& curDir);
Václav Kubernát48fc3832018-05-28 14:21:22 +020012 const Schema& m_schema;
Václav Kubernát2eaceb82018-10-08 19:56:30 +020013 schemaPath_ m_curPath;
Václav Kubernát5c75b252018-10-10 18:33:47 +020014 const schemaPath_ m_curPathOrig;
Václav Kubernát744f57f2018-06-29 22:46:26 +020015 boost::optional<std::string> m_curModule;
Václav Kubernát195eeea2018-05-18 13:52:36 +020016 std::string m_errorMsg;
17 std::string m_tmpListName;
Václav Kubernát744f57f2018-06-29 22:46:26 +020018 bool m_topLevelModulePresent = false;
Václav Kubernát195eeea2018-05-18 13:52:36 +020019 std::set<std::string> m_tmpListKeys;
20 bool m_errorHandled = false;
Václav Kubernátac035d62019-02-18 10:59:08 +010021 bool m_completing = false;
Václav Kubernát4108e0d2018-10-29 13:32:22 +010022 std::set<std::string> m_suggestions;
23 // Iterator pointing to where suggestions were created
24 std::string::const_iterator m_completionIterator;
Václav Kubernát4c325482019-04-11 17:51:55 +020025 // If the parser determines that suggestions are unambiguous (after
26 // filtering by prefix), this suffix gets added to the completion (for
27 // example a left bracket after a list)
28 std::string m_completionSuffix;
Václav Kubernát195eeea2018-05-18 13:52:36 +020029};