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 | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame^] | 9 | container_::container_(const std::string& name) |
| 10 | : m_name(name) |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 11 | { |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 12 | } |
| 13 | |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame^] | 14 | bool container_::operator==(const container_& b) const |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 15 | { |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame^] | 16 | return this->m_name == b.m_name; |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 17 | } |
| 18 | |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame^] | 19 | bool path_::operator==(const path_& b) const |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 20 | { |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame^] | 21 | if (this->m_nodes.size() != b.m_nodes.size()) |
| 22 | return false; |
| 23 | return this->m_nodes == b.m_nodes; |
| 24 | } |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 25 | |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame^] | 26 | bool cd_::operator==(const cd_& b) const |
| 27 | { |
| 28 | return this->m_path == b.m_path; |
| 29 | } |
| 30 | |
| 31 | |
| 32 | ParserContext::ParserContext(const CTree& tree) |
| 33 | : m_tree(tree) |
| 34 | { |
| 35 | m_curPath = m_tree.currentNode(); |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 36 | } |