Václav Kubernát | 624a887 | 2018-03-02 17:28:47 +0100 | [diff] [blame^] | 1 | /* |
| 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" |
| 11 | namespace x3 = boost::spirit::x3; |
| 12 | namespace ascii = boost::spirit::x3::ascii; |
| 13 | using Cmd = std::vector<std::string>; |
| 14 | using x3::alpha; |
| 15 | using x3::lit; |
| 16 | using x3::char_; |
| 17 | using x3::_attr; |
| 18 | using x3::lexeme; |
| 19 | using ascii::space; |
| 20 | |
| 21 | class TooManyArgumentsException : public std::invalid_argument { |
| 22 | public: |
| 23 | using std::invalid_argument::invalid_argument; |
| 24 | ~TooManyArgumentsException() override; |
| 25 | }; |
| 26 | |
| 27 | class CParser { |
| 28 | public: |
| 29 | CParser(const CTree& tree); |
| 30 | Cmd parseInput(const std::string& line); |
| 31 | |
| 32 | private: |
| 33 | const CTree& m_tree; |
| 34 | }; |