GnuCOBOL
2.0
A free COBOL compiler
|
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <ctype.h>
#include "cobc.h"
#include "tree.h"
#include "parser.h"
Go to the source code of this file.
Data Structures | |
struct | system_struct |
Macros | |
#define | SYSTEM_TAB_SIZE sizeof(system_table) / sizeof(struct system_struct) |
#define | EXT_SYSTEM_TAB_SIZE sizeof(ext_system_table) / sizeof(struct system_struct) |
#define | NUM_DEFAULT_RESERVED_WORDS sizeof (default_reserved_words) / sizeof (struct cobc_reserved) |
#define | NUM_INTRINSICS sizeof(function_list) / sizeof(struct cb_intrinsic_table) |
Enumerations | |
enum | free_word_action { FREE_WORD_STR, DONT_FREE_WORD_STR } |
Functions | |
static int | cob_strcasecmp (const void *s1, const void *s2) |
static int | reserve_comp (const void *p1, const void *p2) |
static int | intrinsic_comp (const void *p1, const void *p2) |
static const char * | res_get_feature (const enum cb_system_name_category category) |
static struct cobc_reserved | create_dummy_reserved (const char *word) |
static void | delete_reserved_word_from_list (struct reserved_word_list *const prev, const enum free_word_action action, struct reserved_word_list *to_delete) |
static COB_INLINE COB_A_INLINE int | has_context_sensitive_indicator (const char *word, const size_t size) |
static void | allocate_str_removing_asterisk (const char *word, const size_t size, char **const out_str) |
static COB_INLINE COB_A_INLINE void | initialize_word (const char *word, const size_t size, struct reserved_word_list *const reserved) |
static void | initialize_alias_for (const char *alias_for, struct reserved_word_list *const reserved, const char *fname, const int line) |
static void | add_reserved_word_without_init (const char *word, const char *fname, const int line) |
static void | initialize_user_res_list_if_needed (void) |
static size_t | get_length_of_user_res_list (void) |
static COB_INLINE COB_A_INLINE struct cobc_reserved * | find_default_reserved_word (struct cobc_reserved *to_find) |
static struct cobc_reserved | get_user_specified_reserved_word (struct reserved_word_list user_reserved) |
static COB_INLINE COB_A_INLINE void | pop_reserved_word (const enum free_word_action action) |
static void | get_reserved_words_from_user_list (void) |
static void | get_reserved_words_from_default_list (void) |
static void | initialize_reserved_words_if_needed (void) |
cb_tree | lookup_system_name (const char *name) |
void | remove_reserved_word (const char *word) |
void | add_reserved_word (const char *word, const char *fname, const int line) |
struct cobc_reserved * | lookup_reserved_word (const char *name) |
struct cb_intrinsic_table * | lookup_intrinsic (const char *name, const int checkres, const int checkimpl) |
void | cb_list_reserved (void) |
void | cb_list_intrinsics (void) |
void | cb_list_mnemonics (void) |
void | cobc_init_reserved (void) |
Variables | |
struct reserved_word_list * | cobc_user_res_list = ((void*)0) |
static const struct system_struct | system_table [] |
static const struct system_struct | ext_system_table [] |
static struct cobc_reserved * | reserved_words |
static struct cobc_reserved | default_reserved_words [] |
static size_t | num_reserved_words |
static const struct cb_intrinsic_table | function_list [] |
static unsigned char | cob_lower_tab [256] |
static const unsigned char | pcob_lower_tab [] = "abcdefghijklmnopqrstuvwxyz" |
static const unsigned char | pcob_lower_val [] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
#define EXT_SYSTEM_TAB_SIZE sizeof(ext_system_table) / sizeof(struct system_struct) |
Definition at line 188 of file reserved.c.
Referenced by cb_list_mnemonics(), and lookup_system_name().
#define NUM_DEFAULT_RESERVED_WORDS sizeof (default_reserved_words) / sizeof (struct cobc_reserved) |
Definition at line 1954 of file reserved.c.
Referenced by find_default_reserved_word(), get_reserved_words_from_default_list(), and initialize_user_res_list_if_needed().
#define NUM_INTRINSICS sizeof(function_list) / sizeof(struct cb_intrinsic_table) |
Definition at line 2490 of file reserved.c.
Referenced by cb_list_intrinsics(), and lookup_intrinsic().
#define SYSTEM_TAB_SIZE sizeof(system_table) / sizeof(struct system_struct) |
Definition at line 114 of file reserved.c.
Referenced by cb_list_mnemonics(), and lookup_system_name().
enum free_word_action |
Enumerator | |
---|---|
FREE_WORD_STR | |
DONT_FREE_WORD_STR |
Definition at line 2613 of file reserved.c.
void add_reserved_word | ( | const char * | word, |
const char * | fname, | ||
const int | line | ||
) |
Definition at line 2903 of file reserved.c.
References add_reserved_word_without_init(), and initialize_user_res_list_if_needed().
Referenced by cb_config_entry().
|
static |
Definition at line 2683 of file reserved.c.
References reserved_word_list::alias_for, cob_strcasecmp(), cobc_main_malloc(), cobc_user_res_list, has_context_sensitive_indicator(), initialize_alias_for(), initialize_word(), reserved_word_list::is_context_sensitive, reserved_word_list::next, NULL, and reserved_word_list::word.
Referenced by add_reserved_word(), and initialize_user_res_list_if_needed().
|
static |
Definition at line 2646 of file reserved.c.
References cobc_main_malloc(), and has_context_sensitive_indicator().
Referenced by initialize_alias_for(), and initialize_word().
void cb_list_intrinsics | ( | void | ) |
Definition at line 3052 of file reserved.c.
References _, cb_intrinsic_table::args, cob_free(), cob_malloc(), cb_intrinsic_table::implemented, cb_intrinsic_table::min_args, and NUM_INTRINSICS.
Referenced by process_command_line().
void cb_list_mnemonics | ( | void | ) |
Definition at line 3101 of file reserved.c.
References _, cb_intrinsic_table::category, EXT_SYSTEM_TAB_SIZE, res_get_feature(), and SYSTEM_TAB_SIZE.
Referenced by process_command_line().
void cb_list_reserved | ( | void | ) |
Definition at line 2989 of file reserved.c.
References _, initialize_reserved_words_if_needed(), num_reserved_words, and cb_intrinsic_table::token.
Referenced by process_command_line().
|
static |
Definition at line 2530 of file reserved.c.
References cob_lower_tab.
Referenced by add_reserved_word_without_init(), intrinsic_comp(), lookup_system_name(), remove_reserved_word(), and reserve_comp().
void cobc_init_reserved | ( | void | ) |
Definition at line 3133 of file reserved.c.
References cob_lower_tab, pcob_lower_tab, and pcob_lower_val.
Referenced by main().
|
static |
Definition at line 2599 of file reserved.c.
References cobc_reserved::context_sens, cobc_reserved::context_set, cobc_reserved::context_test, cobc_reserved::name, cobc_reserved::nodegen, and cobc_reserved::token.
Referenced by get_reserved_words_from_user_list(), get_user_specified_reserved_word(), and lookup_reserved_word().
|
static |
Definition at line 2619 of file reserved.c.
References reserved_word_list::alias_for, cobc_main_free(), FREE_WORD_STR, reserved_word_list::next, and reserved_word_list::word.
Referenced by pop_reserved_word(), and remove_reserved_word().
|
static |
Definition at line 2752 of file reserved.c.
References NUM_DEFAULT_RESERVED_WORDS, and reserve_comp().
Referenced by get_reserved_words_from_user_list(), and get_user_specified_reserved_word().
|
static |
Definition at line 2742 of file reserved.c.
References cobc_user_res_list, and reserved_word_list::next.
Referenced by get_reserved_words_from_user_list().
|
static |
Definition at line 2839 of file reserved.c.
References default_reserved_words, NUM_DEFAULT_RESERVED_WORDS, and num_reserved_words.
Referenced by initialize_reserved_words_if_needed().
|
static |
Definition at line 2793 of file reserved.c.
References cobc_main_malloc(), cobc_user_res_list, create_dummy_reserved(), DONT_FREE_WORD_STR, find_default_reserved_word(), FREE_WORD_STR, get_length_of_user_res_list(), get_user_specified_reserved_word(), num_reserved_words, pop_reserved_word(), reserve_comp(), and reserved_word_list::word.
Referenced by initialize_reserved_words_if_needed().
|
static |
Definition at line 2760 of file reserved.c.
References _, configuration_error(), cobc_reserved::context_sens, create_dummy_reserved(), find_default_reserved_word(), NULL, and cobc_reserved::token.
Referenced by get_reserved_words_from_user_list().
|
static |
Definition at line 2640 of file reserved.c.
Referenced by add_reserved_word_without_init(), allocate_str_removing_asterisk(), and initialize_alias_for().
|
static |
Definition at line 2670 of file reserved.c.
References _, reserved_word_list::alias_for, allocate_str_removing_asterisk(), configuration_warning(), and has_context_sensitive_indicator().
Referenced by add_reserved_word_without_init().
|
static |
Definition at line 2846 of file reserved.c.
References get_reserved_words_from_default_list(), and get_reserved_words_from_user_list().
Referenced by cb_list_reserved(), and lookup_reserved_word().
|
static |
Definition at line 2725 of file reserved.c.
References add_reserved_word_without_init(), likely, NULL, and NUM_DEFAULT_RESERVED_WORDS.
Referenced by add_reserved_word(), and remove_reserved_word().
|
static |
Definition at line 2663 of file reserved.c.
References allocate_str_removing_asterisk(), and reserved_word_list::word.
Referenced by add_reserved_word_without_init().
|
static |
Definition at line 2571 of file reserved.c.
References cob_strcasecmp(), and cb_intrinsic_table::name.
Referenced by lookup_intrinsic().
struct cb_intrinsic_table* lookup_intrinsic | ( | const char * | name, |
const int | checkres, | ||
const int | checkimpl | ||
) |
Definition at line 2976 of file reserved.c.
References cb_intrinsic_table::implemented, intrinsic_comp(), NULL, and NUM_INTRINSICS.
Referenced by cb_build_any_intrinsic(), cb_build_intrinsic(), cobc_deciph_funcs(), and yylex().
struct cobc_reserved* lookup_reserved_word | ( | const char * | name | ) |
Definition at line 2910 of file reserved.c.
References _, CB_CS_PROGRAM_ID, cb_error(), cobc_cs_check, cobc_force_literal, cobc_in_procedure, cobc_in_repository, cobc_reserved::context_sens, cobc_reserved::context_set, cobc_reserved::context_test, create_dummy_reserved(), FUNCTION_ID, initialize_reserved_words_if_needed(), INTRINSIC, NULL, num_reserved_words, PROGRAM_ID, REPOSITORY, reserve_comp(), cobc_reserved::token, and unlikely.
Referenced by yylex().
cb_tree lookup_system_name | ( | const char * | name | ) |
Definition at line 2860 of file reserved.c.
References cb_build_system_name(), cob_strcasecmp(), EXT_SYSTEM_TAB_SIZE, NULL, SYSTEM_TAB_SIZE, and cobc_reserved::token.
Referenced by cb_build_display_name(), cb_define_system_name(), cb_emit_accept_name(), and yyparse().
|
static |
Definition at line 2787 of file reserved.c.
References delete_reserved_word_from_list(), and NULL.
Referenced by get_reserved_words_from_user_list().
void remove_reserved_word | ( | const char * | word | ) |
Definition at line 2882 of file reserved.c.
References cob_strcasecmp(), delete_reserved_word_from_list(), FREE_WORD_STR, initialize_user_res_list_if_needed(), reserved_word_list::next, NULL, and reserved_word_list::word.
Referenced by cb_config_entry().
|
static |
Definition at line 2577 of file reserved.c.
References _, CB_DEVICE_NAME, CB_FEATURE_NAME, and CB_SWITCH_NAME.
Referenced by cb_list_mnemonics().
|
static |
Definition at line 2564 of file reserved.c.
References cob_strcasecmp(), and cb_intrinsic_table::name.
Referenced by find_default_reserved_word(), get_reserved_words_from_user_list(), and lookup_reserved_word().
|
static |
Definition at line 2522 of file reserved.c.
Referenced by cob_strcasecmp(), and cobc_init_reserved().
struct reserved_word_list* cobc_user_res_list = ((void*)0) |
Definition at line 36 of file reserved.c.
Referenced by add_reserved_word_without_init(), get_length_of_user_res_list(), and get_reserved_words_from_user_list().
|
static |
Definition at line 200 of file reserved.c.
Referenced by get_reserved_words_from_default_list().
|
static |
Definition at line 116 of file reserved.c.
|
static |
Definition at line 1965 of file reserved.c.
|
static |
Definition at line 1953 of file reserved.c.
Referenced by cb_list_reserved(), get_reserved_words_from_default_list(), get_reserved_words_from_user_list(), and lookup_reserved_word().
|
static |
Definition at line 2523 of file reserved.c.
Referenced by cobc_init_reserved().
|
static |
Definition at line 2524 of file reserved.c.
Referenced by cobc_init_reserved().
|
static |
Definition at line 198 of file reserved.c.
|
static |
Definition at line 46 of file reserved.c.