blob: 1a1770a47c1ea2e64fa3afb5927484a64d684ecd [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-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
33namespace ns3 {
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070034namespace ndn {
Alexander Afanasyev8b379052011-08-21 16:58:20 -070035namespace CcnbParser {
36
37void
38VoidDepthFirstVisitor::visit (Blob &n, boost::any param)
39{
40 // Buffer n.m_blob;
41}
42
43void
44VoidDepthFirstVisitor::visit (Udata &n, boost::any param)
45{
46 // std::string n.m_udata;
47}
48
49void
50VoidDepthFirstVisitor::visit (Tag &n, boost::any param)
51{
52 // std::string n.m_tag;
53 // std::list<Ptr<Block> > n.m_attrs;
54 // std::list<Ptr<Block> > n.m_nestedBlocks;
55 BOOST_FOREACH (Ptr<Block> block, n.m_attrs)
56 {
57 block->accept (*this, param);
58 }
Alexander Afanasyeve709f3d2011-08-21 17:55:45 -070059 BOOST_FOREACH (Ptr<Block> block, n.m_nestedTags)
Alexander Afanasyev8b379052011-08-21 16:58:20 -070060 {
61 block->accept (*this, param);
62 }
63}
64
65void
66VoidDepthFirstVisitor::visit (Dtag &n, boost::any param)
67{
68 // std::string n.m_tag;
69 // std::list<Ptr<Block> > n.m_attrs;
70 // std::list<Ptr<Block> > n.m_nestedBlocks;
71 BOOST_FOREACH (Ptr<Block> block, n.m_attrs)
72 {
73 block->accept (*this, param);
74 }
Alexander Afanasyeve709f3d2011-08-21 17:55:45 -070075 BOOST_FOREACH (Ptr<Block> block, n.m_nestedTags)
Alexander Afanasyev8b379052011-08-21 16:58:20 -070076 {
77 block->accept (*this, param);
78 }
79}
80
81void
82VoidDepthFirstVisitor::visit (Attr &n, boost::any param)
83{
84 // std::string n.m_attr;
85 // Ptr<Udata> n.m_value;
86}
87
88void
89VoidDepthFirstVisitor::visit (Dattr &n, boost::any param)
90{
91 // uint32_t n.m_dattr;
92 // Ptr<Udata> n.m_value;
93}
94
95void
96VoidDepthFirstVisitor::visit (Ext &n, boost::any param)
97{
98 // uint64_t n.m_extSubtype;
99}
100
101}
102}
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700103}