Mercurial > octave-nkf
annotate run-octave.in @ 15896:57be060d7672 classdef
Implement full object construction and superclass references.
* libinterp/octave-value/ov-classdef.h (cdef_object_rep::subsref): Add class
context argument.
(cdef_object_rep::ctor_list): New class member.
(cdef_object_rep::mark_for_construction, cdef_object_rep::is_constructed_for,
cdef_object_rep::is_partially_constructed_for,
cdef_object_rep::mark_as_constructed, cdef_object_rep::is_constructed,
cdef_object::mark_for_construction, cdef_object::is_constructed_for,
cdef_object::is_partially_constructed_for, cdef_object::mark_as_constructed,
cdef_object:is_constructed): New methods to manipulate the new ctor_list
class member.
(cdef_object_rep::cdef_object_rep (const cdef_object_rep&)): New copy
constructor.
(cdef_class::cdef_class_rep (std::string, std::list<cdef_class>)): New
utility constructor.
(cdef_class (std::string, std::list<cdef_class>)): Likewise.
(cdef_class::cdef_class_rep::implicit_ctor_list): New class member.
(cdef_method::cdef_method_rep::is_constructor, cdef_method::is_construcror):
New methods.
(cdef_method::get_function): Likewise.
(cdef_package::cdef_package_rep::subsref): Remove method.
(octave_classdef::get_object_ref): New method.
(to_cdef_ref): New function.
* libinterp/octave-value/ov-classdef.cc (is_superclass): Add max_depth argument.
(is_direct_superclass): New utility function.
(get_class_context): Add bool and std::string return values, as new reference
arguments. Add overload without any arguments.
(check_access): Check for valid class context when required.
(make_class): Remove super_name_list argument. Do not set SuperClasses
explicitly, use new cdef_class constructor instead.
(octave_classdef::subsref): Change skip variable to size_t (avoids compilation
warning). Call cdef_object::subsref with additional class context argument.
(class octave_classdef_superclass_ref): New utility class.
(F__superclass_reference__): Use it.
(cdef_object_rep::subsref): Add class context argument.
(cdef_object_rep::mark_for_construction): New method.
(handle_cdef_object::~handle_cdef_object, value_cdef_object::~value_cdef_object,
cdef_class::cdef_class_rep::subsref_meta, cdef_class::make_meta_class): Use gnulib::printf explicitly.
(cdef_class::cdef_class_rep (std::string, std::list<cdef_class>)): New
constructor.
(class ctor_analyzer): New utility class.
(cdef_class::cdef_class_rep::install_method): Use it to analyze constructors
and detect explicit superclass constructor calls.
(cdef_class::cdef_class_rep::initialize_object): Call
cdef_object::mark_for_construction.
(cdef_class::cdef_class_rep::run_constructor): Run all implicit superclass
constructors first.
(cdef_class::cdef_class_rep::construct): Call cdef_object::mark_as_constructed.
(cdef_class::make_meta_class): Remove snamelist variable.
(cdef_property::cdef_property_rep::get_value,
cdef_property::cdef_property_rep::set_value): Check if object is partially
constructed for the property-defining class.
(cdef_method::cdef_method_rep::is_constructor): New method.
(cdef_package::cdef_package_rep::subsref): Delete method.
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Thu, 03 Jan 2013 21:01:11 -0500 |
parents | f96faf028d90 |
children | e27d9b9b71f4 |
rev | line source |
---|---|
5786 | 1 #! /bin/sh |
7016 | 2 ## |
7017 | 3 ## run-octave -- run Octave in the build tree. |
7016 | 4 ## |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
13187
diff
changeset
|
5 ## Copyright (C) 2006-2012 John W. Eaton |
7017 | 6 ## |
7016 | 7 ## This file is part of Octave. |
8 ## | |
9 ## Octave is free software; you can redistribute it and/or modify it | |
10 ## under the terms of the GNU General Public License as published by the | |
11 ## Free Software Foundation; either version 3 of the License, or (at | |
12 ## your option) any later version. | |
13 ## | |
14 ## Octave is distributed in the hope that it will be useful, but WITHOUT | |
15 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
16 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
17 ## for more details. | |
18 ## | |
19 ## You should have received a copy of the GNU General Public License | |
20 ## along with Octave; see the file COPYING. If not, see | |
21 ## <http://www.gnu.org/licenses/>. | |
6125 | 22 |
7244 | 23 AWK=%AWK% |
24 FIND=%FIND% | |
8005
c0d7eb662384
run-octave.in: use sed to append : to path elements
John W. Eaton <jwe@octave.org>
parents:
7579
diff
changeset
|
25 SED=%SED% |
6125 | 26 |
27 # FIXME -- is there a better way to handle the possibility of spaces | |
28 # in these names? | |
29 | |
6131 | 30 top_srcdir='%abs_top_srcdir%' |
31 builddir='%builddir%' | |
6125 | 32 |
13187
12814f1fbbd2
Omit $top_srcdir/test directory tree from Octave's path in run-octave script
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
33 d1="$top_srcdir/scripts" |
12814f1fbbd2
Omit $top_srcdir/test directory tree from Octave's path in run-octave script
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
34 d2="$builddir/scripts" |
15195 | 35 d3="$builddir/libinterp" |
6125 | 36 |
9381
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
9132
diff
changeset
|
37 d1_list=`$FIND "$d1" -type d -a ! \( \( -name private -o -name '@*' \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'` |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
9132
diff
changeset
|
38 d2_list=`$FIND "$d2" -type d -a ! \( \( -name private -o -name '@*' \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'` |
f9ab19428cd8
* run-octave.in: Exclude @-files from path. Remove CVS exclusions.
Robert T. Short <octave@phaselockedsystems.com>
parents:
9132
diff
changeset
|
39 d3_list=`$FIND "$d3" -type d -a ! \( \( -name private -o -name '@*' \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'` |
6125 | 40 |
6827 | 41 d1_path=`echo "$d1_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` |
42 d2_path=`echo "$d2_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` | |
43 d3_path=`echo "$d3_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` | |
6125 | 44 |
15137
16a6b0a6855d
GUI: support for octave arguments and integrate with run-octave.
John W. Eaton <jwe@octave.org>
parents:
14614
diff
changeset
|
45 octave_executable="$builddir/src/octave" |
16a6b0a6855d
GUI: support for octave arguments and integrate with run-octave.
John W. Eaton <jwe@octave.org>
parents:
14614
diff
changeset
|
46 |
13187
12814f1fbbd2
Omit $top_srcdir/test directory tree from Octave's path in run-octave script
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
47 LOADPATH="$d1_path:$d2_path:$d3_path" |
5814 | 48 IMAGEPATH="$top_srcdir/scripts/image" |
8940
6994961bf1f4
use doc-cache instead of DOC for doc cache file name
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
49 DOCFILE="$builddir/doc/interpreter/doc-cache" |
15470
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15335
diff
changeset
|
50 BUILT_IN_DOCSTRINGS_FILE="$builddir/libinterp/DOCSTRINGS" |
14614
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
51 TEXIMACROSFILE="$top_srcdir/doc/interpreter/macros.texi" |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9613
diff
changeset
|
52 INFOFILE="$top_srcdir/doc/interpreter/octave.info" |
6125 | 53 |
11452
e1a5bf3ea1d9
Add a GUD mode option to run-octave.in
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
9794
diff
changeset
|
54 ## Checking for string equality below with prepended x's in order to |
e1a5bf3ea1d9
Add a GUD mode option to run-octave.in
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
9794
diff
changeset
|
55 ## handle problems with empty strings. |
5786 | 56 if [ $# -gt 0 ]; then |
57 if [ "x$1" = "x-g" ]; then | |
6987 | 58 driver="gdb --args" |
5786 | 59 shift |
11452
e1a5bf3ea1d9
Add a GUD mode option to run-octave.in
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
9794
diff
changeset
|
60 elif [ "x$1" = "x-gud" ]; then |
e1a5bf3ea1d9
Add a GUD mode option to run-octave.in
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
9794
diff
changeset
|
61 ## Frontends for gdb (e.g. Emacs's GUD mode) need --annotate=3 |
e1a5bf3ea1d9
Add a GUD mode option to run-octave.in
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
9794
diff
changeset
|
62 driver="gdb --annotate=3 --args" |
e1a5bf3ea1d9
Add a GUD mode option to run-octave.in
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
9794
diff
changeset
|
63 shift |
15335
5187c3ea5a68
run-octave.in: Add -gud2 option to support new versions of gud
Max Brister <max@2bass.com>
parents:
15249
diff
changeset
|
64 elif [ "x$1" = "x-gud2" ]; then |
5187c3ea5a68
run-octave.in: Add -gud2 option to support new versions of gud
Max Brister <max@2bass.com>
parents:
15249
diff
changeset
|
65 ## The latest version of gud needs -i=mi. There isn't a good way to check |
5187c3ea5a68
run-octave.in: Add -gud2 option to support new versions of gud
Max Brister <max@2bass.com>
parents:
15249
diff
changeset
|
66 ## this at configure time, so we just add a gdb2 flag |
5187c3ea5a68
run-octave.in: Add -gud2 option to support new versions of gud
Max Brister <max@2bass.com>
parents:
15249
diff
changeset
|
67 driver="gdb -i=mi --args" |
5187c3ea5a68
run-octave.in: Add -gud2 option to support new versions of gud
Max Brister <max@2bass.com>
parents:
15249
diff
changeset
|
68 shift |
5786 | 69 elif [ "x$1" = "x-valgrind" ]; then |
70 driver="valgrind --tool=memcheck" | |
71 shift | |
72 elif [ "x$1" = "x-strace" ]; then | |
73 driver="strace -o octave.trace" | |
74 shift | |
15139
bfc220d1de67
include gui in default Octave binary
John W. Eaton <jwe@octave.org>
parents:
15137
diff
changeset
|
75 elif [ "x$1" = "x-cli" ]; then |
bfc220d1de67
include gui in default Octave binary
John W. Eaton <jwe@octave.org>
parents:
15137
diff
changeset
|
76 octave_executable="$builddir/src/octave-cli" |
15137
16a6b0a6855d
GUI: support for octave arguments and integrate with run-octave.
John W. Eaton <jwe@octave.org>
parents:
14614
diff
changeset
|
77 shift |
5786 | 78 fi |
79 fi | |
6125 | 80 |
7001 | 81 OCTAVE_SITE_INITFILE="$top_srcdir/scripts/startup/main-rcfile" \ |
15249
7880fa9d676f
Update path to default settings file in source tree
Mike Miller <mtmiller@ieee.org>
parents:
15195
diff
changeset
|
82 OCTAVE_DEFAULT_QT_SETTINGS="$top_srcdir/libgui/default-qt-settings" \ |
15752
f96faf028d90
make java functions part of core octave_value classes
John W. Eaton <jwe@octave.org>
parents:
15470
diff
changeset
|
83 OCTAVE_JAVA_DIR="$builddir/scripts/java" \ |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9613
diff
changeset
|
84 exec $builddir/libtool --mode=execute $driver \ |
15137
16a6b0a6855d
GUI: support for octave arguments and integrate with run-octave.
John W. Eaton <jwe@octave.org>
parents:
14614
diff
changeset
|
85 "$octave_executable" --no-init-path --path="$LOADPATH" \ |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9613
diff
changeset
|
86 --image-path="$IMAGEPATH" --doc-cache-file="$DOCFILE" \ |
15470
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15335
diff
changeset
|
87 --built-in-docstrings-file="$BUILT_IN_DOCSTRINGS_FILE" \ |
14614
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
88 --texi-macros-file="$TEXIMACROSFILE" --info-file="$INFOFILE" "$@" |