Alexander Afanasyev | 8b37905 | 2011-08-21 16:58:20 -0700 | [diff] [blame] | 1 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2011 University of California, Los Angeles |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation; |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | * |
| 18 | * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu> |
| 19 | */ |
| 20 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 21 | #include "void-depth-first-visitor.h" |
Alexander Afanasyev | 8b37905 | 2011-08-21 16:58:20 -0700 | [diff] [blame] | 22 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 23 | #include "../syntax-tree/blob.h" |
| 24 | #include "../syntax-tree/udata.h" |
| 25 | #include "../syntax-tree/tag.h" |
| 26 | #include "../syntax-tree/dtag.h" |
| 27 | #include "../syntax-tree/attr.h" |
| 28 | #include "../syntax-tree/dattr.h" |
| 29 | #include "../syntax-tree/ext.h" |
Alexander Afanasyev | 8b37905 | 2011-08-21 16:58:20 -0700 | [diff] [blame] | 30 | |
| 31 | #include <boost/foreach.hpp> |
| 32 | |
Alexander Afanasyev | 1043c70 | 2013-07-15 16:21:09 -0700 | [diff] [blame] | 33 | NDN_NAMESPACE_BEGIN |
| 34 | |
| 35 | namespace wire { |
Alexander Afanasyev | 8b37905 | 2011-08-21 16:58:20 -0700 | [diff] [blame] | 36 | namespace CcnbParser { |
| 37 | |
| 38 | void |
| 39 | VoidDepthFirstVisitor::visit (Blob &n, boost::any param) |
| 40 | { |
| 41 | // Buffer n.m_blob; |
| 42 | } |
| 43 | |
| 44 | void |
| 45 | VoidDepthFirstVisitor::visit (Udata &n, boost::any param) |
| 46 | { |
| 47 | // std::string n.m_udata; |
| 48 | } |
| 49 | |
| 50 | void |
| 51 | VoidDepthFirstVisitor::visit (Tag &n, boost::any param) |
| 52 | { |
| 53 | // std::string n.m_tag; |
| 54 | // std::list<Ptr<Block> > n.m_attrs; |
| 55 | // std::list<Ptr<Block> > n.m_nestedBlocks; |
| 56 | BOOST_FOREACH (Ptr<Block> block, n.m_attrs) |
| 57 | { |
| 58 | block->accept (*this, param); |
| 59 | } |
Alexander Afanasyev | e709f3d | 2011-08-21 17:55:45 -0700 | [diff] [blame] | 60 | BOOST_FOREACH (Ptr<Block> block, n.m_nestedTags) |
Alexander Afanasyev | 8b37905 | 2011-08-21 16:58:20 -0700 | [diff] [blame] | 61 | { |
| 62 | block->accept (*this, param); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | void |
| 67 | VoidDepthFirstVisitor::visit (Dtag &n, boost::any param) |
| 68 | { |
| 69 | // std::string n.m_tag; |
| 70 | // std::list<Ptr<Block> > n.m_attrs; |
| 71 | // std::list<Ptr<Block> > n.m_nestedBlocks; |
| 72 | BOOST_FOREACH (Ptr<Block> block, n.m_attrs) |
| 73 | { |
| 74 | block->accept (*this, param); |
| 75 | } |
Alexander Afanasyev | e709f3d | 2011-08-21 17:55:45 -0700 | [diff] [blame] | 76 | BOOST_FOREACH (Ptr<Block> block, n.m_nestedTags) |
Alexander Afanasyev | 8b37905 | 2011-08-21 16:58:20 -0700 | [diff] [blame] | 77 | { |
| 78 | block->accept (*this, param); |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | void |
| 83 | VoidDepthFirstVisitor::visit (Attr &n, boost::any param) |
| 84 | { |
| 85 | // std::string n.m_attr; |
| 86 | // Ptr<Udata> n.m_value; |
| 87 | } |
| 88 | |
| 89 | void |
| 90 | VoidDepthFirstVisitor::visit (Dattr &n, boost::any param) |
| 91 | { |
| 92 | // uint32_t n.m_dattr; |
| 93 | // Ptr<Udata> n.m_value; |
| 94 | } |
| 95 | |
| 96 | void |
| 97 | VoidDepthFirstVisitor::visit (Ext &n, boost::any param) |
| 98 | { |
| 99 | // uint64_t n.m_extSubtype; |
| 100 | } |
| 101 | |
Alexander Afanasyev | 1043c70 | 2013-07-15 16:21:09 -0700 | [diff] [blame] | 102 | } // CcnbParser |
| 103 | } // wire |
| 104 | |
| 105 | NDN_NAMESPACE_END |