comparison libinterp/parse-tree/pt-eval.cc @ 33351:1941a21c23b9 bytecode-interpreter

maint: merge default to bytecode-interpreter
author John W. Eaton <jwe@octave.org>
date Sun, 07 Apr 2024 13:40:32 -0400
parents ac3633dd67d1 1191eae272fa
children fc12e1f3cd5d
comparison
equal deleted inserted replaced
33346:e8854b8d2486 33351:1941a21c23b9
77 # include "pt-bytecode-walk.h" 77 # include "pt-bytecode-walk.h"
78 #endif 78 #endif
79 79
80 OCTAVE_BEGIN_NAMESPACE(octave) 80 OCTAVE_BEGIN_NAMESPACE(octave)
81 81
82 OCTAVE_NORETURN static void
83 error_unexpected (const char *name)
84 {
85 error ("unexpected call to %s - please report this bug", name);
86 }
87
82 // Normal evaluator. 88 // Normal evaluator.
83 89
84 class debugger 90 class debugger
85 { 91 {
86 public: 92 public:
1241 } 1247 }
1242 1248
1243 void 1249 void
1244 tree_evaluator::visit_anon_fcn_handle (tree_anon_fcn_handle&) 1250 tree_evaluator::visit_anon_fcn_handle (tree_anon_fcn_handle&)
1245 { 1251 {
1246 panic_impossible (); 1252 error_unexpected ("tree_evaluator::visit_anon_fcn_handle");
1247 } 1253 }
1248 1254
1249 void 1255 void
1250 tree_evaluator::visit_argument_list (tree_argument_list&) 1256 tree_evaluator::visit_argument_list (tree_argument_list&)
1251 { 1257 {
1252 panic_impossible (); 1258 error_unexpected ("tree_evaluator::visit_argument_list");
1253 } 1259 }
1254 1260
1255 void 1261 void
1256 tree_evaluator::visit_arguments_block (tree_arguments_block&) 1262 tree_evaluator::visit_arguments_block (tree_arguments_block&)
1257 { 1263 {
1259 } 1265 }
1260 1266
1261 void 1267 void
1262 tree_evaluator::visit_args_block_attribute_list (tree_args_block_attribute_list&) 1268 tree_evaluator::visit_args_block_attribute_list (tree_args_block_attribute_list&)
1263 { 1269 {
1264 panic_impossible (); 1270 error_unexpected ("tree_evaluator::visit_args_block_attribute_list");
1265 } 1271 }
1266 1272
1267 void 1273 void
1268 tree_evaluator::visit_args_block_validation_list (tree_args_block_validation_list&) 1274 tree_evaluator::visit_args_block_validation_list (tree_args_block_validation_list&)
1269 { 1275 {
1270 panic_impossible (); 1276 error_unexpected ("tree_evaluator::visit_args_block_validation_list");
1271 } 1277 }
1272 1278
1273 void 1279 void
1274 tree_evaluator::visit_arg_validation (tree_arg_validation&) 1280 tree_evaluator::visit_arg_validation (tree_arg_validation&)
1275 { 1281 {
1276 panic_impossible (); 1282 error_unexpected ("tree_evaluator::visit_arg_validation");
1277 } 1283 }
1278 1284
1279 void 1285 void
1280 tree_evaluator::visit_arg_size_spec (tree_arg_size_spec&) 1286 tree_evaluator::visit_arg_size_spec (tree_arg_size_spec&)
1281 { 1287 {
1282 panic_impossible (); 1288 error_unexpected ("tree_evaluator::visit_arg_size_spec");
1283 } 1289 }
1284 1290
1285 void 1291 void
1286 tree_evaluator::visit_arg_validation_fcns (tree_arg_validation_fcns&) 1292 tree_evaluator::visit_arg_validation_fcns (tree_arg_validation_fcns&)
1287 { 1293 {
1288 panic_impossible (); 1294 error_unexpected ("tree_evaluator::visit_arg_validation_fcns");
1289 } 1295 }
1290 1296
1291 void 1297 void
1292 tree_evaluator::visit_binary_expression (tree_binary_expression&) 1298 tree_evaluator::visit_binary_expression (tree_binary_expression&)
1293 { 1299 {
1294 panic_impossible (); 1300 error_unexpected ("tree_evaluator::visit_binary_expression");
1295 } 1301 }
1296 1302
1297 void 1303 void
1298 tree_evaluator::visit_boolean_expression (tree_boolean_expression&) 1304 tree_evaluator::visit_boolean_expression (tree_boolean_expression&)
1299 { 1305 {
1300 panic_impossible (); 1306 error_unexpected ("tree_evaluator::visit_boolean_expression");
1301 } 1307 }
1302 1308
1303 void 1309 void
1304 tree_evaluator::visit_compound_binary_expression (tree_compound_binary_expression&) 1310 tree_evaluator::visit_compound_binary_expression (tree_compound_binary_expression&)
1305 { 1311 {
1306 panic_impossible (); 1312 error_unexpected ("tree_evaluator::visit_compound_binary_expression");
1307 } 1313 }
1308 1314
1309 void 1315 void
1310 tree_evaluator::visit_break_command (tree_break_command& cmd) 1316 tree_evaluator::visit_break_command (tree_break_command& cmd)
1311 { 1317 {
1328 } 1334 }
1329 1335
1330 void 1336 void
1331 tree_evaluator::visit_colon_expression (tree_colon_expression&) 1337 tree_evaluator::visit_colon_expression (tree_colon_expression&)
1332 { 1338 {
1333 panic_impossible (); 1339 error_unexpected ("tree_evaluator::visit_colon_expression");
1334 } 1340 }
1335 1341
1336 void 1342 void
1337 tree_evaluator::visit_continue_command (tree_continue_command& cmd) 1343 tree_evaluator::visit_continue_command (tree_continue_command& cmd)
1338 { 1344 {
3624 3630
3625 void 3631 void
3626 tree_evaluator::visit_octave_user_script (octave_user_script&) 3632 tree_evaluator::visit_octave_user_script (octave_user_script&)
3627 { 3633 {
3628 // ?? 3634 // ??
3629 panic_impossible (); 3635 error_unexpected ("tree_evaluator::visit_octave_user_script");
3630 } 3636 }
3631 3637
3632 octave_value_list 3638 octave_value_list
3633 tree_evaluator::execute_user_function (octave_user_function& user_function, 3639 tree_evaluator::execute_user_function (octave_user_function& user_function,
3634 int nargout, 3640 int nargout,
3807 3813
3808 void 3814 void
3809 tree_evaluator::visit_octave_user_function (octave_user_function&) 3815 tree_evaluator::visit_octave_user_function (octave_user_function&)
3810 { 3816 {
3811 // ?? 3817 // ??
3812 panic_impossible (); 3818 error_unexpected ("tree_evaluator::visit_octave_user_function");
3813 } 3819 }
3814 3820
3815 void 3821 void
3816 tree_evaluator::visit_octave_user_function_header (octave_user_function&) 3822 tree_evaluator::visit_octave_user_function_header (octave_user_function&)
3817 { 3823 {
3818 panic_impossible (); 3824 error_unexpected ("tree_evaluator::visit_octave_user_function_header");
3819 } 3825 }
3820 3826
3821 void 3827 void
3822 tree_evaluator::visit_octave_user_function_trailer (octave_user_function&) 3828 tree_evaluator::visit_octave_user_function_trailer (octave_user_function&)
3823 { 3829 {
3824 panic_impossible (); 3830 error_unexpected ("tree_evaluator::visit_octave_user_function_trailer");
3825 } 3831 }
3826 3832
3827 void 3833 void
3828 tree_evaluator::visit_function_def (tree_function_def& cmd) 3834 tree_evaluator::visit_function_def (tree_function_def& cmd)
3829 { 3835 {
3847 } 3853 }
3848 3854
3849 void 3855 void
3850 tree_evaluator::visit_identifier (tree_identifier&) 3856 tree_evaluator::visit_identifier (tree_identifier&)
3851 { 3857 {
3852 panic_impossible (); 3858 error_unexpected ("tree_evaluator::visit_identifier");
3853 } 3859 }
3854 3860
3855 void 3861 void
3856 tree_evaluator::visit_if_clause (tree_if_clause&) 3862 tree_evaluator::visit_if_clause (tree_if_clause&)
3857 { 3863 {
3858 panic_impossible (); 3864 error_unexpected ("tree_evaluator::visit_if_clause");
3859 } 3865 }
3860 3866
3861 void 3867 void
3862 tree_evaluator::visit_if_command (tree_if_command& cmd) 3868 tree_evaluator::visit_if_command (tree_if_command& cmd)
3863 { 3869 {
3906 } 3912 }
3907 3913
3908 void 3914 void
3909 tree_evaluator::visit_index_expression (tree_index_expression&) 3915 tree_evaluator::visit_index_expression (tree_index_expression&)
3910 { 3916 {
3911 panic_impossible (); 3917 error_unexpected ("tree_evaluator::visit_index_expression");
3912 } 3918 }
3913 3919
3914 void 3920 void
3915 tree_evaluator::visit_matrix (tree_matrix&) 3921 tree_evaluator::visit_matrix (tree_matrix&)
3916 { 3922 {
3917 panic_impossible (); 3923 error_unexpected ("tree_evaluator::visit_matrix");
3918 } 3924 }
3919 3925
3920 void 3926 void
3921 tree_evaluator::visit_cell (tree_cell&) 3927 tree_evaluator::visit_cell (tree_cell&)
3922 { 3928 {
3923 panic_impossible (); 3929 error_unexpected ("tree_evaluator::visit_cell");
3924 } 3930 }
3925 3931
3926 void 3932 void
3927 tree_evaluator::visit_multi_assignment (tree_multi_assignment&) 3933 tree_evaluator::visit_multi_assignment (tree_multi_assignment&)
3928 { 3934 {
3929 panic_impossible (); 3935 error_unexpected ("tree_evaluator::visit_multi_assignment");
3930 } 3936 }
3931 3937
3932 void 3938 void
3933 tree_evaluator::visit_no_op_command (tree_no_op_command& cmd) 3939 tree_evaluator::visit_no_op_command (tree_no_op_command& cmd)
3934 { 3940 {
3946 } 3952 }
3947 3953
3948 void 3954 void
3949 tree_evaluator::visit_constant (tree_constant&) 3955 tree_evaluator::visit_constant (tree_constant&)
3950 { 3956 {
3951 panic_impossible (); 3957 error_unexpected ("tree_evaluator::visit_constant");
3952 } 3958 }
3953 3959
3954 void 3960 void
3955 tree_evaluator::visit_fcn_handle (tree_fcn_handle&) 3961 tree_evaluator::visit_fcn_handle (tree_fcn_handle&)
3956 { 3962 {
3957 panic_impossible (); 3963 error_unexpected ("tree_evaluator::visit_fcn_handle");
3958 } 3964 }
3959 3965
3960 void 3966 void
3961 tree_evaluator::visit_parameter_list (tree_parameter_list&) 3967 tree_evaluator::visit_parameter_list (tree_parameter_list&)
3962 { 3968 {
3963 panic_impossible (); 3969 error_unexpected ("tree_evaluator::visit_parameter_list");
3964 } 3970 }
3965 3971
3966 void 3972 void
3967 tree_evaluator::visit_postfix_expression (tree_postfix_expression&) 3973 tree_evaluator::visit_postfix_expression (tree_postfix_expression&)
3968 { 3974 {
3969 panic_impossible (); 3975 error_unexpected ("tree_evaluator::visit_postfix_expression");
3970 } 3976 }
3971 3977
3972 void 3978 void
3973 tree_evaluator::visit_prefix_expression (tree_prefix_expression&) 3979 tree_evaluator::visit_prefix_expression (tree_prefix_expression&)
3974 { 3980 {
3975 panic_impossible (); 3981 error_unexpected ("tree_evaluator::visit_prefix_expression");
3976 } 3982 }
3977 3983
3978 void 3984 void
3979 tree_evaluator::visit_return_command (tree_return_command& cmd) 3985 tree_evaluator::visit_return_command (tree_return_command& cmd)
3980 { 3986 {
4001 } 4007 }
4002 4008
4003 void 4009 void
4004 tree_evaluator::visit_simple_assignment (tree_simple_assignment&) 4010 tree_evaluator::visit_simple_assignment (tree_simple_assignment&)
4005 { 4011 {
4006 panic_impossible (); 4012 error_unexpected ("tree_evaluator::visit_simple_assignment");
4007 } 4013 }
4008 4014
4009 void 4015 void
4010 tree_evaluator::visit_statement (tree_statement& stmt) 4016 tree_evaluator::visit_statement (tree_statement& stmt)
4011 { 4017 {
4167 } 4173 }
4168 4174
4169 void 4175 void
4170 tree_evaluator::visit_switch_case (tree_switch_case&) 4176 tree_evaluator::visit_switch_case (tree_switch_case&)
4171 { 4177 {
4172 panic_impossible (); 4178 error_unexpected ("tree_evaluator::visit_switch_case");
4173 } 4179 }
4174 4180
4175 void 4181 void
4176 tree_evaluator::visit_switch_case_list (tree_switch_case_list&) 4182 tree_evaluator::visit_switch_case_list (tree_switch_case_list&)
4177 { 4183 {
4178 panic_impossible (); 4184 error_unexpected ("tree_evaluator::visit_switch_case_list");
4179 } 4185 }
4180 4186
4181 void 4187 void
4182 tree_evaluator::visit_switch_command (tree_switch_command& cmd) 4188 tree_evaluator::visit_switch_command (tree_switch_command& cmd)
4183 { 4189 {
4515 } 4521 }
4516 4522
4517 void 4523 void
4518 tree_evaluator::visit_superclass_ref (tree_superclass_ref&) 4524 tree_evaluator::visit_superclass_ref (tree_superclass_ref&)
4519 { 4525 {
4520 panic_impossible (); 4526 error_unexpected ("tree_evaluator::visit_superclass_ref");
4521 } 4527 }
4522 4528
4523 void 4529 void
4524 tree_evaluator::visit_metaclass_query (tree_metaclass_query&) 4530 tree_evaluator::visit_metaclass_query (tree_metaclass_query&)
4525 { 4531 {
4526 panic_impossible (); 4532 error_unexpected ("tree_evaluator::visit_metaclass_query");
4527 } 4533 }
4528 4534
4529 void 4535 void
4530 tree_evaluator::bind_ans (const octave_value& val, bool print) 4536 tree_evaluator::bind_ans (const octave_value& val, bool print)
4531 { 4537 {