annotate libinterp/corefcn/settings.h @ 31706:597f3ee61a48 stable

update Octave Project Developers copyright for the new year
author John W. Eaton <jwe@octave.org>
date Fri, 06 Jan 2023 13:11:27 -0500
parents aac27ad79be6
children 21f9b34eb893
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 //
31706
597f3ee61a48 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 31607
diff changeset
3 // Copyright (C) 2018-2023 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 ////////////////////////////////////////////////////////////////////////
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 #if ! defined (octave_settings_h)
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 #define octave_settings_h 1
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 #include "octave-config.h"
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30
26325
4877f77d5e1d add necessary includes and forward decls in public header files (bug #55277)
Mike Miller <mtmiller@octave.org>
parents: 25443
diff changeset
31 #include <cstddef>
4877f77d5e1d add necessary includes and forward decls in public header files (bug #55277)
Mike Miller <mtmiller@octave.org>
parents: 25443
diff changeset
32
4877f77d5e1d add necessary includes and forward decls in public header files (bug #55277)
Mike Miller <mtmiller@octave.org>
parents: 25443
diff changeset
33 class octave_value;
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 class octave_value_list;
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35
31605
e88a07dec498 maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents: 30564
diff changeset
36 OCTAVE_BEGIN_NAMESPACE(octave)
29960
939bef0b66e0 merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks
John W. Eaton <jwe@octave.org>
parents: 29572
diff changeset
37
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
38 // Most settings for the interpreter are stored in the classes which
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
39 // they affect (intput_system, output_system, load_path, etc. Some
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
40 // don't really fit anywhere else. For example, there is no single
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
41 // lexer or parser object, so we store settings for those things
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
42 // here.
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
44 class settings
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
45 {
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
46 public:
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
48 settings (void);
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
50 settings (const settings&) = delete;
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
52 settings& operator = (const settings&) = delete;
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
54 ~settings (void) = default;
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
56 octave_value display_tokens (const octave_value_list& args, int nargout);
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
58 bool display_tokens (void) const { return m_display_tokens; }
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
60 bool display_tokens (bool flag)
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
61 {
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
62 bool val = m_display_tokens;
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
63 m_display_tokens = flag;
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
64 return val;
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
65 }
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
66
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
67 // Read only.
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
68 std::size_t token_count (void) const { return m_token_count; }
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
69
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
70 void increment_token_count (void) { ++m_token_count; }
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
72 octave_value lexer_debug_flag (const octave_value_list& args, int nargout);
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
74 bool lexer_debug_flag (void) const { return m_lexer_debug_flag; }
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
76 bool lexer_debug_flag (bool flag)
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
77 {
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
78 bool val = m_lexer_debug_flag;
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
79 m_lexer_debug_flag = flag;
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
80 return val;
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
81 }
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
82
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
83 private:
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
84
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
85 // Display tokens as they are processed, for debugging.
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
86 bool m_display_tokens = false;
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
87
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
88 // Number of tokens processed since interpreter startup.
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
89 std::size_t m_token_count = 0;
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
90
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
91 // Internal variable for lexer debugging state.
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
92 bool m_lexer_debug_flag = false;
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31605
diff changeset
93 };
29960
939bef0b66e0 merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks
John W. Eaton <jwe@octave.org>
parents: 29572
diff changeset
94
31605
e88a07dec498 maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents: 30564
diff changeset
95 OCTAVE_END_NAMESPACE(octave)
25443
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
96
2fa7cd178c4a new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
diff changeset
97 #endif