annotate libinterp/parse-tree/pt-colon.h @ 21016:93748bcaec17

maint: Replace emtpy 'std::string ()' calls with "". * Backend.cc, comment-list.h, debug.cc, defaults.in.h, dynamic-ld.h, error.cc, graphics.cc, graphics.in.h, help.cc, hook-fcn.h, load-path.cc, load-path.h, ls-ascii-helper.cc, ls-mat-ascii.cc, ls-mat5.cc, ls-mat5.h, ls-oct-text.cc, oct-iostrm.h, oct-lvalue.h, oct-stream.cc, oct-stream.h, oct-strstrm.h, regexp.cc, schur.cc, sqrtm.cc, strfns.cc, symtab.cc, symtab.h, sysdep.cc, toplev.cc, urlwrite.cc, variables.cc, variables.h, ov-builtin.h, ov-cell.cc, ov-class.cc, ov-classdef.cc, ov-classdef.h, ov-dld-fcn.h, ov-fcn-handle.cc, ov-fcn-inline.cc, ov-fcn-inline.h, ov-fcn.h, ov-lazy-idx.cc, ov-mex-fcn.h, ov-struct.cc, ov-typeinfo.cc, ov-typeinfo.h, ov-usr-fcn.cc, ov-usr-fcn.h, ov.h, ovl.h, octave.cc, lex.h, parse.h, pt-classdef.h, pt-exp.cc, pt-pr-code.h, token.h, version.cc, version.in.h, oct-rand.h, dir-ops.h, file-ops.cc, file-ops.h, file-stat.h, oct-env.cc, oct-group.cc, oct-passwd.cc, oct-syscalls.cc, cmd-edit.cc, cmd-edit.h, cmd-hist.cc, cmd-hist.h, kpse.cc, lo-array-gripes.h, pathsearch.cc, pathsearch.h, str-vec.h, url-transfer.h: Replace emtpy 'std::string ()' calls with "".
author Rik <rik@octave.org>
date Wed, 30 Dec 2015 12:33:33 -0800
parents f7084eae3318
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
1 /*
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
2
19696
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17822
diff changeset
3 Copyright (C) 1996-2015 John W. Eaton
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
4
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
6
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5861
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5861
diff changeset
10 option) any later version.
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
11
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
15 for more details.
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
16
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 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: 5861
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: 5861
diff changeset
19 <http://www.gnu.org/licenses/>.
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
20
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
21 */
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
22
20790
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 19748
diff changeset
23 #if ! defined (octave_pt_colon_h)
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
24 #define octave_tree_colon 1
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
25
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
26 #include <string>
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
27
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
28 class tree_walker;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
29
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
30 class octave_value;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
31 class octave_value_list;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
32 class octave_lvalue;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
33
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
34 #include "pt-exp.h"
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
35 #include "symtab.h"
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
36
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
37 // Colon expressions.
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
38
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
39 class
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
40 tree_colon_expression : public tree_expression
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
41 {
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
42 public:
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
43
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
44 tree_colon_expression (int l = -1, int c = -1)
2990
35bd1b05cfbe [project @ 1997-05-16 09:19:11 by jwe]
jwe
parents: 2988
diff changeset
45 : tree_expression (l, c), op_base (0), op_limit (0),
35bd1b05cfbe [project @ 1997-05-16 09:19:11 by jwe]
jwe
parents: 2988
diff changeset
46 op_increment (0), save_base (false) { }
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
47
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
48 tree_colon_expression (tree_expression *e, int l = -1, int c = -1)
2990
35bd1b05cfbe [project @ 1997-05-16 09:19:11 by jwe]
jwe
parents: 2988
diff changeset
49 : tree_expression (l, c), op_base (e), op_limit (0),
35bd1b05cfbe [project @ 1997-05-16 09:19:11 by jwe]
jwe
parents: 2988
diff changeset
50 op_increment (0), save_base (false) { }
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
51
5861
2a6cb4ed8f1e [project @ 2006-06-16 05:09:41 by jwe]
jwe
parents: 5349
diff changeset
52 tree_colon_expression (tree_expression *bas, tree_expression *lim,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
53 tree_expression *inc, int l = -1, int c = -1)
5861
2a6cb4ed8f1e [project @ 2006-06-16 05:09:41 by jwe]
jwe
parents: 5349
diff changeset
54 : tree_expression (l, c), op_base (bas), op_limit (lim),
2a6cb4ed8f1e [project @ 2006-06-16 05:09:41 by jwe]
jwe
parents: 5349
diff changeset
55 op_increment (inc), save_base (false) { }
2a6cb4ed8f1e [project @ 2006-06-16 05:09:41 by jwe]
jwe
parents: 5349
diff changeset
56
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
57 ~tree_colon_expression (void)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
58 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
59 if (! save_base)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
60 delete op_base;
2990
35bd1b05cfbe [project @ 1997-05-16 09:19:11 by jwe]
jwe
parents: 2988
diff changeset
61
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
62 delete op_limit;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
63 delete op_increment;
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
64 }
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
65
4267
7cd865a8c815 [project @ 2003-01-03 15:27:05 by jwe]
jwe
parents: 4192
diff changeset
66 bool has_magic_end (void) const
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
67 {
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
68 return ((op_base && op_base->has_magic_end ())
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
69 || (op_limit && op_limit->has_magic_end ())
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
70 || (op_increment && op_increment->has_magic_end ()));
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
71 }
4267
7cd865a8c815 [project @ 2003-01-03 15:27:05 by jwe]
jwe
parents: 4192
diff changeset
72
2990
35bd1b05cfbe [project @ 1997-05-16 09:19:11 by jwe]
jwe
parents: 2988
diff changeset
73 void preserve_base (void) { save_base = true; }
35bd1b05cfbe [project @ 1997-05-16 09:19:11 by jwe]
jwe
parents: 2988
diff changeset
74
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
75 tree_colon_expression *append (tree_expression *t);
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
76
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3523
diff changeset
77 bool rvalue_ok (void) const { return true; }
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
78
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8011
diff changeset
79 octave_value rvalue1 (int nargout = 1);
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
80
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
81 octave_value_list rvalue (int nargout);
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
82
8011
3100283874d7 improve backtrace error messages
John W. Eaton <jwe@octave.org>
parents: 7767
diff changeset
83 void eval_error (const std::string& s) const;
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
84
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
85 tree_expression *base (void) { return op_base; }
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
86
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
87 tree_expression *limit (void) { return op_limit; }
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
88
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
89 tree_expression *increment (void) { return op_increment; }
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
90
5066
05e4d8c0a840 [project @ 2004-11-04 20:38:46 by jwe]
jwe
parents: 4267
diff changeset
91 int line (void) const;
05e4d8c0a840 [project @ 2004-11-04 20:38:46 by jwe]
jwe
parents: 4267
diff changeset
92 int column (void) const;
05e4d8c0a840 [project @ 2004-11-04 20:38:46 by jwe]
jwe
parents: 4267
diff changeset
93
7767
71f068b22fcc scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
94 tree_expression *dup (symbol_table::scope_id scope,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
95 symbol_table::context_id context) const;
5861
2a6cb4ed8f1e [project @ 2006-06-16 05:09:41 by jwe]
jwe
parents: 5349
diff changeset
96
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
97 void accept (tree_walker& tw);
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
98
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
99 private:
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
100
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
101 // The components of the expression.
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
102 tree_expression *op_base;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
103 tree_expression *op_limit;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
104 tree_expression *op_increment;
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
105
2990
35bd1b05cfbe [project @ 1997-05-16 09:19:11 by jwe]
jwe
parents: 2988
diff changeset
106 bool save_base;
35bd1b05cfbe [project @ 1997-05-16 09:19:11 by jwe]
jwe
parents: 2988
diff changeset
107
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
108 // No copying!
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
109
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
110 tree_colon_expression (const tree_colon_expression&);
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
111
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
112 tree_colon_expression& operator = (const tree_colon_expression&);
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
113 };
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
114
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
115 #endif