![]() |
GnuCOBOL
2.0
A free COBOL compiler
|
#include "config.h"
#include "defaults.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include "tarstamp.h"
#include "cobc.h"
#include "tree.h"
#include "libcob.h"
#include "libcob/cobgetopt.h"
#include "libcob/exception.def"
#include "flag.def"
#include "warning.def"
Data Structures | |
struct | strcache |
Macros | |
#define | CB_LEVEL_PREPROCESS 1 |
#define | CB_LEVEL_TRANSLATE 2 |
#define | CB_LEVEL_COMPILE 3 |
#define | CB_LEVEL_ASSEMBLE 4 |
#define | CB_LEVEL_MODULE 5 |
#define | CB_LEVEL_LIBRARY 6 |
#define | CB_LEVEL_EXECUTABLE 7 |
#define | CB_IMSG_SIZE 24 |
#define | CB_IVAL_SIZE (74 - CB_IMSG_SIZE - 4) |
#define | COBC_ADD_STR(v, x, y, z) cobc_add_str (&v, &v##_size, x, y, z); |
#define | COBC_INV_PAR _("Invalid %s parameter") |
#define | OC_C_VERSION_PRF "" |
#define | OC_C_VERSION "unknown" |
#define | CB_TEXT_LIST_ADD(y, z) y = cb_text_list_add (y, z) |
#define | CB_TEXT_LIST_CHK(y, z) y = cb_text_list_chk (y, z) |
#define | CB_COPT_1 " -O" |
#define | CB_COPT_2 " -O2" |
#define | CB_COPT_S " -Os" |
#define | COB_EXCEPTION(code, tag, name, critical) {name, 0x##code, 0}, |
#define | CB_FLAG(var, pdok, name, doc) int var = 0; |
#define | CB_FLAG_RQ(var, pdok, name, def, opt, doc) int var = def; |
#define | CB_FLAG_NQ(pdok, name, opt, doc) |
#define | CB_WARNDEF(var, name, doc) int var = 0; |
#define | CB_NOWARNDEF(var, name, doc) int var = 0; |
#define | COB_NUM_CSYNS sizeof(cob_csyns) / sizeof(char *) |
#define | CB_NO_ARG no_argument |
#define | CB_RQ_ARG required_argument |
#define | CB_OP_ARG optional_argument |
#define | CB_FLAG(var, pdok, name, doc) |
#define | CB_FLAG_RQ(var, pdok, name, def, opt, doc) {"f"name, CB_RQ_ARG, NULL, opt}, |
#define | CB_FLAG_NQ(pdok, name, opt, doc) {"f"name, CB_RQ_ARG, NULL, opt}, |
#define | CB_WARNDEF(var, name, doc) |
#define | CB_NOWARNDEF(var, name, doc) |
#define | CB_WARNDEF(var, name, doc) cobc_print_warn (name, doc, 1); |
#define | CB_NOWARNDEF(var, name, doc) cobc_print_warn (name, doc, 0); |
#define | CB_FLAG(var, pdok, name, doc) cobc_print_flag (name, doc, pdok, 0); |
#define | CB_FLAG_RQ(var, pdok, name, def, opt, doc) cobc_print_flag (name, doc, pdok, 1); |
#define | CB_FLAG_NQ(pdok, name, opt, doc) cobc_print_flag (name, doc, pdok, 1); |
#define | CB_WARNDEF(var, name, doc) var = 0; |
#define | CB_NOWARNDEF(var, name, doc) var = 0; |
#define | CB_WARNDEF(var, name, doc) var = 1; |
#define | CB_NOWARNDEF(var, name, doc) |
#define | CB_WARNDEF(var, name, doc) var = 1; |
#define | CB_NOWARNDEF(var, name, doc) var = 1; |
Functions | |
static void COB_A_NORETURN | cobc_abort_terminate (void) |
static void | cobc_free_mem (void) |
static const char * | cobc_enum_explain (const enum cb_tag tag) |
void | cobc_abort_pr (const char *fmt,...) |
void | cobc_too_many_errors (void) |
void | cobc_abort (const char *filename, const int linenum) |
void | cobc_dumb_abort (const char *filename, const int linenum) |
void | cobc_tree_cast_error (const cb_tree x, const char *filename, const int linenum, const enum cb_tag tagnum) |
void * | cobc_malloc (const size_t size) |
memory allocation for use when compiling More... | |
void | cobc_free (void *mptr) |
deallocation of compile time memory More... | |
void * | cobc_strdup (const char *dupstr) |
safely duplicate a character array More... | |
void * | cobc_realloc (void *prevptr, const size_t size) |
void * | cobc_main_malloc (const size_t size) |
void * | cobc_main_strdup (const char *dupstr) |
void * | cobc_main_realloc (void *prevptr, const size_t size) |
void | cobc_main_free (void *prevptr) |
void * | cobc_parse_malloc (const size_t size) |
void * | cobc_parse_strdup (const char *dupstr) |
void * | cobc_parse_realloc (void *prevptr, const size_t size) |
void | cobc_parse_free (void *prevptr) |
void * | cobc_plex_malloc (const size_t size) |
void * | cobc_plex_strdup (const char *dupstr) |
void * | cobc_check_string (const char *dupstr) |
static struct cb_text_list * | cb_text_list_add (struct cb_text_list *list, const char *text) |
static struct cb_text_list * | cb_text_list_chk (struct cb_text_list *list, const char *text) |
static unsigned int | cobc_set_value (struct cb_define_struct *p, const char *value) |
static int | cobc_bcompare (const void *p1, const void *p2) |
static void | cobc_error_name (const char *name, const unsigned int source, const unsigned int reason) |
size_t | cobc_check_valid_name (const char *name, const unsigned int prechk) |
static void | cobc_chk_buff_size (const size_t bufflen) |
static int | cobc_deciph_optarg (const char *p, const int allow_quote) |
static void COB_A_NORETURN | cobc_err_exit (const char *fmt,...) |
static struct cb_define_struct * | cb_define_list_add (struct cb_define_struct *list, const char *text) |
static char * | cobc_stradd_dup (const char *str1, const char *str2) |
static char * | cobc_getenv (const char *env) |
static void | cobc_add_str (char **var, size_t *cursize, const char *s1, const char *s2, const char *s3) |
static void | cobc_check_action (const char *name) |
static void | cobc_clean_up (const int status) |
static void COB_A_NORETURN | cobc_terminate (const char *str) |
static void | cobc_print_version (void) |
static void | cobc_cmd_print (const char *cmd) |
static void | cobc_var_print (const char *msg, const char *val, const unsigned int env) |
static void | cobc_print_info (void) |
static void | cobc_print_warn (const char *name, const char *doc, const int wall) |
static void | cobc_print_flag (const char *name, const char *doc, const int pdok, const int exten) |
static void | cobc_print_usage (char *prog) |
static void | cobc_options_error_nonfinal (void) |
static void | cobc_options_error_build (void) |
static void | cobc_deciph_funcs (const char *opt) |
static int | process_command_line (const int argc, char **argv) |
static struct cb_program * | program_list_reverse (struct cb_program *p) |
static void | process_env_copy_path (const char *p) |
static char * | file_basename (const char *filename) |
static const char * | file_extension (const char *filename) |
static struct filename * | process_filename (const char *filename) |
static int | process (const char *cmd) |
static int | preprocess (struct filename *fn) |
static int | process_translate (struct filename *fn) |
static int | process_compile (struct filename *fn) |
static int | process_assemble (struct filename *fn) |
static int | process_module_direct (struct filename *fn) |
static int | process_module (struct filename *fn) |
static int | process_library (struct filename *l) |
static int | process_link (struct filename *l) |
int | main (int argc, char **argv) |
#define CB_COPT_1 " -O" |
Referenced by main(), and process_command_line().
#define CB_COPT_2 " -O2" |
Referenced by process_command_line().
#define CB_COPT_S " -Os" |
Referenced by process_command_line().
#define CB_FLAG | ( | var, | |
pdok, | |||
name, | |||
doc | |||
) | int var = 0; |
#define CB_FLAG | ( | var, | |
pdok, | |||
name, | |||
doc | |||
) |
#define CB_FLAG | ( | var, | |
pdok, | |||
name, | |||
doc | |||
) | cobc_print_flag (name, doc, pdok, 0); |
#define CB_FLAG_NQ | ( | pdok, | |
name, | |||
opt, | |||
doc | |||
) |
#define CB_FLAG_NQ | ( | pdok, | |
name, | |||
opt, | |||
doc | |||
) | cobc_print_flag (name, doc, pdok, 1); |
#define CB_FLAG_RQ | ( | var, | |
pdok, | |||
name, | |||
def, | |||
opt, | |||
doc | |||
) | int var = def; |
#define CB_FLAG_RQ | ( | var, | |
pdok, | |||
name, | |||
def, | |||
opt, | |||
doc | |||
) | cobc_print_flag (name, doc, pdok, 1); |
#define CB_IMSG_SIZE 24 |
Referenced by cobc_var_print().
#define CB_IVAL_SIZE (74 - CB_IMSG_SIZE - 4) |
Referenced by cobc_var_print().
#define CB_LEVEL_ASSEMBLE 4 |
Referenced by cobc_clean_up(), main(), process_assemble(), process_command_line(), and process_filename().
#define CB_LEVEL_COMPILE 3 |
Referenced by main(), and process_command_line().
#define CB_LEVEL_LIBRARY 6 |
Referenced by main(), and process_assemble().
#define CB_LEVEL_MODULE 5 |
Referenced by main(), and process_assemble().
#define CB_LEVEL_PREPROCESS 1 |
Referenced by cobc_clean_up(), main(), process_command_line(), and process_filename().
#define CB_LEVEL_TRANSLATE 2 |
Referenced by cobc_clean_up(), main(), process_command_line(), and process_filename().
#define CB_NO_ARG no_argument |
#define CB_NOWARNDEF | ( | var, | |
name, | |||
doc | |||
) | int var = 0; |
#define CB_NOWARNDEF | ( | var, | |
name, | |||
doc | |||
) |
#define CB_NOWARNDEF | ( | var, | |
name, | |||
doc | |||
) | cobc_print_warn (name, doc, 0); |
#define CB_NOWARNDEF | ( | var, | |
name, | |||
doc | |||
) | var = 0; |
#define CB_NOWARNDEF | ( | var, | |
name, | |||
doc | |||
) |
#define CB_NOWARNDEF | ( | var, | |
name, | |||
doc | |||
) | var = 1; |
#define CB_OP_ARG optional_argument |
#define CB_RQ_ARG required_argument |
#define CB_TEXT_LIST_ADD | ( | y, | |
z | |||
) | y = cb_text_list_add (y, z) |
Referenced by cobc_deciph_funcs(), main(), and process_command_line().
#define CB_TEXT_LIST_CHK | ( | y, | |
z | |||
) | y = cb_text_list_chk (y, z) |
Referenced by main(), and process_env_copy_path().
#define CB_WARNDEF | ( | var, | |
name, | |||
doc | |||
) | int var = 0; |
#define CB_WARNDEF | ( | var, | |
name, | |||
doc | |||
) |
#define CB_WARNDEF | ( | var, | |
name, | |||
doc | |||
) | cobc_print_warn (name, doc, 1); |
#define CB_WARNDEF | ( | var, | |
name, | |||
doc | |||
) | var = 0; |
#define CB_WARNDEF | ( | var, | |
name, | |||
doc | |||
) | var = 1; |
#define CB_WARNDEF | ( | var, | |
name, | |||
doc | |||
) | var = 1; |
#define COB_EXCEPTION | ( | code, | |
tag, | |||
name, | |||
critical | |||
) | {name, 0x##code, 0}, |
Referenced by cobc_check_valid_name().
#define COBC_ADD_STR | ( | v, | |
x, | |||
y, | |||
z | |||
) | cobc_add_str (&v, &v##_size, x, y, z); |
Referenced by main(), and process_command_line().
Referenced by process_command_line().
#define OC_C_VERSION "unknown" |
Referenced by cobc_print_version().
#define OC_C_VERSION_PRF "" |
Referenced by cobc_print_version().
|
staticread |
References _, cobc_abort_pr(), cobc_check_string(), cobc_free(), cobc_main_malloc(), cobc_set_value(), cobc_strdup(), cb_define_struct::deftype, cb_define_struct::last, cb_define_struct::name, cb_define_struct::next, NULL, p, and PLEX_DEF_NONE.
Referenced by process_command_line().
|
staticread |
References cobc_main_malloc(), cobc_main_strdup(), cb_text_list::last, cb_text_list::next, p, and cb_text_list::text.
Referenced by cb_text_list_chk().
|
staticread |
References cb_text_list_add(), cb_text_list::next, p, and cb_text_list::text.
DECLNORET void cobc_abort | ( | const char * | filename, |
const int | linenum | ||
) |
void cobc_abort_pr | ( | const char * | fmt, |
... | |||
) |
Referenced by cb_build_binary_op(), cb_define_list_add(), cb_field_size(), cb_get_int(), cb_get_long_long(), cb_get_u_long_long(), cb_tree_category(), cb_tree_type(), cob_gen_optim(), cobc_abort(), cobc_abort_terminate(), cobc_check_action(), cobc_check_string(), cobc_error_name(), cobc_free(), cobc_main_malloc(), cobc_main_realloc(), cobc_main_strdup(), cobc_malloc(), cobc_parse_malloc(), cobc_parse_realloc(), cobc_parse_strdup(), cobc_plex_malloc(), cobc_plex_strdup(), cobc_realloc(), cobc_set_value(), cobc_stradd_dup(), cobc_strdup(), cobc_too_many_errors(), cobc_tree_cast_error(), compute_size(), decimal_alloc(), decimal_compute(), decimal_expand(), initialize_type(), output_attr(), output_base(), output_call_by_value_args(), output_cond(), output_data(), output_funcall(), output_initialize_one(), output_integer(), output_internal_function(), output_long_integer(), output_param(), output_size(), output_stmt(), plex_action_directive(), process_command_line(), process_filename(), and validate_move().
|
static |
References _, cb_source_file, cb_source_line, cobc_abort_pr(), and cobc_clean_up().
Referenced by cobc_abort(), cobc_check_string(), cobc_free(), cobc_main_malloc(), cobc_main_realloc(), cobc_main_strdup(), cobc_malloc(), cobc_parse_malloc(), cobc_parse_realloc(), cobc_parse_strdup(), cobc_plex_malloc(), cobc_plex_strdup(), cobc_realloc(), cobc_stradd_dup(), cobc_strdup(), cobc_too_many_errors(), and cobc_tree_cast_error().
|
static |
References _, cobc_err_exit(), and cobc_main_realloc().
|
static |
Referenced by cobc_check_valid_name().
|
static |
References _, COB_MEDIUM_BUFF, COB_MEDIUM_MAX, cobc_abort_pr(), F_OK, save_temps, save_temps_dir, and SLASH_STR.
Referenced by cobc_clean_up(), process_library(), process_link(), process_module(), and process_module_direct().
void * cobc_check_string | ( | const char * | dupstr | ) |
References _, base_string, cobc_abort_pr(), cobc_abort_terminate(), cobc_main_malloc(), cobc_main_strdup(), strcache::next, unlikely, and strcache::val.
Referenced by cb_build_binary_picture(), cb_build_picture(), cb_build_program_id(), cb_define_list_add(), and cb_encode_program_id().
size_t cobc_check_valid_name | ( | const char * | name, |
const unsigned int | prechk | ||
) |
References cob_csyns, COB_NUM_CSYNS, cobc_bcompare(), cobc_error_name(), and p.
Referenced by cb_build_program_id(), and process_filename().
|
static |
References cobc_buffer, cobc_buffer_size, and cobc_main_realloc().
Referenced by process_assemble(), process_compile(), process_library(), process_link(), process_module(), and process_module_direct().
|
static |
References cb_compile_level, CB_LEVEL_ASSEMBLE, CB_LEVEL_PREPROCESS, CB_LEVEL_TRANSLATE, cb_listing_file, cb_storage_file, cob_u32_t, cobc_buffer, cobc_check_action(), cobc_free_mem(), F_OK, local_filename::local_fp, local_filename::local_name, filename::localfile, filename::need_assemble, filename::need_preprocess, filename::need_translate, local_filename::next, filename::next, NULL, filename::object, ppin, ppout, filename::preprocess, save_all_src, save_c_src, save_temps, filename::translate, filename::trstorage, unlikely, yyin, and yyout.
Referenced by cobc_abort_terminate(), cobc_terminate(), and main().
|
static |
|
static |
References _, cb_flag_functions_all, CB_TEXT_LIST_ADD, cobc_err_exit(), cobc_free(), cobc_strdup(), lookup_intrinsic(), NULL, and p.
Referenced by process_command_line().
|
static |
Referenced by process_command_line().
DECLNORET void cobc_dumb_abort | ( | const char * | filename, |
const int | linenum | ||
) |
References cobc_abort().
|
static |
References CB_TAG_ALPHABET_NAME, CB_TAG_ALTER, CB_TAG_ASSIGN, CB_TAG_BINARY_OP, CB_TAG_CALL, CB_TAG_CANCEL, CB_TAG_CAST, CB_TAG_CLASS_NAME, CB_TAG_CONST, CB_TAG_CONTINUE, CB_TAG_DEBUG, CB_TAG_DEBUG_CALL, CB_TAG_DECIMAL, CB_TAG_DIRECT, CB_TAG_FIELD, CB_TAG_FILE, CB_TAG_FUNCALL, CB_TAG_GOTO, CB_TAG_IF, CB_TAG_INITIALIZE, CB_TAG_INTEGER, CB_TAG_INTRINSIC, CB_TAG_LABEL, CB_TAG_LIST, CB_TAG_LITERAL, CB_TAG_LOCALE_NAME, CB_TAG_PERFORM, CB_TAG_PERFORM_VARYING, CB_TAG_PICTURE, CB_TAG_REFERENCE, CB_TAG_REPORT, CB_TAG_SEARCH, CB_TAG_SET_ATTR, CB_TAG_STATEMENT, CB_TAG_STRING, and CB_TAG_SYSTEM_NAME.
Referenced by cobc_tree_cast_error().
|
static |
References _, and cobc_free_mem().
Referenced by cobc_add_str(), cobc_deciph_funcs(), cobc_options_error_build(), cobc_options_error_nonfinal(), main(), and process_command_line().
|
static |
void cobc_free | ( | void * | mptr | ) |
deallocation of compile time memory
References _, cobc_abort_pr(), cobc_abort_terminate(), and unlikely.
Referenced by cb_define_list_add(), cb_reset_78(), cb_reset_global_78(), clear_initial_values(), cobc_cmd_print(), cobc_deciph_funcs(), cobc_free_mem(), cobc_main_free(), cobc_main_realloc(), cobc_parse_free(), cobc_parse_realloc(), cobc_var_print(), main(), plex_clear_all(), ppecho(), preprocess(), process(), process_env_copy_path(), scan_define_options(), while(), and ylex_clear_all().
|
static |
References cobc_free(), cobc_list_dir, cobc_list_file, cobc_mem_struct::next, NULL, and save_temps_dir.
Referenced by cobc_clean_up(), cobc_err_exit(), preprocess(), and process_command_line().
|
static |
void cobc_main_free | ( | void * | prevptr | ) |
References cobc_free(), cobc_mem_struct::memptr, cobc_mem_struct::next, and NULL.
void * cobc_main_malloc | ( | const size_t | size | ) |
References _, cobc_abort_pr(), cobc_abort_terminate(), cobc_mainmem_base, cobc_mem_struct::memlen, cobc_mem_struct::memptr, cobc_mem_struct::next, and unlikely.
Referenced by ambiguous_error(), cb_build_class_name(), cb_build_picture(), cb_config_entry(), cb_define_list_add(), cb_expr_init(), cb_int(), cb_text_list_add(), cobc_check_string(), cobc_main_strdup(), cobc_set_value(), cobc_stradd_dup(), codegen(), finalize_file(), main(), output_initialize_one(), process_assemble(), process_command_line(), process_filename(), process_module_direct(), process_translate(), and undefined_error().
void * cobc_main_realloc | ( | void * | prevptr, |
const size_t | size | ||
) |
References _, cobc_abort_pr(), cobc_abort_terminate(), cobc_free(), cobc_mem_struct::memlen, cobc_mem_struct::memptr, cobc_mem_struct::next, NULL, and unlikely.
Referenced by cb_expr_shift(), cobc_add_str(), cobc_chk_buff_size(), file_basename(), and output_initialize_one().
void * cobc_main_strdup | ( | const char * | dupstr | ) |
References _, cobc_abort_pr(), cobc_abort_terminate(), cobc_main_malloc(), p, and unlikely.
Referenced by cb_text_list_add(), cobc_check_string(), cobc_getenv(), cobc_set_value(), main(), process_command_line(), process_filename(), process_link(), and read_string().
void * cobc_malloc | ( | const size_t | size | ) |
memory allocation for use when compiling
Allocate size bytes of memory, cleared to zeros. Aborts compile if memory unavailable.
References _, cobc_abort_pr(), cobc_abort_terminate(), and unlikely.
Referenced by cb_add_78(), cb_add_const_var(), cobc_strdup(), ppopen(), and process().
|
static |
References _, and cobc_err_exit().
Referenced by process_command_line().
|
static |
References _, and cobc_err_exit().
Referenced by process_command_line().
void cobc_parse_free | ( | void * | prevptr | ) |
References cobc_free(), cobc_mem_struct::memptr, cobc_mem_struct::next, and NULL.
Referenced by cb_build_move_literal(), terminator_clear(), terminator_error(), and terminator_warning().
void * cobc_parse_malloc | ( | const size_t | size | ) |
References _, cobc_abort_pr(), cobc_abort_terminate(), cobc_parsemem_base, cobc_mem_struct::memlen, cobc_mem_struct::memptr, cobc_mem_struct::next, and unlikely.
Referenced by add_contained_prog(), build_literal(), cb_build_label(), cb_build_move(), cb_build_move_literal(), cb_build_picture(), cb_build_program(), cb_concat_literals(), cb_name(), cb_validate_program_body(), check_attribs(), cobc_parse_strdup(), lookup_attr(), lookup_call(), lookup_func_call(), lookup_literal(), lookup_string(), lookup_word(), make_tree(), output_base(), output_internal_function(), output_param(), output_perform_call(), setup_use_file(), and validate_field_1().
void * cobc_parse_realloc | ( | void * | prevptr, |
const size_t | size | ||
) |
References _, cobc_abort_pr(), cobc_abort_terminate(), cobc_free(), cobc_mem_struct::memlen, cobc_mem_struct::memptr, cobc_mem_struct::next, NULL, and unlikely.
void * cobc_parse_strdup | ( | const char * | dupstr | ) |
References _, cobc_abort_pr(), cobc_abort_terminate(), cobc_parse_malloc(), p, and unlikely.
Referenced by cb_build_class_name(), cb_build_debug(), cb_emit_evaluate(), cb_to_cname(), lookup_string(), lookup_word(), and while().
void * cobc_plex_malloc | ( | const size_t | size | ) |
References _, cobc_abort_pr(), cobc_abort_terminate(), cobc_plexmem_base, cobc_mem_struct::memptr, cobc_mem_struct::next, and unlikely.
Referenced by cobc_plex_strdup(), pp_text_list_add(), ppp_define_add(), ppp_list_add(), and ppp_replace_list_add().
void * cobc_plex_strdup | ( | const char * | dupstr | ) |
References _, cobc_abort_pr(), cobc_abort_terminate(), cobc_plex_malloc(), p, and unlikely.
Referenced by ppp_define_add(), ppp_list_add(), ppp_set_value(), switch_to_buffer(), and while().
|
static |
|
static |
References _, cb_msg_style, CB_MSG_STYLE_MSC, COB_BLD_BUILD, COB_BLD_CC, COB_BLD_CFLAGS, COB_BLD_CPPFLAGS, COB_BLD_LD, COB_BLD_LDFLAGS, COB_CC, COB_CFLAGS, COB_CONFIG_DIR, COB_COPY_DIR, COB_EXEEXT, COB_LDFLAGS, COB_LIBS, COB_MODULE_EXT, cobc_print_version(), cobc_var_print(), NULL, and WITH_VARSEQ.
Referenced by process_command_line().
|
static |
|
static |
References _, cb_oc_build_stamp, COB_TAR_DATE, OC_C_VERSION, OC_C_VERSION_PRF, PACKAGE_NAME, PACKAGE_VERSION, and PATCH_LEVEL.
Referenced by cobc_print_info(), and process_command_line().
|
static |
void * cobc_realloc | ( | void * | prevptr, |
const size_t | size | ||
) |
References _, cobc_abort_pr(), cobc_abort_terminate(), and unlikely.
Referenced by read_literal(), scan_x(), and scan_z().
|
static |
|
static |
References _, cobc_abort_pr(), cobc_abort_terminate(), cobc_main_malloc(), p, and unlikely.
Referenced by process_filename().
void * cobc_strdup | ( | const char * | dupstr | ) |
safely duplicate a character array
References _, cobc_abort_pr(), cobc_abort_terminate(), cobc_malloc(), p, and unlikely.
Referenced by cb_define_list_add(), cobc_cmd_print(), cobc_deciph_funcs(), cobc_var_print(), ppecho(), ppopen(), process_command_line(), process_env_copy_path(), scan_define_options(), and while().
|
static |
References cobc_clean_up().
Referenced by main(), preprocess(), process_filename(), and process_translate().
DECLNORET void cobc_too_many_errors | ( | void | ) |
References _, cobc_abort_pr(), and cobc_abort_terminate().
Referenced by cb_error(), cb_error_x(), and cb_plex_error().
void cobc_tree_cast_error | ( | const cb_tree | x, |
const char * | filename, | ||
const int | linenum, | ||
const enum cb_tag | tagnum | ||
) |
References _, cb_name(), CB_TREE_TAG, cobc_abort_pr(), cobc_abort_terminate(), and cobc_enum_explain().
|
static |
References _, CB_IMSG_SIZE, CB_IVAL_SIZE, cobc_free(), cobc_strdup(), NULL, and p.
Referenced by cobc_print_info().
|
static |
References basename_buffer, basename_len, cobc_main_realloc(), NULL, and p.
Referenced by process_compile(), process_filename(), process_library(), process_link(), process_module(), and process_module_direct().
|
static |
References p.
Referenced by process_filename().
int main | ( | int | argc, |
char ** | argv | ||
) |
References _, aflag_set, basename_buffer, basename_len, bindtextdomain, cb_attr_id, cb_compile_level, CB_COPT_1, CB_EXCEPTION_ENABLE, cb_field_id, cb_id, CB_LEVEL_ASSEMBLE, CB_LEVEL_COMPILE, CB_LEVEL_EXECUTABLE, CB_LEVEL_LIBRARY, CB_LEVEL_MODULE, CB_LEVEL_PREPROCESS, CB_LEVEL_TRANSLATE, cb_listing_file, cb_literal_id, cb_msg_style, CB_MSG_STYLE_GCC, CB_MSG_STYLE_MSC, cb_oc_build_stamp, cb_saveargc, cb_saveargv, cb_source_file, CB_TEXT_LIST_ADD, CB_TEXT_LIST_CHK, COB_CC, COB_CFLAGS, COB_CONFIG_DIR, cob_config_dir, COB_COPY_DIR, COB_EC_I_O, COB_EXPORT_DYN, COB_LARGE_BUFF, COB_LARGE_MAX, COB_LDFLAGS, COB_LIBS, COB_MINI_BUFF, COB_MINI_MAX, cob_optimize, COB_PIC_FLAGS, COB_SHARED_OPT, COB_SMALL_BUFF, COB_SMALL_MAX, COBC_ADD_STR, cobc_buffer, cobc_buffer_size, cobc_cc, cobc_cc_len, cobc_cflags, cobc_cflags_len, cobc_cflags_size, cobc_clean_up(), cobc_err_exit(), cobc_export_dyn_len, cobc_flag_library, cobc_flag_main, cobc_flag_module, cobc_free(), cobc_getenv(), cobc_include, cobc_include_len, cobc_include_size, cobc_init_reserved(), cobc_init_scanner(), cobc_init_typeck(), cobc_ldflags, cobc_ldflags_len, cobc_ldflags_size, cobc_lib_paths, cobc_lib_paths_len, cobc_lib_paths_size, cobc_libs, cobc_libs_len, cobc_libs_size, cobc_list_file, cobc_main_malloc(), cobc_main_strdup(), cobc_objects_buffer, cobc_objects_len, cobc_pic_flags_len, cobc_shared_opt_len, cobc_terminate(), cobc_wants_debug, demangle_name, filename::demangle_source, gflag_set, filename::has_error, iargs, LOCALEDIR, filename::need_assemble, filename::need_preprocess, filename::need_translate, cobc_mem_struct::next, NULL, optimize_defs, output_name, p, PACKAGE, plex_clear_all(), ppin, ppout, preprocess(), process_assemble(), process_command_line(), process_compile(), process_env_copy_path(), process_filename(), process_library(), process_link(), process_module(), process_module_direct(), process_translate(), save_temps_dir, textdomain, verbose_output, wants_nonfinal, ylex_clear_all(), yyin, and yyout.
|
static |
References _, cb_listing_file, cb_source_format, cobc_buffer, cobc_cmd_print(), cobc_free(), cobc_free_mem(), cobc_gen_listing, cobc_list_file, cobc_terminate(), errorcount, filename::listing_file, cobc_mem_struct::next, NULL, plex_call_destroy(), plex_clear_vars(), ppin, ppopen(), ppout, ppparse(), ppparse_clear_vars(), filename::preprocess, filename::source, unlikely, and verbose_output.
Referenced by main().
|
static |
References _, cobc_cmd_print(), cobc_free(), cobc_malloc(), likely, NULL, p, unlikely, and verbose_output.
Referenced by process_assemble(), process_compile(), process_library(), process_link(), process_module(), and process_module_direct().
|
static |
References cb_compile_level, CB_LEVEL_ASSEMBLE, CB_LEVEL_LIBRARY, CB_LEVEL_MODULE, COB_LARGE_BUFF, COB_PIC_FLAGS, cobc_buffer, cobc_cc, cobc_cc_len, cobc_cflags, cobc_cflags_len, cobc_chk_buff_size(), cobc_include, cobc_include_len, cobc_main_malloc(), cobc_pic_flags_len, gflag_set, if(), filename::object, filename::object_len, p, process(), filename::translate, and filename::translate_len.
Referenced by main().
|
static |
References _, aflag_set, cb_compile_level, cb_config_entry(), CB_COPT_1, CB_COPT_2, CB_COPT_S, cb_define_list_add(), CB_EXCEPTION_ENABLE, cb_flag_main, CB_LEVEL_ASSEMBLE, CB_LEVEL_COMPILE, CB_LEVEL_PREPROCESS, CB_LEVEL_TRANSLATE, cb_list_intrinsics(), cb_list_mnemonics(), cb_list_reserved(), cb_list_system(), cb_load_conf(), cb_load_std(), CB_TEXT_LIST_ADD, COB_FOLD_LOWER, COB_FOLD_UPPER, cob_getopt_long_long(), COB_MINI_BUFF, COB_MINI_MAX, cob_optarg, cob_optimize, cob_optind, COB_SMALL_MAX, cobc_abort_pr(), COBC_ADD_STR, cobc_cflags, cobc_deciph_funcs(), cobc_deciph_optarg(), cobc_err_exit(), cobc_flag_library, cobc_flag_main, cobc_flag_module, cobc_free_mem(), cobc_gen_listing, cobc_include, COBC_INV_PAR, cobc_ldflags, cobc_lib_paths, cobc_libs, cobc_list_dir, cobc_list_file, cobc_main_malloc(), cobc_main_strdup(), cobc_options_error_build(), cobc_options_error_nonfinal(), cobc_print_info(), cobc_print_usage(), cobc_print_version(), cobc_strdup(), cobc_wants_debug, configuration_error(), exit_option, gflag_set, cb_text_list::next, no_physical_cancel, NULL, output_name, output_name_buff, p, save_all_src, save_c_src, save_temps, save_temps_dir, short_options, strip_output, cb_text_list::text, verbose_output, wants_nonfinal, and warningopt.
Referenced by main().
|
static |
References cobc_buffer, cobc_cc, cobc_cc_len, cobc_cflags, cobc_cflags_len, cobc_chk_buff_size(), cobc_include, cobc_include_len, file_basename(), gflag_set, output_name, process(), filename::source, filename::translate, and filename::translate_len.
Referenced by main().
|
static |
References CB_TEXT_LIST_CHK, cobc_free(), cobc_strdup(), NULL, PATHSEPS, and value.
Referenced by main().
|
staticread |
References _, cb_compile_level, cb_encode_program_id(), CB_LEVEL_ASSEMBLE, CB_LEVEL_PREPROCESS, CB_LEVEL_TRANSLATE, COB_FILE_MAX, cob_incr_temp_iteration(), COB_NORMAL_MAX, COB_OBJECT_EXT, cob_temp_name(), cobc_abort_pr(), cobc_check_valid_name(), cobc_gen_listing, cobc_list_dir, cobc_list_file, cobc_main_malloc(), cobc_main_strdup(), cobc_objects_len, cobc_stradd_dup(), cobc_terminate(), filename::demangle_source, extension, file_basename(), file_extension(), filename::listing_file, filename::need_assemble, filename::need_preprocess, filename::need_translate, filename::next, NULL, filename::object, filename::object_len, output_name, filename::preprocess, R_OK, save_all_src, save_c_src, save_temps, SLASH_STR, filename::source, filename::translate, filename::translate_len, and filename::trstorage.
Referenced by main().
|
static |
References COB_EXPORT_DYN, COB_MODULE_EXT, COB_PIC_FLAGS, COB_SHARED_OPT, COB_STRIP_CMD, cobc_buffer, cobc_cc, cobc_cc_len, cobc_check_action(), cobc_chk_buff_size(), cobc_export_dyn_len, cobc_ldflags, cobc_ldflags_len, cobc_lib_paths, cobc_lib_paths_len, cobc_libs, cobc_libs_len, cobc_objects_buffer, cobc_objects_len, cobc_pic_flags_len, cobc_shared_opt_len, file_basename(), gflag_set, filename::next, NULL, filename::object, output_name, output_name_buff, process(), filename::source, and strip_output.
Referenced by main().
|
static |
References COB_EXEEXT, COB_EXPORT_DYN, COB_STRIP_CMD, cobc_buffer, cobc_cc, cobc_cc_len, cobc_check_action(), cobc_chk_buff_size(), cobc_export_dyn_len, cobc_ldflags, cobc_ldflags_len, cobc_lib_paths, cobc_lib_paths_len, cobc_libs, cobc_libs_len, cobc_main_strdup(), cobc_objects_buffer, cobc_objects_len, file_basename(), gflag_set, filename::next, filename::object, output_name, process(), filename::source, and strip_output.
Referenced by main().
|
static |
References COB_EXPORT_DYN, COB_MODULE_EXT, COB_PIC_FLAGS, COB_SHARED_OPT, COB_STRIP_CMD, cobc_buffer, cobc_cc, cobc_cc_len, cobc_check_action(), cobc_chk_buff_size(), cobc_export_dyn_len, cobc_ldflags, cobc_ldflags_len, cobc_lib_paths, cobc_lib_paths_len, cobc_libs, cobc_libs_len, cobc_pic_flags_len, cobc_shared_opt_len, file_basename(), gflag_set, NULL, filename::object, filename::object_len, output_name, output_name_buff, process(), filename::source, and strip_output.
Referenced by main().
|
static |
References COB_EXPORT_DYN, COB_LARGE_BUFF, COB_MODULE_EXT, COB_OBJECT_EXT, COB_PIC_FLAGS, COB_SHARED_OPT, COB_STRIP_CMD, cobc_buffer, cobc_cc, cobc_cc_len, cobc_cflags, cobc_cflags_len, cobc_check_action(), cobc_chk_buff_size(), cobc_export_dyn_len, cobc_include, cobc_include_len, cobc_ldflags, cobc_ldflags_len, cobc_lib_paths, cobc_lib_paths_len, cobc_libs, cobc_libs_len, cobc_main_malloc(), cobc_pic_flags_len, cobc_shared_opt_len, file_basename(), gflag_set, NULL, output_name, output_name_buff, p, process(), filename::source, strip_output, filename::translate, and filename::translate_len.
Referenced by main().
|
static |
References _, cb_init_constants(), cb_insert_common_prog(), cb_list_reverse(), cb_source_file, cb_source_line, cb_storage_file, cb_storage_file_name, COB_OPEN_EXTEND, COB_OPEN_INPUT, cobc_main_malloc(), cobc_terminate(), codegen(), cb_program::common_prog_list, current_program, cb_program::entry_list, errorcount, cb_label::flag_global, cb_program::global_file_list, cb_program::global_handler, handler_struct::handler_label, handler_struct::handler_prog, local_filename::local_fp, cb_program::local_include, local_filename::local_name, filename::localfile, cb_program::nested_level, nested_list::nested_prog, local_filename::next, nested_list::next, cb_program::next_program, NULL, p, filename::preprocess, program_list_reverse(), filename::source, filename::translate, filename::translate_len, filename::trstorage, unlikely, verbose_output, ylex_call_destroy(), yyin, yyout, and yyparse.
Referenced by main().
|
staticread |
|
static |
Referenced by main(), and process_command_line().
|
static |
Referenced by cobc_check_string().
|
static |
Referenced by file_basename(), and main().
|
static |
Referenced by file_basename(), and main().
int cb_attr_id = 0 |
Referenced by lookup_attr(), and main().
|
static |
Referenced by cobc_clean_up(), main(), process_assemble(), process_command_line(), and process_filename().
|
static |
struct cb_text_list * cb_early_exit_list = NULL |
Referenced by output_call().
struct cb_exception cb_exception_table |
struct cb_text_list * cb_extension_list = NULL |
Referenced by ppcopy().
int cb_field_id = 0 |
Referenced by cb_build_field(), and main().
int cb_flag_functions_all = 0 |
Referenced by cb_build_program(), and cobc_deciph_funcs().
int cb_flag_main = 0 |
Referenced by process_command_line().
int cb_id = 0 |
Referenced by cb_build_label(), cb_emit_evaluate(), main(), output_perform_call(), and output_stmt().
struct cb_text_list * cb_include_list = NULL |
Referenced by ppcopy().
struct cb_text_list * cb_intrinsic_list = NULL |
Referenced by while().
FILE * cb_listing_file = NULL |
Referenced by check_listing(), cobc_clean_up(), main(), ppecho(), and preprocess().
int cb_literal_id = 0 |
Referenced by lookup_literal(), and main().
char * cb_oc_build_stamp = NULL |
Referenced by cobc_print_version(), main(), and output_header().
int cb_saveargc = 0 |
Referenced by main(), and output_header().
char ** cb_saveargv = NULL |
Referenced by main(), and output_header().
const char * cb_source_file = NULL |
int cb_source_format = CB_FORMAT_FIXED |
Referenced by check_listing(), ppinput(), ppopen(), preprocess(), and while().
int cb_source_line = 0 |
Referenced by begin_statement(), cb_build_comment(), cb_build_debug(), cb_build_debug_call(), cb_build_filler(), cb_plex_error(), cb_plex_warning(), cobc_abort_terminate(), count_lines(), emit_entry(), plex_action_directive(), ppopen(), print_error(), process_translate(), switch_to_buffer(), and while().
struct cb_text_list * cb_static_call_list = NULL |
Referenced by output_call().
FILE * cb_storage_file = NULL |
Referenced by cobc_clean_up(), codegen(), output_storage(), and process_translate().
const char * cb_storage_file_name = NULL |
Referenced by codegen(), and process_translate().
const char * cob_config_dir = NULL |
Referenced by cb_load_conf(), and main().
|
static |
Referenced by cobc_check_valid_name().
|
static |
Referenced by main(), and process_command_line().
|
static |
|
static |
Referenced by cobc_chk_buff_size(), and main().
|
static |
Referenced by main(), process_assemble(), process_compile(), process_library(), process_link(), process_module(), and process_module_direct().
|
static |
Referenced by main(), process_assemble(), process_compile(), process_library(), process_link(), process_module(), and process_module_direct().
|
static |
Referenced by main(), process_assemble(), process_command_line(), process_compile(), and process_module_direct().
|
static |
Referenced by main(), process_assemble(), process_compile(), and process_module_direct().
|
static |
Referenced by main().
|
static |
Referenced by main(), process_library(), process_link(), process_module(), and process_module_direct().
|
static |
Referenced by main(), and process_command_line().
int cobc_flag_main = 0 |
Referenced by codegen(), main(), output_internal_function(), output_module_init(), and process_command_line().
|
static |
Referenced by main(), and process_command_line().
unsigned int cobc_gen_listing = 0 |
Referenced by check_listing(), preprocess(), process_command_line(), and process_filename().
|
static |
Referenced by main(), process_assemble(), process_command_line(), process_compile(), and process_module_direct().
|
static |
Referenced by main(), process_assemble(), process_compile(), and process_module_direct().
|
static |
Referenced by main().
|
static |
Referenced by main(), process_command_line(), process_library(), process_link(), process_module(), and process_module_direct().
|
static |
Referenced by main(), process_library(), process_link(), process_module(), and process_module_direct().
|
static |
Referenced by main().
|
static |
Referenced by main(), process_command_line(), process_library(), process_link(), process_module(), and process_module_direct().
|
static |
Referenced by main(), process_library(), process_link(), process_module(), and process_module_direct().
|
static |
Referenced by main().
|
static |
Referenced by main(), process_command_line(), process_library(), process_link(), process_module(), and process_module_direct().
|
static |
Referenced by main(), process_library(), process_link(), process_module(), and process_module_direct().
|
static |
Referenced by main().
|
static |
Referenced by cobc_free_mem(), process_command_line(), and process_filename().
|
static |
Referenced by cobc_free_mem(), main(), preprocess(), process_command_line(), and process_filename().
|
static |
Referenced by cobc_main_malloc().
Referenced by cb_config_entry(), lookup_intrinsic(), and lookup_reserved_word().
|
static |
Referenced by main(), process_library(), and process_link().
|
static |
Referenced by main(), process_filename(), process_library(), and process_link().
|
static |
Referenced by cobc_parse_malloc().
|
static |
Referenced by main(), process_assemble(), process_library(), process_module(), and process_module_direct().
|
static |
Referenced by cobc_plex_malloc().
|
static |
Referenced by main(), process_library(), process_module(), and process_module_direct().
int cobc_wants_debug = 0 |
Referenced by main(), and process_command_line().
int errorcount = 0 |
Referenced by cb_error(), cb_error_x(), cb_plex_error(), ppopen(), preprocess(), and process_translate().
int exit_option = 0 |
Referenced by process_command_line().
|
static |
|
static |
Referenced by main().
|
static |
int no_physical_cancel = 0 |
Referenced by output_module_init(), and process_command_line().
cob_u32_t optimize_defs = { 0 } |
|
static |
|
static |
Referenced by process_command_line(), process_library(), process_module(), and process_module_direct().
|
static |
Referenced by cobc_clean_up(), process_command_line(), and process_filename().
|
static |
Referenced by cobc_clean_up(), process_command_line(), and process_filename().
|
static |
Referenced by cobc_check_action(), cobc_clean_up(), process_command_line(), and process_filename().
|
static |
Referenced by cobc_check_action(), cobc_free_mem(), main(), and process_command_line().
|
static |
Referenced by process_command_line().
|
static |
Referenced by process_command_line(), process_library(), process_link(), process_module(), and process_module_direct().
|
static |
Referenced by main(), preprocess(), process(), process_command_line(), and process_translate().
|
static |
Referenced by main(), and process_command_line().
int warningcount = 0 |
Referenced by cb_plex_warning(), cb_warning(), and cb_warning_x().
int warningopt = 0 |
Referenced by cb_build_assignment_name(), cb_emit_call(), cb_verify(), check_picture_item(), compute_size(), process_command_line(), validate_move(), and while().