1
/* Copyright 2008 Simon Richter <Simon.Richter@hogyros.de>
3
* Released under the GNU General Public Licence version 3.
10
#include "print_visitor.hpp"
12
#include "parallel_node.hpp"
13
#include "project_node.hpp"
14
#include "configuration_node.hpp"
15
#include "input_node.hpp"
16
#include "temporary_node.hpp"
17
#include "output_node.hpp"
18
#include "tool_node.hpp"
19
#include "environment_node.hpp"
20
#include "action_node.hpp"
27
intrusive_ptr<node> print_visitor::visit(parallel_node &n)
29
out << std::setw(depth*2+11) << "- parallel" << std::endl;
31
for(parallel_node::node_iterator i = n.nodes.begin();
32
i != n.nodes.end(); ++i)
33
*i = (**i).apply(*this);
38
intrusive_ptr<node> print_visitor::visit(project_node &n)
40
out << std::setw(depth*2+12) << "- project: " << n.project_name << " (" << n.project_type << ")" << std::endl;
42
for(project_node::node_iterator i = n.nodes.begin();
43
i != n.nodes.end(); ++i)
44
*i = (**i).apply(*this);
49
intrusive_ptr<node> print_visitor::visit(configuration_node &n)
51
out << std::setw(depth*2+18) << "- configuration: " << n.platform << std::endl;
53
for(configuration_node::node_iterator i = n.nodes.begin();
54
i != n.nodes.end(); ++i)
55
*i = (**i).apply(*this);
60
intrusive_ptr<node> print_visitor::visit(input_node &n)
62
out << std::setw(depth*2+10) << "- input: " << n.filename << std::endl;
66
intrusive_ptr<node> print_visitor::visit(temporary_node &n)
68
out << std::setw(depth*2+14) << "- temporary: " << n.filename << std::endl;
70
n.action = n.action->apply(*this);
75
intrusive_ptr<node> print_visitor::visit(output_node &n)
77
out << std::setw(depth*2+11) << "- output: " << n.filename << std::endl;
79
for(output_node::input_iterator i = n.inputs.begin();
80
i != n.inputs.end(); ++i)
81
*i = (**i).apply(*this);
83
n.action->apply(*this);
88
intrusive_ptr<node> print_visitor::visit(tool_node &n)
90
out << "tool: " << std::endl;
94
intrusive_ptr<node> print_visitor::visit(environment_node &n)
96
out << "environment: " << std::endl;
100
intrusive_ptr<node> print_visitor::visit(action_node &n)
102
out << std::setw(depth*2+11) << "- action: " << n.cmd << std::endl;
104
for(action_node::input_iterator i = n.inputs.begin();
105
i != n.inputs.end(); ++i)
106
*i = (**i).apply(*this);