GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
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-private.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

static octave_value do_isglobal (octave::symbol_table &symtab, const octave_value_list &args)
 
static octave_value do_who (octave::interpreter &interp, 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__ (octave::interpreter &interp, const octave_value_list &args, int)
 
OCTAVE_EXPORT octave_value_list Fexist (octave::interpreter &interp, const octave_value_list &args, int) function
 
OCTAVE_EXPORT octave_value_list Fisglobal (octave::interpreter &interp, 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 (octave::interpreter &interp, 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 (octave::symbol_table &symtab, 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)
 
static int symbol_exist (octave::interpreter &interp, const std::string &name, const std::string &type="any")
 
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

◆ GET_IDX

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

Definition at line 494 of file variables.cc.

Referenced by unique_symbol_name().

Function Documentation

◆ do_isglobal()

static octave_value do_isglobal ( octave::symbol_table symtab,
const octave_value_list args 
)
static

◆ do_who()

◆ extract_function()

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 
)

◆ F__varval__()

OCTAVE_EXPORT octave_value_list F__varval__ ( octave::interpreter interp,
const octave_value_list args,
int   
)

Definition at line 2246 of file variables.cc.

◆ Fexist()

OCTAVE_EXPORT octave_value_list Fexist ( octave::interpreter interp,
const octave_value_list args,
int   
)

◆ Fisglobal()

OCTAVE_EXPORT octave_value_list Fisglobal ( octave::interpreter interp,
const octave_value_list args,
int   
)

Definition at line 353 of file variables.cc.

References do_isglobal().

◆ Fmissing_component_hook()

OCTAVE_EXPORT octave_value_list Fmissing_component_hook ( const octave_value_list args,
int  nargout 
)

◆ Fmissing_function_hook()

OCTAVE_EXPORT octave_value_list Fmissing_function_hook ( const octave_value_list args,
int  nargout 
)

Definition at line 2210 of file variables.cc.

◆ Fwho()

OCTAVE_EXPORT octave_value_list Fwho ( octave::interpreter interp,
const octave_value_list args,
int  nargout 
)

◆ generate_struct_completions()

◆ get_dims_str()

◆ get_struct_elts()

string_vector get_struct_elts ( const std::string text)

Definition at line 164 of file variables.cc.

References i, and retval.

◆ is_valid_function() [1/2]

octave_function* is_valid_function ( const std::string fcn_name,
const std::string warn_for,
bool  warn 
)

◆ is_valid_function() [2/2]

octave_function* is_valid_function ( const octave_value arg,
const std::string warn_for,
bool  warn 
)

◆ is_variable()

static bool is_variable ( octave::symbol_table symtab,
const std::string name 
)
inlinestatic

◆ looks_like_struct()

◆ maybe_missing_function_hook()

nd deftypefn* void maybe_missing_function_hook ( const std::string name)

◆ or()

OCTAVE_EXPORT octave_value_list or class The return code an ordinary file in Octave s or ( after appending @samp{.m}  )

Definition at line 593 of file variables.cc.

Referenced by DQAGIE(), install_class_ops(), and qagie().

◆ print_descriptor()

static void print_descriptor ( std::ostream &  os,
std::list< whos_parameter >  params 
)
static

Definition at line 1013 of file variables.cc.

References a, b, i, left, Array< T >::length(), os, param, and right.

Referenced by symbol_info_list::display().

◆ symbol_exist() [1/2]

◆ symbol_exist() [2/2]

int symbol_exist ( const std::string name,
const std::string type 
)

Definition at line 486 of file variables.cc.

References octave::__get_interpreter__(), name, symbol_exist(), and type.

◆ unique_symbol_name()

Variable Documentation

◆ ar

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 593 of file variables.cc.

◆ code

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 593 of file variables.cc.

◆ directory

◆ eealso

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 1862 of file variables.cc.

◆ 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 oct file

Definition at line 593 of file variables.cc.

◆ function

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 593 of file variables.cc.

◆ name

tem check only for symbols of the specified type Valid types are table asis item and there are multiple possible matches for name

◆ ode

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 1862 of file variables.cc.

◆ options

◆ ospell

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 593 of file variables.cc.

◆ qcode

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 593 of file variables.cc.

◆ Vmissing_component_hook

std::string Vmissing_component_hook
static

Definition at line 2258 of file variables.cc.

◆ Vwhos_line_format

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

Definition at line 71 of file variables.cc.

Referenced by symbol_info_list::parse_whos_line_format().