GNU Octave
4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <set>
#include <string>
#include "file-stat.h"
#include "oct-env.h"
#include "file-ops.h"
#include "glob-match.h"
#include "lo-regexp.h"
#include "str-vec.h"
#include "call-stack.h"
#include <defaults.h>
#include "Cell.h"
#include "defun.h"
#include "dirfns.h"
#include "error.h"
#include "errwarn.h"
#include "help.h"
#include "input.h"
#include "interpreter.h"
#include "lex.h"
#include "load-path.h"
#include "octave-link.h"
#include "octave-preserve-stream-state.h"
#include "oct-map.h"
#include "ovl.h"
#include "ov.h"
#include "ov-class.h"
#include "ov-usr-fcn.h"
#include "pager.h"
#include "parse.h"
#include "symtab.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
Go to the source code of this file.
Classes | |
struct | symbol_info_list::symbol_info |
class | symbol_info_list |
Macros | |
#define | GET_IDX(LEN) static_cast<int> ((LEN-1) * static_cast<double> (rand ()) / RAND_MAX) |
Variables | |
OCTAVE_EXPORT octave_value_list or class The return code | ar {c} is one of able sis tem 1 ar{name} is a variable. tem 2 ar{name} is an absolute filename |
OCTAVE_EXPORT octave_value_list or class The return code an ordinary file in Octave s | code {path} |
OCTAVE_EXPORT octave_value_list | directory |
OCTAVE_EXPORT octave_value_list only variables visible in the local scope are displayed The following are valid but may not be combined able ode tem global List variables in the global scope rather than the current scope tem regexp The patterns are considered to be regular expressions when matching the variables to display The same pattern syntax accepted by the return a cell array of defined names matching the given patterns | eealso |
OCTAVE_EXPORT octave_value_list | file |
tem check only for symbols of the specified type Valid types are table asis item and there are multiple possible matches for built in | function |
tem check only for symbols of the specified type Valid types are table asis item and there are multiple possible matches for | name |
OCTAVE_EXPORT octave_value_list only variables visible in the local scope are displayed The following are valid but may not be combined able ode tem global List variables in the global scope rather than the current scope tem regexp The patterns are considered to be regular expressions when matching the variables to display The same pattern syntax accepted by the | ode {regexp} function is used. tem -file The next argument is treated as a filename. All variables found within the specified file are listed. No patterns are accepted when reading variables from a file. nd table If called as a function |
OCTAVE_EXPORT octave_value_list only variables visible in the local scope are displayed The following are valid | options |
tem check only for symbols of the specified type Valid types are table asis item and there are multiple possible matches for built in oct class calling Octave trusts oct mex files instead of | ospell |
tem check only for symbols of the specified type Valid types are table asis item | qcode {"var"} Check only for variables. @item @qcode{"builtin"} Check only for built-in functions. @item @qcode{"dir"} Check only for directories. @item @qcode{"file"} Check only for files and directories. @item @qcode{"class"} Check only for classes. (Note: This option is accepted, but not currently implemented) @end table If no type is given |
static std::string | Vmissing_component_hook |
static std::string | Vwhos_line_format = " %a:4; %ln:6; %cs:16:6:1; %rb:12; %lc:-1;\n" |
Definition at line 487 of file variables.cc.
Referenced by unique_symbol_name().
void clear_function | ( | const std::string & | nm | ) |
Definition at line 79 of file variables.cc.
References symbol_table::clear_function().
Referenced by symbol_table::clear_symbol(), DEFUN(), and G__eigs__().
void clear_mex_functions | ( | void | ) |
Definition at line 73 of file variables.cc.
References symbol_table::clear_mex_functions().
void clear_symbol | ( | const std::string & | nm | ) |
Definition at line 91 of file variables.cc.
References symbol_table::clear_symbol().
void clear_variable | ( | const std::string & | nm | ) |
Definition at line 85 of file variables.cc.
References symbol_table::clear_variable().
Referenced by symbol_table::clear(), and symbol_table::clear_symbol().
|
static |
Definition at line 338 of file variables.cc.
References error(), symbol_table::is_global(), octave_value_list::length(), name, print_usage(), and string.
Referenced by Fisglobal().
|
static |
Definition at line 1633 of file variables.cc.
References action_container::add_fcn(), symbol_table::alloc_scope(), symbol_info_list::append(), argc, octave_call_stack::caller(), symbol_table::clear_variables(), symbol_info_list::display(), symbol_info_list::empty(), symbol_table::erase_scope(), error(), eval_string(), feval(), symbol_table::find_symbol(), frame, symbol_table::glob_global_variables(), symbol_table::glob_variables(), symbol_table::symbol_record::is_global(), symbol_table::is_variable(), string_vector::list_in_columns(), symbol_info_list::map_value(), octave_function::name(), octave_stdout, p, octave_call_stack::pop(), octave_call_stack::push(), symbol_table::regexp_global_variables(), symbol_table::regexp_variables(), string_vector::resize(), retval, symbol_table::set_scope(), string, tmp, verbose, and warning().
octave_function* extract_function | ( | const octave_value & | arg, |
const std::string & | warn_for, | ||
const std::string & | fname, | ||
const std::string & | header, | ||
const std::string & | trailer | ||
) |
Definition at line 145 of file variables.cc.
References error(), eval_string(), is_valid_function(), retval, s, string, warning(), and octave_value::xstring_value().
Referenced by DEFUN(), and G__eigs__().
OCTAVE_EXPORT octave_value_list F__varval__ | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2295 of file variables.cc.
Referenced by install_variables_fcns().
OCTAVE_EXPORT octave_value_list Fexist | ( | const octave_value_list & | args, |
int | |||
) |
Referenced by install_variables_fcns().
OCTAVE_EXPORT octave_value_list Fisglobal | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 366 of file variables.cc.
References do_isglobal().
Referenced by install_variables_fcns().
OCTAVE_EXPORT octave_value_list Fmissing_component_hook | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Referenced by install_variables_fcns().
OCTAVE_EXPORT octave_value_list Fmissing_function_hook | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 2263 of file variables.cc.
Referenced by install_variables_fcns().
OCTAVE_EXPORT octave_value_list Fwho | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Referenced by install_variables_fcns().
string_vector generate_struct_completions | ( | const std::string & | text, |
std::string & | prefix, | ||
std::string & | hint | ||
) |
Definition at line 236 of file variables.cc.
References array(), discard_error_messages, discard_warning_messages, eval_string(), find_indexed_expression(), frame, octave_value::is_classdef_object(), octave_value::is_defined(), octave_value::is_java(), octave_value::is_map(), is_variable(), octave_value::map_keys(), action_container::protect_var(), recover_from_exception(), action_container::run(), string, and tmp.
Referenced by generate_possible_completions().
std::string get_dims_str | ( | const octave_value & | val | ) |
Definition at line 1129 of file variables.cc.
References dim_vector::alloc(), dv, dim_vector::ndims(), Array< T >::numel(), octave_value::size(), dim_vector::str(), sz, tmp, and val.
Referenced by symbol_info_list::symbol_info::display_line(), and symbol_info_list::parse_whos_line_format().
string_vector get_struct_elts | ( | const std::string & | text | ) |
Definition at line 184 of file variables.cc.
References Array< T >::length(), and retval.
octave_function* is_valid_function | ( | const std::string & | fcn_name, |
const std::string & | warn_for, | ||
bool | warn | ||
) |
Definition at line 101 of file variables.cc.
References error(), symbol_table::find_function(), octave_value::function_value(), octave_value::is_defined(), and val.
Referenced by DEFUN(), extract_function(), named_hook_function::is_valid(), and is_valid_function().
octave_function* is_valid_function | ( | const octave_value & | arg, |
const std::string & | warn_for, | ||
bool | warn | ||
) |
Definition at line 123 of file variables.cc.
References error(), octave_value::is_string(), is_valid_function(), string, and octave_value::string_value().
|
inlinestatic |
Definition at line 221 of file variables.cc.
References octave_value::is_defined(), retval, val, and symbol_table::varval().
Referenced by final_index_error(), and generate_struct_completions().
bool looks_like_struct | ( | const std::string & | text, |
char | prev_char | ||
) |
Definition at line 305 of file variables.cc.
References octave::sys::file_ops::dir_sep_chars(), discard_error_messages, eval_string(), frame, octave_value::is_defined(), octave_value::is_map(), action_container::protect_var(), retval, action_container::run(), and tmp.
Referenced by generate_completion(), and generate_possible_completions().
nd deftypefn* void maybe_missing_function_hook | ( | const std::string & | name | ) |
Definition at line 2268 of file variables.cc.
Referenced by tree_identifier::eval_undefined_error().
OCTAVE_EXPORT octave_value_list or class The return code an ordinary file in Octave s or | ( | after appending @samp{.m} | ) |
Definition at line 582 of file variables.cc.
Referenced by dqagie(), install_class_ops(), and qagie().
|
static |
Definition at line 1028 of file variables.cc.
References a, b, left, param, and right.
Referenced by symbol_info_list::display().
int symbol_exist | ( | const std::string & | name, |
const std::string & | type | ||
) |
Definition at line 382 of file variables.cc.
References error(), file_in_path(), symbol_table::find_cmdline_function(), load_path::find_fcn(), fs, octave_value::is_anonymous_function(), symbol_table::is_built_in_function_name(), octave_value::is_constant(), octave_value::is_defined(), octave::sys::base_file_stat::is_dir(), octave_value::is_function_handle(), octave_value::is_inline_function(), octave::is_keyword(), octave_value::is_object(), lookup_autoload(), string, val, and symbol_table::varval().
Referenced by unique_symbol_name().
std::string unique_symbol_name | ( | const std::string & | basename | ) |
Definition at line 491 of file variables.cc.
References GET_IDX, octave_value_list::length(), nm, string, and symbol_exist().
Referenced by DEFUN(), and G__eigs__().
tem check only for symbols of the specified type Valid types are table asis item and there are multiple possible matches for built in oct class calling ar {c} is one of able sis tem 1 ar{name} is a variable. tem 2 ar{name} is an absolute filename |
Definition at line 582 of file variables.cc.
OCTAVE_EXPORT octave_value_list to provide a hint to users for how to install the missing components When called from inside a function with the code {path} |
Definition at line 582 of file variables.cc.
tem check only for symbols of the specified type Valid types are table asis item and there are multiple possible matches for built in oct directory |
Definition at line 582 of file variables.cc.
Referenced by FileDialog::acceptSelection(), cdef_class::cdef_class_rep::get_directory(), octave::base_url_transfer::mput_directory(), and cdef_class::cdef_class_rep::set_directory().
OCTAVE_EXPORT octave_value_list only variables visible in the local scope are displayed The following are valid but may not be combined able ode tem global List variables in the global scope rather than the current scope tem regexp The patterns are considered to be regular expressions when matching the variables to display The same pattern syntax accepted by the return a cell array of defined names matching the given patterns eealso |
Definition at line 1859 of file variables.cc.
tem check only for symbols of the specified type Valid types are table asis item and there are multiple possible matches for built in oct file |
Definition at line 582 of file variables.cc.
tem check only for symbols of the specified type Valid types are table asis item and there are multiple possible matches for built in function |
Definition at line 582 of file variables.cc.
tem check only for symbols of the specified type Valid types are table asis item and there are multiple possible matches for name |
Definition at line 582 of file variables.cc.
Referenced by symbol_info_list::symbol_info::display_line(), and do_isglobal().
OCTAVE_EXPORT octave_value_list only variables visible in the local scope are displayed The following are valid but may not be combined able ode tem global List variables in the global scope rather than the current scope tem regexp The patterns are considered to be regular expressions when matching the variables to display The same pattern syntax accepted by the ode {regexp} function is used. tem -file The next argument is treated as a filename. All variables found within the specified file are listed. No patterns are accepted when reading variables from a file. nd table If called as a function |
Definition at line 1859 of file variables.cc.
OCTAVE_EXPORT octave_value_list only variables visible in the local scope are displayed The following are valid options |
Definition at line 1859 of file variables.cc.
Referenced by octave::regexp::compile(), F__magick_read__(), G__delaunayn__(), G__voronoi__(), Gconvhulln(), and octregexp().
tem check only for symbols of the specified type Valid types are table asis item and there are multiple possible matches for built in oct class calling Octave trusts oct mex files instead of ospell |
Definition at line 582 of file variables.cc.
tem check only for symbols of the specified type Valid types are table asis item qcode {"var"} Check only for variables. @item @qcode{"builtin"} Check only for built-in functions. @item @qcode{"dir"} Check only for directories. @item @qcode{"file"} Check only for files and directories. @item @qcode{"class"} Check only for classes. (Note: This option is accepted, but not currently implemented) @end table If no type is given |
Definition at line 582 of file variables.cc.
|
static |
Definition at line 2305 of file variables.cc.
|
static |
Definition at line 70 of file variables.cc.
Referenced by symbol_info_list::parse_whos_line_format().