1 #ifndef RBX_ARGUMENTS_HPP
2 #define RBX_ARGUMENTS_HPP
5 #include "class/array.hpp"
6 #include "class/tuple.hpp"
18 Tuple
* argument_container_
;
21 Arguments(Symbol
* name
, Object
* recv
, Object
* block
, uint32_t total
, Object
** buffer
)
27 , argument_container_(0)
30 Arguments(Symbol
* name
, Object
* recv
, uint32_t total
, Object
** buffer
)
36 , argument_container_(0)
39 Arguments(Symbol
* name
, uint32_t total
, Object
** buffer
)
45 , argument_container_(0)
48 Arguments(Symbol
* name
, Object
* recv
, Object
* block
)
54 , argument_container_(0)
57 Arguments(Symbol
* name
, Object
* recv
)
63 , argument_container_(0)
66 Arguments(Symbol
* name
)
72 , argument_container_(0)
75 Arguments(Symbol
* name
, Object
* recv
, Object
* block
, Array
* ary
)
83 Arguments(Symbol
* name
, Object
* recv
, Array
* ary
)
91 Arguments(Symbol
* name
, Array
* ary
)
99 Symbol
* name() const {
103 void set_name(Symbol
* n
) {
107 Object
* recv() const {
111 Object
*& recv_location() {
115 void set_recv(Object
* val
) {
119 Object
* block() const {
123 Object
*& block_location() {
127 void set_block(Object
* val
) {
131 Object
* get_argument(uint32_t which
) const {
132 return arguments_
[which
];
135 Object
** arguments() const {
139 Object
**& arguments_location() {
143 Tuple
* argument_container() const {
144 return argument_container_
;
147 void update_argument_container(Tuple
* obj
);
149 uint32_t total() const {
153 void use_argument(Object
* obj
) {
157 void use_array(Array
* ary
) {
158 use_tuple(ary
->tuple(), ary
->size(), ary
->offset());
161 void use_tuple(Tuple
* tup
, uint32_t size
, uint32_t offset
) {
163 arguments_
= tup
->field
+ offset
;
164 argument_container_
= tup
;
167 void use_tuple(Tuple
* tup
, uint32_t size
) {
168 use_tuple(tup
, size
, 0);
171 Array
* as_array(STATE
);
172 void append(STATE
, Array
* ary
);
173 void prepend(STATE
, Array
* ary
);
175 void unshift(STATE
, Object
* val
);
176 void unshift2(STATE
, Object
* val
, Object
* val2
);
178 Object
* shift(STATE
);