GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
anon-fcn-validator.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2019-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_anon_fcn_validator_h)
27 #define octave_anon_fcn_validator_h 1
28 
29 #include "octave-config.h"
30 
31 #include <string>
32 
33 #include "pt-walk.h"
34 
35 namespace octave
36 {
37  class tree_expression;
38  class tree_parameter_list;
39 
40  // How to check the semantics of the code that the parse trees represent.
41 
43  {
44  public:
45 
47 
48  // No copying!
49 
51 
53 
54  ~anon_fcn_validator (void) = default;
55 
57 
59 
61 
63 
64  bool ok (void) const { return m_ok; }
65 
66  int line (void) const { return m_line; }
67  int column (void) const { return m_column; }
68 
69  std::string message (void) const { return m_message; }
70 
71  private:
72 
73  bool m_ok;
74  int m_line;
75  int m_column;
76  std::string m_message;
77 
78  void error (tree_expression& expr);
79  };
80 }
81 
82 #endif
~anon_fcn_validator(void)=default
void visit_prefix_expression(tree_prefix_expression &)
void visit_postfix_expression(tree_postfix_expression &)
anon_fcn_validator(tree_parameter_list *, tree_expression *expr)
void visit_simple_assignment(tree_simple_assignment &)
anon_fcn_validator & operator=(const anon_fcn_validator &)=delete
void visit_multi_assignment(tree_multi_assignment &)
void error(tree_expression &expr)
std::string message(void) const
anon_fcn_validator(const anon_fcn_validator &)=delete