1 /********************************************************************/ 2 /* */ 3 /* s7 Seed7 interpreter */ 4 /* Copyright (C) 1990 - 2000, 2010 - 2011, 2014 - 2017 */ 5 /* Thomas Mertes */ 6 /* */ 7 /* This program is free software; you can redistribute it and/or */ 8 /* modify it under the terms of the GNU General Public License as */ 9 /* published by the Free Software Foundation; either version 2 of */ 10 /* the License, or (at your option) any later version. */ 11 /* */ 12 /* This program is distributed in the hope that it will be useful, */ 13 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 14 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 15 /* GNU General Public License for more details. */ 16 /* */ 17 /* You should have received a copy of the GNU General Public */ 18 /* License along with this program; if not, write to the */ 19 /* Free Software Foundation, Inc., 51 Franklin Street, */ 20 /* Fifth Floor, Boston, MA 02110-1301, USA. */ 21 /* */ 22 /* Module: Runtime */ 23 /* File: seed7/src/runerr.h */ 24 /* Changes: 1990, 1991, 1992, 1993, 1994 Thomas Mertes */ 25 /* Content: Runtime error and exception handling procedures. */ 26 /* */ 27 /********************************************************************/ 28 29 EXTERN objectType curr_action_object; 30 EXTERN objectType curr_exec_object; 31 EXTERN listType curr_argument_list; 32 EXTERN boolType fail_flag; 33 EXTERN objectType fail_value; 34 EXTERN listType fail_expression; 35 EXTERN listType fail_stack; 36 37 #define set_fail_flag(failValue) interrupt_flag = (failValue); fail_flag = (failValue); 38 /* printf("set_fail_flag(%d) at %s(%d)\n", failValue, __FILE__, __LINE__); */ 39 40 typedef struct { 41 boolType fail_flag; 42 objectType fail_value; 43 listType fail_expression; 44 listType fail_stack; 45 } failStateStruct; 46 47 48 void run_error (objectCategory required, objectType argument); 49 void empty_value (objectType argument); 50 void var_required (objectType argument); 51 void write_call_stack (const_listType stack_elem); 52 void uncaught_exception (void); 53 void write_exception_info (void); 54 objectType raise_with_arguments (objectType exception, listType list); 55 objectType raise_exception (objectType exception); 56 void leaveExceptionHandling (void); 57 void saveFailState (failStateStruct *failState); 58 void restoreFailState (failStateStruct *failState); 59 void show_signal (void); 60