GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Macros | Functions | Variables
variables.cc File Reference
#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"
Include dependency graph for variables.cc:

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)
 

Functions

void clear_function (const std::string &nm)
 
void clear_mex_functions (void)
 
void clear_symbol (const std::string &nm)
 
void clear_variable (const std::string &nm)
 
static octave_value do_isglobal (const octave_value_list &args)
 
static octave_value do_who (int argc, const string_vector &argv, bool return_list, bool verbose=false, std::string msg="")
 
octave_functionextract_function (const octave_value &arg, const std::string &warn_for, const std::string &fname, const std::string &header, const std::string &trailer)
 
OCTAVE_EXPORT octave_value_list F__varval__ (const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fexist (const octave_value_list &args, int) function
 
OCTAVE_EXPORT octave_value_list Fisglobal (const octave_value_list &args, int) exist}nd deftypefn */)
 
OCTAVE_EXPORT octave_value_list Fmissing_component_hook (const octave_value_list &args, int nargout) for example
 
OCTAVE_EXPORT octave_value_list Fmissing_function_hook (const octave_value_list &args, int nargout) the variable is changed locally for the function and any subroutines it calls.The original variable value is restored when exiting the function.eealso
 
OCTAVE_EXPORT octave_value_list Fwho (const octave_value_list &args, int nargout) all variables are listed.By default
 
string_vector generate_struct_completions (const std::string &text, std::string &prefix, std::string &hint)
 
std::string get_dims_str (const octave_value &val)
 
string_vector get_struct_elts (const std::string &text)
 
octave_functionis_valid_function (const std::string &fcn_name, const std::string &warn_for, bool warn)
 
octave_functionis_valid_function (const octave_value &arg, const std::string &warn_for, bool warn)
 
static bool is_variable (const std::string &name)
 
bool looks_like_struct (const std::string &text, char prev_char)
 
nd deftypefn *void maybe_missing_function_hook (const std::string &name)
 
OCTAVE_EXPORT
octave_value_list or class The
return code an ordinary file
in Octave s 
or (after appending @samp{.m}) a function file in Octave's ode
 
static void print_descriptor (std::ostream &os, std::list< whos_parameter > params)
 
int symbol_exist (const std::string &name, const std::string &type)
 
std::string unique_symbol_name (const std::string &basename)
 

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"
 

Macro Definition Documentation

#define GET_IDX (   LEN)    static_cast<int> ((LEN-1) * static_cast<double> (rand ()) / RAND_MAX)

Definition at line 487 of file variables.cc.

Referenced by unique_symbol_name().

Function Documentation

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 octave_value do_isglobal ( const octave_value_list args)
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 octave_value do_who ( int  argc,
const string_vector argv,
bool  return_list,
bool  verbose = false,
std::string  msg = "" 
)
static
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 
)
std::string get_dims_str ( const octave_value val)
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 
)
octave_function* is_valid_function ( const octave_value arg,
const std::string warn_for,
bool  warn 
)
static bool is_variable ( const std::string name)
inlinestatic
bool looks_like_struct ( const std::string text,
char  prev_char 
)
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 void print_descriptor ( std::ostream &  os,
std::list< whos_parameter >  params 
)
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 
)
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__().

Variable Documentation

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
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
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.

std::string Vmissing_component_hook
static

Definition at line 2305 of file variables.cc.

std::string Vwhos_line_format = " %a:4; %ln:6; %cs:16:6:1; %rb:12; %lc:-1;\n"
static

Definition at line 70 of file variables.cc.

Referenced by symbol_info_list::parse_whos_line_format().