blob: 5bcecb8d71e996f1a0bbeecff9e393880ff4624c [file] [log] [blame]
Alexander Afanasyev8b379052011-08-21 16:58:20 -07001/* -*- 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 Afanasyev2b4c9472012-08-09 15:00:38 -070021#include "void-no-argu-depth-first-visitor.h"
Alexander Afanasyev8b379052011-08-21 16:58:20 -070022
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070023#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 Afanasyev8b379052011-08-21 16:58:20 -070030
31#include <boost/foreach.hpp>
32
Alexander Afanasyev1043c702013-07-15 16:21:09 -070033NDN_NAMESPACE_BEGIN
34
35namespace wire {
Alexander Afanasyev8b379052011-08-21 16:58:20 -070036namespace CcnbParser {
37
38void
39VoidNoArguDepthFirstVisitor::visit (Blob &n)
40{
41 // Buffer n.m_blob;
42}
43
44void
45VoidNoArguDepthFirstVisitor::visit (Udata &n)
46{
47 // std::string n.m_udata;
48}
49
50void
51VoidNoArguDepthFirstVisitor::visit (Tag &n)
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);
59 }
Alexander Afanasyeve709f3d2011-08-21 17:55:45 -070060 BOOST_FOREACH (Ptr<Block> block, n.m_nestedTags)
Alexander Afanasyev8b379052011-08-21 16:58:20 -070061 {
62 block->accept (*this);
63 }
64}
65
66void
67VoidNoArguDepthFirstVisitor::visit (Dtag &n)
68{
69 // uint32_t n.m_dtag;
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);
75 }
Alexander Afanasyeve709f3d2011-08-21 17:55:45 -070076 BOOST_FOREACH (Ptr<Block> block, n.m_nestedTags)
Alexander Afanasyev8b379052011-08-21 16:58:20 -070077 {
78 block->accept (*this);
79 }
80}
81
82void
83VoidNoArguDepthFirstVisitor::visit (Attr &n)
84{
85 // std::string n.m_attr;
86 // Ptr<Udata> n.m_value;
87}
88
89void
90VoidNoArguDepthFirstVisitor::visit (Dattr &n)
91{
92 // uint32_t n.m_dattr;
93 // Ptr<Udata> n.m_value;
94}
95
96void
97VoidNoArguDepthFirstVisitor::visit (Ext &n)
98{
99 // uint64_t n.m_extSubtype;
100}
101
Alexander Afanasyev1043c702013-07-15 16:21:09 -0700102} // CcnbParser
103} // wire
104
105NDN_NAMESPACE_END