annotate src/pt-colon.h @ 2988:daa1ed1f5462

[project @ 1997-05-16 07:23:15 by jwe]
author jwe
date Fri, 16 May 1997 07:23:17 +0000
parents cd5ad3fd8049
children 35bd1b05cfbe
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
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
3 Copyright (C) 1996, 1997 John W. Eaton
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
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
10 later version.
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
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, write to the Free
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
23 #if !defined (octave_tree_colon_h)
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 #if defined (__GNUG__)
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
27 #pragma interface
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
28 #endif
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 #include <string>
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
31
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
32 class tree_walker;
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 class octave_value;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
35 class octave_value_list;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
36 class octave_lvalue;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
37
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
38 #include "pt-exp.h"
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
39
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
40 // Colon expressions.
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 class
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
43 tree_colon_expression : public tree_expression
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
44 {
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
45 public:
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
46
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
47 tree_colon_expression (int l = -1, int c = -1)
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
48 : tree_expression (l, c), op_base (0), op_limit (0), op_increment (0) { }
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
49
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
50 tree_colon_expression (tree_expression *e, int l = -1, int c = -1)
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
51 : tree_expression (l, c), op_base (e), op_limit (0), op_increment (0) { }
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
52
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
53 ~tree_colon_expression (void)
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
54 {
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
55 delete op_base;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
56 delete op_limit;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
57 delete op_increment;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
58 }
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
59
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
60 tree_colon_expression *append (tree_expression *t);
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
61
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
62 bool rvalue_ok (void) const
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
63 { return true; }
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
64
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
65 octave_value rvalue (void);
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
66
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
67 octave_value_list rvalue (int nargout);
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
68
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
69 void eval_error (const string& s = string ());
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
70
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
71 tree_expression *base (void) { return op_base; }
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
72
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
73 tree_expression *limit (void) { return op_limit; }
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
74
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
75 tree_expression *increment (void) { return op_increment; }
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
76
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
77 void accept (tree_walker& tw);
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
78
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
79 private:
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 // The components of the expression.
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
82 tree_expression *op_base;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
83 tree_expression *op_limit;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
84 tree_expression *op_increment;
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
85
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
86 // No copying!
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
87
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
88 tree_colon_expression (const tree_colon_expression&);
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
89
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
90 tree_colon_expression& operator = (const tree_colon_expression&);
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
91 };
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
92
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
93 #endif
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
94
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
95 /*
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
96 ;;; Local Variables: ***
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
97 ;;; mode: C++ ***
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
98 ;;; End: ***
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
99 */