GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
libinterp
parse-tree
pt-loop.cc
Go to the documentation of this file.
1
/*
2
3
Copyright (C) 1996-2013 John W. Eaton
4
5
This file is part of Octave.
6
7
Octave is free software; you can redistribute it and/or modify it
8
under the terms of the GNU General Public License as published by the
9
Free Software Foundation; either version 3 of the License, or (at your
10
option) any later version.
11
12
Octave is distributed in the hope that it will be useful, but WITHOUT
13
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15
for more details.
16
17
You should have received a copy of the GNU General Public License
18
along with Octave; see the file COPYING. If not, see
19
<http://www.gnu.org/licenses/>.
20
21
*/
22
23
#ifdef HAVE_CONFIG_H
24
#include <config.h>
25
#endif
26
27
#include "
quit.h
"
28
29
#include "
error.h
"
30
#include "
gripes.h
"
31
#include "
oct-map.h
"
32
#include "
oct-lvalue.h
"
33
#include "
ov.h
"
34
#include "
pt-arg-list.h
"
35
#include "
pt-bp.h
"
36
#include "
pt-cmd.h
"
37
#include "
pt-exp.h
"
38
#include "
pt-jit.h
"
39
#include "
pt-jump.h
"
40
#include "
pt-loop.h
"
41
#include "
pt-stmt.h
"
42
#include "
pt-walk.h
"
43
#include "
unwind-prot.h
"
44
45
// While.
46
47
tree_while_command::~tree_while_command
(
void
)
48
{
49
delete
expr
;
50
delete
list
;
51
delete
lead_comm
;
52
delete
trail_comm
;
53
#ifdef HAVE_LLVM
54
delete
compiled
;
55
#endif
56
}
57
58
tree_command
*
59
tree_while_command::dup
(
symbol_table::scope_id
scope,
60
symbol_table::context_id
context
)
const
61
{
62
return
new
tree_while_command
(
expr
?
expr
->
dup
(scope, context) : 0,
63
list
?
list
->
dup
(scope, context) : 0,
64
lead_comm
?
lead_comm
->
dup
() : 0,
65
trail_comm
?
trail_comm
->
dup
(): 0,
66
line
(),
column
());
67
}
68
69
void
70
tree_while_command::accept
(
tree_walker
& tw)
71
{
72
tw.
visit_while_command
(*
this
);
73
}
74
75
// Do-Until
76
77
tree_command
*
78
tree_do_until_command::dup
(
symbol_table::scope_id
scope,
79
symbol_table::context_id
context
)
const
80
{
81
return
new
tree_do_until_command
(
expr
?
expr
->
dup
(scope, context) : 0,
82
list
?
list
->
dup
(scope, context) : 0,
83
lead_comm
?
lead_comm
->
dup
() : 0,
84
trail_comm
?
trail_comm
->
dup
(): 0,
85
line
(),
column
());
86
}
87
88
void
89
tree_do_until_command::accept
(
tree_walker
& tw)
90
{
91
tw.
visit_do_until_command
(*
this
);
92
}
93
94
// For.
95
96
tree_simple_for_command::~tree_simple_for_command
(
void
)
97
{
98
delete
lhs
;
99
delete
expr
;
100
delete
maxproc
;
101
delete
list
;
102
delete
lead_comm
;
103
delete
trail_comm
;
104
#ifdef HAVE_LLVM
105
delete
compiled
;
106
#endif
107
}
108
109
tree_command
*
110
tree_simple_for_command::dup
(
symbol_table::scope_id
scope,
111
symbol_table::context_id
context
)
const
112
{
113
return
new
tree_simple_for_command
114
(
parallel
,
lhs
?
lhs
->
dup
(scope, context) : 0,
115
expr
?
expr
->
dup
(scope, context) : 0,
116
maxproc
?
maxproc
->
dup
(scope, context) : 0,
117
list
?
list
->
dup
(scope, context) : 0,
118
lead_comm
?
lead_comm
->
dup
() : 0,
119
trail_comm
?
trail_comm
->
dup
() : 0,
line
(),
column
());
120
}
121
122
void
123
tree_simple_for_command::accept
(
tree_walker
& tw)
124
{
125
tw.
visit_simple_for_command
(*
this
);
126
}
127
128
tree_complex_for_command::~tree_complex_for_command
(
void
)
129
{
130
delete
lhs
;
131
delete
expr
;
132
delete
list
;
133
delete
lead_comm
;
134
delete
trail_comm
;
135
}
136
137
tree_command
*
138
tree_complex_for_command::dup
(
symbol_table::scope_id
scope,
139
symbol_table::context_id
context
)
const
140
{
141
return
new
tree_complex_for_command
(
lhs
?
lhs
->
dup
(scope, context) : 0,
142
expr
?
expr
->
dup
(scope, context) : 0,
143
list
?
list
->
dup
(scope, context) : 0,
144
lead_comm
?
lead_comm
->
dup
() : 0,
145
trail_comm
?
trail_comm
->
dup
() : 0,
146
line
(),
column
());
147
}
148
149
void
150
tree_complex_for_command::accept
(
tree_walker
& tw)
151
{
152
tw.
visit_complex_for_command
(*
this
);
153
}
Generated on Mon Dec 30 2013 03:04:38 for GNU Octave by
1.8.1.2