blob: c3333af4b1e78ae85a09e012c3a84822cde58808 [file] [log] [blame]
Václav Kubernát624a8872018-03-02 17:28:47 +01001/*
2 * Copyright (C) 2018 CESNET, https://photonics.cesnet.cz/
3 *
4 * Written by Václav Kubernát <kubervac@fit.cvut.cz>
5 *
6 */
7
8#pragma once
9#include <boost/spirit/home/x3.hpp>
10#include "CTree.hpp"
11namespace x3 = boost::spirit::x3;
12namespace ascii = boost::spirit::x3::ascii;
13using Cmd = std::vector<std::string>;
14using x3::alpha;
15using x3::lit;
16using x3::char_;
17using x3::_attr;
18using x3::lexeme;
19using ascii::space;
20
21class TooManyArgumentsException : public std::invalid_argument {
22public:
23 using std::invalid_argument::invalid_argument;
24 ~TooManyArgumentsException() override;
25};
26
27class CParser {
28public:
29 CParser(const CTree& tree);
30 Cmd parseInput(const std::string& line);
31
32private:
33 const CTree& m_tree;
34};