annotate libinterp/parse-tree/pt-walk.cc @ 29724:c19f8cbe0fd5

initial implementation of parsing for arguments validaton block (bug #59405) This change allows parsing of arguments validation blocks. Octave should now accept the arguments block syntax in a mostly Matlab compatible way. Multiple argument blocks are allowed. All arguments blocks must appear before any other exectuable statements in a function. Similar to "methods", "properties", etc., "arguments" is defined as a keyword in the octave.gperf file so that converting "arguments" to the ARGUMENTS token in the lexer and parser is simplified but it is not really treated as a reserved keyword in the language. One known problem with the current approach is that function [...] = f (...) arguments = 13; ... end will result in a parse error. A simple workaround is to place another statement (that is not an arguments block) ahead of the "arguments = ..." line in the function. Fixing this problem generally might require a different parsing method that allows a different type of lookahead than we currently use. NOTE: arguments blocks do not currently perform any actions. Since they may provide default values and/or transform arguments to different types or values, ignoring the arguments block can lead to incorrect results. Octave also currently allows arguments blocks in nested functions though they should be rejected. Special treatment of "arguments" and "endarguments" may be disabled by defining the macro DISABLE_ARGUMENTS_VALIDATION_BLOCK. With this macro defined, Octave's lexer will never return the ARGUMENTS token, so the parser will fail to parse these program elements and the behavior should be the same as prior to this change. * pt-args-block.h, pt-args-block.cc: New files. * libinterp/parse-tree/module.mk: Update. * lex.h, lex.ll (lexical_feedback::m_arguments_is_keyword): New member variable. (lexical_feedback::reset): Reset m_arguments_is_keyword to false. (iskeyword, Fiskeyword): Also handle "arguments" as a special case. (base_lexer::make_keyword_token): Handle arguments and endarguments. * parse.h, oct-parse.yy (base_parser::make_arguments_block, base_parser::make_args_attribute_list, base_parser::make_arg_validation, base_parser::make_args_validation_list, base_parser::append_args_validation_list, base_parser::make_arg_size_spec, base_parser::make_arg_validation_fcns): New functions. (function_body, at_first_executable_stmt, function_body1, arguments_block, arguments_beg, args_attr_list, args_validation_list, arg_validation, size_spec, class_name, validation_fcns, default_value): New non-terminals. (ARGUMENTS): New token. (function): Use new function_body and function_body1 non-terminals to accept arguments blocks, but only at the beginning of a function. (fcn_name): Set lexer.m_arguments_is_keyword to true after parsing function name. (param_list_beg): Set lexer.m_arguments_is_keyword to false while parsing function parameter list. (param_list_beg): Reset lexer.m_arguments_is_keyword to true after parsing function parameter list. (tree_arguments_block_type, tree_args_block_attribute_list_type, tree_args_block_validation_list_type, tree_arg_size_spec_type, tree_arg_validation_type, tree_arg_validation_fcns_type): New non-terminal types. Also declare %destructors for them. * octave.gperf (octave_kw_id): New IDs, arguments_kw and endarguments_kw. Provide entries for arguments and endarguments keywords. * pt-all.h: Include pt-args-block.h. * pt-bp.h, pt-bp.cc (tree_breakpoint::visit_arguments_block, tree_breakpoint::visit_args_block_attribute_list, tree_breakpoint::visit_args_block_validation_list, tree_breakpoint::visit_arg_validation, tree_breakpoint::visit_arg_size_spec, tree_breakpoint::visit_arg_validation_fcns): New virtual functions for arguments block elements. * pt-eval.h, pt-eval.cc (tree_evaluator::visit_arguments_block, tree_evaluator::visit_args_block_attribute_list, tree_evaluator::visit_args_block_validation_list, tree_evaluator::visit_arg_validation, tree_evaluator::visit_arg_size_spec, tree_evaluator::visit_arg_validation_fcns): New virtual functions for arguments block elements. * pt-pr-code.h, pt-pr-code.cc (tree_print_code::visit_arguments_block, tree_print_code::visit_args_block_attribute_list, tree_print_code::visit_args_block_validation_list, tree_print_code::visit_arg_validation, tree_print_code::visit_arg_size_spec, tree_print_code::visit_arg_validation_fcns): New virtual functions for arguments block elements. * pt-walk.h, pt-walk.cc (tree_walker::visit_arguments_block, tree_walker::visit_args_block_attribute_list, tree_walker::visit_args_block_validation_list, tree_walker::visit_arg_validation, tree_walker::visit_arg_size_spec, tree_walker::visit_arg_validation_fcns): New virtual functions for arguments block elements. * token.h (end_tok_type): New type, arguments_end.
author John W. Eaton <jwe@octave.org>
date Tue, 01 Jun 2021 13:34:57 -0400
parents 7854d5752dd2
children c29cfcf7a941
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 //
29358
0a5b15007766 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 28317
diff changeset
3 // Copyright (C) 2017-2021 The Octave Project Developers
27923
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
29724
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
52 void tree_walker::visit_arguments_block (tree_arguments_block&)
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
53 {
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
54 // FIXME?
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
55 }
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
56
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
57 void tree_walker::visit_args_block_attribute_list (tree_args_block_attribute_list&)
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
58 {
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
59 // FIXME?
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
60 }
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
61
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
62 void tree_walker::visit_args_block_validation_list (tree_args_block_validation_list&)
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
63 {
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
64 // FIXME?
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
65 }
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
66
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
67 void tree_walker::visit_arg_validation (tree_arg_validation&)
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
68 {
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
69 // FIXME?
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
70 }
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
71
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
72 void tree_walker::visit_arg_size_spec (tree_arg_size_spec&)
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
73 {
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
74 // FIXME?
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
75 }
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
76
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
77 void tree_walker::visit_arg_validation_fcns (tree_arg_validation_fcns&)
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
78 {
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
79 // FIXME?
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
80 }
c19f8cbe0fd5 initial implementation of parsing for arguments validaton block (bug #59405)
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
81
27725
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
82 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
83 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
84 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
85
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
86 if (op1)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
87 op1->accept (*this);
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 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
90
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
91 if (op2)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
92 op2->accept (*this);
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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
95 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
96 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
97 visit_binary_expression (expr);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
98 }
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 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
101 {
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
102 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
103 }
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
104
27725
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
105 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
106 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
107 // Nothing to do.
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
108 }
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 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
111 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
112 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
113
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
114 if (op1)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
115 op1->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
116
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
117 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
118
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
119 if (op3)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
120 op3->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
121
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
122 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
123
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
124 if (op2)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
125 op2->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
126 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
127
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
128 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
129 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
130 // Nothing to do.
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
131 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
132
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
133 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
134 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
135 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
136
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
137 if (init_list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
138 init_list->accept (*this);
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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
141 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
142 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
143 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
144
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
145 if (id)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
146 id->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 *expr = cmd.expression ();
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 (expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
151 expr->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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
154 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
155 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
156 // 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
157 // 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
158
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
159 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
160 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
161 if (elt)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
162 elt->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
163 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
164 }
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 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
167 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
168 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
169
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
170 if (lhs)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
171 lhs->accept (*this);
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 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
174
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
175 if (expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
176 expr->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
177
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
178 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
179
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
180 if (maxproc)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
181 maxproc->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
182
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
183 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
184
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
185 if (list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
186 list->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
187 }
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 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
190 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
191 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
192
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
193 if (lhs)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
194 lhs->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
195
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
196 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
197
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
198 if (expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
199 expr->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
200
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
201 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
202
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
203 if (list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
204 list->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
205 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
206
28518
b8ab8b58547d accept spmd command blocks as language elements (bug #58676)
John W. Eaton <jwe@octave.org>
parents: 28317
diff changeset
207 void tree_walker::visit_spmd_command (tree_spmd_command& cmd)
b8ab8b58547d accept spmd command blocks as language elements (bug #58676)
John W. Eaton <jwe@octave.org>
parents: 28317
diff changeset
208 {
b8ab8b58547d accept spmd command blocks as language elements (bug #58676)
John W. Eaton <jwe@octave.org>
parents: 28317
diff changeset
209 tree_statement_list *body = cmd.body ();
b8ab8b58547d accept spmd command blocks as language elements (bug #58676)
John W. Eaton <jwe@octave.org>
parents: 28317
diff changeset
210
b8ab8b58547d accept spmd command blocks as language elements (bug #58676)
John W. Eaton <jwe@octave.org>
parents: 28317
diff changeset
211 if (body)
b8ab8b58547d accept spmd command blocks as language elements (bug #58676)
John W. Eaton <jwe@octave.org>
parents: 28317
diff changeset
212 body->accept (*this);
b8ab8b58547d accept spmd command blocks as language elements (bug #58676)
John W. Eaton <jwe@octave.org>
parents: 28317
diff changeset
213 }
b8ab8b58547d accept spmd command blocks as language elements (bug #58676)
John W. Eaton <jwe@octave.org>
parents: 28317
diff changeset
214
27725
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
215 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
216 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
217 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
218
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
219 if (cmd_list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
220 cmd_list->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
221 }
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 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
224 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
225 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
226
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
227 if (cmd_list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
228 cmd_list->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
229 }
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 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
232 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
233 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
234
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
235 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
236
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
237 if (f)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
238 f->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 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
242 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
243 // Nothing to do.
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
244 }
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 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
247 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
248 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
249
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
250 if (expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
251 expr->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
252
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
253 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
254
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
255 if (list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
256 list->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
257 }
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 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
260 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
261 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
262
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
263 if (list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
264 list->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 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
268 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
269 auto p = lst.begin ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
270
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
271 while (p != lst.end ())
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
272 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
273 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
274
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
275 if (elt)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
276 elt->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
277 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
278 }
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 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
281 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
282 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
283
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
284 if (label)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
285 label->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
286
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
287 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
288
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
289 if (list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
290 list->accept (*this);
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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
293 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
294 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
295 auto p = lst.begin ();
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
296
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
297 while (p != lst.end ())
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 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
300
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
301 if (elt)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
302 elt->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
303 }
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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
306 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
307 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
308 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
309
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
310 if (expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
311 expr->accept (*this);
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 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
314
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
315 if (list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
316 list->accept (*this);
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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
319 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
320 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
321 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
322
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
323 if (e)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
324 e->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
325
28317
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
326 std::list<tree_argument_list *> arg_lists = expr.arg_lists ();
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
327 std::list<string_vector> arg_names = expr.arg_names ();
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
328 std::list<tree_expression *> dyn_fields = expr.dyn_fields ();
27725
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
329
28317
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
330 auto p_arg_lists = arg_lists.begin ();
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
331 auto p_arg_names = arg_names.begin ();
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
332 auto p_dyn_fields = dyn_fields.begin ();
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
333
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
334 std::string type_tags = expr.type_tags ();
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
335 int n = type_tags.length ();
27725
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
336
28317
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
337 for (int i = 0; i < n; i++)
27725
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
338 {
28317
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
339 switch (type_tags[i])
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
340 {
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
341 case '(':
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
342 case '{':
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
343 {
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
344 tree_argument_list *l = *p_arg_lists;
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
345 if (l)
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
346 l->accept (*this);
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
347 }
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
348 break;
27725
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
349
28317
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
350 case '.':
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
351 {
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
352 std::string fn = (*p_arg_names)(0);
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
353 if (fn.empty ())
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
354 {
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
355 tree_expression *df = *p_dyn_fields;
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
356 if (df)
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
357 df->accept (*this);
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
358 }
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
359 }
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
360 break;
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
361
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
362 default:
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
363 panic_impossible ();
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
364 }
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
365
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
366 p_arg_lists++;
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
367 p_arg_names++;
ac87763b1949 capture dynamic field variable values in anonymous functions (bug #58389)
John W. Eaton <jwe@octave.org>
parents: 28256
diff changeset
368 p_dyn_fields++;
27725
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 }
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 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
373 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
374 auto p = lst.begin ();
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 while (p != lst.end ())
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_argument_list *elt = *p++;
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 (elt)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
381 elt->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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
385 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
386 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
387 auto p = lst.begin ();
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 while (p != lst.end ())
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_argument_list *elt = *p++;
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 (elt)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
394 elt->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 }
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 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
399 {
27725
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
400 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
401
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
402 if (lhs)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
403 lhs->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
404
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
405 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
406
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
407 if (rhs)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
408 rhs->accept (*this);
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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
411 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
412 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
413 // Nothing to do.
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 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
417 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
418 // Nothing to do.
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
419 }
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 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
422 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
423 // Nothing to do.
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_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
427 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
428 auto p = lst.begin ();
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 while (p != lst.end ())
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
431 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
432 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
433
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
434 if (elt)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
435 elt->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
436 }
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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
439 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
440 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
441 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
442
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
443 if (e)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
444 e->accept (*this);
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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
447 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
448 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
449 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
450
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
451 if (e)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
452 e->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
453 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
454
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
455 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
456 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
457 // Nothing to do.
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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
460 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
461 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
462 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
463
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
464 if (lhs)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
465 lhs->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
466
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
467 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
468
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
469 if (rhs)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
470 rhs->accept (*this);
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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
473 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
474 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
475 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
476
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
477 if (cmd)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
478 cmd->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
479 else
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
480 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
481 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
482
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
483 if (expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
484 expr->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
485 }
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_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
489 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
490 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
491 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
492 if (elt)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
493 elt->accept (*this);
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 }
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 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
498 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
499 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
500
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
501 if (try_code)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
502 try_code->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
503
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
504 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
505
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
506 if (expr_id)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
507 expr_id->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
508
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
509 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
510
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
511 if (catch_code)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
512 catch_code->accept (*this);
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
513 }
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 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
516 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
517 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
518
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
519 if (unwind_protect_code)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
520 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
521
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
522 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
523
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
524 if (cleanup_code)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
525 cleanup_code->accept (*this);
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_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
529 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
530 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
531
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
532 if (expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
533 expr->accept (*this);
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 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
536
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
537 if (list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
538 list->accept (*this);
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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
541 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
542 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
543 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
544
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
545 if (list)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
546 list->accept (*this);
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 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
549
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
550 if (expr)
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
551 expr->accept (*this);
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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
554 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
555 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
556 // FIXME?
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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
559 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
560 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
561 // FIXME?
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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
564 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
565 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
566 // FIXME?
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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
569 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
570 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
571 // FIXME?
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
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
574 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
575 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
576 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
577 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
578
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
579 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
580 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
581 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
582 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
583
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
584 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
585 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
586 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
587 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
588
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
589 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
590 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
591 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
592 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
593
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
594 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
595 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
596 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
597 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
598
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
599 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
600 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
601 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
602 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
603
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
604 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
605 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
606 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
607 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
608
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
609 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
610 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
611 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
612 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
613
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
614 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
615 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
616 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
617 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
618
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
619 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
620 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
621 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
622 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
623
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
624 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
625 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
626 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
627 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
628
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
629 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
630 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
631 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
632 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
633
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
634 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
635 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
636 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
637 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
638
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
639 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
640 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
641 // FIXME?
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
642 }
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
643
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
644 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
645 {
6388a240de87 move some common actions into tree_walker base class
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
646 // FIXME?
23424
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
647 }
872f42fb26dc let walker visit tree_boolean and tree_compound_binary expressions directly
John W. Eaton <jwe@octave.org>
parents:
diff changeset
648 }