Václav Kubernát | 624a887 | 2018-03-02 17:28:47 +0100 | [diff] [blame] | 1 | #include "CParser.hpp" |
| 2 | |
| 3 | TooManyArgumentsException::~TooManyArgumentsException() = default; |
| 4 | |
| 5 | CParser::CParser(const CTree& tree) |
| 6 | : m_tree(tree) |
| 7 | { |
| 8 | } |
| 9 | |
| 10 | |
| 11 | Cmd CParser::parseInput(const std::string& line) |
| 12 | { |
| 13 | Cmd args; |
| 14 | auto it = line.begin(); |
| 15 | //bool result = x3::phrase_parse(it, line.end(), command, space, args); |
| 16 | //std::cout << "success: " << result << std::endl; |
| 17 | if (it != line.end()) { |
| 18 | throw TooManyArgumentsException(std::string(it, line.end())); |
| 19 | } |
| 20 | |
| 21 | |
| 22 | return args; |
| 23 | } |