GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
pt-check.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1996-2018 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software: you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_pt_check_h)
24 #define octave_pt_check_h 1
25 
26 #include "octave-config.h"
27 
28 #include <string>
29 
30 #include "pt-walk.h"
31 
32 namespace octave
33 {
34  class tree_decl_command;
35 
36  // How to check the semantics of the code that the parse trees represent.
37 
38  class tree_checker : public tree_walker
39  {
40  public:
41 
42  tree_checker (void)
44 
45  // No copying!
46 
47  tree_checker (const tree_checker&) = delete;
48 
49  tree_checker& operator = (const tree_checker&) = delete;
50 
51  ~tree_checker (void) = default;
52 
54 
56 
58 
60 
62 
64 
66 
68 
70 
72 
74 
76 
78 
80 
82 
84 
86 
88 
89  void visit_matrix (tree_matrix&);
90 
91  void visit_cell (tree_cell&);
92 
94 
96 
98 
100 
102 
103  void visit_funcall (tree_funcall&);
104 
106 
108 
110 
112 
114 
116 
118 
120 
122 
124 
126 
128 
130 
132 
134 
135  private:
136 
138 
140 
141  OCTAVE_NORETURN void errmsg (const std::string& msg, int line);
142  };
143 }
144 
145 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS)
146 
147 OCTAVE_DEPRECATED (4.4, "use 'octave::tree_checker' instead")
148 typedef octave::tree_checker tree_checker;
149 
150 #endif
151 
152 #endif
void visit_continue_command(tree_continue_command &)
Definition: pt-check.cc:89
std::string m_file_name
Definition: pt-check.h:139
void visit_while_command(tree_while_command &)
Definition: pt-check.cc:519
void visit_simple_for_command(tree_simple_for_command &)
Definition: pt-check.cc:130
OCTAVE_NORETURN void errmsg(const std::string &msg, int line)
Definition: pt-check.cc:547
void visit_if_command_list(tree_if_command_list &)
Definition: pt-check.cc:244
void visit_function_def(tree_function_def &)
Definition: pt-check.cc:206
void visit_identifier(tree_identifier &)
Definition: pt-check.cc:217
void visit_switch_case_list(tree_switch_case_list &)
Definition: pt-check.cc:454
void visit_constant(tree_constant &)
Definition: pt-check.cc:335
void visit_statement(tree_statement &)
Definition: pt-check.cc:414
void visit_do_until_command(tree_do_until_command &)
Definition: pt-check.cc:533
void visit_octave_user_script(octave_user_script &)
Definition: pt-check.cc:188
void visit_statement_list(tree_statement_list &)
Definition: pt-check.cc:430
void visit_multi_assignment(tree_multi_assignment &)
Definition: pt-check.cc:307
void visit_binary_expression(tree_binary_expression &)
Definition: pt-check.cc:52
void visit_no_op_command(tree_no_op_command &)
Definition: pt-check.cc:327
tree_checker & operator=(const tree_checker &)=delete
void visit_simple_assignment(tree_simple_assignment &)
Definition: pt-check.cc:397
void visit_unwind_protect_command(tree_unwind_protect_command &)
Definition: pt-check.cc:505
void visit_return_command(tree_return_command &)
Definition: pt-check.cc:379
void visit_cell(tree_cell &)
Definition: pt-check.cc:293
void visit_anon_fcn_handle(tree_anon_fcn_handle &)
Definition: pt-check.cc:331
void visit_octave_user_function(octave_user_function &)
Definition: pt-check.cc:197
is false
Definition: cellfun.cc:400
void visit_switch_command(tree_switch_command &)
Definition: pt-check.cc:468
void visit_decl_elt(tree_decl_elt &)
Definition: pt-check.cc:116
~tree_checker(void)=default
void visit_if_command(tree_if_command &)
Definition: pt-check.cc:235
void visit_prefix_expression(tree_prefix_expression &)
Definition: pt-check.cc:370
void visit_complex_for_command(tree_complex_for_command &)
Definition: pt-check.cc:157
void visit_postfix_expression(tree_postfix_expression &)
Definition: pt-check.cc:361
void visit_try_catch_command(tree_try_catch_command &)
Definition: pt-check.cc:482
void visit_switch_case(tree_switch_case &)
Definition: pt-check.cc:440
void visit_colon_expression(tree_colon_expression &)
Definition: pt-check.cc:70
void visit_matrix(tree_matrix &)
Definition: pt-check.cc:279
void visit_funcall(tree_funcall &)
Definition: pt-check.cc:343
void visit_decl_init_list(tree_decl_init_list &)
Definition: pt-check.cc:102
void visit_break_command(tree_break_command &)
Definition: pt-check.cc:66
void visit_return_list(tree_return_list &)
Definition: pt-check.cc:383
void visit_parameter_list(tree_parameter_list &)
Definition: pt-check.cc:347
void visit_decl_command(tree_decl_command &)
Definition: pt-check.cc:93
void visit_fcn_handle(tree_fcn_handle &)
Definition: pt-check.cc:339
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:888
void visit_if_clause(tree_if_clause &)
Definition: pt-check.cc:221
void visit_index_expression(tree_index_expression &)
Definition: pt-check.cc:258
void visit_argument_list(tree_argument_list &)
Definition: pt-check.cc:35