31 #ifdef HAVE_SYS_TIME_H
35 #define WIN32_LEAN_AND_MEAN
69 #define START_STACK_SIZE 32
70 #define TOKEN(offset) (expr_stack[expr_index + offset].token)
71 #define VALUE(offset) (expr_stack[expr_index + offset].value)
73 #define dpush(x) CB_ADD_TO_CHAIN (x, decimal_stack)
76 current_statement->body = cb_list_add (current_statement->body, x)
77 #define cb_emit_list(l) \
78 current_statement->body = cb_list_append (current_statement->body, l)
109 static const unsigned char hexval[] =
"0123456789ABCDEF";
111 #ifdef HAVE_DESIGNATED_INITS
112 static const unsigned char expr_prio[256] = {
133 static const unsigned char valid_char[256] = {
202 "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
207 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F,
208 0x16, 0x05, 0x25, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
209 0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26,
210 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F,
211 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D,
212 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61,
213 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
214 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F,
215 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
216 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6,
217 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6,
218 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D,
219 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
220 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
221 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6,
222 0xA7, 0xA8, 0xA9, 0xC0, 0x6A, 0xD0, 0xA1, 0x07,
223 0x68, 0xDC, 0x51, 0x42, 0x43, 0x44, 0x47, 0x48,
224 0x52, 0x53, 0x54, 0x57, 0x56, 0x58, 0x63, 0x67,
225 0x71, 0x9C, 0x9E, 0xCB, 0xCC, 0xCD, 0xDB, 0xDD,
226 0xDF, 0xEC, 0xFC, 0xB0, 0xB1, 0xB2, 0x3E, 0xB4,
227 0x45, 0x55, 0xCE, 0xDE, 0x49, 0x69, 0x9A, 0x9B,
228 0xAB, 0x9F, 0xBA, 0xB8, 0xB7, 0xAA, 0x8A, 0x8B,
229 0xB6, 0xB5, 0x62, 0x4F, 0x64, 0x65, 0x66, 0x20,
230 0x21, 0x22, 0x70, 0x23, 0x72, 0x73, 0x74, 0xBE,
231 0x76, 0x77, 0x78, 0x80, 0x24, 0x15, 0x8C, 0x8D,
232 0x8E, 0x41, 0x06, 0x17, 0x28, 0x29, 0x9D, 0x2A,
233 0x2B, 0x2C, 0x09, 0x0A, 0xAC, 0x4A, 0xAE, 0xAF,
234 0x1B, 0x30, 0x31, 0xFA, 0x1A, 0x33, 0x34, 0x35,
235 0x36, 0x59, 0x08, 0x38, 0xBC, 0x39, 0xA0, 0xBF,
236 0xCA, 0x3A, 0xFE, 0x3B, 0x04, 0xCF, 0xDA, 0x14,
237 0xE1, 0x8F, 0x46, 0x75, 0xFD, 0xEB, 0xEE, 0xED,
238 0x90, 0xEF, 0xB3, 0xFB, 0xB9, 0xEA, 0xBB, 0xFF
243 0x00, 0x01, 0x02, 0x03, 0xEC, 0x09, 0xCA, 0x7F,
244 0xE2, 0xD2, 0xD3, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
245 0x10, 0x11, 0x12, 0x13, 0xEF, 0xC5, 0x08, 0xCB,
246 0x18, 0x19, 0xDC, 0xD8, 0x1C, 0x1D, 0x1E, 0x1F,
247 0xB7, 0xB8, 0xB9, 0xBB, 0xC4, 0x0A, 0x17, 0x1B,
248 0xCC, 0xCD, 0xCF, 0xD0, 0xD1, 0x05, 0x06, 0x07,
249 0xD9, 0xDA, 0x16, 0xDD, 0xDE, 0xDF, 0xE0, 0x04,
250 0xE3, 0xE5, 0xE9, 0xEB, 0x14, 0x15, 0x9E, 0x1A,
251 0x20, 0xC9, 0x83, 0x84, 0x85, 0xA0, 0xF2, 0x86,
252 0x87, 0xA4, 0xD5, 0x2E, 0x3C, 0x28, 0x2B, 0xB3,
253 0x26, 0x82, 0x88, 0x89, 0x8A, 0xA1, 0x8C, 0x8B,
254 0x8D, 0xE1, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0x5E,
255 0x2D, 0x2F, 0xB2, 0x8E, 0xB4, 0xB5, 0xB6, 0x8F,
256 0x80, 0xA5, 0x7C, 0x2C, 0x25, 0x5F, 0x3E, 0x3F,
257 0xBA, 0x90, 0xBC, 0xBD, 0xBE, 0xF3, 0xC0, 0xC1,
258 0xC2, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22,
259 0xC3, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
260 0x68, 0x69, 0xAE, 0xAF, 0xC6, 0xC7, 0xC8, 0xF1,
261 0xF8, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70,
262 0x71, 0x72, 0xA6, 0xA7, 0x91, 0xCE, 0x92, 0xA9,
263 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
264 0x79, 0x7A, 0xAD, 0xA8, 0xD4, 0x5B, 0xD6, 0xD7,
265 0x9B, 0x9C, 0x9D, 0xFA, 0x9F, 0xB1, 0xB0, 0xAC,
266 0xAB, 0xFC, 0xAA, 0xFE, 0xE4, 0x5D, 0xBF, 0xE7,
267 0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
268 0x48, 0x49, 0xE8, 0x93, 0x94, 0x95, 0xA2, 0xED,
269 0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50,
270 0x51, 0x52, 0xEE, 0x96, 0x81, 0x97, 0xA3, 0x98,
271 0x5C, 0xF0, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
272 0x59, 0x5A, 0xFD, 0xF5, 0x99, 0xF7, 0xF6, 0xF9,
273 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
274 0x38, 0x39, 0xDB, 0xFB, 0x9A, 0xF4, 0xEA, 0xFF
279 #undef COB_SYSTEM_GEN
280 #define COB_SYSTEM_GEN(x, y, z) { x, y },
287 #undef COB_SYSTEM_GEN
413 #if defined(COB_NON_ALIGNED) && !defined(_MSC_VER)
414 static const struct optim_table align_bin_compare_funcs[] = {
449 static const struct optim_table align_bin_add_funcs[] = {
484 static const struct optim_table align_bin_sub_funcs[] = {
528 for (l = stmt; l; l =
CB_CHAIN (l)) {
563 if (f->
level == 88) {
573 _(
"Reference to item containing nested ODO"));
714 cb_error_x (x,
_(
"A positive numeric integer is required here"));
755 if (!cb_relaxed_syntax_check ||
759 if (numsubs > numindex) {
840 printf (
_(
"System routine\t\t\tParameters"));
842 for (psyst = system_tab; psyst->
syst_name; psyst++) {
843 switch (*(
unsigned char *)(psyst->
syst_name)) {
962 size = strlen (buff);
968 if (size >=
sizeof(buff)) {
971 strcat (buff,
" OF ");
986 for (; l && found < 3; l =
CB_CHAIN (l), ++found) {
1012 for (; found < 3; ++found) {
1053 #if !defined(__linux__) && !defined(__CYGWIN__) && defined(HAVE_TIMEZONE)
1098 tlt = localtime (&t);
1100 if (tlt->tm_sec >= 60) {
1105 memset (buff, 0,
sizeof (buff));
1106 strftime (buff, (
size_t)17,
"%m/%d/%y%H.%M.%S", tlt);
1111 memset (buff, 0,
sizeof (buff));
1112 #if defined(__linux__) || defined(__CYGWIN__)
1113 strftime (buff, (
size_t)22,
"%Y%m%d%H%M%S00%z", tlt);
1114 #elif defined(HAVE_TIMEZONE)
1115 strftime (buff, (
size_t)17,
"%Y%m%d%H%M%S00", tlt);
1116 if (timezone <= 0) {
1123 sprintf (&buff[17],
"%2.2ld%2.2ld", contz / 3600, contz % 60);
1125 strftime (buff, (
size_t)22,
"%Y%m%d%H%M%S0000000", tlt);
1135 const unsigned char *s;
1136 const unsigned char *t;
1140 for (t = (
const unsigned char *)name; *t; t++) {
1141 if (*t == (
unsigned char)
'/' || *t == (
unsigned char)
'\\') {
1146 s = (
const unsigned char *)name;
1150 if (*s <= (
unsigned char)
'9' && *s >= (
unsigned char)
'0') {
1151 *p++ = (
unsigned char)
'_';
1158 *p++ = (
unsigned char)
'_';
1159 if (*s == (
unsigned char)
'-') {
1160 *p++ = (
unsigned char)
'_';
1172 for (p = buff; *p; p++) {
1178 for (p = buff; *p; p++) {
1192 const char *name_str;
1205 name_str = (
const char *)
CB_LITERAL (alt_name)->data;
1207 name_str = (
const char *)
CB_LITERAL (name)->data;
1218 for (p = (
unsigned char *)s; *p; ++p) {
1219 if (islower ((
int)*p)) {
1238 cb_error_x (name,
_(
"ON/OFF usage requires a SWITCH name"));
1297 p = strrchr (s,
'-');
1308 if (strncmp (s,
"S-", (
size_t)2) == 0 ||
1309 strncmp (s,
"AS-", (
size_t)3) == 0) {
1313 if ((p = strchr (s,
'-')) !=
NULL) {
1317 if (strncmp (s,
"S-", (
size_t)2) == 0 ||
1318 strncmp (s,
"AS-", (
size_t)3) == 0) {
1321 s = strchr (s,
'-') + 1;
1382 if (refsubs > numsubs) {
1384 }
else if (refsubs < numsubs) {
1385 if (!cb_relaxed_syntax_check) {
1389 _(
"Subscripts missing for '%s' - Defaulting to 1"),
1391 for (; refsubs < numsubs; ++refsubs) {
1402 cb_error_x (x,
_(
"'%s' cannot be reference modified"), name);
1412 cb_error_x (x,
_(
"'%s' cannot be subscripted"), name);
1415 cb_error_x (x,
_(
"'%s' requires 1 subscript"), name);
1461 cb_error_x (x,
_(
"'%s' cannot be subscripted"), name);
1465 cb_error_x (x,
_(
"'%s' cannot be reference modified"), name);
1481 sprintf(full_name,
"'%s'", name);
1483 sprintf(full_name,
_(
"'%s' (accessed by '%s')"), p->
name, name);
1501 "cob_check_linkage",
1519 cb_error_x (x,
_(
"'%s' has no OCCURS clause"), name);
1527 if (refsubs != numsubs) {
1528 if (refsubs > numsubs) {
1530 }
else if (refsubs < numsubs) {
1531 if (!cb_relaxed_syntax_check) {
1535 _(
"Subscripts missing for '%s' - Defaulting to 1"),
1537 for (; refsubs < numsubs; ++refsubs) {
1562 for (p = f; p; p = p->
parent) {
1582 cb_error_x (x,
_(
"Subscript of '%s' out of bounds: %d"),
1624 pseudosize = f->
size / 2;
1626 pseudosize = f->
size;
1634 cb_error_x (x,
_(
"Offset of '%s' out of bounds: %d"), name, offset);
1638 cb_error_x (x,
_(
"Length of '%s' out of bounds: %d"),
1643 if (offset < 1 || offset > pseudosize) {
1644 cb_error_x (x,
_(
"Offset of '%s' out of bounds: %d"), name, offset);
1647 if (length < 1 || length > pseudosize - offset + 1) {
1648 cb_error_x (x,
_(
"Length of '%s' out of bounds: %d"),
1682 cb_error_x (x,
_(
"'%s' cannot be subscripted"), name);
1685 cb_error_x (x,
_(
"'%s' requires 1 subscript"), name);
1747 cb_error (
_(
"Reference modification not allowed here"));
1752 memset (buff, 0,
sizeof (buff));
1755 cb_error (
_(
"ANY LENGTH item not allowed here"));
1758 if (f->
level == 88) {
1759 cb_error (
_(
"88 level item not allowed here"));
1763 cb_error (
_(
"Variable length item not allowed here"));
1772 sprintf (buff,
"%d", f->
size);
1797 sprintf (buff,
"%d", (
int)l->
size);
1850 return cb_flag_apostrophe ?
'\'' :
'"';
1899 unsigned char *data;
1920 for (n = 0; n < 256; n++) {
1929 for (n = 0; n < 256; n++) {
1930 #ifdef COB_EBCDIC_MACHINE
1943 for (n = 0; n < 256; n++) {
1944 #ifdef COB_EBCDIC_MACHINE
1961 for (n = 0; n < 256; n++) {
1983 if (lower < 0 || lower > 255) {
1987 if (upper < 0 || upper > 255) {
1991 if (lower <= upper) {
1992 for (i = lower; i <= upper; i++) {
1993 if (values[i] != -1) {
1999 ap->
values[i] = tableval++;
2003 for (i = lower; i >= upper; i--) {
2004 if (values[i] != -1) {
2010 ap->
values[i] = tableval++;
2019 for (ls = x; ls; ls =
CB_CHAIN (ls)) {
2024 if (n < 0 || n > 255) {
2028 if (values[n] != -1) {
2032 ap->
values[n] = tableval;
2048 if (n < 0 || n > 255) {
2052 if (values[n] != -1) {
2058 ap->
values[n] = tableval++;
2066 lastval = data[size - 1];
2067 for (i = 0; i < size; i++) {
2069 if (values[n] != -1) {
2075 ap->
values[n] = tableval++;
2084 if (n < 0 || n > 255) {
2088 if (values[n] != -1) {
2094 ap->
values[n] = tableval++;
2099 if (dupls || unvals) {
2101 cb_error_x (l,
_(
"Duplicate character values in alphabet '%s'"),
2105 cb_error_x (l,
_(
"Invalid character values in alphabet '%s'"),
2119 }
else if (values[255] != -1) {
2120 for (n = 254; n >= 0; n--) {
2121 if (values[n] == -1) {
2129 for (n = tableval; n < 256; ++n) {
2130 for (i = 0; i < 256; ++i) {
2131 if (charvals[i] < 0) {
2140 for (n = 0; n < 256; n++) {
2142 ap->
values[n] = tableval++;
2171 memset (values, 0,
sizeof(values));
2179 for (i = lower; i <= upper; i++) {
2195 for (i = 0; i < size; i++) {
2212 if (!cb_relaxed_syntax_check) {
2214 _(
"Duplicate values in class '%s'"),
2218 _(
"Duplicate values in class '%s'"),
2234 _(
"'%s' is not a locale name"),
2288 CB_FIELD (x)->flag_sign_leading = 1;
2289 CB_FIELD (x)->flag_sign_separate = 1;
2304 CB_FIELD (x)->flag_sign_leading = 1;
2305 CB_FIELD (x)->flag_sign_separate = 1;
2320 CB_FIELD (x)->flag_sign_leading = 1;
2321 CB_FIELD (x)->flag_sign_separate = 1;
2337 cb_debug_contents = l;
2356 unsigned int odo_level;
2362 "LINE-COUNTER %s", rep->
cname);
2370 snprintf (buff, (
size_t)COB_MINI_MAX,
2371 "PAGE-COUNTER %s", rep->
cname);
2411 if (cb_warn_implicit_define) {
2449 }
else if (
CB_FIELD(x)->size != 4) {
2489 for (p = q; ; p = p->
parent) {
2496 if (p->
sister == depfld) {
2498 _(
"'%s' ODO field item invalid here"),
2502 if (!cb_complex_odo) {
2504 _(
"'%s' cannot have OCCURS DEPENDING"),
2516 cb_error_x (x,
_(
"'%s' ODO item must have GLOBAL attribute"),
2538 cb_error (
_(
"RECORD DEPENDING item must be in WORKING/LOCAL/LINKAGE section"));
2543 cb_error (
_(
"Invalid RECORD DEPENDING item"));
2578 !
CB_LABEL (v)->flag_declaratives) {
2579 if (!cb_relaxed_syntax_check) {
2587 if (
CB_LABEL (v)->flag_declaratives &&
2616 cb_error_x (x,
_(
"'%s' - DEBUGGING target invalid with ALL PROCEDURES"),
2619 if (!
CB_LABEL (v)->flag_real_label) {
2620 cb_error_x (x,
_(
"'%s' - DEBUGGING target invalid"),
2625 CB_LABEL (v)->flag_debugging_mode = 1;
2635 cb_error_x (x,
_(
"'%s' is not a valid DEBUGGING target"),
2675 cb_error_x (x,
_(
"'%s' is not an alterable paragraph"),
2744 if (f1->
level == 88) {
2751 switch (
CB_CAST (expr_1)->cast_type) {
2760 }
else if (expr_1 ==
cb_null) {
2765 if (f2->
level == 88) {
2772 switch (
CB_CAST (expr_2)->cast_type) {
2781 }
else if (expr_2 ==
cb_null) {
2784 return is_ptr_1 ^ is_ptr_2;
2810 if (
TOKEN (-1) !=
'x' ||
TOKEN (-3) !=
'x') {
2820 if (
TOKEN (-1) !=
'x') {
2837 if (
TOKEN (-1) !=
'x' ||
TOKEN (-3) !=
'x') {
2851 if (cb_warn_parentheses && op ==
'|') {
2856 cb_warning (
_(
"Suggest parentheses around AND within OR"));
2871 if (
TOKEN (-1) !=
'x') {
2874 switch (
TOKEN (-3)) {
2881 expr_lh =
VALUE (-3);
2920 if (token ==
'&' &&
TOKEN (-2) ==
'|' &&
2934 if (
TOKEN (-1) ==
'!') {
2941 if (
TOKEN (-1) ==
'x') {
2954 if (
TOKEN (-1) ==
'!') {
2961 if (
TOKEN (-1) ==
'x') {
2978 if (
TOKEN (-1) ==
'x' ||
TOKEN (-1) ==
'!') {
2985 if ((
TOKEN (-1) ==
'+' ||
TOKEN (-1) ==
'-') &&
2986 TOKEN (-2) !=
'x') {
2987 if (
TOKEN (-1) ==
'-') {
2996 switch (
TOKEN (-1)) {
3004 if (
TOKEN (-2) ==
'x') {
3005 expr_lh =
VALUE (-2);
3016 if (
TOKEN (-2) ==
'(') {
3027 if (token ==
'=' &&
TOKEN (-1) ==
'|' &&
3029 token = (
TOKEN (-2) ==
'<') ?
'[' :
']';
3034 if (
TOKEN (-1) ==
'!') {
3113 if (!expr_stack[3].
value) {
3122 cb_error_x (expr_stack[3].value,
_(
"Invalid expression"));
3127 if (expr_stack[3].token !=
'x') {
3128 cb_error_x (expr_stack[3].value,
_(
"Invalid expression"));
3132 return expr_stack[3].
value;
3143 for (l = list; l; l =
CB_CHAIN (l)) {
3236 cobc_abort_pr (
_(
"Internal decimal structure size exceeded - %d"),
3240 "or split into multiple computations."));
3263 func =
"cob_decimal_add";
3266 func =
"cob_decimal_sub";
3269 func =
"cob_decimal_mul";
3272 func =
"cob_decimal_div";
3275 func =
"cob_decimal_pow";
3427 for (l = vars; l; l =
CB_CHAIN (l)) {
3436 decimal_stack =
NULL;
3440 for (l = vars; l; l =
CB_CHAIN (l)) {
3454 decimal_stack =
NULL;
3486 if (op ==
'+' || op ==
'-' || op ==
'*' || op ==
'/') {
3488 for (l = vars; l; l =
CB_CHAIN (l)) {
3629 #if defined(COB_NON_ALIGNED) && !defined(_MSC_VER)
3632 #ifdef COB_SHORT_BORK
3634 s = bin_compare_funcs[n].optim_name;
3642 s = align_bin_compare_funcs[n].optim_name;
3645 s = bin_compare_funcs[n].optim_name;
3650 s = bin_compare_funcs[n].optim_name;
3655 s = bin_compare_funcs[n].optim_name;
3753 _(
"Invalid expression"));
3767 if (f->
level == 88) {
3808 decimal_stack =
NULL;
3849 if (size1 == 1 && size2 == 1) {
3851 }
else if (size1 != 0 && size1 == size2) {
3894 #if defined(COB_NON_ALIGNED) && !defined(_MSC_VER)
3897 #ifdef COB_SHORT_BORK
3899 s = bin_add_funcs[z].optim_name;
3908 s = align_bin_add_funcs[z].optim_name;
3911 s = bin_add_funcs[z].optim_name;
3916 s = bin_add_funcs[z].optim_name;
3932 s = bin_add_funcs[z].optim_name;
3964 #if defined(COB_NON_ALIGNED) && !defined(_MSC_VER)
3967 #ifdef COB_SHORT_BORK
3969 s = bin_sub_funcs[z].optim_name;
3977 s = align_bin_sub_funcs[z].optim_name;
3980 s = bin_sub_funcs[z].optim_name;
3985 s = bin_sub_funcs[z].optim_name;
4001 s = bin_sub_funcs[z].optim_name;
4020 #ifdef COB_NON_ALIGNED
4063 #ifdef COB_NON_ALIGNED
4106 if (strcmp (f1->
name, f2->
name) == 0) {
4138 if (cb_warn_corresponding) {
4157 if (strcmp (f1->
name, f2->
name) == 0) {
4191 if (cb_warn_corresponding) {
4203 if (sisters && p->
sister) {
4226 if (sisters && p->
sister) {
4248 return x <= 4 || x == 6;
4299 cb_error (
_(
"Invalid value in AT clause"));
4305 cb_error (
_(
"Value in AT clause may not have 5 digits"));
4307 }
else if (size > 6) {
4308 cb_error (
_(
"Value in AT clause may not be longer than 6 digits"));
4318 cb_tree size_is,
int dispattrs)
4326 timeout, prompt, size_is,
cb_int (dispattrs)));
4331 var, line, column, fgc, bgc, scroll,
4332 timeout, prompt, size_is,
cb_int (dispattrs)));
4335 var, pos,
NULL, fgc, bgc, scroll,
4336 timeout, prompt, size_is,
cb_int (dispattrs)));
4358 fgc = attr_ptr->
fgc;
4359 bgc = attr_ptr->
bgc;
4360 scroll = attr_ptr->
scroll;
4362 prompt = attr_ptr->
prompt;
4405 cb_error_x (prompt,
_(
"Invalid PROMPT identifier"));
4432 var, line, column, timeout));
4435 var, pos,
NULL, timeout));
4447 if (pos || fgc || bgc || scroll || dispattrs) {
4449 timeout, prompt, size_is, dispattrs);
4453 scroll, timeout, prompt,
4454 size_is,
cb_int (dispattrs)));
4457 }
else if (pos || fgc || bgc || scroll || dispattrs) {
4466 timeout, prompt, size_is, dispattrs);
4628 cb_error_x (mnemonic,
_(
"Invalid input device '%s'"),
4649 if (!cb_relaxed_syntax_check) {
4661 cb_error_x (name,
_(
"'%s' is not defined in SPECIAL-NAMES"),
4690 _(
"Target of ALLOCATE is not a BASED item"));
4698 _(
"Target of RETURNING is not a data pointer"));
4705 _(
"The CHARACTERS field of ALLOCATE must be numeric"));
4718 _(
"INITIALIZED TO item is not alphanumeric"));
4721 NULL, target2, size, initialize));
4723 if (initialize && target1) {
4770 _(
"Only alphanumeric FUNCTION types are allowed here"));
4774 if (returning && returning !=
cb_null) {
4778 _(
"Invalid RETURNING field"));
4797 call_conv &= ~CB_CONV_STDCALL;
4799 cb_warning (
_(
"STDCALL not available on this platform"));
4802 #elif defined(_WIN64)
4803 if (call_conv & CB_CONV_STDCALL) {
4805 cb_warning (
_(
"STDCALL used on 64-bit Windows platform"));
4811 _(
"STATIC CALL convention requires a literal program name"));
4815 for (l = par_using; l; l =
CB_CHAIN (l), numargs++) {
4876 "18446744073709551615",
4890 "9223372036854775807",
4900 if (!valmin && !valmax) {
4903 if (val < valmin || val > valmax) {
4904 cb_error_x (x,
_(
"Numeric literal exceeds size limits"));
4910 cb_error_x (x,
_(
"Figurative constant invalid here"));
4917 if (f->
level == 88) {
4928 if (cb_warn_call_params &&
4942 if (*p ==
'/' || *p ==
'\\') {
4947 entry = (
const char *)
CB_LITERAL(prog)->data;
4950 for (psyst = system_tab; psyst->
syst_name; psyst++, is_sys_idx++) {
4951 if (!strcmp(entry, (
const char *)psyst->
syst_name)) {
4954 _(
"Wrong number of CALL parameters for '%s'"),
4958 is_sys_call = is_sys_idx;
4971 returning, is_sys_call, call_conv));
5004 _(
"%s not allowed on %s files"),
"CLOSE",
"SORT");
5055 _(
"%s not allowed on %s files"),
"DELETE",
"SORT");
5059 _(
"%s not allowed on %s files"),
"DELETE",
"LINE SEQUENTIAL");
5087 _(
"%s not allowed on %s files"),
"DELETE FILE",
"SORT");
5155 int *
const dispattrs)
5158 *fgc = attr_ptr->
fgc;
5159 *bgc = attr_ptr->
bgc;
5160 *scroll = attr_ptr->
scroll;
5204 const cb_tree size_is,
const int dispattrs)
5211 x, line, column, fgc, bgc,
5257 for (l = values; l; l =
CB_CHAIN (l)) {
5277 cb_error_x (x,
_(
"Invalid type for DISPLAY operand"));
5294 }
else if (pos || fgc || bgc || scroll || size_is || dispattrs || upon ==
cb_null) {
5295 for (l = values; l; l =
CB_CHAIN (l)) {
5306 }
else if (x ==
cb_low) {
5330 for (l = values; l; l =
CB_CHAIN (l)) {
5377 if (!cb_relaxed_syntax_check) {
5378 cb_warning_x (x,
_(
"'%s' is not defined in SPECIAL-NAMES"), name);
5382 if (!cb_relaxed_syntax_check) {
5383 cb_warning_x (x,
_(
"'%s' is not defined in SPECIAL-NAMES"), name);
5387 cb_error_x (x,
_(
"'%s' is not an output device"), name);
5392 cb_error_x (x,
_(
"'%s' is not defined in SPECIAL-NAMES"), name);
5474 _(
"Invalid use of 88 level in WHEN expression"));
5503 if (case_list ==
NULL) {
5513 for (; whens; whens =
CB_CHAIN (whens)) {
5516 for (subjs = subject_list, objs =
CB_VALUE (whens);
5533 if (subjs || objs) {
5534 cb_error (
_(
"Wrong number of WHEN parameters"));
5553 for (c3 = stmt; c3; c3 =
CB_CHAIN (c3)) {
5597 for (l = vars, i = 1; l; l =
CB_CHAIN (l), i++) {
5603 _(
"Target %d of FREE is not a BASED data item"), i);
5615 _(
"Target %d of FREE is not a BASED data item"), i);
5621 _(
"Target %d of FREE must be a data pointer"), i);
5634 if (target ==
NULL) {
5635 cb_verify (cb_goto_statement_without_name,
_(
"GO TO without procedure-name"));
5636 }
else if (depending) {
5645 _(
"GO TO with multiple procedure-names"));
5686 unsigned int no_fill_init;
5687 unsigned int def_init;
5693 if (value ==
NULL && replacing ==
NULL) {
5696 no_fill_init = (fillinit ==
NULL);
5697 def_init = (def !=
NULL);
5698 for (l = vars; l; l =
CB_CHAIN (l)) {
5707 def_init, 1, no_fill_init));
5736 if (size1 && r->
offset) {
5747 size1 -= (offset - 1);
5772 if (size2 && r->
offset) {
5783 size2 -= (offset - 1);
5793 if (size1 && size2 && size1 != size2) {
5794 if (replconv == 1) {
5796 _(
"%s operands differ in size"),
"REPLACING");
5799 _(
"%s operands differ in size"),
"CONVERTING");
5806 const unsigned int replconv)
5822 _(
"Invalid target for %s"),
"CONVERTING");
5839 if (replconv == 1) {
5841 _(
"Invalid target for %s"),
"REPLACING");
5844 _(
"Invalid target for %s"),
"CONVERTING");
5852 inspect_data =
NULL;
5865 if (inspect_data ==
NULL) {
5867 _(
"Data name expected before CHARACTERS"));
5876 if (inspect_data ==
NULL) {
5878 _(
"Data name expected before ALL"));
5887 if (inspect_data ==
NULL) {
5889 _(
"Data name expected before LEADING"));
5898 if (inspect_data ==
NULL) {
5900 _(
"Data name expected before TRAILING"));
5920 _(
"Operand has wrong size"));
5983 if (!strcmp (f->
name,
"RETURN-CODE") ||
5984 !strcmp (f->
name,
"SORT-RETURN") ||
5985 !strcmp (f->
name,
"NUMBER-OF-CALL-PARAMETERS")) {
5986 cb_warning (
_(
"Internal register '%s' defined as BINARY-LONG"),
5999 f->
name,
"FLOAT EXTENDED");
6002 f->
name,
"FLOAT-BINARY-7");
6005 f->
name,
"FLOAT-BINARY-16");
6008 f->
name,
"FLOAT-BINARY-34");
6011 f->
name,
"FLOAT-DECIMAL-16");
6014 f->
name,
"FLOAT-DECIMAL-34");
6015 }
else if (f->
pic) {
6019 cb_warning_x (loc,
_(
"'%s' defined here as a group of length %d"),
6026 const int flag,
const int src_flag,
const char *msg)
6068 for (p = (
unsigned char *)(field->
pic->
str); *p; p += 5) {
6069 if (*p ==
'9' || *p ==
'A' || *p ==
'X') {
6070 memcpy ((
void *)&repeat, p + 1,
sizeof(
int));
6117 if (src_size <= 0 || dst_size <= 0 ||
6151 if (src_off >= dst_off && src_off < (dst_off + dst_size)) {
6154 if (src_off < dst_off && (src_off + src_size) > dst_off) {
6161 cb_warning_x (loc,
_(
"Overlapping MOVE may produce unpredictable results"));
6176 size_t is_numeric_edited;
6181 int most_significant;
6182 int least_significant;
6185 is_numeric_edited = 0;
6196 cb_error_x (loc,
_(
"Invalid destination for MOVE"));
6214 if (!cb_relaxed_syntax_check || is_value) {
6217 cb_warning_x (loc,
_(
"Source is non-numeric - substituting zero"));
6226 if (!cb_relaxed_syntax_check || is_value) {
6229 cb_warning_x (loc,
_(
"Source is non-numeric - substituting zero"));
6250 most_significant = -999;
6251 least_significant = 999;
6254 for (i = 0; i < l->
size; i++) {
6255 if (l->
data[i] !=
'0') {
6260 most_significant = (int) (l->
size - l->
scale - i - 1);
6264 for (i = 0; i < l->
size; i++) {
6265 if (l->
data[l->
size - i - 1] !=
'0') {
6270 least_significant = (int) (-l->
scale + i);
6278 goto expect_alphanumeric;
6280 if (l->
scale == 0) {
6281 goto expect_alphanumeric;
6283 goto non_integer_move;
6287 if (least_significant < -fdst->pic->scale) {
6288 goto value_mismatch;
6293 goto value_mismatch;
6299 goto expect_alphanumeric;
6306 goto expect_alphanumeric;
6320 goto expect_alphanumeric;
6331 if (cb_warn_constant) {
6343 for (i = 0; i < l->
size; i++) {
6344 if (l->
data[i] !=
'0') {
6350 switch (fdst->
size) {
6353 goto numlit_overflow;
6359 goto numlit_overflow;
6363 goto numlit_overflow;
6369 goto numlit_overflow;
6375 goto numlit_overflow;
6379 goto numlit_overflow;
6385 goto numlit_overflow;
6391 goto numlit_overflow;
6395 goto numlit_overflow;
6401 goto numlit_overflow;
6407 goto numlit_overflow;
6411 goto numlit_overflow;
6417 goto numlit_overflow;
6423 goto numlit_overflow;
6427 goto numlit_overflow;
6433 goto numlit_overflow;
6437 if (val <
COB_S64_C(-140737488355328) ||
6439 goto numlit_overflow;
6443 goto numlit_overflow;
6449 goto numlit_overflow;
6453 if (val <
COB_S64_C(-36028797018963968) ||
6455 goto numlit_overflow;
6458 if (val >
COB_S64_C(72057594037927935)) {
6459 goto numlit_overflow;
6469 goto numlit_overflow;
6471 if (memcmp (p,
"9223372036854775807", (
size_t)19) > 0) {
6472 goto numlit_overflow;
6479 goto numlit_overflow;
6481 if (memcmp (p,
"18446744073709551615", (
size_t)20) > 0) {
6482 goto numlit_overflow;
6489 if (least_significant < -fdst->pic->scale) {
6497 if (most_significant >= size) {
6506 for (i = 0; i < l->
size; i++) {
6507 if (!isalpha (l->
data[i]) &&
6508 l->
data[i] !=
' ') {
6509 goto value_mismatch;
6514 goto expect_numeric;
6517 goto expect_numeric;
6528 if (size > 0 && (
int)l->
size > size) {
6554 if (size > fdst->
size) {
6555 goto size_overflow_1;
6567 goto size_overflow_2;
6572 goto size_overflow_1;
6576 if (size > fdst->
size) {
6577 goto size_overflow_1;
6590 goto size_overflow_1;
6594 if (size > fdst->
size) {
6595 goto size_overflow_1;
6606 is_numeric_edited = 1;
6612 if (is_numeric_edited) {
6615 dst_size_mod = fdst->
size;
6619 goto non_integer_move;
6622 (
int)fsrc->
pic->
digits > dst_size_mod) {
6623 goto size_overflow_2;
6626 fsrc->
size > dst_size_mod) {
6627 goto size_overflow_1;
6637 src_scale_mod = fsrc->
pic->
scale < 0 ?
6639 dst_scale_mod = fdst->
pic->
scale < 0 ?
6643 src_scale_mod > dst_scale_mod) {
6644 goto size_overflow_2;
6677 cb_error_x (loc,
_(
"Invalid VALUE clause - literal exceeds data size"));
6686 if (cb_move_noninteger_to_alphanumeric ==
CB_ERROR) {
6690 cb_warning_x (loc,
_(
"MOVE of non-integer to alphanumeric"));
6695 move_warning (src, dst, is_value, cb_warn_strict_typing, 0,
6696 _(
"Numeric value is expected"));
6699 expect_alphanumeric:
6700 move_warning (src, dst, is_value, cb_warn_strict_typing, 0,
6701 _(
"Alphanumeric value is expected"));
6706 _(
"Value does not fit the picture string"));
6711 _(
"Value size exceeds data size"));
6716 _(
"Sending field larger than receiving field"));
6721 _(
"Some digits may be truncated"));
6779 #ifdef COB_NON_ALIGNED
6783 #ifdef COB_SHORT_BORK
6809 if (!cb_ebcdic_sign) {
6919 #ifdef COB_EBCDIC_MACHINE
6925 *p = (
unsigned char)
'p';
6928 *p = (
unsigned char)
'q';
6931 *p = (
unsigned char)
'r';
6934 *p = (
unsigned char)
's';
6937 *p = (
unsigned char)
't';
6940 *p = (
unsigned char)
'u';
6943 *p = (
unsigned char)
'v';
6946 *p = (
unsigned char)
'w';
6949 *p = (
unsigned char)
'x';
6952 *p = (
unsigned char)
'y';
6964 *p = (
unsigned char)
'}';
6967 *p = (
unsigned char)
'J';
6970 *p = (
unsigned char)
'K';
6973 *p = (
unsigned char)
'L';
6976 *p = (
unsigned char)
'M';
6979 *p = (
unsigned char)
'N';
6982 *p = (
unsigned char)
'O';
6985 *p = (
unsigned char)
'P';
6988 *p = (
unsigned char)
'Q';
6991 *p = (
unsigned char)
'R';
6995 *p = (
unsigned char)
'}';
7001 *p = (
unsigned char)
'{';
7004 *p = (
unsigned char)
'A';
7007 *p = (
unsigned char)
'B';
7010 *p = (
unsigned char)
'C';
7013 *p = (
unsigned char)
'D';
7016 *p = (
unsigned char)
'E';
7019 *p = (
unsigned char)
'F';
7022 *p = (
unsigned char)
'G';
7025 *p = (
unsigned char)
'H';
7028 *p = (
unsigned char)
'I';
7032 *p = (
unsigned char)
'{';
7042 unsigned char *buff;
7049 unsigned char bbyte;
7067 for (i = 0; i < (int)l->
size; i++) {
7068 if (bbyte != l->
data[i]) {
7073 if (i == (
int)l->
size) {
7079 if (f->
size > 128) {
7083 for (i = 0; i < f->
size; i++) {
7109 memcpy (buff, l->
data - diff, (
size_t)f->
size);
7111 memset (buff,
'0', (
size_t)diff);
7112 memcpy (buff + diff, l->
data, (
size_t)l->
size);
7116 for (p = buff; p < buff + f->
size; p++) {
7123 p = &buff[f->
size - 1];
7127 if (cb_ebcdic_sign) {
7130 }
else if (cb_ebcdic_sign) {
7132 }
else if (l->
sign < 0) {
7133 #ifdef COB_EBCDIC_MACHINE
7143 memcpy (buff, l->
data - diff, (
size_t)f->
size);
7145 memset (buff,
' ', (
size_t)diff);
7146 memcpy (buff + diff, l->
data, (
size_t)l->
size);
7150 memcpy (buff, l->
data, (
size_t)f->
size);
7152 memcpy (buff, l->
data, (
size_t)l->
size);
7153 memset (buff + l->
size,
' ', (
size_t)diff);
7162 for (i = 0; i < f->
size; i++) {
7163 if (bbyte != buff[i]) {
7186 if ((l->
size + n) > 9) {
7189 for (; n > 0; n--) {
7192 for (; n < 0; n++) {
7213 #ifdef COB_SHORT_BORK
7222 #ifdef COB_NON_ALIGNED
7244 if ((l->
size + n) > 9) {
7247 for (; n > 0; n--) {
7250 for (; n < 0; n++) {
7286 if (src_size > 0 && dst_size > 0 && src_size >= dst_size &&
7405 }
else if (src ==
cb_low) {
7421 unsigned int tempval;
7442 for (l = dsts; l; l =
CB_CHAIN (l)) {
7446 _(
"Invalid MOVE target - %s"),
cb_name (x));
7477 _(
"%s not allowed on %s files"),
"OPEN",
"SORT");
7482 _(
"%s not allowed on %s files"),
"OPEN I-O",
"LINE SEQUENTIAL");
7485 if (sharing ==
NULL) {
7598 }
else if (lock_opts ==
cb_int2) {
7600 }
else if (lock_opts ==
cb_int3) {
7602 }
else if (lock_opts ==
cb_int4) {
7617 _(
"%s not allowed on %s files"),
"READ",
"SORT");
7630 _(
"READ PREVIOUS not allowed for this file type"));
7638 cb_warning (
_(
"KEY ignored with sequential READ"));
7652 }
else if (key || f->
key) {
7654 file, key ? key : f->
key,
7721 _(
"%s requires a record name as subject"),
"REWRITE");
7726 _(
"%s subject does not refer to a record name"),
"REWRITE");
7740 _(
"%s not allowed on %s files"),
"REWRITE",
"SORT");
7744 _(
"%s not allowed on %s files"),
"REWRITE",
"LINE SEQUENTIAL");
7750 _(
"INVALID KEY clause invalid with this file type"));
7754 _(
"LOCK clause invalid with file LOCK AUTOMATIC"));
7756 }
else if (lockopt ==
cb_int1) {
7793 _(
"%s requires a record name as subject"),
"RELEASE");
7799 _(
"%s subject does not refer to a record name"),
"RELEASE");
7805 _(
"RELEASE not allowed on this record item"));
7886 if (!fldx && !fldy) {
7888 _(
"Invalid SEARCH ALL condition"));
7892 for (i = 0; i < f->
nkeys; ++i) {
7899 if (i == f->
nkeys) {
7900 for (i = 0; i < f->
nkeys; ++i) {
7907 if (i == f->
nkeys) {
7909 _(
"Invalid SEARCH ALL condition"));
7916 _(
"Invalid SEARCH ALL condition"));
7932 for (i = 0; i < f->
nkeys; i++) {
7941 for (i = 0; i < f->
nkeys; i++) {
8035 for (l = vars; l; l =
CB_CHAIN (l)) {
8046 _(
"The targets of SET must be either indexes or pointers"));
8054 for (l = vars; l; l =
CB_CHAIN (l)) {
8058 _(
"SET targets must be PROGRAM-POINTER"));
8062 _(
"SET targets must be PROGRAM-POINTER"));
8069 for (l = vars; l; l =
CB_CHAIN (l)) {
8087 for (l = vars; l; l =
CB_CHAIN (l)) {
8098 _(
"SET target is invalid - '%s'"),
8157 if (f->
level != 88) {
8189 if (f->
level != 88) {
8194 cb_error_x (x,
_(
"Field does not have FALSE clause"));
8216 _(
"SET ATTRIBUTE requires a screen item as subject"));
8222 _(
"SET ATTRIBUTE subject does not refer to a screen item"));
8248 for (l = keys; l; l =
CB_CHAIN (l)) {
8264 for (l = keys; l; l =
CB_CHAIN (l)) {
8273 cb_error_x (name,
_(
"Table sort without keys not implemented yet"));
8277 for (l = keys; l; l =
CB_CHAIN (l)) {
8301 _(
"Invalid SORT USING parameter"));
8330 _(
"Invalid SORT GIVING parameter"));
8346 "MERGE OUTPUT",
NULL));
8349 "SORT OUTPUT",
NULL));
8376 _(
"Invalid key item"));
8439 _(
"%s not allowed on %s files"),
"START",
"SEQUENTIAL");
8444 _(
"LENGTH/SIZE clause only allowed on INDEXED files"));
8449 _(
"START not allowed with ACCESS MODE RANDOM"));
8508 for (end = start; end; end =
CB_CHAIN (end)) {
8522 for (l = start; l != end; l =
CB_CHAIN (l)) {
8592 if (delimiter ==
NULL) {
8595 if (count ==
NULL) {
8618 _(
"%s requires a record name as subject"),
"WRITE");
8623 _(
"%s subject does not refer to a record name"),
"WRITE");
8635 _(
"%s not allowed on %s files"),
"WRITE",
"SORT");
8640 _(
"INVALID KEY clause invalid with this file type"));
8641 }
else if (lockopt) {
8644 _(
"LOCK clause invalid with file LOCK AUTOMATIC"));
8647 _(
"LOCK clause invalid here"));
8648 }
else if (lockopt ==
cb_int1) {
8732 cb_error_x (mnemonic,
_(
"Invalid mnemonic name"));
8745 #ifndef HAVE_DESIGNATED_INITS
8749 const unsigned char *p;
unsigned int flag_justified
struct cb_literal * build_literal(const enum cb_category category, const void *data, const size_t size)
#define CB_NUMERIC_LITERAL_P(x)
void cb_build_debug_item(void)
unsigned int flag_is_pointer
#define CB_BUILD_PARENTHESIS(x)
static int validate_attrs(cb_tree pos, cb_tree fgc, cb_tree bgc, cb_tree scroll, cb_tree size_is)
static cb_tree cb_check_group_name(cb_tree x)
unsigned int flag_real_binary
static cb_tree cb_build_move_field(cb_tree src, cb_tree dst)
cb_tree cb_build_any_intrinsic(cb_tree args)
const char *const optim_name
#define CB_REFERENCE_P(x)
static int cb_field_size(const cb_tree x)
void cb_error_x(cb_tree x, const char *fmt,...)
void * cobc_main_malloc(const size_t size)
#define CB_SYSTEM_NAME(x)
cb_tree cb_list_append(cb_tree l1, cb_tree l2)
static cb_tree cb_check_numeric_edited_name(cb_tree x)
static cb_tree cb_build_optim_sub(cb_tree v, cb_tree n)
static void cb_expr_shift(int token, cb_tree value)
#define CB_TREE_CATEGORY(x)
#define CB_STATEMENT_P(x)
cb_tree cb_build_tallying_data(cb_tree x)
void cobc_abort_pr(const char *fmt,...)
static const struct optim_table bin_sub_funcs[]
#define COB_SCREEN_TYPE_VALUE
size_t cb_check_index_p(cb_tree x)
static const struct system_table system_tab[]
cb_tree cb_build_replacing_trailing(cb_tree x, cb_tree y, cb_tree l)
#define CB_CALL_BY_REFERENCE
void cb_emit_accept_day_yyyyddd(cb_tree var)
cb_tree cb_build_comment(const char *str)
cb_tree cb_build_cancel(const cb_tree target)
const char * cb_source_file
unsigned int flag_is_pdiv_opt
cb_tree cb_build_filler(void)
unsigned int flag_line_adv
if fold fold static computed alternate extra correct stack on syntax debugging source implicit stack check
cb_tree cb_build_constant(cb_tree name, cb_tree value)
void cb_emit_exit(const unsigned int goback)
#define COB_SCREEN_TYPE_FIELD
unsigned int flag_any_length
void * cobc_parse_malloc(const size_t size)
static void cob_put_sign_ebcdic(unsigned char *p, const int sign)
#define CB_FIELD_ADD(x, y)
void cb_warning_x(cb_tree x, const char *fmt,...)
struct cb_label * debug_section
cb_tree cb_build_call(const cb_tree name, const cb_tree args, const cb_tree stmt1, const cb_tree stmt2, const cb_tree returning, const cob_u32_t is_system_call, const int convention)
static void move_warning(cb_tree src, cb_tree dst, const unsigned int value_flag, const int flag, const int src_flag, const char *msg)
void cb_validate_program_environment(struct cb_program *prog)
static void expr_expand(cb_tree *x)
static void cb_check_lit_subs(struct cb_reference *r, const int numsubs, const int numindex)
static const struct optim_table bin_add_funcs[]
static int count_pic_alphanumeric_edited(struct cb_field *field)
unsigned int flag_no_based
static cb_tree cb_build_move_zero(cb_tree x)
static COB_INLINE COB_A_INLINE int value_is_numeric_field(cb_tree pos)
struct cb_field * children
#define COB_LOCK_AUTOMATIC
static const unsigned char cob_refer_ebcdic[256]
cb_tree cb_build_write_advancing_lines(cb_tree pos, cb_tree lines)
static COB_INLINE COB_A_INLINE int is_reference_with_value(cb_tree pos)
static void emit_field_display(const cb_tree x, const cb_tree pos, const cb_tree fgc, const cb_tree bgc, const cb_tree scroll, const cb_tree size_is, const int dispattrs)
cb_tree cb_build_move(cb_tree src, cb_tree dst)
void cb_emit_sort_output(cb_tree proc)
cb_tree cb_build_implicit_field(cb_tree name, const int len)
cb_tree cb_build_perform_once(cb_tree body)
void cb_emit_unstring(cb_tree name, cb_tree delimited, cb_tree into, cb_tree pointer, cb_tree tallying)
static void output_screen_to(struct cb_field *p, const unsigned int sisters)
static cb_tree decimal_stack
static unsigned int emit_move_corresponding(cb_tree x1, cb_tree x2)
void cb_emit_ready_trace(void)
unsigned int flag_odo_relative
void cb_emit_search_all(cb_tree table, cb_tree at_end, cb_tree when, cb_tree stmts)
int cb_get_int(const cb_tree x)
static COB_INLINE COB_A_INLINE int is_less_than_four_or_is_six(int x)
static size_t cb_validate_one(cb_tree x)
static unsigned int check_valid_key(const struct cb_file *cbf, const struct cb_field *f)
unsigned int cb_verify(const enum cb_support, const char *)
#define CB_FEATURE_FORMFEED
cb_tree cb_build_perform_times(cb_tree times)
cb_tree cb_build_field_reference(struct cb_field *f, cb_tree ref)
void cb_emit_accept(cb_tree var, cb_tree pos, struct cb_attr_struct *attr_ptr)
void cb_emit_accept_user_name(cb_tree var)
static void validate_inspect(cb_tree x, cb_tree y, const unsigned int replconv)
#define CB_PURPOSE_INT(x)
void cb_emit_set_up_down(cb_tree l, cb_tree flag, cb_tree x)
static int cb_chk_alpha_cond(cb_tree x)
void cb_emit_display(cb_tree values, cb_tree upon, cb_tree no_adv, cb_tree pos, struct cb_attr_struct *attr_ptr)
#define CB_BUILD_FUNCALL_4(f, a1, a2, a3, a4)
cb_tree cb_ref(cb_tree x)
cb_tree cb_build_field_tree(cb_tree level, cb_tree name, struct cb_field *last_field, enum cb_storage storage, struct cb_file *fn, const int expl_level)
char * cb_name(cb_tree x)
void cb_emit_evaluate(cb_tree subject_list, cb_tree case_list)
#define CB_ALPHABET_ASCII
void cb_emit_accept_escape_key(cb_tree var)
cb_tree cb_build_field(cb_tree name)
#define CB_BUILD_FUNCALL_1(f, a1)
cb_tree cb_build_add(cb_tree v, cb_tree n, cb_tree round_opt)
void cb_build_symbolic_chars(const cb_tree sym_list, const cb_tree alphabet)
static cb_tree cb_build_mul(cb_tree v, cb_tree n, cb_tree round_opt)
void cb_emit_set_last_exception_to_off(void)
cb_tree cb_build_perform_forever(cb_tree body)
cb_tree cb_build_index(cb_tree x, cb_tree values, const unsigned int indexed_by, struct cb_field *qual)
void cb_emit_goto(cb_tree target, cb_tree depending)
#define CB_ALPHABET_NATIVE
#define CB_BUILD_CAST_PPOINTER(x)
static size_t overlapping
void cb_emit_commit(void)
static cb_tree cb_build_move_num_zero(cb_tree x)
cb_tree cb_build_search(const int flag_all, const cb_tree table, const cb_tree var, const cb_tree end_stmt, const cb_tree whens)
void cb_emit_delete(cb_tree file)
static void decimal_expand(cb_tree d, cb_tree x)
#define COB_MAX_DEC_STRUCT
void cb_emit_string(cb_tree items, cb_tree into, cb_tree pointer)
void cb_emit_accept_date_yyyymmdd(cb_tree var)
cb_tree cb_build_perform_exit(struct cb_label *label)
cb_tree cb_build_sub(cb_tree v, cb_tree n, cb_tree round_opt)
struct cb_field * cb_field_variable_size(const struct cb_field *f)
void * cobc_check_string(const char *dupstr)
static int expr_stack_size
void cb_emit_accept_exception_status(cb_tree var)
cb_tree cb_build_replacing_all(cb_tree x, cb_tree y, cb_tree l)
unsigned char flag_is_global
cb_tree cb_build_tallying_value(cb_tree x, cb_tree l)
cb_tree cb_build_decimal(const int id)
int cb_fits_long_long(const cb_tree x)
#define COB_READ_PREVIOUS
cb_tree cb_build_numsize_literal(const void *data, const size_t size, const int sign)
cb_tree cb_build_if_check_break(cb_tree cond, cb_tree stmts)
void * cobc_parse_strdup(const char *dupstr)
unsigned int flag_ext_assign
void cb_emit_release(cb_tree record, cb_tree from)
void cb_emit_read(cb_tree ref, cb_tree next, cb_tree into, cb_tree key, cb_tree lock_opts)
static const unsigned char pvalid_char[]
cb_tree cb_build_string(const void *data, const size_t size)
if fold fold static computed alternate extra correct stack on syntax debugging source implicit stack syntax write single recursive relax optional file
unsigned int flag_debugging
struct cb_label * debug_section
void cb_emit_corresponding(cb_tree(*func)(cb_tree f1, cb_tree f2, cb_tree f3), cb_tree x1, cb_tree x2, cb_tree opt)
static int get_value(cb_tree x)
char * cb_build_program_id(cb_tree name, cb_tree alt_name, const cob_u32_t is_func)
cb_tree cb_build_set_attribute(const struct cb_field *fld, const int val_on, const int val_off)
cb_tree cb_build_tallying_leading(void)
static void get_line_and_column_from_pos(const cb_tree pos, cb_tree *const line, cb_tree *const column)
cb_tree cb_build_picture(const char *str)
void cb_emit_accept_date(cb_tree var)
void * cobc_main_realloc(void *prevptr, const size_t size)
#define CB_BUILD_NEGATION(x)
void cb_emit_unlock(cb_tree ref)
cb_tree cb_build_section_name(cb_tree name, const int sect_or_para)
void cb_emit_free(cb_tree vars)
void cb_emit_env_value(cb_tree value)
void cb_emit_move_corresponding(cb_tree x1, cb_tree x2)
void cb_emit_accept_environment(cb_tree var)
struct cb_alter_id * alter_gotos
static size_t cb_check_overlapping(cb_tree src, cb_tree dst, struct cb_field *src_f, struct cb_field *dst_f)
#define COB_ACCESS_DYNAMIC
static unsigned char valid_char[256]
#define COB_SCREEN_ERASE_EOL
#define CB_BUILD_FUNCALL_3(f, a1, a2, a3)
static cb_tree cb_build_optim_add(cb_tree v, cb_tree n)
void cb_emit_allocate(cb_tree target1, cb_tree target2, cb_tree size, cb_tree initialize)
cb_tree cb_build_alphanumeric_literal(const void *data, const size_t size)
cb_tree cb_build_display_mnemonic(cb_tree x)
#define COB_READ_WAIT_LOCK
#define CB_BINARY_OP_P(x)
int cb_list_length(cb_tree l)
char * cb_encode_program_id(const char *name)
cb_tree cb_build_numeric_literal(const int sign, const void *data, const int scale)
static cb_tree cb_build_move_literal(cb_tree src, cb_tree dst)
int validate_move(cb_tree src, cb_tree dst, const unsigned int is_value)
static cb_tree cb_build_move_quote(cb_tree x)
unsigned int flag_all_debug
void cb_emit_if(cb_tree cond, cb_tree stmt1, cb_tree stmt2)
cb_tree cb_build_ppointer(cb_tree x)
static cb_tree evaluate_test(cb_tree s, cb_tree o)
static cb_tree cb_check_needs_break(cb_tree stmt)
strict implicit external value
void cb_emit_sort_finish(cb_tree file)
unsigned int flag_in_debug
#define CB_ALPHABET_NAME(x)
#define CB_BUILD_CAST_ADDRESS(x)
unsigned int flag_sign_leading
static void cb_check_data_incompat(cb_tree x)
void cb_emit_accept_day(cb_tree var)
void cb_emit_get_environment(cb_tree envvar, cb_tree envval)
void cobc_parse_free(void *prevptr)
unsigned int flag_is_pdiv_parm
void cb_emit_write(cb_tree record, cb_tree from, cb_tree opt, cb_tree lockopt)
void cb_emit_start(cb_tree file, cb_tree op, cb_tree key, cb_tree keylen)
void cb_list_system(void)
cb_tree cb_define_switch_name(cb_tree name, cb_tree sname, const int flag)
cb_tree lookup_system_name(const char *name)
static cb_tree cb_build_length_1(cb_tree x)
cb_tree cb_build_direct(const char *str, const unsigned int flagnl)
static void decimal_free(void)
static cb_tree decimal_alloc(void)
cb_tree cb_build_tallying_all(void)
void cb_validate_program_body(struct cb_program *prog)
#define CB_BUILD_FUNCALL_2(f, a1, a2)
unsigned int flag_no_init
#define CB_BUILD_FUNCALL_0(f)
void cb_emit_delete_file(cb_tree file)
void cb_emit_cancel(cb_tree prog)
cb_tree cb_int_hex(const int n)
EC ARGUMENT EC EC BOUND EC BOUND EC BOUND EC BOUND TABLE EC DATA EC DATA EC DATA PTR NULL
#define COB_WRITE_CHANNEL
cb_tree cb_build_write_advancing_mnemonic(cb_tree pos, cb_tree mnemonic)
unsigned int flag_indexed_by
static cb_tree cb_build_move_high(cb_tree x)
void cb_emit_accept_line_or_col(cb_tree var, const int l_or_c)
cb_tree cb_build_const_length(cb_tree x)
static int valid_screen_pos(cb_tree pos)
static int cb_chk_num_cond(cb_tree x, cb_tree y)
const char *const syst_name
void cb_emit_alter(cb_tree source, cb_tree target)
static cb_tree cb_build_div(cb_tree v, cb_tree n, cb_tree round_opt)
static const unsigned char hexval[]
cb_tree cb_build_replacing_leading(cb_tree x, cb_tree y, cb_tree l)
unsigned int flag_invalid
cb_tree cb_build_cast_llint(const cb_tree val)
static void output_screen_from(struct cb_field *p, const unsigned int sisters)
cb_tree alphabet_name_list
#define CB_BUILD_FUNCALL_8(f, a1, a2, a3, a4, a5, a6, a7, a8)
unsigned int flag_binary_swap
#define COB_SCREEN_TYPE_ATTRIBUTE
void cb_emit_accept_arg_number(cb_tree var)
cb_tree cb_build_expr(cb_tree list)
void redefinition_error(cb_tree x)
int cb_fits_int(const cb_tree x)
cb_tree cb_build_display_name(cb_tree x)
#define COB_STORE_KEEP_ON_OVERFLOW
void cb_emit_set_true(cb_tree l)
#define CB_LOCALE_NAME_P(x)
cb_tree cb_build_debug_call(struct cb_label *target)
struct cb_alter_id * next
#define CB_CONV_STATIC_LINK
cb_tree cb_build_length(cb_tree x)
static COB_INLINE COB_A_INLINE int value_has_picture_clause(cb_tree pos)
cb_tree cb_int(const int n)
#define COB_ACCESS_SEQUENTIAL
void cb_emit_sort_input(cb_tree proc)
static void decimal_assign(cb_tree x, cb_tree d, cb_tree round_opt)
void cb_emit_sort_using(cb_tree file, cb_tree l)
static cb_tree cb_build_move_space(cb_tree x)
void cb_emit_rollback(void)
#define COB_READ_IGNORE_LOCK
#define CB_BUILD_CAST_ADDR_OF_ADDR(x)
#define CB_ALPHABET_CUSTOM
cb_tree cb_build_reference(const char *name)
static const struct optim_table bin_compare_funcs[]
void cobc_init_typeck(void)
void finalize_file(struct cb_file *f, struct cb_field *records)
void cb_emit_set_false(cb_tree l)
unsigned int flag_any_numeric
void cb_validate_program_data(struct cb_program *prog)
static cb_tree build_cond_88(cb_tree x)
struct cb_field * rename_thru
#define CB_INTRINSIC_P(x)
#define CB_BUILD_FUNCALL_10(f, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
void cb_emit_divide(cb_tree dividend, cb_tree divisor, cb_tree quotient, cb_tree remainder)
static void warning_destination(cb_tree x)
unsigned int gen_screen_ptr
static COB_INLINE COB_A_INLINE int value_pic_has_no_scale(cb_tree pos)
struct cb_label * current_paragraph
void * cobc_strdup(const char *dupstr)
void cb_emit_close(cb_tree file, cb_tree opt)
#define CB_DEVICE_CONSOLE
unsigned int flag_blank_zero
static void cb_expr_shift_class(const char *name)
#define CB_BUILD_CHAIN(x, y)
unsigned int flag_receiving
cb_tree cb_build_unstring_into(cb_tree name, cb_tree delimiter, cb_tree count)
static int valid_screen_pos_type(cb_tree pos)
void cb_emit_accept_time(cb_tree var)
void cb_error(const char *,...) COB_A_FORMAT12
void cb_emit_arithmetic(cb_tree vars, const int op, cb_tree val)
static cb_tree cb_build_move_low(cb_tree x)
cb_tree cb_build_address(cb_tree x)
enum cb_cast_type cast_type
static void emit_screen_display(const cb_tree x, const cb_tree pos)
static void decimal_compute(const int op, cb_tree x, cb_tree y)
void cb_emit_sort_init(cb_tree name, cb_tree keys, cb_tree col)
static void cb_gen_field_accept(cb_tree var, cb_tree pos, cb_tree fgc, cb_tree bgc, cb_tree scroll, cb_tree timeout, cb_tree prompt, cb_tree size_is, int dispattrs)
const char * program_name
void cb_emit_set_on_off(cb_tree l, cb_tree flag)
#define COB_SCREEN_ERASE_EOS
static cb_tree cb_build_optim_cond(struct cb_binary_op *p)
void cb_emit_command_line(cb_tree value)
void cb_emit_initialize(cb_tree vars, cb_tree fillinit, cb_tree value, cb_tree replacing, cb_tree def)
cb_tree cb_build_alter(const cb_tree source, const cb_tree target)
static cb_tree cb_check_integer_value(cb_tree x)
if fold fold static computed alternate extra correct stack on syntax debugging line
unsigned int flag_fl_debug
struct cb_program * current_program
#define CB_ADD_TO_CHAIN(x, y)
#define CB_BUILD_STRING0(str)
cb_tree cb_build_initialize(const cb_tree var, const cb_tree val, const cb_tree rep, const unsigned int def, const unsigned int is_statement, const unsigned int no_filler_init)
cb_tree collating_sequence
#define COB_SCREEN_NO_DISP
void cb_emit_accept_day_of_week(cb_tree var)
#define CB_EXCEPTION_ENABLE(id)
struct cb_alter_id * alter_gotos
static void cb_validate_collating(struct cb_program *prog)
cb_tree cb_build_continue(void)
cb_tree cb_build_write_advancing_page(cb_tree pos)
unsigned int flag_sign_separate
void cb_emit_search(cb_tree table, cb_tree varying, cb_tree at_end, cb_tree whens)
void cb_build_registers(void)
static int expr_chk_cond(cb_tree expr_1, cb_tree expr_2)
int cb_category_is_alpha(cb_tree x)
void cb_warning(const char *,...) COB_A_FORMAT12
cb_tree cb_build_assign(const cb_tree var, const cb_tree val)
static size_t initialized
void cb_emit_rewrite(cb_tree record, cb_tree from, cb_tree lockopt)
static cb_tree build_decimal_assign(cb_tree vars, const int op, cb_tree val)
static void cb_expr_shift_sign(const int op)
void cb_emit_setenv(cb_tree x, cb_tree y)
#define CB_ALPHABET_NAME_P(x)
#define CB_SIZES_INT_UNSIGNED(x)
cb_tree cb_debug_contents
#define COB_ACCESS_RANDOM
struct cb_label * all_procedure
#define COBC_DUMB_ABORT()
unsigned int flag_callback
static void cob_put_sign_ascii(unsigned char *p)
static cb_tree build_store_option(cb_tree x, cb_tree round_opt)
void cb_list_map(cb_tree(*func)(cb_tree x), cb_tree l)
#define COB_ORG_LINE_SEQUENTIAL
void cb_emit_inspect(cb_tree var, cb_tree body, cb_tree replacing, const unsigned int replconv)
cb_tree cb_build_replacing_first(cb_tree x, cb_tree y, cb_tree l)
void cb_check_field_debug(cb_tree fld)
struct cb_field * working_storage
void cb_emit_continue(void)
static void build_evaluate(cb_tree subject_list, cb_tree case_list, cb_tree labid)
cb_tree cb_build_cond(cb_tree x)
static unsigned int emit_corresponding(cb_tree(*func)(cb_tree f1, cb_tree f2, cb_tree f3), cb_tree x1, cb_tree x2, cb_tree opt)
#define CB_BUILD_CAST_LENGTH(x)
static const struct optim_table bin_set_funcs[]
#define COB_STORE_TRUNC_ON_OVERFLOW
void cb_emit_stop_run(cb_tree x)
cb_tree cb_build_perform(const enum cb_perform_type type)
void cb_emit_env_name(cb_tree value)
static struct expr_node * expr_stack
struct cb_field * index_qual
enum cb_class cb_tree_class(cb_tree x)
cob_u32_t optimize_defs[COB_OPTIM_MAX]
struct cb_label * current_section
cb_tree cb_build_debug(const cb_tree target, const char *str, const cb_tree fld)
#define CB_BUILD_FUNCALL_5(f, a1, a2, a3, a4, a5)
cb_tree cb_build_converting(cb_tree x, cb_tree y, cb_tree l)
void cb_emit_set_attribute(cb_tree x, const int val_on, const int val_off)
void cb_validate_field(struct cb_field *f)
#define COB_SCREEN_TYPE_GROUP
size_t cobc_check_valid_name(const char *name, const unsigned int prechk)
static size_t cb_validate_list(cb_tree l)
cb_tree cb_list_reverse(cb_tree l)
unsigned int cobc_cs_check
void cb_emit_accept_name(cb_tree var, cb_tree name)
cb_tree cb_build_tallying_trailing(void)
struct cb_field * redefines
void cb_emit_return(cb_tree ref, cb_tree into)
void cb_emit_accept_arg_value(cb_tree var)
static unsigned char expr_prio[256]
void cb_init_tallying(void)
cb_tree cb_build_cast_int(const cb_tree val)
void cb_emit_reset_trace(void)
static cb_tree cb_build_move_copy(cb_tree src, cb_tree dst)
cob_s64_t cb_get_long_long(const cb_tree x)
static void initialize_attrs(const struct cb_attr_struct *const attr_ptr, cb_tree *const fgc, cb_tree *const bgc, cb_tree *const scroll, cb_tree *const size_is, int *const dispattrs)
void cb_emit_accept_mnemonic(cb_tree var, cb_tree mnemonic)
void cb_emit_sort_giving(cb_tree file, cb_tree l)
void cb_emit_arg_number(cb_tree value)
cb_tree cb_build_tallying_characters(cb_tree l)
static int expr_reduce(int token)
static cb_tree inspect_data
static unsigned int search_set_keys(struct cb_field *f, cb_tree x)
unsigned int flag_finalized
static cb_tree cb_expr_finish(void)
static const char * inspect_func
struct cb_alt_key * alt_key_list
void cb_emit_set_to(cb_tree vars, cb_tree x)
#define CB_REF_OR_FIELD_P(x)
cb_tree cb_check_numeric_value(cb_tree x)
cb_tree cb_build_assignment_name(struct cb_file *cfile, cb_tree name)
unsigned int alphabet_type
struct cb_field * check_level_78(const char *name)
cb_tree cb_build_inspect_region_start(void)
struct cb_statement * current_statement
cb_tree cb_build_binary_op(cb_tree x, const int op, cb_tree y)
void cb_emit_accept_command_line(cb_tree var)
void cb_emit_move(cb_tree src, cb_tree dsts)
cb_tree cb_build_if(const cb_tree test, const cb_tree stmt1, const cb_tree stmt2, const unsigned int is_if)
static cb_tree cb_build_memset(cb_tree x, const int c)
#define CB_ALPHABET_EBCDIC
static const unsigned char cob_refer_ascii[256]
struct cb_field * cb_field_founder(const struct cb_field *f)
static void cb_expr_init(void)
static cb_tree cb_check_numeric_name(cb_tree x)
void cb_emit_open(cb_tree file, cb_tree mode, cb_tree sharing)
cb_tree symbolic_char_list
cb_tree cb_build_perform_until(cb_tree condition, cb_tree varying)
unsigned char decimal_point
static cb_tree cb_build_search_all(cb_tree table, cb_tree cond)
void cb_emit_perform(cb_tree perform, cb_tree body)
unsigned int flag_first_is_goto
cb_tree cb_build_goto(const cb_tree target, const cb_tree depending)
cb_tree cb_build_replacing_characters(cb_tree x, cb_tree l)
void cb_emit_display_omitted(cb_tree pos, struct cb_attr_struct *attr_ptr)
cb_tree cb_list_add(cb_tree l, cb_tree x)
cb_tree cb_build_unstring_delimited(cb_tree all, cb_tree value)
void cb_emit_call(cb_tree prog, cb_tree par_using, cb_tree returning, cb_tree on_exception, cb_tree not_on_exception, cb_tree convention)
cb_tree cb_build_identifier(cb_tree x, const int subchk)
unsigned int flag_item_based