Mercurial > octave
annotate libinterp/corefcn/input.h @ 24740:d85470c4f09c
* input.h: Don't provide typedefs for old function names (bug #53123).
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 12 Feb 2018 10:18:12 -0500 |
parents | f079a0856321 |
children | 7c88cf242111 |
rev | line source |
---|---|
1 | 1 /* |
2 | |
23219
3ac9f9ecfae5
maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents:
23083
diff
changeset
|
3 Copyright (C) 1993-2017 John W. Eaton |
1 | 4 |
5 This file is part of Octave. | |
6 | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24279
diff
changeset
|
7 Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
8 under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24279
diff
changeset
|
9 the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
10 (at your option) any later version. |
1 | 11 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
13 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
15 GNU General Public License for more details. |
1 | 16 |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24279
diff
changeset
|
19 <https://www.gnu.org/licenses/>. |
1 | 20 |
21 */ | |
22 | |
23 // Use the GNU readline library for command line editing and hisory. | |
24 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19849
diff
changeset
|
25 #if ! defined (octave_input_h) |
383 | 26 #define octave_input_h 1 |
1 | 27 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20940
diff
changeset
|
28 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20940
diff
changeset
|
29 |
1342 | 30 #include <cstdio> |
1 | 31 |
1750 | 32 #include <string> |
33 | |
22380
ddac3d15ad7d
use octave_refcount class for reference counts
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
34 #include "oct-refcount.h" |
3255 | 35 #include "oct-time.h" |
20940
48b2ad5ee801
maint: Rename oct-obj.[cc|h] to ovl.[cc|h] for clarity.
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
36 #include "ovl.h" |
3770 | 37 #include "pager.h" |
3255 | 38 |
3707 | 39 class octave_value; |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
22171
diff
changeset
|
40 namespace octave |
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
22171
diff
changeset
|
41 { |
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
22171
diff
changeset
|
42 class base_lexer; |
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
22171
diff
changeset
|
43 } |
3707 | 44 |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
45 extern OCTINTERP_API FILE * get_input_from_stdin (void); |
1 | 46 |
3804 | 47 // TRUE after a call to completion_matches. |
2299 | 48 extern bool octave_completion_matches_called; |
49 | |
7409 | 50 // TRUE if the plotting system has requested a call to drawnow at |
51 // the next user prompt. | |
7414 | 52 extern OCTINTERP_API bool Vdrawnow_requested; |
7409 | 53 |
7752
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7414
diff
changeset
|
54 // TRUE if we are in debugging mode. |
9237
3c1762c7e787
Add missing xxx_API decoration and remove misplaced ones
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
55 extern OCTINTERP_API bool Vdebugging; |
7752
40c428ea3408
initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents:
7414
diff
changeset
|
56 |
22164
5d4a286061c8
Track line numbers when in debug mode (bug #45764)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
22089
diff
changeset
|
57 // TRUE if we are not executing a command direct from debug> prompt. |
5d4a286061c8
Track line numbers when in debug mode (bug #45764)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
22089
diff
changeset
|
58 extern OCTINTERP_API bool Vtrack_line_num; |
5d4a286061c8
Track line numbers when in debug mode (bug #45764)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
22089
diff
changeset
|
59 |
22171
0a4c5a90f286
Allow tab completion of arrays of structures.
Lachlan Andrew <lachlanbis@gmail.com>
parents:
22164
diff
changeset
|
60 extern std::string find_indexed_expression (const std::string& text); |
0a4c5a90f286
Allow tab completion of arrays of structures.
Lachlan Andrew <lachlanbis@gmail.com>
parents:
22164
diff
changeset
|
61 |
2927 | 62 extern void initialize_command_input (void); |
1 | 63 |
5640 | 64 extern bool octave_yes_or_no (const std::string& prompt); |
65 | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
66 extern octave_value do_keyboard (const octave_value_list& args |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
67 = octave_value_list ()); |
3707 | 68 |
16347
bf8397caeff1
allow add_input_event_hook to accept function handles
John W. Eaton <jwe@octave.org>
parents:
16209
diff
changeset
|
69 extern void remove_input_event_hook_functions (void); |
bf8397caeff1
allow add_input_event_hook to accept function handles
John W. Eaton <jwe@octave.org>
parents:
16209
diff
changeset
|
70 |
16528
9bc1f8278966
allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents:
16347
diff
changeset
|
71 extern void set_default_prompts (void); |
9bc1f8278966
allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents:
16347
diff
changeset
|
72 |
21730
30c53770f47e
use namespace for system time classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
73 extern octave::sys::time Vlast_prompt_time; |
3165 | 74 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
75 namespace octave |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
76 { |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
77 class |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
78 base_reader |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
79 { |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
80 public: |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
81 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
82 friend class input_reader; |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
83 |
23696
08036a7f3660
remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
84 base_reader (base_lexer *lxr) |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
85 : count (1), pflag (0), lexer (lxr) |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
86 { } |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
87 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
88 base_reader (const base_reader& x) |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
89 : count (1), pflag (x.pflag), lexer (x.lexer) |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
90 { } |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
91 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
92 virtual ~base_reader (void) = default; |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
93 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
94 virtual std::string get_input (bool& eof) = 0; |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
95 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
96 virtual std::string input_source (void) const { return in_src; } |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
97 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
98 void reset (void) { promptflag (1); } |
16209
e7ff32e7cf82
move global promptflag variable to octave_reader class
John W. Eaton <jwe@octave.org>
parents:
16208
diff
changeset
|
99 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
100 void increment_promptflag (void) { pflag++; } |
16209
e7ff32e7cf82
move global promptflag variable to octave_reader class
John W. Eaton <jwe@octave.org>
parents:
16208
diff
changeset
|
101 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
102 void decrement_promptflag (void) { pflag--; } |
16209
e7ff32e7cf82
move global promptflag variable to octave_reader class
John W. Eaton <jwe@octave.org>
parents:
16208
diff
changeset
|
103 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
104 int promptflag (void) const { return pflag; } |
16209
e7ff32e7cf82
move global promptflag variable to octave_reader class
John W. Eaton <jwe@octave.org>
parents:
16208
diff
changeset
|
105 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
106 int promptflag (int n) |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
107 { |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
108 int retval = pflag; |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
109 pflag = n; |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
110 return retval; |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
111 } |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
112 |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
113 std::string octave_gets (bool& eof); |
16209
e7ff32e7cf82
move global promptflag variable to octave_reader class
John W. Eaton <jwe@octave.org>
parents:
16208
diff
changeset
|
114 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
115 virtual bool reading_fcn_file (void) const; |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
116 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
117 virtual bool reading_classdef_file (void) const; |
17731
f79bf671a493
eliminate global LEXER variable
John W. Eaton <jwe@octave.org>
parents:
16892
diff
changeset
|
118 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
119 virtual bool reading_script_file (void) const; |
17731
f79bf671a493
eliminate global LEXER variable
John W. Eaton <jwe@octave.org>
parents:
16892
diff
changeset
|
120 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
121 virtual bool input_from_terminal (void) const { return false; } |
17731
f79bf671a493
eliminate global LEXER variable
John W. Eaton <jwe@octave.org>
parents:
16892
diff
changeset
|
122 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
123 virtual bool input_from_file (void) const { return false; } |
17733
8ad59bef27b5
use more direct method for checking input source for lexer
John W. Eaton <jwe@octave.org>
parents:
17731
diff
changeset
|
124 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
125 virtual bool input_from_eval_string (void) const { return false; } |
17733
8ad59bef27b5
use more direct method for checking input source for lexer
John W. Eaton <jwe@octave.org>
parents:
17731
diff
changeset
|
126 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
127 private: |
17733
8ad59bef27b5
use more direct method for checking input source for lexer
John W. Eaton <jwe@octave.org>
parents:
17731
diff
changeset
|
128 |
23696
08036a7f3660
remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
129 refcount<int> count; |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
130 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
131 int pflag; |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
132 |
23696
08036a7f3660
remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
133 base_lexer *lexer; |
16209
e7ff32e7cf82
move global promptflag variable to octave_reader class
John W. Eaton <jwe@octave.org>
parents:
16208
diff
changeset
|
134 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
135 static const std::string in_src; |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
136 }; |
16209
e7ff32e7cf82
move global promptflag variable to octave_reader class
John W. Eaton <jwe@octave.org>
parents:
16208
diff
changeset
|
137 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
138 class |
24732
f079a0856321
move internal input reader classes out of header file
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
139 input_reader |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
140 { |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
141 public: |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
142 |
24732
f079a0856321
move internal input reader classes out of header file
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
143 input_reader (base_lexer *lxr = nullptr); |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
144 |
24732
f079a0856321
move internal input reader classes out of header file
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
145 input_reader (FILE *file, base_lexer *lxr = nullptr); |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
146 |
24732
f079a0856321
move internal input reader classes out of header file
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
147 input_reader (const std::string& str, base_lexer *lxr = nullptr); |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
148 |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
149 input_reader (const input_reader& ir) |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
150 { |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
151 rep = ir.rep; |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
152 rep->count++; |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
153 } |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
154 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
155 input_reader& operator = (const input_reader& ir) |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
156 { |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
157 if (&ir != this) |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
158 { |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
159 rep = ir.rep; |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
160 rep->count++; |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
161 } |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
162 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
163 return *this; |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
164 } |
16209
e7ff32e7cf82
move global promptflag variable to octave_reader class
John W. Eaton <jwe@octave.org>
parents:
16208
diff
changeset
|
165 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
166 ~input_reader (void) |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
167 { |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
168 if (--rep->count == 0) |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
169 delete rep; |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
170 } |
16209
e7ff32e7cf82
move global promptflag variable to octave_reader class
John W. Eaton <jwe@octave.org>
parents:
16208
diff
changeset
|
171 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
172 void reset (void) { return rep->reset (); } |
16209
e7ff32e7cf82
move global promptflag variable to octave_reader class
John W. Eaton <jwe@octave.org>
parents:
16208
diff
changeset
|
173 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
174 void increment_promptflag (void) { rep->increment_promptflag (); } |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
175 |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
176 void decrement_promptflag (void) { rep->decrement_promptflag (); } |
16209
e7ff32e7cf82
move global promptflag variable to octave_reader class
John W. Eaton <jwe@octave.org>
parents:
16208
diff
changeset
|
177 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
178 int promptflag (void) const { return rep->promptflag (); } |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
179 |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
180 int promptflag (int n) { return rep->promptflag (n); } |
16209
e7ff32e7cf82
move global promptflag variable to octave_reader class
John W. Eaton <jwe@octave.org>
parents:
16208
diff
changeset
|
181 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
182 std::string get_input (bool& eof) |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
183 { |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
184 return rep->get_input (eof); |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
185 } |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
186 |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
187 std::string input_source (void) const |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
188 { |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
189 return rep->input_source (); |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
190 } |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
191 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
192 bool input_from_terminal (void) const |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
193 { |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
194 return rep->input_from_terminal (); |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
195 } |
16195
b52d2f9294b6
use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents:
16098
diff
changeset
|
196 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
197 bool input_from_file (void) const |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
198 { |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
199 return rep->input_from_file (); |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
200 } |
17733
8ad59bef27b5
use more direct method for checking input source for lexer
John W. Eaton <jwe@octave.org>
parents:
17731
diff
changeset
|
201 |
23061
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
202 bool input_from_eval_string (void) const |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
203 { |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
204 return rep->input_from_eval_string (); |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
205 } |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
206 |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
207 private: |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
208 |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
209 base_reader *rep; |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
210 }; |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
211 } |
aedc662896a3
move input reader classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
23012
diff
changeset
|
212 |
1 | 213 #endif |