Mercurial > octave
comparison libinterp/parse-tree/oct-lvalue.h @ 31608:23664317f0d3
maint: merge stable to default
author | Rik <rik@octave.org> |
---|---|
date | Thu, 01 Dec 2022 20:05:44 -0800 |
parents | dfa5d9c3ae72 aac27ad79be6 |
children | 5f11de0e7440 |
comparison
equal
deleted
inserted
replaced
31606:dfa5d9c3ae72 | 31608:23664317f0d3 |
---|---|
34 #include "stack-frame.h" | 34 #include "stack-frame.h" |
35 #include "symrec.h" | 35 #include "symrec.h" |
36 | 36 |
37 OCTAVE_BEGIN_NAMESPACE(octave) | 37 OCTAVE_BEGIN_NAMESPACE(octave) |
38 | 38 |
39 class octave_lvalue | 39 class octave_lvalue |
40 { | 40 { |
41 public: | 41 public: |
42 | 42 |
43 octave_lvalue (const symbol_record& sr, | 43 octave_lvalue (const symbol_record& sr, |
44 const std::shared_ptr<stack_frame>& frame) | 44 const std::shared_ptr<stack_frame>& frame) |
45 : m_sym (sr), m_frame (frame), m_black_hole (false), | 45 : m_sym (sr), m_frame (frame), m_black_hole (false), |
46 m_type (), m_idx () | 46 m_type (), m_idx () |
47 { } | 47 { } |
48 | 48 |
49 octave_lvalue (const octave_lvalue&) = default; | 49 octave_lvalue (const octave_lvalue&) = default; |
50 | 50 |
51 octave_lvalue& operator = (const octave_lvalue&) = delete; | 51 octave_lvalue& operator = (const octave_lvalue&) = delete; |
52 | 52 |
53 ~octave_lvalue (void) = default; | 53 ~octave_lvalue (void) = default; |
54 | 54 |
55 bool is_black_hole (void) const { return m_black_hole; } | 55 bool is_black_hole (void) const { return m_black_hole; } |
56 | 56 |
57 void mark_black_hole (void) { m_black_hole = true; } | 57 void mark_black_hole (void) { m_black_hole = true; } |
58 | 58 |
59 bool is_defined (void) const; | 59 bool is_defined (void) const; |
60 | 60 |
61 bool is_undefined (void) const; | 61 bool is_undefined (void) const; |
62 | 62 |
63 bool isstruct (void) const { return value().isstruct (); } | 63 bool isstruct (void) const { return value().isstruct (); } |
64 | 64 |
65 void define (const octave_value& v); | 65 void define (const octave_value& v); |
66 | 66 |
67 void assign (octave_value::assign_op, const octave_value&); | 67 void assign (octave_value::assign_op, const octave_value&); |
68 | 68 |
69 octave_idx_type numel (void) const; | 69 octave_idx_type numel (void) const; |
70 | 70 |
71 void set_index (const std::string& t, | 71 void set_index (const std::string& t, |
72 const std::list<octave_value_list>& i); | 72 const std::list<octave_value_list>& i); |
73 | 73 |
74 void clear_index (void) { m_type = ""; m_idx.clear (); } | 74 void clear_index (void) { m_type = ""; m_idx.clear (); } |
75 | 75 |
76 std::string index_type (void) const { return m_type; } | 76 std::string index_type (void) const { return m_type; } |
77 | 77 |
78 bool index_is_empty (void) const; | 78 bool index_is_empty (void) const; |
79 | 79 |
80 bool index_is_colon (void) const; | 80 bool index_is_colon (void) const; |
81 | 81 |
82 void unary_op (octave_value::unary_op op); | 82 void unary_op (octave_value::unary_op op); |
83 | 83 |
84 octave_value value (void) const; | 84 octave_value value (void) const; |
85 | 85 |
86 private: | 86 private: |
87 | 87 |
88 octave_value | 88 octave_value |
89 eval_for_numel (const std::string& type, | 89 eval_for_numel (const std::string& type, |
90 const std::list<octave_value_list>& idx) const; | 90 const std::list<octave_value_list>& idx) const; |
91 | 91 |
92 symbol_record m_sym; | 92 symbol_record m_sym; |
93 | 93 |
94 std::shared_ptr<stack_frame> m_frame; | 94 std::shared_ptr<stack_frame> m_frame; |
95 | 95 |
96 bool m_black_hole; | 96 bool m_black_hole; |
97 | 97 |
98 std::string m_type; | 98 std::string m_type; |
99 | 99 |
100 std::list<octave_value_list> m_idx; | 100 std::list<octave_value_list> m_idx; |
101 }; | 101 }; |
102 | 102 |
103 OCTAVE_END_NAMESPACE(octave) | 103 OCTAVE_END_NAMESPACE(octave) |
104 | 104 |
105 #endif | 105 #endif |