annotate libinterp/parse-tree/pt-walk.cc @ 28256:3241ede9806c stable

delete obsolete and unused tree_return_list class (bug #58279) * pt-misc.h, pt-misc.cc (tree_return_list): Delete class. * pt-walk.h, pt-walk.cc (tree_walker::visit_return_list): Delete unused function from base tree_walker class (no tree_return_list objects are created by the parser so this function can never be called). * cdef-class.cc, pt-bp.cc, pt-bp.h, pt-eval.cc, pt-eval.h, pt-jit.cc, pt-jit.h,pt-pr-code.cc, pt-pr-code.h: Delete all visit_return_list functions in classes derived from tree_walker.
author John W. Eaton <jwe@octave.org>
date Thu, 30 Apr 2020 23:51:30 -0400
parents bd51beb6205e
children ac87763b1949
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
3 // Copyright (C) 2017-2020 The Octave Project Developers
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
23424
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 #if defined (HAVE_CONFIG_H)
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 # include "config.h"
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28 #endif
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29
27725
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
30 #include "pt-all.h"
23424
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 namespace octave
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 {
27725
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
34 void tree_walker::visit_anon_fcn_handle (tree_anon_fcn_handle&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
35 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
36 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
37 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
38
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
39 void tree_walker::visit_argument_list (tree_argument_list& lst)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
40 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
41 auto p = lst.begin ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
42
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
43 while (p != lst.end ())
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
44 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
45 tree_expression *elt = *p++;
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
46
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
47 if (elt)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
48 elt->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
49 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
50 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
51
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
52 void tree_walker::visit_binary_expression (tree_binary_expression& expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
53 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
54 tree_expression *op1 = expr.lhs ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
55
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
56 if (op1)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
57 op1->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
58
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
59 tree_expression *op2 = expr.rhs ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
60
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
61 if (op2)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
62 op2->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
63 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
64
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
65 void tree_walker::visit_boolean_expression (tree_boolean_expression& expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
66 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
67 visit_binary_expression (expr);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
68 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
69
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
70 void tree_walker::visit_compound_binary_expression (tree_compound_binary_expression& expr)
23424
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71 {
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72 visit_binary_expression (expr);
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73 }
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74
27725
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
75 void tree_walker::visit_break_command (tree_break_command&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
76 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
77 // Nothing to do.
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
78 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
79
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
80 void tree_walker::visit_colon_expression (tree_colon_expression& expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
81 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
82 tree_expression *op1 = expr.base ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
83
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
84 if (op1)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
85 op1->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
86
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
87 tree_expression *op3 = expr.increment ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
88
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
89 if (op3)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
90 op3->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
91
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
92 tree_expression *op2 = expr.limit ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
93
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
94 if (op2)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
95 op2->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
96 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
97
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
98 void tree_walker::visit_continue_command (tree_continue_command&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
99 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
100 // Nothing to do.
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
101 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
102
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
103 void tree_walker::visit_decl_command (tree_decl_command& cmd)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
104 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
105 tree_decl_init_list *init_list = cmd.initializer_list ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
106
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
107 if (init_list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
108 init_list->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
109 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
110
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
111 void tree_walker::visit_decl_elt (tree_decl_elt& cmd)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
112 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
113 tree_identifier *id = cmd.ident ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
114
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
115 if (id)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
116 id->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
117
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
118 tree_expression *expr = cmd.expression ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
119
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
120 if (expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
121 expr->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
122 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
123
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
124 void tree_walker::visit_decl_init_list (tree_decl_init_list& lst)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
125 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
126 // FIXME: tree_decl_elt is not derived from tree, so should it
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
127 // really have an accept method?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
128
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
129 for (tree_decl_elt *elt : lst)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
130 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
131 if (elt)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
132 elt->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
133 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
134 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
135
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
136 void tree_walker::visit_simple_for_command (tree_simple_for_command& cmd)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
137 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
138 tree_expression *lhs = cmd.left_hand_side ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
139
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
140 if (lhs)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
141 lhs->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
142
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
143 tree_expression *expr = cmd.control_expr ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
144
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
145 if (expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
146 expr->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
147
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
148 tree_expression *maxproc = cmd.maxproc_expr ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
149
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
150 if (maxproc)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
151 maxproc->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
152
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
153 tree_statement_list *list = cmd.body ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
154
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
155 if (list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
156 list->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
157 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
158
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
159 void tree_walker::visit_complex_for_command (tree_complex_for_command& cmd)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
160 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
161 tree_argument_list *lhs = cmd.left_hand_side ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
162
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
163 if (lhs)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
164 lhs->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
165
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
166 tree_expression *expr = cmd.control_expr ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
167
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
168 if (expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
169 expr->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
170
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
171 tree_statement_list *list = cmd.body ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
172
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
173 if (list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
174 list->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
175 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
176
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
177 void tree_walker::visit_octave_user_script (octave_user_script& fcn)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
178 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
179 tree_statement_list *cmd_list = fcn.body ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
180
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
181 if (cmd_list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
182 cmd_list->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
183 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
184
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
185 void tree_walker::visit_octave_user_function (octave_user_function& fcn)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
186 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
187 tree_statement_list *cmd_list = fcn.body ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
188
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
189 if (cmd_list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
190 cmd_list->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
191 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
192
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
193 void tree_walker::visit_function_def (tree_function_def& fdef)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
194 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
195 octave_value fcn = fdef.function ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
196
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
197 octave_function *f = fcn.function_value ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
198
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
199 if (f)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
200 f->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
201 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
202
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
203 void tree_walker::visit_identifier (tree_identifier&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
204 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
205 // Nothing to do.
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
206 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
207
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
208 void tree_walker::visit_if_clause (tree_if_clause& cmd)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
209 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
210 tree_expression *expr = cmd.condition ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
211
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
212 if (expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
213 expr->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
214
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
215 tree_statement_list *list = cmd.commands ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
216
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
217 if (list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
218 list->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
219 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
220
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
221 void tree_walker::visit_if_command (tree_if_command& cmd)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
222 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
223 tree_if_command_list *list = cmd.cmd_list ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
224
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
225 if (list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
226 list->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
227 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
228
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
229 void tree_walker::visit_if_command_list (tree_if_command_list& lst)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
230 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
231 auto p = lst.begin ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
232
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
233 while (p != lst.end ())
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
234 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
235 tree_if_clause *elt = *p++;
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
236
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
237 if (elt)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
238 elt->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
239 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
240 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
241
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
242 void tree_walker::visit_switch_case (tree_switch_case& cs)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
243 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
244 tree_expression *label = cs.case_label ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
245
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
246 if (label)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
247 label->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
248
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
249 tree_statement_list *list = cs.commands ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
250
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
251 if (list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
252 list->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
253 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
254
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
255 void tree_walker::visit_switch_case_list (tree_switch_case_list& lst)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
256 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
257 auto p = lst.begin ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
258
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
259 while (p != lst.end ())
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
260 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
261 tree_switch_case *elt = *p++;
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
262
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
263 if (elt)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
264 elt->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
265 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
266 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
267
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
268 void tree_walker::visit_switch_command (tree_switch_command& cmd)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
269 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
270 tree_expression *expr = cmd.switch_value ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
271
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
272 if (expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
273 expr->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
274
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
275 tree_switch_case_list *list = cmd.case_list ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
276
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
277 if (list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
278 list->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
279 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
280
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
281 void tree_walker::visit_index_expression (tree_index_expression& expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
282 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
283 tree_expression *e = expr.expression ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
284
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
285 if (e)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
286 e->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
287
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
288 std::list<tree_argument_list *> lst = expr.arg_lists ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
289
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
290 auto p = lst.begin ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
291
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
292 while (p != lst.end ())
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
293 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
294 tree_argument_list *elt = *p++;
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
295
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
296 if (elt)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
297 elt->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
298 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
299 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
300
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
301 void tree_walker::visit_matrix (tree_matrix& lst)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
302 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
303 auto p = lst.begin ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
304
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
305 while (p != lst.end ())
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
306 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
307 tree_argument_list *elt = *p++;
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
308
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
309 if (elt)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
310 elt->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
311 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
312 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
313
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
314 void tree_walker::visit_cell (tree_cell& lst)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
315 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
316 auto p = lst.begin ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
317
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
318 while (p != lst.end ())
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
319 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
320 tree_argument_list *elt = *p++;
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
321
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
322 if (elt)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
323 elt->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
324 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
325 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
326
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
327 void tree_walker::visit_multi_assignment (tree_multi_assignment& expr)
23424
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
328 {
27725
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
329 tree_argument_list *lhs = expr.left_hand_side ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
330
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
331 if (lhs)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
332 lhs->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
333
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
334 tree_expression *rhs = expr.right_hand_side ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
335
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
336 if (rhs)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
337 rhs->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
338 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
339
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
340 void tree_walker::visit_no_op_command (tree_no_op_command&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
341 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
342 // Nothing to do.
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
343 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
344
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
345 void tree_walker::visit_constant (tree_constant&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
346 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
347 // Nothing to do.
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
348 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
349
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
350 void tree_walker::visit_fcn_handle (tree_fcn_handle&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
351 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
352 // Nothing to do.
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
353 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
354
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
355 void tree_walker::visit_parameter_list (tree_parameter_list& lst)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
356 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
357 auto p = lst.begin ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
358
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
359 while (p != lst.end ())
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
360 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
361 tree_decl_elt *elt = *p++;
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
362
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
363 if (elt)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
364 elt->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
365 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
366 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
367
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
368 void tree_walker::visit_postfix_expression (tree_postfix_expression& expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
369 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
370 tree_expression *e = expr.operand ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
371
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
372 if (e)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
373 e->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
374 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
375
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
376 void tree_walker::visit_prefix_expression (tree_prefix_expression& expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
377 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
378 tree_expression *e = expr.operand ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
379
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
380 if (e)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
381 e->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
382 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
383
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
384 void tree_walker::visit_return_command (tree_return_command&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
385 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
386 // Nothing to do.
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
387 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
388
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
389 void tree_walker::visit_simple_assignment (tree_simple_assignment& expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
390 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
391 tree_expression *lhs = expr.left_hand_side ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
392
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
393 if (lhs)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
394 lhs->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
395
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
396 tree_expression *rhs = expr.right_hand_side ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
397
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
398 if (rhs)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
399 rhs->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
400 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
401
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
402 void tree_walker::visit_statement (tree_statement& stmt)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
403 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
404 tree_command *cmd = stmt.command ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
405
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
406 if (cmd)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
407 cmd->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
408 else
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
409 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
410 tree_expression *expr = stmt.expression ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
411
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
412 if (expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
413 expr->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
414 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
415 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
416
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
417 void tree_walker::visit_statement_list (tree_statement_list& lst)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
418 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
419 for (tree_statement *elt : lst)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
420 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
421 if (elt)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
422 elt->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
423 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
424 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
425
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
426 void tree_walker::visit_try_catch_command (tree_try_catch_command& cmd)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
427 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
428 tree_statement_list *try_code = cmd.body ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
429
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
430 if (try_code)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
431 try_code->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
432
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
433 tree_identifier *expr_id = cmd.identifier ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
434
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
435 if (expr_id)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
436 expr_id->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
437
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
438 tree_statement_list *catch_code = cmd.cleanup ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
439
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
440 if (catch_code)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
441 catch_code->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
442 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
443
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
444 void tree_walker::visit_unwind_protect_command (tree_unwind_protect_command& cmd)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
445 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
446 tree_statement_list *unwind_protect_code = cmd.body ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
447
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
448 if (unwind_protect_code)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
449 unwind_protect_code->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
450
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
451 tree_statement_list *cleanup_code = cmd.cleanup ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
452
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
453 if (cleanup_code)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
454 cleanup_code->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
455 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
456
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
457 void tree_walker::visit_while_command (tree_while_command& cmd)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
458 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
459 tree_expression *expr = cmd.condition ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
460
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
461 if (expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
462 expr->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
463
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
464 tree_statement_list *list = cmd.body ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
465
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
466 if (list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
467 list->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
468 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
469
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
470 void tree_walker::visit_do_until_command (tree_do_until_command& cmd)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
471 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
472 tree_statement_list *list = cmd.body ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
473
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
474 if (list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
475 list->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
476
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
477 tree_expression *expr = cmd.condition ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
478
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
479 if (expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
480 expr->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
481 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
482
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
483 void tree_walker::visit_superclass_ref (tree_superclass_ref&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
484 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
485 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
486 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
487
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
488 void tree_walker::visit_metaclass_query (tree_metaclass_query&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
489 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
490 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
491 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
492
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
493 void tree_walker::visit_classdef_attribute (tree_classdef_attribute&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
494 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
495 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
496 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
497
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
498 void tree_walker::visit_classdef_attribute_list (tree_classdef_attribute_list&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
499 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
500 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
501 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
502
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
503 void tree_walker::visit_classdef_superclass (tree_classdef_superclass&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
504 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
505 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
506 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
507
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
508 void tree_walker::visit_classdef_superclass_list (tree_classdef_superclass_list&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
509 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
510 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
511 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
512
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
513 void tree_walker::visit_classdef_property (tree_classdef_property&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
514 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
515 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
516 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
517
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
518 void tree_walker::visit_classdef_property_list (tree_classdef_property_list&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
519 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
520 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
521 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
522
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
523 void tree_walker::visit_classdef_properties_block (tree_classdef_properties_block&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
524 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
525 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
526 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
527
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
528 void tree_walker::visit_classdef_methods_list (tree_classdef_methods_list&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
529 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
530 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
531 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
532
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
533 void tree_walker::visit_classdef_methods_block (tree_classdef_methods_block&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
534 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
535 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
536 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
537
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
538 void tree_walker::visit_classdef_event (tree_classdef_event&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
539 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
540 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
541 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
542
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
543 void tree_walker::visit_classdef_events_list (tree_classdef_events_list&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
544 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
545 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
546 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
547
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
548 void tree_walker::visit_classdef_events_block (tree_classdef_events_block&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
549 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
550 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
551 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
552
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
553 void tree_walker::visit_classdef_enum (tree_classdef_enum&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
554 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
555 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
556 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
557
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
558 void tree_walker::visit_classdef_enum_list (tree_classdef_enum_list&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
559 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
560 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
561 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
562
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
563 void tree_walker::visit_classdef_enum_block (tree_classdef_enum_block&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
564 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
565 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
566 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
567
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
568 void tree_walker::visit_classdef_body (tree_classdef_body&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
569 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
570 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
571 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
572
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
573 void tree_walker::visit_classdef (tree_classdef&)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
574 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
575 // FIXME?
23424
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
576 }
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
577 }