annotate libinterp/parse-tree/parse.h @ 23502:c6714ae1c06c

eliminate remaining do_multi_index_op methods For function (and function-like) objects, define a call meethod instead of do_multi_index_op. For data value objects, remove do_multi_index_op as it is no longer used for indexing operations. * ov-fcn.h (octave_function::call): New pure virtual function. * ov-builtin.cc, ov-builtin.h (octave_builtin::call): Rename from do_multi_index_op. Change all uses. * ov-mex-fcn.cc, ov-mex-fcn.h (octave_mex_function::call): Rename from do_multi_index_op. Change all uses. * ov-usr-fcn.cc, ov-usr-fcn.h (octave_user_script::call): Rename from do_multi_index_op. Change all uses. (octave_user_fcn::call): Likewise. * ov-classdef.cc (octave_classdef_meta::call): Rename from do_multi_index_op. Change all uses. (octave_classdef_superclass_ref::call): Likewise. * ov-fcn-handle.cc, ov-fcn-handle.h (octave_fcn_handle::call): Rename from do_multi_index_op. Now a protected virtual function. (octave_fcn_binder::call): Rename from do_multi_index_op. Now a protected function. * ov-class.h (octave_class::do_multi_index_op): Delete. * ov-base-mat.h (octave_base_matrix::do_multi_index_op): Delete. * ov-base-scalar.h (octave_base_scalar::do_multi_index_op): Delete. * ov-base.cc, ov-base.h (octave_base_value::do_multi_index_op): Delete. * ov.cc, ov.h (octave_value::do_multi_index_op): Delete. * oct-parse.in.yy (source_file): Use call instead of do_multi_index_op. (feval (const std::string&, const octave_value_list&, int)): Likewise. (feval (octave_function *, const octave_value_list&, int)): Likewise. (feval (octave_value&, const octave_value_list&, int)): Instead of do_multi_index_op, use call for function objects and subsref for function_handle objects. Also handle named functions. (feval (const octave_value_list&, int)): Simply extract first argument and forward to feval (octave_value&, const octave_value_list&, int). * pt-eval.cc (tree_evaluator::visit_identifier, tree_evaluator::visit_index_expression, tree_evaluator::visit_funcall): Use call instead of do_multi_index_op.
author John W. Eaton <jwe@octave.org>
date Wed, 17 May 2017 14:34:05 -0400
parents 55916f99b8b6
children db947ba52118
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
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
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
4
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
6
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
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
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
9 the Free Software Foundation; either version 3 of the License, or
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
10 (at your option) any later version.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
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
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
16
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6109
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6109
diff changeset
19 <http://www.gnu.org/licenses/>.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
20
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
21 */
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
22
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 19697
diff changeset
23 #if ! defined (octave_parse_h)
383
0b52c68ec81f [project @ 1994-03-09 21:19:44 by jwe]
jwe
parents: 338
diff changeset
24 #define octave_parse_h 1
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
25
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21139
diff changeset
26 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21139
diff changeset
27
3021
18d64612e67a [project @ 1997-06-03 22:18:56 by jwe]
jwe
parents: 2907
diff changeset
28 #include <cstdio>
18d64612e67a [project @ 1997-06-03 22:18:56 by jwe]
jwe
parents: 2907
diff changeset
29
1755
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1315
diff changeset
30 #include <string>
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1315
diff changeset
31
23054
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
32 #include <deque>
16153
a57c2c8c8163 move some variables into the octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16149
diff changeset
33 #include <map>
23054
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
34 #include <set>
4426
51a0dcde8778 [project @ 2003-06-13 19:16:37 by jwe]
jwe
parents: 4342
diff changeset
35
16139
2fd39ab12209 move a function and data member from lexical_feedback to octave_parser
John W. Eaton <jwe@octave.org>
parents: 16138
diff changeset
36 #include "lex.h"
16153
a57c2c8c8163 move some variables into the octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16149
diff changeset
37 #include "symtab.h"
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
38 #include "token.h"
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
39
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
40 class octave_comment_list;
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
41 class octave_function;
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
42 class octave_user_function;
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
43
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
44 namespace octave
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
45 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
46 class tree;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
47 class tree_anon_fcn_handle;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
48 class tree_argument_list;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
49 class tree_array_list;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
50 class tree_cell;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
51 class tree_classdef;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
52 class tree_classdef_attribute_list;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
53 class tree_classdef_body;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
54 class tree_classdef_enum_block;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
55 class tree_classdef_enum_list;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
56 class tree_classdef_events_block;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
57 class tree_classdef_events_list;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
58 class tree_classdef_methods_block;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
59 class tree_classdef_methods_list;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
60 class tree_classdef_properties_block;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
61 class tree_classdef_property_list;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
62 class tree_classdef_superclass_list;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
63 class tree_colon_expression;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
64 class tree_command;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
65 class tree_constant;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
66 class tree_decl_command;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
67 class tree_decl_init_list;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
68 class tree_expression;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
69 class tree_fcn_handle;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
70 class tree_funcall;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
71 class tree_function_def;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
72 class tree_identifier;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
73 class tree_if_clause;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
74 class tree_if_command;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
75 class tree_if_command_list;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
76 class tree_index_expression;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
77 class tree_matrix;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
78 class tree_matrix;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
79 class tree_parameter_list;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
80 class tree_statement;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
81 class tree_statement_list;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
82 class tree_statement_listtree_statement;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
83 class tree_switch_case;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
84 class tree_switch_case_list;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
85 class tree_switch_command;
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
86 }
3772
e44ffad3d06c [project @ 2001-02-03 06:23:38 by jwe]
jwe
parents: 3523
diff changeset
87
20940
48b2ad5ee801 maint: Rename oct-obj.[cc|h] to ovl.[cc|h] for clarity.
Rik <rik@octave.org>
parents: 20791
diff changeset
88 #include "ovl.h"
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
89
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
90 // Nonzero means print parser debugging info (-d).
4753
9f0ce1536368 [project @ 2004-02-13 17:55:24 by jwe]
jwe
parents: 4486
diff changeset
91 extern int octave_debug;
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
92
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
93 namespace octave
16133
249d62b3fac8 new class for parser state
John W. Eaton <jwe@octave.org>
parents: 16122
diff changeset
94 {
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
95 class
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
96 base_parser
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
97 {
23054
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
98 private:
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
99
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
100 class parent_scope_info
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
101 {
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
102 public:
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
103
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
104 typedef std::pair<symbol_table::scope_id, std::string> value_type;
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
105
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
106 typedef std::deque<value_type>::iterator iterator;
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
107 typedef std::deque<value_type>::const_iterator const_iterator;
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
108
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
109 typedef std::deque<value_type>::reverse_iterator reverse_iterator;
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
110 typedef std::deque<value_type>::const_reverse_iterator const_reverse_iterator;
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
111
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
112 parent_scope_info (void) = default;
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
113
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
114 parent_scope_info (const parent_scope_info&) = default;
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
115
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
116 parent_scope_info& operator = (const parent_scope_info&) = default;
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
117
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
118 ~parent_scope_info (void) = default;
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
119
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
120 size_t size (void) const;
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
121
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
122 void push (const value_type& elt);
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
123
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
124 void push (symbol_table::scope_id id);
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
125
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
126 void pop (void);
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
127
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
128 bool name_ok (const std::string& name);
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
129
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
130 bool name_current_scope (const std::string& name);
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
131
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
132 symbol_table::scope_id parent_scope (void) const;
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
133
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
134 std::string parent_name (void) const;
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
135
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
136 void clear (void);
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
137
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
138 private:
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
139
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
140 std::deque<value_type> info;
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
141 std::set<std::string> all_names;
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
142 };
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
143
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
144 public:
16195
b52d2f9294b6 use class for reading lexer input
John W. Eaton <jwe@octave.org>
parents: 16177
diff changeset
145
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
146 base_parser (base_lexer& lxr);
16157
335041cc657a optionally use push parser interface
John W. Eaton <jwe@octave.org>
parents: 16153
diff changeset
147
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
148 // No copying!
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
149
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
150 base_parser (const base_parser&) = delete;
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
151
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
152 base_parser& operator = (const base_parser&) = delete;
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
153
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
154 ~base_parser (void);
16139
2fd39ab12209 move a function and data member from lexical_feedback to octave_parser
John W. Eaton <jwe@octave.org>
parents: 16138
diff changeset
155
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
156 void reset (void);
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
157
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
158 // Error mesages for mismatched end tokens.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
159 void end_token_error (token *tok, token::end_tok_type expected);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
160
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
161 // Check to see that end tokens are properly matched.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
162 bool end_token_ok (token *tok, token::end_tok_type expected);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
163
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
164 // Maybe print a warning if an assignment expression is used as the
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
165 // test in a logical expression.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
166 void maybe_warn_assign_as_truth_value (tree_expression *expr);
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
167
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
168 // Maybe print a warning about switch labels that aren't constants.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
169 void maybe_warn_variable_switch_label (tree_expression *expr);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
170
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
171 // Finish building a range.
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23343
diff changeset
172 tree_expression * finish_colon_expression (tree_colon_expression *e);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
173
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
174 // Build a constant.
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23343
diff changeset
175 tree_constant * make_constant (int op, token *tok_val);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
176
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
177 // Build a function handle.
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23343
diff changeset
178 tree_fcn_handle * make_fcn_handle (token *tok_val);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
179
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
180 // Build an anonymous function handle.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
181 tree_anon_fcn_handle *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
182 make_anon_fcn_handle (tree_parameter_list *param_list, tree_statement *stmt);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
183
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
184 // Build a binary expression.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
185 tree_expression *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
186 make_binary_op (int op, tree_expression *op1, token *tok_val,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
187 tree_expression *op2);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
188
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
189 // Build a boolean expression.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
190 tree_expression *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
191 make_boolean_op (int op, tree_expression *op1, token *tok_val,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
192 tree_expression *op2);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
193
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
194 // Build a prefix expression.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
195 tree_expression *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
196 make_prefix_op (int op, tree_expression *op1, token *tok_val);
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
197
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
198 // Build a postfix expression.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
199 tree_expression *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
200 make_postfix_op (int op, tree_expression *op1, token *tok_val);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
201
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
202 // Build an unwind-protect command.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
203 tree_command *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
204 make_unwind_command (token *unwind_tok, tree_statement_list *body,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
205 tree_statement_list *cleanup, token *end_tok,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
206 octave_comment_list *lc, octave_comment_list *mc);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
207
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
208 // Build a try-catch command.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
209 tree_command *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
210 make_try_command (token *try_tok, tree_statement_list *body,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
211 char catch_sep, tree_statement_list *cleanup,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
212 token *end_tok, octave_comment_list *lc,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
213 octave_comment_list *mc);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
214
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
215 // Build a while command.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
216 tree_command *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
217 make_while_command (token *while_tok, tree_expression *expr,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
218 tree_statement_list *body, token *end_tok,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
219 octave_comment_list *lc);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
220
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
221 // Build a do-until command.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
222 tree_command *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
223 make_do_until_command (token *until_tok, tree_statement_list *body,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
224 tree_expression *expr, octave_comment_list *lc);
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
225
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
226 // Build a for command.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
227 tree_command *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
228 make_for_command (int tok_id, token *for_tok, tree_argument_list *lhs,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
229 tree_expression *expr, tree_expression *maxproc,
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
230 tree_statement_list *body, token *end_tok,
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
231 octave_comment_list *lc);
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
232
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
233 // Build a break command.
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23343
diff changeset
234 tree_command * make_break_command (token *break_tok);
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
235
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
236 // Build a continue command.
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23343
diff changeset
237 tree_command * make_continue_command (token *continue_tok);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
238
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
239 // Build a return command.
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23343
diff changeset
240 tree_command * make_return_command (token *return_tok);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
241
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
242 // Start an if command.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
243 tree_if_command_list *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
244 start_if_command (tree_expression *expr, tree_statement_list *list);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
245
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
246 // Finish an if command.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
247 tree_if_command *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
248 finish_if_command (token *if_tok, tree_if_command_list *list,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
249 token *end_tok, octave_comment_list *lc);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
250
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
251 // Build an elseif clause.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
252 tree_if_clause *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
253 make_elseif_clause (token *elseif_tok, tree_expression *expr,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
254 tree_statement_list *list, octave_comment_list *lc);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
255
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
256 // Finish a switch command.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
257 tree_switch_command *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
258 finish_switch_command (token *switch_tok, tree_expression *expr,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
259 tree_switch_case_list *list, token *end_tok,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
260 octave_comment_list *lc);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
261
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
262 // Build a switch case.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
263 tree_switch_case *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
264 make_switch_case (token *case_tok, tree_expression *expr,
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
265 tree_statement_list *list, octave_comment_list *lc);
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
266
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
267 // Build an assignment to a variable.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
268 tree_expression *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
269 make_assign_op (int op, tree_argument_list *lhs, token *eq_tok,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
270 tree_expression *rhs);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
271
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
272 // Define a script.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
273 void make_script (tree_statement_list *cmds, tree_statement *end_script);
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
274
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
275 // Begin defining a function.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
276 octave_user_function *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
277 start_function (tree_parameter_list *param_list, tree_statement_list *body,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
278 tree_statement *end_function);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
279
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
280 // Create a no-op statement for end_function.
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23343
diff changeset
281 tree_statement * make_end (const std::string& type, bool eof, int l, int c);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
282
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
283 // Do most of the work for defining a function.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
284 octave_user_function *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
285 frob_function (const std::string& fname, octave_user_function *fcn);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
286
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
287 // Finish defining a function.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
288 tree_function_def *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
289 finish_function (tree_parameter_list *ret_list,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
290 octave_user_function *fcn, octave_comment_list *lc,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
291 int l, int c);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
292
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
293 // Reset state after parsing function.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
294 void
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
295 recover_from_parsing_function (void);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
296
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
297 tree_funcall *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
298 make_superclass_ref (const std::string& method_nm,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
299 const std::string& class_nm);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
300
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
301 tree_funcall *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
302 make_meta_class_query (const std::string& class_nm);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
303
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
304 tree_classdef *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
305 make_classdef (token *tok_val, tree_classdef_attribute_list *a,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
306 tree_identifier *id, tree_classdef_superclass_list *sc,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
307 tree_classdef_body *body, token *end_tok,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
308 octave_comment_list *lc);
16155
0259254a3ccc maint: periodic merge of default to classdef
John W. Eaton <jwe@octave.org>
parents: 16153
diff changeset
309
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
310 tree_classdef_properties_block *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
311 make_classdef_properties_block (token *tok_val,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
312 tree_classdef_attribute_list *a,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
313 tree_classdef_property_list *plist,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
314 token *end_tok, octave_comment_list *lc);
16155
0259254a3ccc maint: periodic merge of default to classdef
John W. Eaton <jwe@octave.org>
parents: 16153
diff changeset
315
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
316 tree_classdef_methods_block *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
317 make_classdef_methods_block (token *tok_val,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
318 tree_classdef_attribute_list *a,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
319 tree_classdef_methods_list *mlist,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
320 token *end_tok, octave_comment_list *lc);
16155
0259254a3ccc maint: periodic merge of default to classdef
John W. Eaton <jwe@octave.org>
parents: 16153
diff changeset
321
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
322 tree_classdef_events_block *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
323 make_classdef_events_block (token *tok_val,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
324 tree_classdef_attribute_list *a,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
325 tree_classdef_events_list *elist,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
326 token *end_tok, octave_comment_list *lc);
16155
0259254a3ccc maint: periodic merge of default to classdef
John W. Eaton <jwe@octave.org>
parents: 16153
diff changeset
327
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
328 tree_classdef_enum_block *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
329 make_classdef_enum_block (token *tok_val,
16155
0259254a3ccc maint: periodic merge of default to classdef
John W. Eaton <jwe@octave.org>
parents: 16153
diff changeset
330 tree_classdef_attribute_list *a,
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
331 tree_classdef_enum_list *elist,
16155
0259254a3ccc maint: periodic merge of default to classdef
John W. Eaton <jwe@octave.org>
parents: 16153
diff changeset
332 token *end_tok, octave_comment_list *lc);
0259254a3ccc maint: periodic merge of default to classdef
John W. Eaton <jwe@octave.org>
parents: 16153
diff changeset
333
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
334 octave_user_function *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
335 start_classdef_external_method (tree_identifier *id,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
336 tree_parameter_list *pl);
16155
0259254a3ccc maint: periodic merge of default to classdef
John W. Eaton <jwe@octave.org>
parents: 16153
diff changeset
337
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
338 tree_function_def *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
339 finish_classdef_external_method (octave_user_function *fcn,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
340 tree_parameter_list *ret_list,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
341 octave_comment_list *cl);
18262
69990d5edcc2 Allow to parse external methods declaration in classdef files.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17856
diff changeset
342
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
343 // Make an index expression.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
344 tree_index_expression *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
345 make_index_expression (tree_expression *expr,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
346 tree_argument_list *args, char type);
18262
69990d5edcc2 Allow to parse external methods declaration in classdef files.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17856
diff changeset
347
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
348 // Make an indirect reference expression.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
349 tree_index_expression *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
350 make_indirect_ref (tree_expression *expr, const std::string&);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
351
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
352 // Make an indirect reference expression with dynamic field name.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
353 tree_index_expression *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
354 make_indirect_ref (tree_expression *expr, tree_expression *field);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
355
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
356 // Make a declaration command.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
357 tree_decl_command *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
358 make_decl_command (int tok, token *tok_val, tree_decl_init_list *lst);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
359
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
360 // Validate matrix or cell
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
361 bool validate_array_list (tree_expression *e);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
362
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
363 // Validate matrix object used in "[lhs] = ..." assignments.
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23343
diff changeset
364 tree_argument_list * validate_matrix_for_assignment (tree_expression *e);
16273
c5e5f6ccac5d 9/10 commits reworking the lexer
John W. Eaton <jwe@octave.org>
parents: 16237
diff changeset
365
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
366 // Finish building an array_list (common action for finish_matrix
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
367 // and finish_cell).
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23343
diff changeset
368 tree_expression * finish_array_list (tree_array_list *a);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
369
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
370 // Finish building a matrix list.
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23343
diff changeset
371 tree_expression * finish_matrix (tree_matrix *m);
16237
70f465930546 rearrange class heirarchy for tree_cell and tree_matrix
John W. Eaton <jwe@octave.org>
parents: 16210
diff changeset
372
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
373 // Finish building a cell list.
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23343
diff changeset
374 tree_expression * finish_cell (tree_cell *c);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
375
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
376 // Maybe print a warning. Duh.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
377 void maybe_warn_missing_semi (tree_statement_list *);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
378
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
379 // Set the print flag for a statement based on the separator type.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
380 tree_statement_list *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
381 set_stmt_print_flag (tree_statement_list *, char, bool);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
382
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
383 // Finish building a statement.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
384 template <typename T>
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23343
diff changeset
385 tree_statement * make_statement (T *arg);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
386
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
387 // Create a statement list.
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23343
diff changeset
388 tree_statement_list * make_statement_list (tree_statement *stmt);
17693
efbe746f8fa8 eliminate octave_comment_buffer singleton
John W. Eaton <jwe@octave.org>
parents: 17283
diff changeset
389
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
390 // Append a statement to an existing statement list.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
391 tree_statement_list *
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
392 append_statement_list (tree_statement_list *list, char sep,
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
393 tree_statement *stmt, bool warn_missing_semi);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
394
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
395 // Generic error messages.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
396 void bison_error (const std::string& s, int l = -1, int c = -1);
16134
ec9c6222ef5a move static parser helper functions to octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16133
diff changeset
397
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
398 // Contains error message if Bison-generated parser returns non-zero
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
399 // status.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
400 std::string parse_error_msg;
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
401
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
402 // Have we found an explicit end to a function?
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
403 bool endfunction_found;
16142
26d65d677557 rename yyerror to bison_error and make it a member of octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16139
diff changeset
404
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
405 // TRUE means we are in the process of autoloading a function.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
406 bool autoloading;
16153
a57c2c8c8163 move some variables into the octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16149
diff changeset
407
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
408 // TRUE means the current function file was found in a relative path
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
409 // element.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
410 bool fcn_file_from_relative_lookup;
16153
a57c2c8c8163 move some variables into the octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16149
diff changeset
411
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
412 // FALSE if we are still at the primary function. Subfunctions can
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
413 // only be declared inside function files.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
414 bool parsing_subfunctions;
16153
a57c2c8c8163 move some variables into the octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16149
diff changeset
415
23343
49f051ef6f2f local functions in classdef files (bug #41723)
John W. Eaton <jwe@octave.org>
parents: 23342
diff changeset
416 // TRUE if we are parsing local functions defined at after a
49f051ef6f2f local functions in classdef files (bug #41723)
John W. Eaton <jwe@octave.org>
parents: 23342
diff changeset
417 // classdef block. Local functions can only be declared inside
49f051ef6f2f local functions in classdef files (bug #41723)
John W. Eaton <jwe@octave.org>
parents: 23342
diff changeset
418 // classdef files.
49f051ef6f2f local functions in classdef files (bug #41723)
John W. Eaton <jwe@octave.org>
parents: 23342
diff changeset
419 bool parsing_local_functions;
49f051ef6f2f local functions in classdef files (bug #41723)
John W. Eaton <jwe@octave.org>
parents: 23342
diff changeset
420
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
421 // Maximum function depth detected. Used to determine whether
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
422 // we have nested functions or just implicitly ended subfunctions.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
423 int max_fcn_depth;
16153
a57c2c8c8163 move some variables into the octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16149
diff changeset
424
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
425 // = 0 currently outside any function.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
426 // = 1 inside the primary function or a subfunction.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
427 // > 1 means we are looking at a function definition that seems to be
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
428 // inside a function. Note that the function still might not be a
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
429 // nested function.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
430 int curr_fcn_depth;
16153
a57c2c8c8163 move some variables into the octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16149
diff changeset
431
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
432 // Scope where we install all subfunctions and nested functions. Only
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
433 // used while reading function files.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
434 symbol_table::scope_id primary_fcn_scope;
16153
a57c2c8c8163 move some variables into the octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16149
diff changeset
435
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
436 // Name of the current class when we are parsing class methods or
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
437 // constructors.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
438 std::string curr_class_name;
16153
a57c2c8c8163 move some variables into the octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16149
diff changeset
439
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
440 // Name of the current package when we are parsing an element contained
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
441 // in a package directory (+-directory).
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
442 std::string curr_package_name;
16676
7368654f302f Initial support for (classdef) packages.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 16644
diff changeset
443
23054
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
444 // Nested function scopes and names currently being parsed.
564e959a0e89 avoid invalid nested function and subfunctions definitions (bug #50014)
John W. Eaton <jwe@octave.org>
parents: 22869
diff changeset
445 parent_scope_info function_scopes;
16153
a57c2c8c8163 move some variables into the octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16149
diff changeset
446
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
447 // Pointer to the primary user function or user script function.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
448 octave_function *primary_fcn_ptr;
16153
a57c2c8c8163 move some variables into the octave_parser class
John W. Eaton <jwe@octave.org>
parents: 16149
diff changeset
449
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
450 // List of subfunction names, initially in the order they are
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
451 // installed in the symbol table, then ordered as they appear in the
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
452 // file. Eventually stashed in the primary function object.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
453 std::list<std::string> subfunction_names;
16627
de91b1621260 adjust location of eof marker for files with subfunctions but no explicit end statements
John W. Eaton <jwe@octave.org>
parents: 16335
diff changeset
454
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
455 // Pointer to the classdef object we just parsed, if any.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
456 tree_classdef *classdef_object;
16211
3449bf257514 maint: fix botched merge of default to classdef
John W. Eaton <jwe@octave.org>
parents: 16205
diff changeset
457
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
458 // Result of parsing input.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
459 tree_statement_list *stmt_list;
16177
a7669b4d27f6 eliminate global global_command variable
John W. Eaton <jwe@octave.org>
parents: 16164
diff changeset
460
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
461 // State of the lexer.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
462 base_lexer& lexer;
16149
49dfba4fd3c5 use pure parser and reentrant lexer interfaces
John W. Eaton <jwe@octave.org>
parents: 16142
diff changeset
463
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
464 // Internal state of the Bison parser.
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
465 void *parser_state;
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
466 };
16287
04a7953496a7 create base class for parser; use reference for curr_lexer
John W. Eaton <jwe@octave.org>
parents: 16273
diff changeset
467
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
468 class
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
469 parser : public base_parser
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
470 {
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
471 public:
16287
04a7953496a7 create base class for parser; use reference for curr_lexer
John W. Eaton <jwe@octave.org>
parents: 16273
diff changeset
472
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
473 parser (void)
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
474 : base_parser (*(new octave::lexer ()))
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
475 { }
16287
04a7953496a7 create base class for parser; use reference for curr_lexer
John W. Eaton <jwe@octave.org>
parents: 16273
diff changeset
476
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
477 parser (FILE *file)
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
478 : base_parser (*(new octave::lexer (file)))
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
479 { }
16287
04a7953496a7 create base class for parser; use reference for curr_lexer
John W. Eaton <jwe@octave.org>
parents: 16273
diff changeset
480
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
481 parser (const std::string& eval_string)
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
482 : base_parser (*(new octave::lexer (eval_string)))
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
483 { }
16287
04a7953496a7 create base class for parser; use reference for curr_lexer
John W. Eaton <jwe@octave.org>
parents: 16273
diff changeset
484
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
485 parser (octave::lexer& lxr)
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
486 : base_parser (lxr)
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
487 { }
16335
bef822a80ffb if not interactive, bypass readline and read stdin as a file (bug #38520)
John W. Eaton <jwe@octave.org>
parents: 16294
diff changeset
488
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
489 // No copying!
16133
249d62b3fac8 new class for parser state
John W. Eaton <jwe@octave.org>
parents: 16122
diff changeset
490
22865
89756f2f085b use c++11 style for deleting default copy constructor and assignment operator
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
491 parser (const parser&) = delete;
16133
249d62b3fac8 new class for parser state
John W. Eaton <jwe@octave.org>
parents: 16122
diff changeset
492
22865
89756f2f085b use c++11 style for deleting default copy constructor and assignment operator
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
493 parser& operator = (const parser&) = delete;
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
494
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
495 ~parser (void) = default;
16287
04a7953496a7 create base class for parser; use reference for curr_lexer
John W. Eaton <jwe@octave.org>
parents: 16273
diff changeset
496
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
497 int run (void);
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
498 };
16133
249d62b3fac8 new class for parser state
John W. Eaton <jwe@octave.org>
parents: 16122
diff changeset
499
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
500 class
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
501 push_parser : public base_parser
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
502 {
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
503 public:
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
504
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
505 push_parser (void)
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
506 : base_parser (*(new octave::push_lexer ()))
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
507 { }
16294
0925d1f6875e push parser/lexer interface
John W. Eaton <jwe@octave.org>
parents: 16293
diff changeset
508
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
509 // No copying!
16294
0925d1f6875e push parser/lexer interface
John W. Eaton <jwe@octave.org>
parents: 16293
diff changeset
510
22865
89756f2f085b use c++11 style for deleting default copy constructor and assignment operator
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
511 push_parser (const push_parser&) = delete;
16294
0925d1f6875e push parser/lexer interface
John W. Eaton <jwe@octave.org>
parents: 16293
diff changeset
512
22865
89756f2f085b use c++11 style for deleting default copy constructor and assignment operator
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
513 push_parser& operator = (const push_parser&) = delete;
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
514
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
515 ~push_parser (void) = default;
16294
0925d1f6875e push parser/lexer interface
John W. Eaton <jwe@octave.org>
parents: 16293
diff changeset
516
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
517 int run (const std::string& input, bool eof);
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
518 };
16294
0925d1f6875e push parser/lexer interface
John W. Eaton <jwe@octave.org>
parents: 16293
diff changeset
519
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
520 extern OCTINTERP_API std::string
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
521 get_help_from_file (const std::string& nm, bool& symbol_found,
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
522 std::string& file);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
523
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
524 extern OCTINTERP_API std::string
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
525 get_help_from_file (const std::string& nm, bool& symbol_found);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
526
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
527 extern OCTINTERP_API
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
528 std::string lookup_autoload (const std::string& nm);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
529
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
530 extern OCTINTERP_API string_vector
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
531 autoloaded_functions (void);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
532
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
533 extern OCTINTERP_API string_vector
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
534 reverse_lookup_autoload (const std::string& nm);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
535
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
536 extern OCTINTERP_API octave_function *
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
537 load_fcn_from_file (const std::string& file_name,
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
538 const std::string& dir_name = "",
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
539 const std::string& dispatch_type = "",
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
540 const std::string& package_name = "",
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
541 const std::string& fcn_name = "",
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
542 bool autoload = false);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
543
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
544 extern OCTINTERP_API void
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
545 source_file (const std::string& file_name,
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
546 const std::string& context = "",
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
547 bool verbose = false, bool require_file = true,
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
548 const std::string& warn_for = "");
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
549
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
550 extern OCTINTERP_API octave_value_list
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
551 feval (const std::string& name,
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
552 const octave_value_list& args = octave_value_list (),
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
553 int nargout = 0);
16294
0925d1f6875e push parser/lexer interface
John W. Eaton <jwe@octave.org>
parents: 16293
diff changeset
554
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
555 extern OCTINTERP_API octave_value_list
23502
c6714ae1c06c eliminate remaining do_multi_index_op methods
John W. Eaton <jwe@octave.org>
parents: 23473
diff changeset
556 feval (octave_function *fcn,
23473
55916f99b8b6 prefer feval over do_multi_index_op
John W. Eaton <jwe@octave.org>
parents: 23446
diff changeset
557 const octave_value_list& args = octave_value_list (),
55916f99b8b6 prefer feval over do_multi_index_op
John W. Eaton <jwe@octave.org>
parents: 23446
diff changeset
558 int nargout = 0);
55916f99b8b6 prefer feval over do_multi_index_op
John W. Eaton <jwe@octave.org>
parents: 23446
diff changeset
559
55916f99b8b6 prefer feval over do_multi_index_op
John W. Eaton <jwe@octave.org>
parents: 23446
diff changeset
560 extern OCTINTERP_API octave_value_list
23502
c6714ae1c06c eliminate remaining do_multi_index_op methods
John W. Eaton <jwe@octave.org>
parents: 23473
diff changeset
561 feval (octave_value& val,
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
562 const octave_value_list& args = octave_value_list (),
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
563 int nargout = 0);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
564
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
565 extern OCTINTERP_API octave_value_list
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
566 feval (const octave_value_list& args, int nargout = 0);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
567
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
568 extern OCTINTERP_API octave_value_list
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
569 eval_string (const std::string&, bool silent, int& parse_status, int nargout);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
570
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
571 extern OCTINTERP_API octave_value
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
572 eval_string (const std::string&, bool silent, int& parse_status);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
573
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
574 extern OCTINTERP_API void
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
575 cleanup_statement_list (octave::tree_statement_list **lst);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
576 }
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
577
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
578 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
579
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
580 OCTAVE_DEPRECATED ("use 'octave::get_help_from_file' instead")
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
581 static inline std::string
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
582 get_help_from_file (const std::string& nm, bool& symbol_found,
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
583 std::string& file)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
584 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
585 return octave::get_help_from_file (nm, symbol_found, file);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
586 }
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
587
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
588 OCTAVE_DEPRECATED ("use 'octave::get_help_from_file' instead")
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
589 static inline std::string
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
590 get_help_from_file (const std::string& nm, bool& symbol_found)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
591 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
592 return octave::get_help_from_file (nm, symbol_found);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
593 }
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
594
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
595 OCTAVE_DEPRECATED ("use 'octave::lookup_autoload' instead")
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
596 static inline std::string
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
597 lookup_autoload (const std::string& nm)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
598 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
599 return octave::lookup_autoload (nm);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
600 }
16294
0925d1f6875e push parser/lexer interface
John W. Eaton <jwe@octave.org>
parents: 16293
diff changeset
601
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
602 OCTAVE_DEPRECATED ("use 'octave::autoloaded_functions' instead")
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
603 static inline string_vector
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
604 autoloaded_functions (void)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
605 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
606 return octave::autoloaded_functions ();
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
607 }
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
608
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
609 OCTAVE_DEPRECATED ("use 'octave::reverse_lookup_autoload' instead")
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
610 static inline string_vector
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
611 reverse_lookup_autoload (const std::string& nm)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
612 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
613 return octave::reverse_lookup_autoload (nm);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
614 }
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
615
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
616 OCTAVE_DEPRECATED ("use 'octave::load_fcn_from_file' instead")
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
617 static inline octave_function *
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
618 load_fcn_from_file (const std::string& file_name,
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
619 const std::string& dir_name = "",
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
620 const std::string& dispatch_type = "",
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
621 const std::string& package_name = "",
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
622 const std::string& fcn_name = "",
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
623 bool autoload = false)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
624 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
625 return octave::load_fcn_from_file (file_name, dir_name, dispatch_type,
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
626 package_name, fcn_name, autoload);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
627 }
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
628
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
629 OCTAVE_DEPRECATED ("use 'octave::source_file' instead")
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
630 static inline void
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
631 source_file (const std::string& file_name,
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
632 const std::string& context = "",
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
633 bool verbose = false, bool require_file = true,
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
634 const std::string& warn_for = "")
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
635 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
636 octave::source_file (file_name, context, verbose, require_file, warn_for);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
637 }
16294
0925d1f6875e push parser/lexer interface
John W. Eaton <jwe@octave.org>
parents: 16293
diff changeset
638
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
639 OCTAVE_DEPRECATED ("use 'octave::feval' instead")
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
640 static inline octave_value_list
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
641 feval (const std::string& name,
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
642 const octave_value_list& args = octave_value_list (),
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
643 int nargout = 0)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
644 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
645 return octave::feval (name, args, nargout);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
646 }
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
647
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
648 OCTAVE_DEPRECATED ("use 'octave::feval' instead")
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
649 static inline octave_value_list
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
650 feval (octave_function *fcn,
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
651 const octave_value_list& args = octave_value_list (),
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
652 int nargout = 0)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
653 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
654 return octave::feval (fcn, args, nargout);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
655 }
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
656
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
657 OCTAVE_DEPRECATED ("use 'octave::feval' instead")
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
658 static inline octave_value_list
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
659 feval (const octave_value_list& args, int nargout = 0)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
660 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
661 return octave::feval (args, nargout);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
662 }
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
663
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
664 OCTAVE_DEPRECATED ("use 'octave::eval_string' instead")
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
665 static inline octave_value_list
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
666 eval_string (const std::string& str, bool silent, int& parse_status, int nargout)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
667 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
668 return octave::eval_string (str, silent, parse_status, nargout);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
669 }
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
670
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
671 OCTAVE_DEPRECATED ("use 'octave::eval_string' instead")
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
672 static inline octave_value
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
673 eval_string (const std::string& str, bool silent, int& parse_status)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
674 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
675 return octave::eval_string (str, silent, parse_status);
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
676 }
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
677
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
678 OCTAVE_DEPRECATED ("use 'octave::cleanup_statement_list' instead")
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
679 static inline void
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
680 cleanup_statement_list (octave::tree_statement_list **lst)
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
681 {
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
682 octave::cleanup_statement_list (lst);
22196
dd992fd74fce put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents: 21751
diff changeset
683 }
16294
0925d1f6875e push parser/lexer interface
John W. Eaton <jwe@octave.org>
parents: 16293
diff changeset
684
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
685 #endif
22407
34ce5be04942 maint: Style check C++ code in libinterp/.
Rik <rik@octave.org>
parents: 22323
diff changeset
686
23075
4e3d47dc7e25 move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23054
diff changeset
687 #endif