| 191 | } |
| 192 | |
| 193 | void instance_type::check_declar_var(tree_type<token_base *>::iterator it, bool regist) |
| 194 | { |
| 195 | if (it.data() == nullptr) |
| 196 | throw internal_error("Null pointer accessed."); |
| 197 | if (it.data()->get_type() == token_types::parallel) { |
| 198 | auto ¶llel_list = static_cast<token_parallel *>(it.data())->get_parallel(); |
| 199 | for (auto &t : parallel_list) |
| 200 | check_declar_var(t.root(), regist); |
| 201 | } |
| 202 | else { |
| 203 | token_base *root = it.data(); |
| 204 | if (root == nullptr || root->get_type() != token_types::id) |
| 205 | throw runtime_error("Wrong grammar for variable declaration."); |
| 206 | if (regist) |
| 207 | storage.add_record(static_cast<token_id *>(root)->get_id().get_id()); |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | void instance_type::check_define_var(tree_type<token_base *>::iterator it, bool regist, bool constant) |
| 212 | { |
no test coverage detected