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 <limits.h>
#include "cobc.h"
#include "tree.h"
Go to the source code of this file.
Functions | |
int | cb_get_level (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) |
struct cb_field * | cb_resolve_redefines (struct cb_field *field, cb_tree redefines) |
static void | validate_field_clauses (cb_tree x, struct cb_field *f) |
static unsigned int | check_picture_item (cb_tree x, struct cb_field *f) |
static unsigned int | validate_field_1 (struct cb_field *f) |
static void | setup_parameters (struct cb_field *f) |
static void | compute_binary_size (struct cb_field *f, const int size) |
static int | compute_size (struct cb_field *f) |
static int | validate_field_value (struct cb_field *f) |
void | cb_validate_field (struct cb_field *f) |
void | cb_validate_88_item (struct cb_field *f) |
struct cb_field * | cb_validate_78_item (struct cb_field *f, const cob_u32_t no78add) |
void | cb_clear_real_field (void) |
struct cb_field * | cb_get_real_field (void) |
Variables | |
cb_tree | cb_depend_check = ((void*)0) |
size_t | cb_needs_01 = 0 |
static struct cb_field * | last_real_field = ((void*)0) |
static int | occur_align_size = 0 |
static const int | pic_digits [] = { 2, 4, 7, 9, 12, 14, 16, 18 } |
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 | ||
) |
Definition at line 90 of file field.c.
References _, cb_build_field(), cb_build_filler(), CB_CHAIN, cb_error_node, cb_error_x(), CB_FIELD, cb_field_founder(), CB_FIELD_P, cb_get_level(), cb_needs_01, CB_REFERENCE, CB_STORAGE_FILE, CB_TREE, CB_VALUE, cb_warning_x(), cb_field::children, cb_word::count, current_program, cb_field::flag_external, cb_file::flag_external, cb_field::flag_filler, cb_reference::flag_filler_ref, cb_file::flag_global, cb_program::flag_has_external, cb_field::flag_is_global, cb_field::flag_item_78, cb_field::flag_sign_leading, cb_field::flag_sign_separate, cb_field::indexes, cb_word::items, cb_field::level, NULL, cb_field::parent, redefinition_warning(), cb_field::sister, cb_field::storage, cb_field::usage, and cb_reference::word.
Referenced by cb_build_debug_item(), and yyparse().
void cb_clear_real_field | ( | void | ) |
Definition at line 1439 of file field.c.
References NULL.
Referenced by cb_build_program(), and yyparse().
int cb_get_level | ( | cb_tree | x | ) |
Definition at line 46 of file field.c.
References _, cb_error_x(), CB_INVALID_TREE, CB_NAME, cb_field::level, and cb_field::name.
Referenced by cb_build_field_tree(), and yyparse().
struct cb_field* cb_get_real_field | ( | void | ) |
Definition at line 1445 of file field.c.
References last_real_field.
Referenced by yyparse().
Definition at line 247 of file field.c.
References _, CB_CHAIN, cb_error_x(), CB_FIELD_P, CB_FIELD_PTR, CB_NAME, CB_REFERENCE, CB_TREE, CB_VALUE, cb_reference::chain, cb_field::children, cb_word::items, cb_field::level, cb_field::name, NULL, cb_field::parent, cb_field::redefines, cb_field::sister, cb_reference::subs, undefined_error(), and cb_reference::word.
Referenced by yyparse().
Definition at line 1415 of file field.c.
References cb_add_78(), CB_INVALID_TREE, CB_TREE, CB_VALUE, cob_u32_t, cb_field::flag_occurs, last_real_field, level_except_error(), level_require_error(), cb_field::pic, and cb_field::values.
Referenced by cb_add_const_var(), cb_build_symbolic_chars(), and yyparse().
void cb_validate_88_item | ( | struct cb_field * | f | ) |
Definition at line 1386 of file field.c.
References _, CB_CHAIN, CB_CLASS_NUMERIC, cb_error_x(), cb_high, cb_low, cb_quote, cb_space, CB_TREE, CB_TREE_CLASS, CB_VALID_TREE, CB_VALUE, cb_field::flag_occurs, level_except_error(), level_require_error(), cb_field::parent, cb_field::pic, and cb_field::values.
Referenced by yyparse().
void cb_validate_field | ( | struct cb_field * | f | ) |
Definition at line 1338 of file field.c.
References CB_STORAGE_LINKAGE, CB_STORAGE_LOCAL, cb_field::children, compute_size(), cb_field::count, cb_field::flag_base, cb_field::flag_invalid, cb_field::flag_is_global, cb_field::flag_is_verified, cb_field::flag_item_78, cb_field::flag_item_based, cb_field::flag_local, cb_field::memory_size, occur_align_size, cb_field::occurs_max, cb_field::redefines, setup_parameters(), cb_field::sister, cb_field::size, cb_field::storage, validate_field_1(), and validate_field_value().
Referenced by cb_build_const_length(), cb_build_debug_item(), cb_build_implicit_field(), cb_build_index(), cb_build_registers(), cb_validate_program_data(), finalize_file(), and yyparse().
Definition at line 333 of file field.c.
References _, cb_picture::category, cb_build_picture(), CB_CATEGORY_ALPHANUMERIC, CB_CATEGORY_NUMERIC, cb_error_node, cb_error_x(), CB_FIELD_PTR, CB_LITERAL, cb_name(), CB_NUMERIC_LITERAL_P, CB_PICTURE, CB_STORAGE_SCREEN, CB_USAGE_COMP_5, CB_USAGE_DISPLAY, CB_VALUE, cb_warning_x(), cb_field::count, cb_field::flag_item_78, cb_field::flag_no_field, cb_field::level, level_require_error(), cb_field::pic, cb_literal::scale, cb_field::screen_from, cb_field::screen_to, cb_literal::sign, cb_literal::size, cb_field::storage, cb_field::usage, cb_field::values, and warningopt.
Referenced by validate_field_1().
|
static |
Definition at line 921 of file field.c.
References CB_BINARY_SIZE_1_2_4_8, CB_BINARY_SIZE_1__8, CB_BINARY_SIZE_2_4_8, cb_field::flag_real_binary, cb_picture::have_sign, cb_field::pic, and cb_field::size.
Referenced by compute_size().
|
static |
Definition at line 1090 of file field.c.
References _, cb_picture::category, CB_CATEGORY_ALPHANUMERIC, cb_error_x(), cb_name(), CB_TREE, CB_USAGE_BINARY, CB_USAGE_COMP_5, CB_USAGE_COMP_6, CB_USAGE_COMP_X, CB_USAGE_DISPLAY, CB_USAGE_DOUBLE, CB_USAGE_FLOAT, CB_USAGE_FP_BIN128, CB_USAGE_FP_BIN32, CB_USAGE_FP_BIN64, CB_USAGE_FP_DEC128, CB_USAGE_FP_DEC64, CB_USAGE_INDEX, CB_USAGE_LENGTH, CB_USAGE_LONG_DOUBLE, CB_USAGE_OBJECT, CB_USAGE_PACKED, CB_USAGE_POINTER, CB_USAGE_PROGRAM, CB_USAGE_PROGRAM_POINTER, cb_verify(), cb_warning_x(), cb_field::children, COB_MAX_BINARY, COB_MAX_FIELD_SIZE, cob_u64_t, COBC_ABORT, cobc_abort_pr(), compute_binary_size(), cb_field::flag_binary_swap, cb_field::flag_external, cb_field::flag_sign_separate, cb_field::flag_synchronized, cb_picture::have_sign, cb_field::level, cb_field::name, occur_align_size, cb_field::occurs_max, cb_field::offset, cb_field::pic, cb_field::redefines, cb_field::rename_thru, cb_field::sister, cb_picture::size, cb_field::size, cb_field::usage, and warningopt.
Referenced by cb_validate_field().
|
static |
Definition at line 845 of file field.c.
References cb_picture::category, cb_build_picture(), CB_BYTEORDER_BIG_ENDIAN, CB_CATEGORY_ALPHANUMERIC, CB_PICTURE, CB_USAGE_BINARY, CB_USAGE_COMP_5, CB_USAGE_COMP_X, CB_USAGE_DOUBLE, CB_USAGE_FLOAT, CB_USAGE_FP_DEC128, CB_USAGE_FP_DEC64, CB_USAGE_INDEX, CB_USAGE_LENGTH, CB_USAGE_POINTER, CB_USAGE_PROGRAM_POINTER, cb_field::children, cb_field::flag_binary_swap, cb_field::flag_local, cb_field::pic, pic_digits, cb_field::sister, cb_picture::size, and cb_field::usage.
Referenced by cb_validate_field().
|
static |
Definition at line 418 of file field.c.
References _, cb_picture::category, cb_build_binary_picture(), cb_build_picture(), CB_CATEGORY_ALPHABETIC, CB_CATEGORY_ALPHANUMERIC, CB_CATEGORY_NUMERIC, CB_CATEGORY_NUMERIC_EDITED, CB_CHAIN, cb_error_x(), CB_FIELD_PTR, cb_field_variable_size(), cb_list_add(), cb_name(), CB_PAIR_P, CB_PICTURE, CB_STORAGE_FILE, CB_STORAGE_LINKAGE, CB_STORAGE_LOCAL, CB_STORAGE_SCREEN, CB_STORAGE_WORKING, CB_TREE, CB_USAGE_BINARY, CB_USAGE_BIT, CB_USAGE_COMP_5, CB_USAGE_COMP_6, CB_USAGE_COMP_X, CB_USAGE_DISPLAY, CB_USAGE_DOUBLE, CB_USAGE_FLOAT, CB_USAGE_FP_BIN128, CB_USAGE_FP_BIN32, CB_USAGE_FP_BIN64, CB_USAGE_FP_DEC128, CB_USAGE_FP_DEC64, CB_USAGE_INDEX, CB_USAGE_LENGTH, CB_USAGE_LONG_DOUBLE, CB_USAGE_OBJECT, CB_USAGE_PACKED, CB_USAGE_POINTER, CB_USAGE_PROGRAM, CB_USAGE_PROGRAM_POINTER, CB_USAGE_SIGNED_CHAR, CB_USAGE_SIGNED_INT, CB_USAGE_SIGNED_LONG, CB_USAGE_SIGNED_SHORT, CB_USAGE_UNSIGNED_CHAR, CB_USAGE_UNSIGNED_INT, CB_USAGE_UNSIGNED_LONG, CB_USAGE_UNSIGNED_SHORT, CB_VALUE, cb_verify(), cb_warning_x(), check_picture_item(), cb_field::children, cobc_parse_malloc(), cb_field::count, current_program, cb_field::depending, cb_picture::digits, cb_field::flag_any_length, cb_field::flag_any_numeric, cb_field::flag_blank_zero, cb_field::flag_external, cb_field::flag_invalid, cb_field::flag_is_global, cb_field::flag_item_based, cb_field::flag_justified, cb_field::flag_occurs, cb_field::flag_real_binary, cb_field::flag_sign_leading, cb_field::flag_sign_separate, cb_program::flag_trailing_separate, group_error(), cb_picture::have_sign, cb_field::index_list, cb_picture::lenstr, cb_field::level, level_except_error(), level_redundant_error(), level_require_error(), cb_field::name, NULL, cb_field::parent, cb_field::pic, cb_field::redefines, cb_picture::scale, cb_field::screen_from, cb_field::screen_to, cb_field::sister, cb_picture::size, cb_field::storage, cb_picture::str, cb_field::usage, validate_field_clauses(), and cb_field::values.
Referenced by cb_validate_field().
Definition at line 322 of file field.c.
References _, cb_error_x(), cb_field::flag_blank_zero, cb_field::flag_sign_leading, and cb_field::flag_sign_separate.
Referenced by validate_field_1().
|
static |
Definition at line 1322 of file field.c.
References CB_TREE, CB_VALUE, cb_field::children, cb_field::sister, validate_move(), and cb_field::values.
Referenced by cb_validate_field().
cb_tree cb_depend_check = ((void*)0) |
Definition at line 36 of file field.c.
Referenced by cb_validate_program_data().
size_t cb_needs_01 = 0 |
Definition at line 37 of file field.c.
Referenced by cb_build_field_tree(), cb_validate_program_data(), and yyparse().
|
static |
Definition at line 41 of file field.c.
Referenced by cb_get_real_field(), and cb_validate_78_item().
|
static |
Definition at line 42 of file field.c.
Referenced by cb_validate_field(), and compute_size().
|
static |
Definition at line 43 of file field.c.
Referenced by setup_parameters().