annotate libinterp/parse-tree/anon-fcn-validator.h @ 30564:796f54d4ddbf stable

update Octave Project Developers copyright for the new year In files that have the "Octave Project Developers" copyright notice, update for 2021. In all .txi and .texi files except gpl.txi and gpl.texi in the doc/liboctave and doc/interpreter directories, change the copyright to "Octave Project Developers", the same as used for other source files. Update copyright notices for 2022 (not done since 2019). For gpl.txi and gpl.texi, change the copyright notice to be "Free Software Foundation, Inc." and leave the date at 2007 only because this file only contains the text of the GPL, not anything created by the Octave Project Developers. Add Paul Thomas to contributors.in.
author John W. Eaton <jwe@octave.org>
date Tue, 28 Dec 2021 18:22:40 -0500
parents 0a5b15007766
children e88a07dec498
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 //
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
3 // Copyright (C) 2019-2022 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 ////////////////////////////////////////////////////////////////////////
27728
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 #if ! defined (octave_anon_fcn_validator_h)
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 #define octave_anon_fcn_validator_h 1
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 #include "octave-config.h"
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 #include <string>
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 #include "pt-walk.h"
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 namespace octave
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 {
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 class tree_expression;
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38 class tree_parameter_list;
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 // How to check the semantics of the code that the parse trees represent.
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42 class anon_fcn_validator : public tree_walker
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43 {
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44 public:
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 anon_fcn_validator (tree_parameter_list *, tree_expression *expr);
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48 // No copying!
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 anon_fcn_validator (const anon_fcn_validator&) = delete;
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 anon_fcn_validator& operator = (const anon_fcn_validator&) = delete;
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 ~anon_fcn_validator (void) = default;
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56 void visit_postfix_expression (tree_postfix_expression&);
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58 void visit_prefix_expression (tree_prefix_expression&);
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60 void visit_multi_assignment (tree_multi_assignment&);
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62 void visit_simple_assignment (tree_simple_assignment&);
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
63
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
64 bool ok (void) const { return m_ok; }
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
65
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
66 int line (void) const { return m_line; }
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
67 int column (void) const { return m_column; }
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
69 std::string message (void) const { return m_message; }
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71 private:
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73 bool m_ok;
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74 int m_line;
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75 int m_column;
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
76 std::string m_message;
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
77
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78 void error (tree_expression& expr);
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
79 };
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
80 }
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
81
5e92bff668d6 disallow lvalue references in anonymous functions (bug #57255)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
82 #endif