Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 CESNET, https://photonics.cesnet.cz/ |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame] | 3 | * Copyright (C) 2018 FIT CVUT, https://fit.cvut.cz/ |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 4 | * |
| 5 | * Written by Václav Kubernát <kubervac@fit.cvut.cz> |
| 6 | * |
| 7 | */ |
| 8 | #include "ast.hpp" |
Václav Kubernát | 0a2a2e8 | 2018-05-11 13:59:12 +0200 | [diff] [blame^] | 9 | #include "ast_handlers.hpp" |
Václav Kubernát | b96eef7 | 2018-05-04 19:10:22 +0200 | [diff] [blame] | 10 | |
| 11 | InvalidKeyException::~InvalidKeyException() = default; |
| 12 | |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame] | 13 | container_::container_(const std::string& name) |
| 14 | : m_name(name) |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 15 | { |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 16 | } |
| 17 | |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame] | 18 | bool container_::operator==(const container_& b) const |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 19 | { |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame] | 20 | return this->m_name == b.m_name; |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 21 | } |
| 22 | |
Václav Kubernát | b96eef7 | 2018-05-04 19:10:22 +0200 | [diff] [blame] | 23 | listElement_::listElement_(const std::string& listName, const std::map<std::string, std::string>& keys) |
| 24 | : m_listName(listName) |
| 25 | , m_keys(keys) |
| 26 | { |
| 27 | } |
| 28 | |
| 29 | bool listElement_::operator==(const listElement_& b) const |
| 30 | { |
| 31 | return (this->m_listName == b.m_listName && this->m_keys == b.m_keys); |
| 32 | } |
| 33 | |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame] | 34 | bool path_::operator==(const path_& b) const |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 35 | { |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame] | 36 | if (this->m_nodes.size() != b.m_nodes.size()) |
| 37 | return false; |
| 38 | return this->m_nodes == b.m_nodes; |
| 39 | } |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 40 | |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame] | 41 | bool cd_::operator==(const cd_& b) const |
| 42 | { |
| 43 | return this->m_path == b.m_path; |
| 44 | } |
| 45 | |
| 46 | |
| 47 | ParserContext::ParserContext(const CTree& tree) |
| 48 | : m_tree(tree) |
| 49 | { |
| 50 | m_curPath = m_tree.currentNode(); |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 51 | } |