24 #if ! defined (octave_symrec_h) 25 #define octave_symrec_h 1 27 #include "octave-config.h" 41 class symbol_scope_rep;
50 static const unsigned int local = 1;
57 static const unsigned int formal = 4;
60 static const unsigned int hidden = 8;
66 static const unsigned int global = 32;
104 const std::list<octave_value_list>& idx,
124 const std::list<octave_value_list>& idx,
228 return t_fwd_rep->is_variable (
context);
236 return t_fwd_rep->is_local ();
244 return t_fwd_rep->is_automatic ();
252 return t_fwd_rep->is_formal ();
260 return t_fwd_rep->is_hidden ();
268 return t_fwd_rep->is_inherited ();
281 return t_fwd_rep->is_global ();
289 return t_fwd_rep->is_persistent ();
297 return t_fwd_rep->is_added_static ();
306 t_fwd_rep->mark_local ();
317 t_fwd_rep->mark_automatic ();
328 t_fwd_rep->mark_formal ();
339 t_fwd_rep->mark_hidden ();
350 t_fwd_rep->mark_inherited ();
375 t_fwd_rep->mark_persistent ();
380 error (
"can't make global variable %s persistent",
m_name.c_str ());
383 error (
"can't make function parameter %s persistent",
m_name.c_str ());
391 t_fwd_rep->mark_added_static ();
402 t_fwd_rep->unmark_local ();
413 t_fwd_rep->unmark_automatic ();
424 t_fwd_rep->unmark_formal ();
435 t_fwd_rep->unmark_hidden ();
446 t_fwd_rep->unmark_inherited ();
457 t_fwd_rep->unmark_persistent ();
468 t_fwd_rep->unmark_added_static ();
480 const std::shared_ptr<symbol_record_rep>& fwd_rep)
493 if (t_fwd_rep->is_marked_global ())
496 t_fwd_rep->bind_fwd_rep (fwd_scope, fwd_rep);
522 if (t_fwd_rep->is_marked_global ())
531 t_fwd_rep->unbind_global_rep ();
535 std::shared_ptr<symbol_record_rep>
536 dup (
const std::shared_ptr<symbol_scope_rep>& new_scope)
const;
599 const std::list<octave_value_list>& idx,
618 const std::list<octave_value_list>& idx,
700 std::shared_ptr<symbol_record_rep>
m_rep;
octave_value dump(context_id context) const
std::shared_ptr< symbol_record_rep > m_rep
void unmark_persistent(void)
For example cd octave end example noindent changes the current working directory to an error message is printed and the working directory is not changed sc
void mark_automatic(void)
bool is_global(void) const
std::weak_ptr< symbol_scope_rep > m_fwd_scope
static const unsigned int local
std::string name(void) const
symbol_record_rep & operator=(const symbol_record_rep &)=delete
void assign(octave_value::assign_op op, const octave_value &value, context_id context)
static const unsigned int global
bool is_undefined(context_id context) const
symbol_record(const std::string &nm="", const octave_value &v=octave_value(), unsigned int sc=local)
void assign(const octave_value &value, context_id context)
void mark_inherited(void)
~symbol_record(void)=default
bool is_defined(context_id context) const
void rename(const std::string &new_name)
static octave_value dummy_octave_value
octave_value find(context_id context, const octave_value_list &args=octave_value_list()) const
bool is_variable(context_id context) const
bool is_global(void) const
std::shared_ptr< symbol_record_rep > dup(const std::shared_ptr< symbol_scope_rep > &new_scope) const
unsigned int storage_class(void) const
void bind_fwd_rep(const std::shared_ptr< symbol_scope_rep > &fwd_scope, const std::shared_ptr< symbol_record_rep > &fwd_rep)
bool is_variable(context_id context) const
static const unsigned int inherited
void clear(context_id context)
bool is_persistent(void) const
void error(const char *fmt,...)
static const unsigned int formal
void unmark_automatic(void)
void bind_fwd_rep(const std::shared_ptr< symbol_scope_rep > &fwd_scope, const symbol_record &sr)
bool is_formal(void) const
void do_non_const_unary_op(octave_value::unary_op op, context_id context)
bool is_defined(void) const
void assign(octave_value::assign_op op, const std::string &type, const std::list< octave_value_list > &idx, const octave_value &value, context_id context)
static llvm::LLVMContext & context
bool is_added_static(void) const
unsigned int storage_class(void) const
octave_value & do_non_const_unary_op(unary_op op)
bool is_marked_global(void) const
bool is_inherited(void) const
void mark_persistent(void)
bool is_local(void) const
bool is_persistent(void) const
void mark_added_static(void)
octave_value varval(context_id context) const
void unbind_fwd_rep(void)
unsigned int m_storage_class
octave_value find_function(const std::string &name, const octave_value_list &args) const
octave_value & assign(assign_op op, const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
void clear(context_id context)
symbol_record_rep(const std::string &nm, const octave_value &v, unsigned int sc)
octave_value dump(context_id context) const
std::string name(void) const
void unbind_fwd_rep(void)
void unbind_global_rep(void)
static const unsigned int persistent
bool is_forwarded(void) const
symbol_record(const std::shared_ptr< symbol_record_rep > &new_rep)
bool is_marked_global(void) const
bool is_formal(void) const
void unmark_persistent(void)
std::weak_ptr< symbol_record_rep > m_fwd_rep
octave_value & varref(context_id context)
bool is_automatic(void) const
void unbind_global_rep(void)
bool is_local(void) const
context_id pop_context(void)
void init_persistent(void)
std::deque< octave_value > m_value_stack
bool is_added_static(void) const
void do_non_const_unary_op(octave_value::unary_op op, context_id context)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
void unmark_added_static(void)
~symbol_record_rep(void)=default
bool is_undefined(void) const
bool is_inherited(void) const
void init_persistent(void)
static const unsigned int hidden
bool is_hidden(void) const
void unmark_inherited(void)
void do_non_const_unary_op(octave_value::unary_op op, const std::string &type, const std::list< octave_value_list > &idx, context_id context)
void assign(const octave_value &value, context_id context)
void mark_automatic(void)
bool is_defined(context_id context) const
static const unsigned int added_static
symbol_record dup(const std::shared_ptr< symbol_scope_rep > &sid) const
bool is_automatic(void) const
void rename(const std::string &new_name)
octave_value varval(context_id context) const
context_id get_fwd_scope_context(void) const
void assign(octave_value::assign_op op, const octave_value &value, context_id context)
static const unsigned int automatic
void assign(octave_value::assign_op op, const std::string &type, const std::list< octave_value_list > &idx, const octave_value &value, context_id context)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
nd group nd example For each display the value
void mark_added_static(void)
bool is_forwarded(void) const
void unmark_inherited(void)
bool is_hidden(void) const
void unmark_added_static(void)
void unmark_automatic(void)
context_id pop_context(void)
void mark_persistent(void)
void do_non_const_unary_op(octave_value::unary_op op, const std::string &type, const std::list< octave_value_list > &idx, context_id context)
void mark_inherited(void)
symbol_record & operator=(const symbol_record &)=default