| 1 |
/* |
| 2 |
* Copyright (c) 2021-2025 Symas Corporation |
| 3 |
* All rights reserved. |
| 4 |
* |
| 5 |
* Redistribution and use in source and binary forms, with or without |
| 6 |
* modification, are permitted provided that the following conditions are |
| 7 |
* met: |
| 8 |
* |
| 9 |
* * Redistributions of source code must retain the above copyright |
| 10 |
* notice, this list of conditions and the following disclaimer. |
| 11 |
* * Redistributions in binary form must reproduce the above |
| 12 |
* copyright notice, this list of conditions and the following disclaimer |
| 13 |
* in the documentation and/or other materials provided with the |
| 14 |
* distribution. |
| 15 |
* * Neither the name of the Symas Corporation nor the names of its |
| 16 |
* contributors may be used to endorse or promote products derived from |
| 17 |
* this software without specific prior written permission. |
| 18 |
* |
| 19 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 20 |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 21 |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 22 |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 23 |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 |
*/ |
| 31 |
|
| 32 |
#ifndef _CBL_EXCEPTC_H_ |
| 33 |
#define _CBL_EXCEPTC_H_ |
| 34 |
|
| 35 |
/* This file contains declarations needed by the libgcobol compilation. Some |
| 36 |
of the information here is required by the gcc/cobol compilation, and so it |
| 37 |
is safe to include in those files. */ |
| 38 |
|
| 39 |
static const ec_type_t simon_says_important[] = { |
| 40 |
ec_argument_function_e, |
| 41 |
ec_bound_odo_e, |
| 42 |
ec_bound_ref_mod_e, |
| 43 |
ec_bound_subscript_e, |
| 44 |
ec_data_incompatible_e, |
| 45 |
ec_data_ptr_null_e, |
| 46 |
ec_size_overflow_e, |
| 47 |
ec_size_exponentiation_e, |
| 48 |
ec_size_truncation_e, |
| 49 |
ec_size_zero_divide_e, |
| 50 |
ec_program_not_found_e, |
| 51 |
ec_program_recursive_call_e, |
| 52 |
ec_program_arg_mismatch_e, |
| 53 |
}; |
| 54 |
|
| 55 |
enum ec_disposition_t { |
| 56 |
ec_category_none_e, |
| 57 |
ec_category_fatal_e, |
| 58 |
ec_category_nonfatal_e, |
| 59 |
ec_category_implementor_e, |
| 60 |
|
| 61 |
// unimplemented equivalents |
| 62 |
uc_category_none_e = 0x80 + ec_category_none_e, |
| 63 |
uc_category_fatal_e = 0x80 + ec_category_fatal_e, |
| 64 |
uc_category_nonfatal_e = 0x80 + ec_category_nonfatal_e, |
| 65 |
uc_category_implementor_e = 0x80 + ec_category_implementor_e, |
| 66 |
}; |
| 67 |
|
| 68 |
struct ec_descr_t { |
| 69 |
ec_type_t type; |
| 70 |
ec_disposition_t disposition; |
| 71 |
const cbl_name_t name; |
| 72 |
const char *description; |
| 73 |
|
| 74 |
bool operator==( ec_type_t type ) const { |
| 75 |
return this->type == type; |
| 76 |
} |
| 77 |
}; |
| 78 |
|
| 79 |
extern ec_type_t ec_type_of( const cbl_name_t name ); |
| 80 |
|
| 81 |
extern ec_descr_t __gg__exception_table[]; |
| 82 |
extern ec_descr_t *__gg__exception_table_end; |
| 83 |
|
| 84 |
/* Inventory of exceptions: |
| 85 |
In except.hc::__gg__exception_table, unimplemented ECs have a uc_ disposition. |
| 86 |
|
| 87 |
ec_function_argument_e ACOS |
| 88 |
ANNUITY |
| 89 |
ASIN |
| 90 |
LOG |
| 91 |
LOG10 |
| 92 |
PRESENT-VALUE |
| 93 |
SQRT |
| 94 |
|
| 95 |
ec_sort_merge_file_open_e FILE MERGE |
| 96 |
|
| 97 |
ec_bound_subscript_e table subscript not an integer |
| 98 |
table subscript less than 1 |
| 99 |
table subscript greater than occurs |
| 100 |
|
| 101 |
ec_bound_ref_mod_e refmod start not an integer |
| 102 |
refmod start less than 1 |
| 103 |
refmod start greater than variable size |
| 104 |
refmod length not an integer |
| 105 |
refmod length less than 1 |
| 106 |
refmod start+length exceeds variable size |
| 107 |
|
| 108 |
ec_bound_odo_e DEPENDING not an integer |
| 109 |
DEPENDING greater than occurs upper limit |
| 110 |
DEPENDING less than occurs lower limit |
| 111 |
subscript greater than DEPENDING for sending item |
| 112 |
|
| 113 |
ec_size_zero_divide_e For both fixed-point and floating-point division |
| 114 |
|
| 115 |
ec_size_truncation |
| 116 |
ec_size_exponentiation |
| 117 |
|
| 118 |
*/ |
| 119 |
|
| 120 |
#endif |