annotate src/ov-fcn-inline.h @ 4967:0355f2f7d193

[project @ 2004-09-07 15:09:14 by jwe]
author jwe
date Tue, 07 Sep 2004 15:09:14 +0000
parents ed0f3cb6d3d4
children 724675f7f7cb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4933
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
1 /*
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
2
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
3 Copyright (C) 2004 David Bateman
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
4
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
5 This program is free software; you can redistribute it and/or modify it
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
6 under the terms of the GNU General Public License as published by
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
7 the Free Software Foundation; either version 2, or (at your option)
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
8 any later version.
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
9
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
10 This program is distributed in the hope that it will be useful, but
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
11 WITHOUT ANY WARRANTY; without even the implied warranty of
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
13 General Public License for more details.
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
14
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
16 along with Octave; see the file COPYING. If not, write to the Free
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
17 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
18 02111-1307, USA.
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
19
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
20 In addition to the terms of the GPL, you are permitted to link
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
21 this program with any Open Source program, as defined by the
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
22 Open Source Initiative (www.opensource.org)
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
23
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
24 */
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
25
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
26 #if !defined (octave_fcn_inline_h)
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
27 #define octave_fcn_inline_h 1
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
28
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
29 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
30 #pragma interface
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
31 #endif
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
32
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
33 #include <iostream>
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
34 #include <string>
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
35
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
36 #include "oct-alloc.h"
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
37
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
38 #include "ov-base.h"
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
39 #include "ov-base-mat.h"
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
40 #include "ov-fcn.h"
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
41 #include "ov-typeinfo.h"
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
42 #include "symtab.h"
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
43 #include "ov-fcn-handle.h"
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
44
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
45 // Inline functions.
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
46
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
47 class
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
48 octave_fcn_inline : public octave_fcn_handle
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
49 {
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
50 public:
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
51
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
52 octave_fcn_inline (void)
4967
0355f2f7d193 [project @ 2004-09-07 15:09:14 by jwe]
jwe
parents: 4954
diff changeset
53 : octave_fcn_handle (), iftext (), ifargs () { }
4933
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
54
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
55 octave_fcn_inline (const std::string& f, const string_vector& a,
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
56 const std::string& n = std::string ());
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
57
4967
0355f2f7d193 [project @ 2004-09-07 15:09:14 by jwe]
jwe
parents: 4954
diff changeset
58 octave_fcn_inline (const octave_fcn_inline& fi)
0355f2f7d193 [project @ 2004-09-07 15:09:14 by jwe]
jwe
parents: 4954
diff changeset
59 : octave_fcn_handle (fi), iftext (fi.iftext), ifargs (fi.ifargs) { }
0355f2f7d193 [project @ 2004-09-07 15:09:14 by jwe]
jwe
parents: 4954
diff changeset
60
4933
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
61 ~octave_fcn_inline (void) { }
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
62
4967
0355f2f7d193 [project @ 2004-09-07 15:09:14 by jwe]
jwe
parents: 4954
diff changeset
63 octave_value *clone (void) const { return new octave_fcn_inline (*this); }
0355f2f7d193 [project @ 2004-09-07 15:09:14 by jwe]
jwe
parents: 4954
diff changeset
64 octave_value *empty_clone (void) const { return new octave_fcn_inline (); }
0355f2f7d193 [project @ 2004-09-07 15:09:14 by jwe]
jwe
parents: 4954
diff changeset
65
4954
ed0f3cb6d3d4 [project @ 2004-09-01 21:24:53 by jwe]
jwe
parents: 4933
diff changeset
66 bool is_inline_function (void) const { return true; }
ed0f3cb6d3d4 [project @ 2004-09-01 21:24:53 by jwe]
jwe
parents: 4933
diff changeset
67
4933
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
68 octave_fcn_inline *fcn_inline_value (bool = false) { return this; }
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
69
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
70 std::string fcn_text (void) const { return iftext; }
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
71
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
72 string_vector fcn_arg_names (void) const { return ifargs; }
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
73
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
74 octave_value convert_to_str_internal (bool, bool) const;
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
75
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
76 void print (std::ostream& os, bool pr_as_read_syntax = false) const;
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
77
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
78 void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const;
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
79
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
80 private:
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
81
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
82 DECLARE_OCTAVE_ALLOCATOR
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
83
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
84 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
85
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
86 // The expression of an inline function.
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
87 std::string iftext;
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
88
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
89 // The args of an inline function.
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
90 string_vector ifargs;
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
91 };
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
92
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
93 #endif
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
94
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
95 /*
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
96 ;;; Local Variables: ***
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
97 ;;; mode: C++ ***
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
98 ;;; End: ***
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
99 */
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
100