26 #if ! defined (octave_symrec_h)
27 #define octave_symrec_h 1
29 #include "octave-config.h"
66 class symbol_record_rep
70 symbol_record_rep () =
delete;
72 symbol_record_rep (
const std::string& nm,
symrec_t sc)
73 : m_frame_offset (0), m_data_offset (0), m_storage_class (sc),
77 OCTAVE_DEFAULT_COPY_MOVE_DELETE (symbol_record_rep)
80 bool is_valid ()
const {
return ! m_name.empty (); }
84 std::size_t
frame_offset ()
const {
return m_frame_offset; }
88 std::size_t
data_offset ()
const {
return m_data_offset; }
92 return m_storage_class &
LOCAL;
97 return m_storage_class &
FORMAL;
112 m_storage_class =
static_cast<symrec_t> (m_storage_class |
LOCAL);
118 m_storage_class =
static_cast<symrec_t> (m_storage_class
124 m_storage_class =
static_cast<symrec_t> (m_storage_class
135 m_storage_class =
static_cast<symrec_t> (m_storage_class & ~
LOCAL);
140 m_storage_class =
static_cast<symrec_t> (m_storage_class & ~
FORMAL);
145 m_storage_class =
static_cast<symrec_t> (m_storage_class
154 unsigned int storage_class ()
const {
return m_storage_class; }
156 std::shared_ptr<symbol_record_rep>
dup ()
const;
160 std::string
name ()
const {
return m_name; }
162 void rename (
const std::string& new_name) { m_name = new_name; }
166 std::size_t m_frame_offset;
167 std::size_t m_data_offset;
177 : m_rep (new symbol_record_rep (nm, sc))
182 : m_rep (new symbol_record_rep (nm, sc))
191 bool is_valid ()
const {
return m_rep->is_valid (); }
193 explicit operator bool ()
const {
return is_valid (); }
196 { m_rep->set_frame_offset (offset); }
201 { m_rep->set_data_offset (offset); }
203 std::size_t
data_offset ()
const {
return m_rep->data_offset (); }
207 std::string
name ()
const {
return m_rep->name (); }
209 void rename (
const std::string& new_name) { m_rep->rename (new_name); }
211 bool is_local ()
const {
return m_rep->is_local (); }
232 std::shared_ptr<symbol_record_rep> m_rep;
235 symbol_record (
const std::shared_ptr<symbol_record_rep>& new_rep)
240 OCTAVE_END_NAMESPACE(
octave)
symbol_record & operator=(const symbol_record &)=default
symbol_record(const symbol_record &)=default
symbol_record(const std::string &nm="", symrec_t sc=LOCAL)
unsigned int storage_class() const
symbol_record dup() const
void unmark_as_variable()
void set_data_offset(std::size_t offset)
void unmark_added_static()
void set_frame_offset(std::size_t offset)
bool is_added_static() const
void rename(const std::string &new_name)
std::size_t frame_offset() const
std::size_t data_offset() const
symbol_record(const std::string &nm, const octave_value &, symrec_t sc=LOCAL)
octave_value dump() const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn