OpenCOBOL 1.1pre-rel
Classes | Defines | Typedefs | Enumerations | Functions | Variables
tree.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cb_tree_common
struct  cb_const
struct  cb_integer
struct  cb_string
struct  cb_alphabet_name
struct  cb_class_name
struct  cb_locale_name
struct  cb_system_name
struct  cb_literal
struct  cb_decimal
struct  cb_picture
struct  cb_field
struct  cb_field::cb_key
struct  cb_label
struct  handler_struct
struct  cb_alt_key
struct  cb_file
struct  cb_word
struct  cb_reference
struct  cb_binary_op
struct  cb_funcall
struct  cb_cast
struct  cb_assign
struct  cb_intrinsic_table
struct  cb_intrinsic
struct  cb_initialize
struct  cb_search
struct  cb_call
struct  cb_goto
struct  cb_if
struct  cb_perform_varying
struct  cb_perform
struct  cb_statement
struct  cb_continue
struct  cb_list
struct  cb_program

Defines

#define YYSTYPE   cb_tree
#define CB_BEFORE   cb_int0
#define CB_AFTER   cb_int1
#define COB_MAX_SUBSCRIPTS   16
#define CB_PREFIX_ATTR   "a_"
#define CB_PREFIX_BASE   "b_"
#define CB_PREFIX_CONST   "c_"
#define CB_PREFIX_DECIMAL   "d_"
#define CB_PREFIX_FIELD   "f_"
#define CB_PREFIX_FILE   "h_"
#define CB_PREFIX_KEYS   "k_"
#define CB_PREFIX_LABEL   "l_"
#define CB_PREFIX_SEQUENCE   "s_"
#define CB_PROGRAM_TYPE   0
#define CB_FUNCTION_TYPE   1
#define CB_TREE(x)   ((struct cb_tree_common *) (x))
#define CB_TREE_TAG(x)   (CB_TREE (x)->tag)
#define CB_TREE_CLASS(x)   cb_tree_class (CB_TREE (x))
#define CB_TREE_CATEGORY(x)   cb_tree_category (CB_TREE (x))
#define CB_TREE_CAST(tg, ty, x)   ((ty *) (x))
#define CB_CONST(x)   (CB_TREE_CAST (CB_TAG_CONST, struct cb_const, x))
#define CB_CONST_P(x)   (CB_TREE_TAG (x) == CB_TAG_CONST)
#define CB_INTEGER(x)   (CB_TREE_CAST (CB_TAG_INTEGER, struct cb_integer, x))
#define CB_INTEGER_P(x)   (CB_TREE_TAG (x) == CB_TAG_INTEGER)
#define CB_STRING(x)   (CB_TREE_CAST (CB_TAG_STRING, struct cb_string, x))
#define CB_STRING_P(x)   (CB_TREE_TAG (x) == CB_TAG_STRING)
#define cb_build_string0(str)   cb_build_string (str, strlen ((char *)str))
#define CB_ALPHABET_NAME(x)   (CB_TREE_CAST (CB_TAG_ALPHABET_NAME, struct cb_alphabet_name, x))
#define CB_ALPHABET_NAME_P(x)   (CB_TREE_TAG (x) == CB_TAG_ALPHABET_NAME)
#define CB_CLASS_NAME(x)   (CB_TREE_CAST (CB_TAG_CLASS_NAME, struct cb_class_name, x))
#define CB_CLASS_NAME_P(x)   (CB_TREE_TAG (x) == CB_TAG_CLASS_NAME)
#define CB_LOCALE_NAME(x)   (CB_TREE_CAST (CB_TAG_LOCALE_NAME, struct cb_locale_name, x))
#define CB_LOCALE_NAME_P(x)   (CB_TREE_TAG (x) == CB_TAG_LOCALE_NAME)
#define CB_SYSTEM_NAME(x)   (CB_TREE_CAST (CB_TAG_SYSTEM_NAME, struct cb_system_name, x))
#define CB_SYSTEM_NAME_P(x)   (CB_TREE_TAG (x) == CB_TAG_SYSTEM_NAME)
#define CB_LITERAL(x)   (CB_TREE_CAST (CB_TAG_LITERAL, struct cb_literal, x))
#define CB_LITERAL_P(x)   (CB_TREE_TAG (x) == CB_TAG_LITERAL)
#define CB_NUMERIC_LITERAL_P(x)   (CB_LITERAL_P (x) && CB_TREE_CATEGORY (x) == CB_CATEGORY_NUMERIC)
#define CB_DECIMAL(x)   (CB_TREE_CAST (CB_TAG_DECIMAL, struct cb_decimal, x))
#define CB_DECIMAL_P(x)   (CB_TREE_TAG (x) == CB_TAG_DECIMAL)
#define CB_PICTURE(x)   (CB_TREE_CAST (CB_TAG_PICTURE, struct cb_picture, x))
#define CB_PICTURE_P(x)   (CB_TREE_TAG (x) == CB_TAG_PICTURE)
#define CB_FIELD(x)   (CB_TREE_CAST (CB_TAG_FIELD, struct cb_field, x))
#define CB_FIELD_P(x)   (CB_TREE_TAG (x) == CB_TAG_FIELD)
#define CB_REF_OR_FIELD_P(x)   ((CB_FIELD_P (x) || CB_REFERENCE_P (x)))
#define CB_INDEX_P(x)
#define CB_LABEL(x)   (CB_TREE_CAST (CB_TAG_LABEL, struct cb_label, x))
#define CB_LABEL_P(x)   (CB_TREE_TAG (x) == CB_TAG_LABEL)
#define CB_FILE(x)   (CB_TREE_CAST (CB_TAG_FILE, struct cb_file, x))
#define CB_FILE_P(x)   (CB_TREE_TAG (x) == CB_TAG_FILE)
#define CB_WORD_HASH_SIZE   133
#define CB_REFERENCE(x)   (CB_TREE_CAST (CB_TAG_REFERENCE, struct cb_reference, x))
#define CB_REFERENCE_P(x)   (CB_TREE_TAG (x) == CB_TAG_REFERENCE)
#define CB_NAME(x)   (CB_REFERENCE (x)->word->name)
#define CB_BINARY_OP(x)   (CB_TREE_CAST (CB_TAG_BINARY_OP, struct cb_binary_op, x))
#define CB_BINARY_OP_P(x)   (CB_TREE_TAG (x) == CB_TAG_BINARY_OP)
#define cb_build_parenthesis(x)   cb_build_binary_op (x, '@', NULL)
#define cb_build_negation(x)   cb_build_binary_op (x, '!', NULL)
#define CB_FUNCALL(x)   (CB_TREE_CAST (CB_TAG_FUNCALL, struct cb_funcall, x))
#define CB_FUNCALL_P(x)   (CB_TREE_TAG (x) == CB_TAG_FUNCALL)
#define cb_build_funcall_0(f)   cb_build_funcall(f, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
#define cb_build_funcall_1(f, a1)   cb_build_funcall(f, 1, a1, NULL, NULL, NULL, NULL, NULL, NULL)
#define cb_build_funcall_2(f, a1, a2)   cb_build_funcall(f, 2, a1, a2, NULL, NULL, NULL, NULL, NULL)
#define cb_build_funcall_3(f, a1, a2, a3)   cb_build_funcall(f, 3, a1, a2, a3, NULL, NULL, NULL, NULL)
#define cb_build_funcall_4(f, a1, a2, a3, a4)   cb_build_funcall(f, 4, a1, a2, a3, a4, NULL, NULL, NULL)
#define cb_build_funcall_5(f, a1, a2, a3, a4, a5)   cb_build_funcall(f, 5, a1, a2, a3, a4, a5, NULL, NULL)
#define cb_build_funcall_6(f, a1, a2, a3, a4, a5, a6)   cb_build_funcall(f, 6, a1, a2, a3, a4, a5, a6, NULL)
#define cb_build_funcall_7(f, a1, a2, a3, a4, a5, a6, a7)   cb_build_funcall(f, 7, a1, a2, a3, a4, a5, a6, a7)
#define CB_CAST(x)   (CB_TREE_CAST (CB_TAG_CAST, struct cb_cast, x))
#define CB_CAST_P(x)   (CB_TREE_TAG (x) == CB_TAG_CAST)
#define cb_build_cast_integer(x)   cb_build_cast (CB_CAST_INTEGER, x)
#define cb_build_cast_address(x)   cb_build_cast (CB_CAST_ADDRESS, x)
#define cb_build_cast_addr_of_addr(x)   cb_build_cast (CB_CAST_ADDR_OF_ADDR, x)
#define cb_build_cast_length(x)   cb_build_cast (CB_CAST_LENGTH, x)
#define cb_build_cast_ppointer(x)   cb_build_cast (CB_CAST_PROGRAM_POINTER, x)
#define CB_ASSIGN(x)   (CB_TREE_CAST (CB_TAG_ASSIGN, struct cb_assign, x))
#define CB_ASSIGN_P(x)   (CB_TREE_TAG (x) == CB_TAG_ASSIGN)
#define CB_INTRINSIC(x)   (CB_TREE_CAST (CB_TAG_INTRINSIC, struct cb_intrinsic, x))
#define CB_INTRINSIC_P(x)   (CB_TREE_TAG (x) == CB_TAG_INTRINSIC)
#define CB_INITIALIZE(x)   (CB_TREE_CAST (CB_TAG_INITIALIZE, struct cb_initialize, x))
#define CB_INITIALIZE_P(x)   (CB_TREE_TAG (x) == CB_TAG_INITIALIZE)
#define CB_SEARCH(x)   (CB_TREE_CAST (CB_TAG_SEARCH, struct cb_search, x))
#define CB_SEARCH_P(x)   (CB_TREE_TAG (x) == CB_TAG_SEARCH)
#define CB_CALL_BY_REFERENCE   1
#define CB_CALL_BY_CONTENT   2
#define CB_CALL_BY_VALUE   3
#define CB_CALL(x)   (CB_TREE_CAST (CB_TAG_CALL, struct cb_call, x))
#define CB_CALL_P(x)   (CB_TREE_TAG (x) == CB_TAG_CALL)
#define CB_GOTO(x)   (CB_TREE_CAST (CB_TAG_GOTO, struct cb_goto, x))
#define CB_GOTO_P(x)   (CB_TREE_TAG (x) == CB_TAG_GOTO)
#define CB_IF(x)   (CB_TREE_CAST (CB_TAG_IF, struct cb_if, x))
#define CB_IF_P(x)   (CB_TREE_TAG (x) == CB_TAG_IF)
#define CB_PERFORM_VARYING(x)   (CB_TREE_CAST (CB_TAG_PERFORM_VARYING, struct cb_perform_varying, x))
#define CB_PERFORM(x)   (CB_TREE_CAST (CB_TAG_PERFORM, struct cb_perform, x))
#define CB_PERFORM_P(x)   (CB_TREE_TAG (x) == CB_TAG_PERFORM)
#define CB_STATEMENT(x)   (CB_TREE_CAST (CB_TAG_STATEMENT, struct cb_statement, x))
#define CB_STATEMENT_P(x)   (CB_TREE_TAG (x) == CB_TAG_STATEMENT)
#define CB_CONTINUE(x)   (CB_TREE_CAST (CB_TAG_CONTINUE, struct cb_continue, x))
#define CB_CONTINUE_P(x)   (CB_TREE_TAG (x) == CB_TAG_CONTINUE)
#define CB_LIST(x)   (CB_TREE_CAST (CB_TAG_LIST, struct cb_list, x))
#define CB_LIST_P(x)   (CB_TREE_TAG (x) == CB_TAG_LIST)
#define CB_PURPOSE(x)   (CB_LIST (x)->purpose)
#define CB_VALUE(x)   (CB_LIST (x)->value)
#define CB_CHAIN(x)   (CB_LIST (x)->chain)
#define CB_SIZES(x)   (CB_LIST (x)->sizes)
#define CB_PURPOSE_INT(x)   (CB_INTEGER (CB_PURPOSE (x))->val)
#define CB_SIZE_AUTO   0
#define CB_SIZE_1   1
#define CB_SIZE_2   2
#define CB_SIZE_4   3
#define CB_SIZE_8   4
#define CB_SIZE_UNSIGNED   8
#define CB_SIZES_INT(x)   ((CB_LIST (x)->sizes) & 0x07)
#define CB_SIZES_INT_UNSIGNED(x)   ((CB_LIST (x)->sizes) & CB_SIZE_UNSIGNED)
#define cb_list_init(x)   cb_build_list (NULL, x, NULL)
#define cb_cons(x, l)   cb_build_list (NULL, x, l)
#define CB_PAIR_P(x)   (CB_LIST_P (x) && CB_PAIR_X (x))
#define CB_PAIR_X(x)   CB_PURPOSE (x)
#define CB_PAIR_Y(x)   CB_VALUE (x)
#define cb_build_pair(x, y)   cb_build_list (x, y, NULL)

Typedefs

typedef struct cb_tree_commoncb_tree

Enumerations

enum  cb_tag {
  CB_TAG_CONST, CB_TAG_INTEGER, CB_TAG_STRING, CB_TAG_ALPHABET_NAME,
  CB_TAG_CLASS_NAME, CB_TAG_LOCALE_NAME, CB_TAG_SYSTEM_NAME, CB_TAG_LITERAL,
  CB_TAG_DECIMAL, CB_TAG_FIELD, CB_TAG_FILE, CB_TAG_REFERENCE,
  CB_TAG_BINARY_OP, CB_TAG_FUNCALL, CB_TAG_CAST, CB_TAG_INTRINSIC,
  CB_TAG_LABEL, CB_TAG_ASSIGN, CB_TAG_INITIALIZE, CB_TAG_SEARCH,
  CB_TAG_CALL, CB_TAG_GOTO, CB_TAG_IF, CB_TAG_PERFORM,
  CB_TAG_STATEMENT, CB_TAG_CONTINUE, CB_TAG_PERFORM_VARYING, CB_TAG_PICTURE,
  CB_TAG_LIST
}
enum  cb_alphabet_name_type {
  CB_ALPHABET_NATIVE, CB_ALPHABET_STANDARD_1, CB_ALPHABET_STANDARD_2, CB_ALPHABET_EBCDIC,
  CB_ALPHABET_CUSTOM
}
enum  cb_system_name_category {
  CB_CALL_CONVENTION_NAME, CB_CODE_NAME, CB_COMPUTER_NAME, CB_DEVICE_NAME,
  CB_ENTRY_CONVENTION_NAME, CB_EXTERNAL_LOCALE_NAME, CB_FEATURE_NAME, CB_LIBRARY_NAME,
  CB_SWITCH_NAME, CB_TEXT_NAME
}
enum  cb_device_name { CB_DEVICE_SYSIN, CB_DEVICE_SYSOUT, CB_DEVICE_SYSERR, CB_DEVICE_CONSOLE }
enum  cb_feature_name {
  CB_FEATURE_FORMFEED, CB_FEATURE_C01, CB_FEATURE_C02, CB_FEATURE_C03,
  CB_FEATURE_C04, CB_FEATURE_C05, CB_FEATURE_C06, CB_FEATURE_C07,
  CB_FEATURE_C08, CB_FEATURE_C09, CB_FEATURE_C10, CB_FEATURE_C11,
  CB_FEATURE_C12
}
enum  cb_switch_name {
  CB_SWITCH_1, CB_SWITCH_2, CB_SWITCH_3, CB_SWITCH_4,
  CB_SWITCH_5, CB_SWITCH_6, CB_SWITCH_7, CB_SWITCH_8
}
enum  cb_class {
  CB_CLASS_UNKNOWN, CB_CLASS_ALPHABETIC, CB_CLASS_ALPHANUMERIC, CB_CLASS_BOOLEAN,
  CB_CLASS_INDEX, CB_CLASS_NATIONAL, CB_CLASS_NUMERIC, CB_CLASS_OBJECT,
  CB_CLASS_POINTER
}
enum  cb_category {
  CB_CATEGORY_UNKNOWN, CB_CATEGORY_ALPHABETIC, CB_CATEGORY_ALPHANUMERIC, CB_CATEGORY_ALPHANUMERIC_EDITED,
  CB_CATEGORY_BOOLEAN, CB_CATEGORY_INDEX, CB_CATEGORY_NATIONAL, CB_CATEGORY_NATIONAL_EDITED,
  CB_CATEGORY_NUMERIC, CB_CATEGORY_NUMERIC_EDITED, CB_CATEGORY_OBJECT_REFERENCE, CB_CATEGORY_DATA_POINTER,
  CB_CATEGORY_PROGRAM_POINTER
}
enum  cb_storage {
  CB_STORAGE_CONSTANT, CB_STORAGE_FILE, CB_STORAGE_WORKING, CB_STORAGE_LOCAL,
  CB_STORAGE_LINKAGE, CB_STORAGE_SCREEN, CB_STORAGE_REPORT, CB_STORAGE_COMMUNICATION
}
enum  cb_usage {
  CB_USAGE_BINARY, CB_USAGE_BIT, CB_USAGE_COMP_5, CB_USAGE_COMP_X,
  CB_USAGE_DISPLAY, CB_USAGE_FLOAT, CB_USAGE_DOUBLE, CB_USAGE_INDEX,
  CB_USAGE_NATIONAL, CB_USAGE_OBJECT, CB_USAGE_PACKED, CB_USAGE_POINTER,
  CB_USAGE_PROGRAM, CB_USAGE_LENGTH, CB_USAGE_PROGRAM_POINTER, CB_USAGE_UNSIGNED_CHAR,
  CB_USAGE_SIGNED_CHAR, CB_USAGE_UNSIGNED_SHORT, CB_USAGE_SIGNED_SHORT, CB_USAGE_UNSIGNED_INT,
  CB_USAGE_SIGNED_INT, CB_USAGE_UNSIGNED_LONG, CB_USAGE_SIGNED_LONG
}
enum  cb_operand_type { CB_SENDING_OPERAND, CB_RECEIVING_OPERAND }
enum  cb_cast_type {
  CB_CAST_INTEGER, CB_CAST_ADDRESS, CB_CAST_ADDR_OF_ADDR, CB_CAST_LENGTH,
  CB_CAST_PROGRAM_POINTER
}
enum  cb_intr_enum {
  CB_INTR_ABS = 1, CB_INTR_ACOS, CB_INTR_ANNUITY, CB_INTR_ASIN,
  CB_INTR_ATAN, CB_INTR_BOOLEAN_OF_INTEGER, CB_INTR_BYTE_LENGTH, CB_INTR_CHAR,
  CB_INTR_CHAR_NATIONAL, CB_INTR_COMBINED_DATETIME, CB_INTR_CONCATENATE, CB_INTR_COS,
  CB_INTR_CURRENT_DATE, CB_INTR_DATE_OF_INTEGER, CB_INTR_DATE_TO_YYYYMMDD, CB_INTR_DAY_OF_INTEGER,
  CB_INTR_DAY_TO_YYYYDDD, CB_INTR_DISPLAY_OF, CB_INTR_E, CB_INTR_EXCEPTION_FILE,
  CB_INTR_EXCEPTION_FILE_N, CB_INTR_EXCEPTION_LOCATION, CB_INTR_EXCEPTION_LOCATION_N, CB_INTR_EXCEPTION_STATEMENT,
  CB_INTR_EXCEPTION_STATUS, CB_INTR_EXP, CB_INTR_EXP10, CB_INTR_FACTORIAL,
  CB_INTR_FRACTION_PART, CB_INTR_HIGHEST_ALGEBRAIC, CB_INTR_INTEGER, CB_INTR_INTEGER_OF_BOOLEAN,
  CB_INTR_INTEGER_OF_DATE, CB_INTR_INTEGER_OF_DAY, CB_INTR_INTEGER_PART, CB_INTR_LENGTH,
  CB_INTR_LOCALE_COMPARE, CB_INTR_LOCALE_DATE, CB_INTR_LOCALE_TIME, CB_INTR_LOCALE_TIME_FROM_SECS,
  CB_INTR_LOG, CB_INTR_LOG10, CB_INTR_LOWER_CASE, CB_INTR_LOWEST_ALGEBRAIC,
  CB_INTR_MAX, CB_INTR_MEAN, CB_INTR_MEDIAN, CB_INTR_MIDRANGE,
  CB_INTR_MIN, CB_INTR_MOD, CB_INTR_NATIONAL_OF, CB_INTR_NUMVAL,
  CB_INTR_NUMVAL_C, CB_INTR_NUMVAL_F, CB_INTR_ORD, CB_INTR_ORD_MAX,
  CB_INTR_ORD_MIN, CB_INTR_PI, CB_INTR_PRESENT_VALUE, CB_INTR_RANDOM,
  CB_INTR_RANGE, CB_INTR_REM, CB_INTR_REVERSE, CB_INTR_SECONDS_FROM_FORMATTED_TIME,
  CB_INTR_SECONDS_PAST_MIDNIGHT, CB_INTR_SIGN, CB_INTR_SIN, CB_INTR_SQRT,
  CB_INTR_STANDARD_COMPARE, CB_INTR_STANDARD_DEVIATION, CB_INTR_STORED_CHAR_LENGTH, CB_INTR_SUBSTITUTE,
  CB_INTR_SUBSTITUTE_CASE, CB_INTR_SUM, CB_INTR_TAN, CB_INTR_TEST_DATE_YYYYMMDD,
  CB_INTR_TEST_DAY_YYYYDDD, CB_INTR_TEST_NUMVAL, CB_INTR_TEST_NUMVAL_C, CB_INTR_TEST_NUMVAL_F,
  CB_INTR_TRIM, CB_INTR_UPPER_CASE, CB_INTR_VARIANCE, CB_INTR_WHEN_COMPILED,
  CB_INTR_YEAR_TO_YYYY
}
enum  cb_perform_type {
  CB_PERFORM_EXIT, CB_PERFORM_ONCE, CB_PERFORM_TIMES, CB_PERFORM_UNTIL,
  CB_PERFORM_FOREVER
}

Functions

char * cb_name (cb_tree x)
enum cb_class cb_tree_class (cb_tree x)
enum cb_category cb_tree_category (cb_tree x)
int cb_tree_type (cb_tree x)
int cb_fits_int (cb_tree x)
int cb_fits_long_long (cb_tree x)
int cb_get_int (cb_tree x)
long long cb_get_long_long (cb_tree x)
void cb_init_constants (void)
cb_tree cb_int (int n)
cb_tree cb_build_string (const unsigned char *data, size_t size)
cb_tree cb_build_alphabet_name (cb_tree name, enum cb_alphabet_name_type type)
cb_tree cb_build_class_name (cb_tree name, cb_tree list)
cb_tree cb_build_locale_name (cb_tree name, cb_tree list)
cb_tree cb_build_system_name (enum cb_system_name_category category, int token)
cb_tree cb_build_numeric_literal (int sign, const unsigned char *data, int scale)
cb_tree cb_build_alphanumeric_literal (const unsigned char *data, size_t size)
cb_tree cb_concat_literals (cb_tree x1, cb_tree x2)
cb_tree cb_build_decimal (int id)
cb_tree cb_build_picture (const char *str)
cb_tree cb_build_field (cb_tree name)
cb_tree cb_build_implicit_field (cb_tree name, int len)
cb_tree cb_build_constant (cb_tree name, cb_tree value)
struct cb_fieldcb_field (cb_tree x)
struct cb_fieldcb_field_add (struct cb_field *f, struct cb_field *p)
int cb_field_size (cb_tree x)
struct cb_fieldcb_field_founder (struct cb_field *f)
struct cb_fieldcb_field_variable_size (struct cb_field *f)
struct cb_fieldcb_field_variable_address (struct cb_field *f)
int cb_field_subordinate (struct cb_field *p, struct cb_field *f)
cb_tree cb_build_label (cb_tree name, struct cb_label *section)
struct cb_filebuild_file (cb_tree name)
void validate_file (struct cb_file *f, cb_tree name)
void finalize_file (struct cb_file *f, struct cb_field *records)
cb_tree cb_build_filler (void)
cb_tree cb_build_reference (const char *name)
cb_tree cb_build_field_reference (struct cb_field *f, cb_tree ref)
const char * cb_define (cb_tree name, cb_tree val)
void cb_define_system_name (const char *name)
cb_tree cb_ref (cb_tree x)
cb_tree cb_build_binary_op (cb_tree x, int op, cb_tree y)
cb_tree cb_build_binary_list (cb_tree l, int op)
cb_tree cb_build_funcall (const char *name, int argc, cb_tree a1, cb_tree a2, cb_tree a3, cb_tree a4, cb_tree a5, cb_tree a6, cb_tree a7)
cb_tree cb_build_cast (enum cb_cast_type type, cb_tree val)
cb_tree cb_build_assign (cb_tree var, cb_tree val)
struct cb_intrinsic_tablelookup_intrinsic (const char *name, const int checkres)
cb_tree cb_build_intrinsic (cb_tree name, cb_tree args, cb_tree refmod)
cb_tree cb_build_any_intrinsic (cb_tree args)
cb_tree cb_build_initialize (cb_tree var, cb_tree val, cb_tree rep, cb_tree def, int flag)
cb_tree cb_build_search (int flag_all, cb_tree table, cb_tree var, cb_tree end_stmt, cb_tree whens)
cb_tree cb_build_call (cb_tree name, cb_tree args, cb_tree stmt1, cb_tree stmt2, cb_tree returning, int is_system_call)
cb_tree cb_build_goto (cb_tree target, cb_tree depending)
cb_tree cb_build_if (cb_tree test, cb_tree stmt1, cb_tree stmt2)
cb_tree cb_build_perform (int type)
cb_tree cb_build_perform_varying (cb_tree name, cb_tree from, cb_tree step, cb_tree until)
struct cb_statementcb_build_statement (const char *name)
cb_tree cb_build_continue (void)
cb_tree cb_build_list (cb_tree purpose, cb_tree value, cb_tree rest)
cb_tree cb_list_add (cb_tree l, cb_tree x)
cb_tree cb_list_append (cb_tree l1, cb_tree l2)
cb_tree cb_list_reverse (cb_tree l)
int cb_list_length (cb_tree l)
struct cb_programcb_build_program (struct cb_program *last_program, int nest_level)
cb_tree lookup_system_name (const char *name)
int lookup_reserved_word (const char *name)
void cb_list_reserved (void)
void cb_list_intrinsics (void)
void cb_list_mnemonics (void)
void cb_init_reserved (void)
void cb_list_map (cb_tree(*func)(cb_tree x), cb_tree l)
void cb_warning_x (cb_tree x, const char *fmt,...)
void cb_error_x (cb_tree x, const char *fmt,...)
char * check_filler_name (char *name)
void redefinition_error (cb_tree x)
void redefinition_warning (cb_tree x, cb_tree y)
void undefined_error (cb_tree x)
void ambiguous_error (cb_tree x)
void group_error (cb_tree x, const char *clause)
void level_redundant_error (cb_tree x, const char *clause)
void level_require_error (cb_tree x, const char *clause)
void level_except_error (cb_tree x, const char *clause)
struct cb_literalbuild_literal (enum cb_category category, const unsigned char *data, size_t size)
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)
struct cb_fieldcb_resolve_redefines (struct cb_field *field, cb_tree redefines)
void cb_validate_field (struct cb_field *p)
void cb_validate_88_item (struct cb_field *p)
struct cb_fieldcb_validate_78_item (struct cb_field *p)
void cb_clear_real_field (void)
cb_tree cb_check_numeric_value (cb_tree x)
void cb_build_registers (void)
char * cb_encode_program_id (const char *name)
const char * cb_build_program_id (cb_tree name, cb_tree alt_name)
void cb_define_switch_name (cb_tree name, cb_tree sname, cb_tree flag, cb_tree ref)
cb_tree cb_build_section_name (cb_tree name, int sect_or_para)
cb_tree cb_build_assignment_name (struct cb_file *curfile, cb_tree name)
cb_tree cb_build_index (cb_tree name, cb_tree values, int indexed_by, struct cb_field *qual)
cb_tree cb_build_identifier (cb_tree x)
cb_tree cb_build_length (cb_tree x)
cb_tree cb_build_const_length (cb_tree x)
cb_tree cb_build_address (cb_tree x)
cb_tree cb_build_ppointer (cb_tree x)
void cb_validate_program_environment (struct cb_program *prog)
void cb_validate_program_data (struct cb_program *prog)
void cb_validate_program_body (struct cb_program *prog)
cb_tree cb_build_expr (cb_tree list)
cb_tree cb_build_cond (cb_tree x)
void cb_emit_arithmetic (cb_tree vars, int op, cb_tree val)
cb_tree cb_build_add (cb_tree v, cb_tree n, cb_tree round_opt)
cb_tree cb_build_sub (cb_tree v, cb_tree n, cb_tree round_opt)
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)
void cb_emit_move_corresponding (cb_tree x1, cb_tree x2)
void cb_emit_accept (cb_tree var, cb_tree pos, cb_tree fgc, cb_tree bgc, cb_tree scroll, int dispattrs)
void cb_emit_accept_line_or_col (cb_tree var, const int l_or_c)
void cb_emit_accept_date (cb_tree var)
void cb_emit_accept_date_yyyymmdd (cb_tree var)
void cb_emit_accept_day (cb_tree var)
void cb_emit_accept_day_yyyyddd (cb_tree var)
void cb_emit_accept_day_of_week (cb_tree var)
void cb_emit_accept_time (cb_tree var)
void cb_emit_accept_command_line (cb_tree var)
void cb_emit_get_environment (cb_tree envvar, cb_tree envval)
void cb_emit_accept_environment (cb_tree var)
void cb_emit_accept_mnemonic (cb_tree var, cb_tree mnemonic)
void cb_emit_accept_name (cb_tree var, cb_tree name)
void cb_emit_accept_arg_number (cb_tree var)
void cb_emit_accept_arg_value (cb_tree var)
void cb_emit_allocate (cb_tree target1, cb_tree target2, cb_tree size, cb_tree initialize)
void cb_emit_free (cb_tree vars)
void cb_emit_call (cb_tree prog, cb_tree using, cb_tree returning, cb_tree on_exception, cb_tree not_on_exception)
void cb_emit_cancel (cb_tree prog)
void cb_emit_close (cb_tree file, cb_tree opt)
void cb_emit_commit (void)
void cb_emit_continue (void)
void cb_emit_delete (cb_tree file)
void cb_emit_display (cb_tree values, cb_tree upon, cb_tree no_adv, cb_tree pos, cb_tree fgc, cb_tree bgc, cb_tree scroll, int dispattrs)
cb_tree cb_build_display_upon (cb_tree x)
cb_tree cb_build_display_upon_direct (cb_tree x)
void cb_emit_env_name (cb_tree value)
void cb_emit_env_value (cb_tree value)
void cb_emit_arg_number (cb_tree value)
void cb_emit_command_line (cb_tree value)
void cb_emit_divide (cb_tree dividend, cb_tree divisor, cb_tree quotient, cb_tree remainder)
void cb_emit_evaluate (cb_tree subject_list, cb_tree case_list)
void cb_emit_goto (cb_tree target, cb_tree depending)
void cb_emit_exit (size_t goback)
void cb_emit_if (cb_tree cond, cb_tree stmt1, cb_tree stmt2)
void cb_emit_initialize (cb_tree vars, cb_tree fillinit, cb_tree value, cb_tree replacing, cb_tree def)
void cb_emit_inspect (cb_tree var, cb_tree body, cb_tree replacing, int replconv)
void cb_init_tarrying (void)
cb_tree cb_build_tarrying_data (cb_tree x)
cb_tree cb_build_tarrying_characters (cb_tree l)
cb_tree cb_build_tarrying_all (void)
cb_tree cb_build_tarrying_leading (void)
cb_tree cb_build_tarrying_trailing (void)
cb_tree cb_build_tarrying_value (cb_tree x, cb_tree l)
cb_tree cb_build_replacing_characters (cb_tree x, cb_tree l)
cb_tree cb_build_replacing_all (cb_tree x, cb_tree y, cb_tree l)
cb_tree cb_build_replacing_leading (cb_tree x, cb_tree y, cb_tree l)
cb_tree cb_build_replacing_first (cb_tree x, cb_tree y, cb_tree l)
cb_tree cb_build_replacing_trailing (cb_tree x, cb_tree y, cb_tree l)
cb_tree cb_build_converting (cb_tree x, cb_tree y, cb_tree l)
cb_tree cb_build_inspect_region_start (void)
cb_tree cb_build_inspect_region (cb_tree l, cb_tree pos, cb_tree x)
int validate_move (cb_tree src, cb_tree dst, size_t is_value)
cb_tree cb_build_move (cb_tree src, cb_tree dst)
void cb_emit_move (cb_tree src, cb_tree dsts)
void cb_emit_open (cb_tree file, cb_tree mode, cb_tree sharing)
void cb_emit_perform (cb_tree perform, cb_tree body)
cb_tree cb_build_perform_once (cb_tree body)
cb_tree cb_build_perform_times (cb_tree count)
cb_tree cb_build_perform_until (cb_tree condition, cb_tree varying)
cb_tree cb_build_perform_forever (cb_tree body)
cb_tree cb_build_perform_exit (struct cb_label *label)
void cb_emit_read (cb_tree ref, cb_tree next, cb_tree into, cb_tree key, cb_tree lock_opts)
void cb_emit_rewrite (cb_tree record, cb_tree from, cb_tree lockopt)
void cb_emit_release (cb_tree ref, cb_tree from)
void cb_emit_return (cb_tree ref, cb_tree into)
void cb_emit_rollback (void)
void cb_emit_search (cb_tree table, cb_tree varying, cb_tree at_end, cb_tree whens)
void cb_emit_search_all (cb_tree table, cb_tree at_end, cb_tree when, cb_tree stmts)
void cb_emit_setenv (cb_tree x, cb_tree y)
void cb_emit_set_to (cb_tree l, cb_tree x)
void cb_emit_set_up_down (cb_tree l, cb_tree flag, cb_tree x)
void cb_emit_set_on_off (cb_tree l, cb_tree flag)
void cb_emit_set_true (cb_tree l)
void cb_emit_set_false (cb_tree l)
void cb_emit_sort_init (cb_tree name, cb_tree keys, cb_tree col)
void cb_emit_sort_using (cb_tree file, cb_tree l)
void cb_emit_sort_input (cb_tree proc)
void cb_emit_sort_giving (cb_tree file, cb_tree l)
void cb_emit_sort_output (cb_tree proc)
void cb_emit_sort_finish (cb_tree file)
void cb_emit_start (cb_tree file, cb_tree op, cb_tree key)
void cb_emit_stop_run (cb_tree x)
void cb_emit_string (cb_tree items, cb_tree into, cb_tree pointer)
void cb_emit_unlock (cb_tree ref)
void cb_emit_unstring (cb_tree name, cb_tree delimited, cb_tree into, cb_tree pointer, cb_tree tallying)
cb_tree cb_build_unstring_delimited (cb_tree all, cb_tree value)
cb_tree cb_build_unstring_into (cb_tree name, cb_tree delimiter, cb_tree count)
void cb_emit_write (cb_tree record, cb_tree from, cb_tree opt, cb_tree lockopt)
cb_tree cb_build_write_advancing_lines (cb_tree pos, cb_tree lines)
cb_tree cb_build_write_advancing_mnemonic (cb_tree pos, cb_tree mnemonic)
cb_tree cb_build_write_advancing_page (cb_tree pos)
void cobc_tree_cast_error (cb_tree x, const char *filen, const int linenum, const int tagnum)
void codegen (struct cb_program *prog, int nested)
void cb_set_in_procedure (void)
void cb_reset_in_procedure (void)
void cb_add_78 (struct cb_field *f)
void cb_reset_78 (void)
struct cb_fieldcheck_level_78 (const char *name)

Variables

cb_tree cb_any
cb_tree cb_true
cb_tree cb_false
cb_tree cb_null
cb_tree cb_zero
cb_tree cb_one
cb_tree cb_space
cb_tree cb_low
cb_tree cb_high
cb_tree cb_norm_low
cb_tree cb_norm_high
cb_tree cb_quote
cb_tree cb_int0
cb_tree cb_int1
cb_tree cb_int2
cb_tree cb_int3
cb_tree cb_int4
cb_tree cb_int5
cb_tree cb_i [8]
cb_tree cb_error_node
cb_tree cb_intr_whencomp
cb_tree cb_intr_pi
cb_tree cb_intr_e
cb_tree cb_standard_error_handler
size_t gen_screen_ptr
int non_const_word
size_t cb_needs_01

Define Documentation

#define CB_AFTER   cb_int1

Definition at line 27 of file tree.h.

#define CB_ALPHABET_NAME (   x)    (CB_TREE_CAST (CB_TAG_ALPHABET_NAME, struct cb_alphabet_name, x))

Definition at line 338 of file tree.h.

#define CB_ALPHABET_NAME_P (   x)    (CB_TREE_TAG (x) == CB_TAG_ALPHABET_NAME)

Definition at line 339 of file tree.h.

#define CB_ASSIGN (   x)    (CB_TREE_CAST (CB_TAG_ASSIGN, struct cb_assign, x))

Definition at line 799 of file tree.h.

#define CB_ASSIGN_P (   x)    (CB_TREE_TAG (x) == CB_TAG_ASSIGN)

Definition at line 800 of file tree.h.

#define CB_BEFORE   cb_int0

Definition at line 26 of file tree.h.

#define CB_BINARY_OP (   x)    (CB_TREE_CAST (CB_TAG_BINARY_OP, struct cb_binary_op, x))

Definition at line 711 of file tree.h.

#define CB_BINARY_OP_P (   x)    (CB_TREE_TAG (x) == CB_TAG_BINARY_OP)

Definition at line 712 of file tree.h.

#define cb_build_cast_addr_of_addr (   x)    cb_build_cast (CB_CAST_ADDR_OF_ADDR, x)

Definition at line 784 of file tree.h.

#define cb_build_cast_address (   x)    cb_build_cast (CB_CAST_ADDRESS, x)

Definition at line 783 of file tree.h.

#define cb_build_cast_integer (   x)    cb_build_cast (CB_CAST_INTEGER, x)

Definition at line 782 of file tree.h.

#define cb_build_cast_length (   x)    cb_build_cast (CB_CAST_LENGTH, x)

Definition at line 785 of file tree.h.

#define cb_build_cast_ppointer (   x)    cb_build_cast (CB_CAST_PROGRAM_POINTER, x)

Definition at line 786 of file tree.h.

#define cb_build_funcall_0 (   f)    cb_build_funcall(f, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL)

Definition at line 741 of file tree.h.

#define cb_build_funcall_1 (   f,
  a1 
)    cb_build_funcall(f, 1, a1, NULL, NULL, NULL, NULL, NULL, NULL)

Definition at line 743 of file tree.h.

#define cb_build_funcall_2 (   f,
  a1,
  a2 
)    cb_build_funcall(f, 2, a1, a2, NULL, NULL, NULL, NULL, NULL)

Definition at line 745 of file tree.h.

#define cb_build_funcall_3 (   f,
  a1,
  a2,
  a3 
)    cb_build_funcall(f, 3, a1, a2, a3, NULL, NULL, NULL, NULL)

Definition at line 747 of file tree.h.

#define cb_build_funcall_4 (   f,
  a1,
  a2,
  a3,
  a4 
)    cb_build_funcall(f, 4, a1, a2, a3, a4, NULL, NULL, NULL)

Definition at line 749 of file tree.h.

#define cb_build_funcall_5 (   f,
  a1,
  a2,
  a3,
  a4,
  a5 
)    cb_build_funcall(f, 5, a1, a2, a3, a4, a5, NULL, NULL)

Definition at line 751 of file tree.h.

#define cb_build_funcall_6 (   f,
  a1,
  a2,
  a3,
  a4,
  a5,
  a6 
)    cb_build_funcall(f, 6, a1, a2, a3, a4, a5, a6, NULL)

Definition at line 753 of file tree.h.

#define cb_build_funcall_7 (   f,
  a1,
  a2,
  a3,
  a4,
  a5,
  a6,
  a7 
)    cb_build_funcall(f, 7, a1, a2, a3, a4, a5, a6, a7)

Definition at line 755 of file tree.h.

#define cb_build_negation (   x)    cb_build_binary_op (x, '!', NULL)

Definition at line 715 of file tree.h.

#define cb_build_pair (   x,
 
)    cb_build_list (x, y, NULL)

Definition at line 1147 of file tree.h.

#define cb_build_parenthesis (   x)    cb_build_binary_op (x, '@', NULL)

Definition at line 714 of file tree.h.

#define cb_build_string0 (   str)    cb_build_string (str, strlen ((char *)str))

Definition at line 319 of file tree.h.

#define CB_CALL (   x)    (CB_TREE_CAST (CB_TAG_CALL, struct cb_call, x))

Definition at line 984 of file tree.h.

#define CB_CALL_BY_CONTENT   2

Definition at line 971 of file tree.h.

#define CB_CALL_BY_REFERENCE   1

Definition at line 970 of file tree.h.

#define CB_CALL_BY_VALUE   3

Definition at line 972 of file tree.h.

#define CB_CALL_P (   x)    (CB_TREE_TAG (x) == CB_TAG_CALL)

Definition at line 985 of file tree.h.

#define CB_CAST (   x)    (CB_TREE_CAST (CB_TAG_CAST, struct cb_cast, x))

Definition at line 777 of file tree.h.

#define CB_CAST_P (   x)    (CB_TREE_TAG (x) == CB_TAG_CAST)

Definition at line 778 of file tree.h.

#define CB_CHAIN (   x)    (CB_LIST (x)->chain)

Definition at line 1117 of file tree.h.

#define CB_CLASS_NAME (   x)    (CB_TREE_CAST (CB_TAG_CLASS_NAME, struct cb_class_name, x))

Definition at line 355 of file tree.h.

#define CB_CLASS_NAME_P (   x)    (CB_TREE_TAG (x) == CB_TAG_CLASS_NAME)

Definition at line 356 of file tree.h.

#define cb_cons (   x,
 
)    cb_build_list (NULL, x, l)

Definition at line 1139 of file tree.h.

#define CB_CONST (   x)    (CB_TREE_CAST (CB_TAG_CONST, struct cb_const, x))

Definition at line 285 of file tree.h.

#define CB_CONST_P (   x)    (CB_TREE_TAG (x) == CB_TAG_CONST)

Definition at line 286 of file tree.h.

#define CB_CONTINUE (   x)    (CB_TREE_CAST (CB_TAG_CONTINUE, struct cb_continue, x))

Definition at line 1094 of file tree.h.

#define CB_CONTINUE_P (   x)    (CB_TREE_TAG (x) == CB_TAG_CONTINUE)

Definition at line 1095 of file tree.h.

#define CB_DECIMAL (   x)    (CB_TREE_CAST (CB_TAG_DECIMAL, struct cb_decimal, x))

Definition at line 426 of file tree.h.

#define CB_DECIMAL_P (   x)    (CB_TREE_TAG (x) == CB_TAG_DECIMAL)

Definition at line 427 of file tree.h.

#define CB_FIELD (   x)    (CB_TREE_CAST (CB_TAG_FIELD, struct cb_field, x))

Definition at line 534 of file tree.h.

#define CB_FIELD_P (   x)    (CB_TREE_TAG (x) == CB_TAG_FIELD)

Definition at line 535 of file tree.h.

#define CB_FILE (   x)    (CB_TREE_CAST (CB_TAG_FILE, struct cb_file, x))

Definition at line 634 of file tree.h.

#define CB_FILE_P (   x)    (CB_TREE_TAG (x) == CB_TAG_FILE)

Definition at line 635 of file tree.h.

#define CB_FUNCALL (   x)    (CB_TREE_CAST (CB_TAG_FUNCALL, struct cb_funcall, x))

Definition at line 734 of file tree.h.

#define CB_FUNCALL_P (   x)    (CB_TREE_TAG (x) == CB_TAG_FUNCALL)

Definition at line 735 of file tree.h.

#define CB_FUNCTION_TYPE   1

Definition at line 42 of file tree.h.

#define CB_GOTO (   x)    (CB_TREE_CAST (CB_TAG_GOTO, struct cb_goto, x))

Definition at line 1001 of file tree.h.

#define CB_GOTO_P (   x)    (CB_TREE_TAG (x) == CB_TAG_GOTO)

Definition at line 1002 of file tree.h.

#define CB_IF (   x)    (CB_TREE_CAST (CB_TAG_IF, struct cb_if, x))

Definition at line 1018 of file tree.h.

#define CB_IF_P (   x)    (CB_TREE_TAG (x) == CB_TAG_IF)

Definition at line 1019 of file tree.h.

#define CB_INDEX_P (   x)
Value:

Definition at line 553 of file tree.h.

#define CB_INITIALIZE (   x)    (CB_TREE_CAST (CB_TAG_INITIALIZE, struct cb_initialize, x))

Definition at line 941 of file tree.h.

#define CB_INITIALIZE_P (   x)    (CB_TREE_TAG (x) == CB_TAG_INITIALIZE)

Definition at line 942 of file tree.h.

#define CB_INTEGER (   x)    (CB_TREE_CAST (CB_TAG_INTEGER, struct cb_integer, x))

Definition at line 300 of file tree.h.

#define CB_INTEGER_P (   x)    (CB_TREE_TAG (x) == CB_TAG_INTEGER)

Definition at line 301 of file tree.h.

#define CB_INTRINSIC (   x)    (CB_TREE_CAST (CB_TAG_INTRINSIC, struct cb_intrinsic, x))

Definition at line 917 of file tree.h.

#define CB_INTRINSIC_P (   x)    (CB_TREE_TAG (x) == CB_TAG_INTRINSIC)

Definition at line 918 of file tree.h.

#define CB_LABEL (   x)    (CB_TREE_CAST (CB_TAG_LABEL, struct cb_label, x))

Definition at line 578 of file tree.h.

#define CB_LABEL_P (   x)    (CB_TREE_TAG (x) == CB_TAG_LABEL)

Definition at line 579 of file tree.h.

#define CB_LIST (   x)    (CB_TREE_CAST (CB_TAG_LIST, struct cb_list, x))

Definition at line 1112 of file tree.h.

#define cb_list_init (   x)    cb_build_list (NULL, x, NULL)

Definition at line 1138 of file tree.h.

#define CB_LIST_P (   x)    (CB_TREE_TAG (x) == CB_TAG_LIST)

Definition at line 1113 of file tree.h.

#define CB_LITERAL (   x)    (CB_TREE_CAST (CB_TAG_LITERAL, struct cb_literal, x))

Definition at line 407 of file tree.h.

#define CB_LITERAL_P (   x)    (CB_TREE_TAG (x) == CB_TAG_LITERAL)

Definition at line 408 of file tree.h.

#define CB_LOCALE_NAME (   x)    (CB_TREE_CAST (CB_TAG_LOCALE_NAME, struct cb_locale_name, x))

Definition at line 372 of file tree.h.

#define CB_LOCALE_NAME_P (   x)    (CB_TREE_TAG (x) == CB_TAG_LOCALE_NAME)

Definition at line 373 of file tree.h.

#define CB_NAME (   x)    (CB_REFERENCE (x)->word->name)

Definition at line 672 of file tree.h.

#define CB_NUMERIC_LITERAL_P (   x)    (CB_LITERAL_P (x) && CB_TREE_CATEGORY (x) == CB_CATEGORY_NUMERIC)

Definition at line 409 of file tree.h.

#define CB_PAIR_P (   x)    (CB_LIST_P (x) && CB_PAIR_X (x))

Definition at line 1143 of file tree.h.

#define CB_PAIR_X (   x)    CB_PURPOSE (x)

Definition at line 1144 of file tree.h.

#define CB_PAIR_Y (   x)    CB_VALUE (x)

Definition at line 1145 of file tree.h.

#define CB_PERFORM (   x)    (CB_TREE_CAST (CB_TAG_PERFORM, struct cb_perform, x))

Definition at line 1057 of file tree.h.

#define CB_PERFORM_P (   x)    (CB_TREE_TAG (x) == CB_TAG_PERFORM)

Definition at line 1058 of file tree.h.

#define CB_PERFORM_VARYING (   x)    (CB_TREE_CAST (CB_TAG_PERFORM_VARYING, struct cb_perform_varying, x))

Definition at line 1055 of file tree.h.

#define CB_PICTURE (   x)    (CB_TREE_CAST (CB_TAG_PICTURE, struct cb_picture, x))

Definition at line 449 of file tree.h.

#define CB_PICTURE_P (   x)    (CB_TREE_TAG (x) == CB_TAG_PICTURE)

Definition at line 450 of file tree.h.

#define CB_PREFIX_ATTR   "a_"

Definition at line 31 of file tree.h.

#define CB_PREFIX_BASE   "b_"

Definition at line 32 of file tree.h.

#define CB_PREFIX_CONST   "c_"

Definition at line 33 of file tree.h.

#define CB_PREFIX_DECIMAL   "d_"

Definition at line 34 of file tree.h.

#define CB_PREFIX_FIELD   "f_"

Definition at line 35 of file tree.h.

#define CB_PREFIX_FILE   "h_"

Definition at line 36 of file tree.h.

#define CB_PREFIX_KEYS   "k_"

Definition at line 37 of file tree.h.

#define CB_PREFIX_LABEL   "l_"

Definition at line 38 of file tree.h.

#define CB_PREFIX_SEQUENCE   "s_"

Definition at line 39 of file tree.h.

#define CB_PROGRAM_TYPE   0

Definition at line 41 of file tree.h.

#define CB_PURPOSE (   x)    (CB_LIST (x)->purpose)

Definition at line 1115 of file tree.h.

#define CB_PURPOSE_INT (   x)    (CB_INTEGER (CB_PURPOSE (x))->val)

Definition at line 1120 of file tree.h.

#define CB_REF_OR_FIELD_P (   x)    ((CB_FIELD_P (x) || CB_REFERENCE_P (x)))

Definition at line 549 of file tree.h.

#define CB_REFERENCE (   x)    (CB_TREE_CAST (CB_TAG_REFERENCE, struct cb_reference, x))

Definition at line 669 of file tree.h.

#define CB_REFERENCE_P (   x)    (CB_TREE_TAG (x) == CB_TAG_REFERENCE)

Definition at line 670 of file tree.h.

#define CB_SEARCH (   x)    (CB_TREE_CAST (CB_TAG_SEARCH, struct cb_search, x))

Definition at line 960 of file tree.h.

#define CB_SEARCH_P (   x)    (CB_TREE_TAG (x) == CB_TAG_SEARCH)

Definition at line 961 of file tree.h.

#define CB_SIZE_1   1

Definition at line 1123 of file tree.h.

#define CB_SIZE_2   2

Definition at line 1124 of file tree.h.

#define CB_SIZE_4   3

Definition at line 1125 of file tree.h.

#define CB_SIZE_8   4

Definition at line 1126 of file tree.h.

#define CB_SIZE_AUTO   0

Definition at line 1122 of file tree.h.

#define CB_SIZE_UNSIGNED   8

Definition at line 1127 of file tree.h.

#define CB_SIZES (   x)    (CB_LIST (x)->sizes)

Definition at line 1118 of file tree.h.

#define CB_SIZES_INT (   x)    ((CB_LIST (x)->sizes) & 0x07)

Definition at line 1129 of file tree.h.

#define CB_SIZES_INT_UNSIGNED (   x)    ((CB_LIST (x)->sizes) & CB_SIZE_UNSIGNED)

Definition at line 1130 of file tree.h.

#define CB_STATEMENT (   x)    (CB_TREE_CAST (CB_TAG_STATEMENT, struct cb_statement, x))

Definition at line 1080 of file tree.h.

#define CB_STATEMENT_P (   x)    (CB_TREE_TAG (x) == CB_TAG_STATEMENT)

Definition at line 1081 of file tree.h.

#define CB_STRING (   x)    (CB_TREE_CAST (CB_TAG_STRING, struct cb_string, x))

Definition at line 316 of file tree.h.

#define CB_STRING_P (   x)    (CB_TREE_TAG (x) == CB_TAG_STRING)

Definition at line 317 of file tree.h.

#define CB_SYSTEM_NAME (   x)    (CB_TREE_CAST (CB_TAG_SYSTEM_NAME, struct cb_system_name, x))

Definition at line 387 of file tree.h.

#define CB_SYSTEM_NAME_P (   x)    (CB_TREE_TAG (x) == CB_TAG_SYSTEM_NAME)

Definition at line 388 of file tree.h.

#define CB_TREE (   x)    ((struct cb_tree_common *) (x))

Definition at line 219 of file tree.h.

#define CB_TREE_CAST (   tg,
  ty,
 
)    ((ty *) (x))

Definition at line 235 of file tree.h.

#define CB_TREE_CATEGORY (   x)    cb_tree_category (CB_TREE (x))

Definition at line 222 of file tree.h.

#define CB_TREE_CLASS (   x)    cb_tree_class (CB_TREE (x))

Definition at line 221 of file tree.h.

#define CB_TREE_TAG (   x)    (CB_TREE (x)->tag)

Definition at line 220 of file tree.h.

#define CB_VALUE (   x)    (CB_LIST (x)->value)

Definition at line 1116 of file tree.h.

#define CB_WORD_HASH_SIZE   133

Definition at line 646 of file tree.h.

#define COB_MAX_SUBSCRIPTS   16

Definition at line 29 of file tree.h.

#define YYSTYPE   cb_tree

Definition at line 24 of file tree.h.


Typedef Documentation

typedef struct cb_tree_common* cb_tree

Definition at line 217 of file tree.h.


Enumeration Type Documentation

Enumerator:
CB_ALPHABET_NATIVE 
CB_ALPHABET_STANDARD_1 
CB_ALPHABET_STANDARD_2 
CB_ALPHABET_EBCDIC 
CB_ALPHABET_CUSTOM 

Definition at line 80 of file tree.h.

Enumerator:
CB_CAST_INTEGER 
CB_CAST_ADDRESS 
CB_CAST_ADDR_OF_ADDR 
CB_CAST_LENGTH 
CB_CAST_PROGRAM_POINTER 

Definition at line 763 of file tree.h.

Enumerator:
CB_CATEGORY_UNKNOWN 
CB_CATEGORY_ALPHABETIC 
CB_CATEGORY_ALPHANUMERIC 
CB_CATEGORY_ALPHANUMERIC_EDITED 
CB_CATEGORY_BOOLEAN 
CB_CATEGORY_INDEX 
CB_CATEGORY_NATIONAL 
CB_CATEGORY_NATIONAL_EDITED 
CB_CATEGORY_NUMERIC 
CB_CATEGORY_NUMERIC_EDITED 
CB_CATEGORY_OBJECT_REFERENCE 
CB_CATEGORY_DATA_POINTER 
CB_CATEGORY_PROGRAM_POINTER 

Definition at line 147 of file tree.h.

enum cb_class
Enumerator:
CB_CLASS_UNKNOWN 
CB_CLASS_ALPHABETIC 
CB_CLASS_ALPHANUMERIC 
CB_CLASS_BOOLEAN 
CB_CLASS_INDEX 
CB_CLASS_NATIONAL 
CB_CLASS_NUMERIC 
CB_CLASS_OBJECT 
CB_CLASS_POINTER 

Definition at line 135 of file tree.h.

Enumerator:
CB_DEVICE_SYSIN 
CB_DEVICE_SYSOUT 
CB_DEVICE_SYSERR 
CB_DEVICE_CONSOLE 

Definition at line 101 of file tree.h.

Enumerator:
CB_FEATURE_FORMFEED 
CB_FEATURE_C01 
CB_FEATURE_C02 
CB_FEATURE_C03 
CB_FEATURE_C04 
CB_FEATURE_C05 
CB_FEATURE_C06 
CB_FEATURE_C07 
CB_FEATURE_C08 
CB_FEATURE_C09 
CB_FEATURE_C10 
CB_FEATURE_C11 
CB_FEATURE_C12 

Definition at line 108 of file tree.h.

Enumerator:
CB_INTR_ABS 
CB_INTR_ACOS 
CB_INTR_ANNUITY 
CB_INTR_ASIN 
CB_INTR_ATAN 
CB_INTR_BOOLEAN_OF_INTEGER 
CB_INTR_BYTE_LENGTH 
CB_INTR_CHAR 
CB_INTR_CHAR_NATIONAL 
CB_INTR_COMBINED_DATETIME 
CB_INTR_CONCATENATE 
CB_INTR_COS 
CB_INTR_CURRENT_DATE 
CB_INTR_DATE_OF_INTEGER 
CB_INTR_DATE_TO_YYYYMMDD 
CB_INTR_DAY_OF_INTEGER 
CB_INTR_DAY_TO_YYYYDDD 
CB_INTR_DISPLAY_OF 
CB_INTR_E 
CB_INTR_EXCEPTION_FILE 
CB_INTR_EXCEPTION_FILE_N 
CB_INTR_EXCEPTION_LOCATION 
CB_INTR_EXCEPTION_LOCATION_N 
CB_INTR_EXCEPTION_STATEMENT 
CB_INTR_EXCEPTION_STATUS 
CB_INTR_EXP 
CB_INTR_EXP10 
CB_INTR_FACTORIAL 
CB_INTR_FRACTION_PART 
CB_INTR_HIGHEST_ALGEBRAIC 
CB_INTR_INTEGER 
CB_INTR_INTEGER_OF_BOOLEAN 
CB_INTR_INTEGER_OF_DATE 
CB_INTR_INTEGER_OF_DAY 
CB_INTR_INTEGER_PART 
CB_INTR_LENGTH 
CB_INTR_LOCALE_COMPARE 
CB_INTR_LOCALE_DATE 
CB_INTR_LOCALE_TIME 
CB_INTR_LOCALE_TIME_FROM_SECS 
CB_INTR_LOG 
CB_INTR_LOG10 
CB_INTR_LOWER_CASE 
CB_INTR_LOWEST_ALGEBRAIC 
CB_INTR_MAX 
CB_INTR_MEAN 
CB_INTR_MEDIAN 
CB_INTR_MIDRANGE 
CB_INTR_MIN 
CB_INTR_MOD 
CB_INTR_NATIONAL_OF 
CB_INTR_NUMVAL 
CB_INTR_NUMVAL_C 
CB_INTR_NUMVAL_F 
CB_INTR_ORD 
CB_INTR_ORD_MAX 
CB_INTR_ORD_MIN 
CB_INTR_PI 
CB_INTR_PRESENT_VALUE 
CB_INTR_RANDOM 
CB_INTR_RANGE 
CB_INTR_REM 
CB_INTR_REVERSE 
CB_INTR_SECONDS_FROM_FORMATTED_TIME 
CB_INTR_SECONDS_PAST_MIDNIGHT 
CB_INTR_SIGN 
CB_INTR_SIN 
CB_INTR_SQRT 
CB_INTR_STANDARD_COMPARE 
CB_INTR_STANDARD_DEVIATION 
CB_INTR_STORED_CHAR_LENGTH 
CB_INTR_SUBSTITUTE 
CB_INTR_SUBSTITUTE_CASE 
CB_INTR_SUM 
CB_INTR_TAN 
CB_INTR_TEST_DATE_YYYYMMDD 
CB_INTR_TEST_DAY_YYYYDDD 
CB_INTR_TEST_NUMVAL 
CB_INTR_TEST_NUMVAL_C 
CB_INTR_TEST_NUMVAL_F 
CB_INTR_TRIM 
CB_INTR_UPPER_CASE 
CB_INTR_VARIANCE 
CB_INTR_WHEN_COMPILED 
CB_INTR_YEAR_TO_YYYY 

Definition at line 809 of file tree.h.

                  {
        CB_INTR_ABS = 1,
        CB_INTR_ACOS,
        CB_INTR_ANNUITY,
        CB_INTR_ASIN,
        CB_INTR_ATAN,
        CB_INTR_BOOLEAN_OF_INTEGER,
        CB_INTR_BYTE_LENGTH,
        CB_INTR_CHAR,
        CB_INTR_CHAR_NATIONAL,
        CB_INTR_COMBINED_DATETIME,
        CB_INTR_CONCATENATE,
        CB_INTR_COS,
        CB_INTR_CURRENT_DATE,
        CB_INTR_DATE_OF_INTEGER,
        CB_INTR_DATE_TO_YYYYMMDD,
        CB_INTR_DAY_OF_INTEGER,
        CB_INTR_DAY_TO_YYYYDDD,
        CB_INTR_DISPLAY_OF,
        CB_INTR_E,
        CB_INTR_EXCEPTION_FILE,
        CB_INTR_EXCEPTION_FILE_N,
        CB_INTR_EXCEPTION_LOCATION,
        CB_INTR_EXCEPTION_LOCATION_N,
        CB_INTR_EXCEPTION_STATEMENT,
        CB_INTR_EXCEPTION_STATUS,
        CB_INTR_EXP,
        CB_INTR_EXP10,
        CB_INTR_FACTORIAL,
        CB_INTR_FRACTION_PART,
        CB_INTR_HIGHEST_ALGEBRAIC,
        CB_INTR_INTEGER,
        CB_INTR_INTEGER_OF_BOOLEAN,
        CB_INTR_INTEGER_OF_DATE,
        CB_INTR_INTEGER_OF_DAY,
        CB_INTR_INTEGER_PART,
        CB_INTR_LENGTH,
        CB_INTR_LOCALE_COMPARE,
        CB_INTR_LOCALE_DATE,
        CB_INTR_LOCALE_TIME,
        CB_INTR_LOCALE_TIME_FROM_SECS,
        CB_INTR_LOG,
        CB_INTR_LOG10,
        CB_INTR_LOWER_CASE,
        CB_INTR_LOWEST_ALGEBRAIC,
        CB_INTR_MAX,
        CB_INTR_MEAN,
        CB_INTR_MEDIAN,
        CB_INTR_MIDRANGE,
        CB_INTR_MIN,
        CB_INTR_MOD,
        CB_INTR_NATIONAL_OF,
        CB_INTR_NUMVAL,
        CB_INTR_NUMVAL_C,
        CB_INTR_NUMVAL_F,
        CB_INTR_ORD,
        CB_INTR_ORD_MAX,
        CB_INTR_ORD_MIN,
        CB_INTR_PI,
        CB_INTR_PRESENT_VALUE,
        CB_INTR_RANDOM,
        CB_INTR_RANGE,
        CB_INTR_REM,
        CB_INTR_REVERSE,
        CB_INTR_SECONDS_FROM_FORMATTED_TIME,
        CB_INTR_SECONDS_PAST_MIDNIGHT,
        CB_INTR_SIGN,
        CB_INTR_SIN,
        CB_INTR_SQRT,
        CB_INTR_STANDARD_COMPARE,
        CB_INTR_STANDARD_DEVIATION,
        CB_INTR_STORED_CHAR_LENGTH,
        CB_INTR_SUBSTITUTE,
        CB_INTR_SUBSTITUTE_CASE,
        CB_INTR_SUM,
        CB_INTR_TAN,
        CB_INTR_TEST_DATE_YYYYMMDD,
        CB_INTR_TEST_DAY_YYYYDDD,
        CB_INTR_TEST_NUMVAL,
        CB_INTR_TEST_NUMVAL_C,
        CB_INTR_TEST_NUMVAL_F,
        CB_INTR_TRIM,
        CB_INTR_UPPER_CASE,
        CB_INTR_VARIANCE,
        CB_INTR_WHEN_COMPILED,
        CB_INTR_YEAR_TO_YYYY
};
Enumerator:
CB_SENDING_OPERAND 
CB_RECEIVING_OPERAND 

Definition at line 200 of file tree.h.

Enumerator:
CB_PERFORM_EXIT 
CB_PERFORM_ONCE 
CB_PERFORM_TIMES 
CB_PERFORM_UNTIL 
CB_PERFORM_FOREVER 

Definition at line 1028 of file tree.h.

enum cb_storage
Enumerator:
CB_STORAGE_CONSTANT 
CB_STORAGE_FILE 
CB_STORAGE_WORKING 
CB_STORAGE_LOCAL 
CB_STORAGE_LINKAGE 
CB_STORAGE_SCREEN 
CB_STORAGE_REPORT 
CB_STORAGE_COMMUNICATION 

Definition at line 163 of file tree.h.

                {
        CB_STORAGE_CONSTANT,            /* Constants */
        CB_STORAGE_FILE,                /* FILE SECTION */
        CB_STORAGE_WORKING,             /* WORKING-STORAGE SECTION */
        CB_STORAGE_LOCAL,               /* LOCAL-STORAGE SECTION */
        CB_STORAGE_LINKAGE,             /* LINKAGE SECTION */
        CB_STORAGE_SCREEN,              /* SCREEN SECTION */
        CB_STORAGE_REPORT,              /* REPORT SECTION */
        CB_STORAGE_COMMUNICATION        /* COMMUNICATION SECTION */
};
Enumerator:
CB_SWITCH_1 
CB_SWITCH_2 
CB_SWITCH_3 
CB_SWITCH_4 
CB_SWITCH_5 
CB_SWITCH_6 
CB_SWITCH_7 
CB_SWITCH_8 

Definition at line 124 of file tree.h.

Enumerator:
CB_CALL_CONVENTION_NAME 
CB_CODE_NAME 
CB_COMPUTER_NAME 
CB_DEVICE_NAME 
CB_ENTRY_CONVENTION_NAME 
CB_EXTERNAL_LOCALE_NAME 
CB_FEATURE_NAME 
CB_LIBRARY_NAME 
CB_SWITCH_NAME 
CB_TEXT_NAME 

Definition at line 88 of file tree.h.

enum cb_tag
Enumerator:
CB_TAG_CONST 
CB_TAG_INTEGER 
CB_TAG_STRING 
CB_TAG_ALPHABET_NAME 
CB_TAG_CLASS_NAME 
CB_TAG_LOCALE_NAME 
CB_TAG_SYSTEM_NAME 
CB_TAG_LITERAL 
CB_TAG_DECIMAL 
CB_TAG_FIELD 
CB_TAG_FILE 
CB_TAG_REFERENCE 
CB_TAG_BINARY_OP 
CB_TAG_FUNCALL 
CB_TAG_CAST 
CB_TAG_INTRINSIC 
CB_TAG_LABEL 
CB_TAG_ASSIGN 
CB_TAG_INITIALIZE 
CB_TAG_SEARCH 
CB_TAG_CALL 
CB_TAG_GOTO 
CB_TAG_IF 
CB_TAG_PERFORM 
CB_TAG_STATEMENT 
CB_TAG_CONTINUE 
CB_TAG_PERFORM_VARYING 
CB_TAG_PICTURE 
CB_TAG_LIST 

Definition at line 44 of file tree.h.

            {
        /* primitives */
        CB_TAG_CONST,           /* 0 constant value */
        CB_TAG_INTEGER,         /* 1 integer constant */
        CB_TAG_STRING,          /* 2 string constant */
        CB_TAG_ALPHABET_NAME,   /* 3 alphabet-name */
        CB_TAG_CLASS_NAME,      /* 4 class-name */
        CB_TAG_LOCALE_NAME,     /* 5 locale-name */
        CB_TAG_SYSTEM_NAME,     /* 6 system-name */
        CB_TAG_LITERAL,         /* 7 numeric/alphanumeric literal */
        CB_TAG_DECIMAL,         /* 8 decimal number */
        CB_TAG_FIELD,           /* 9 user-defined variable */
        CB_TAG_FILE,            /* 10 file description */
        /* expressions */
        CB_TAG_REFERENCE,       /* 11 reference to a field, file, or label */
        CB_TAG_BINARY_OP,       /* 12 binary operation */
        CB_TAG_FUNCALL,         /* 13 run-time function call */
        CB_TAG_CAST,            /* 14 type cast */
        CB_TAG_INTRINSIC,       /* 15 intrinsic function */
        /* statements */
        CB_TAG_LABEL,           /* 16 label statement */
        CB_TAG_ASSIGN,          /* 17 assignment statement */
        CB_TAG_INITIALIZE,      /* 18 INITIALIZE statement */
        CB_TAG_SEARCH,          /* 19 SEARCH statement */
        CB_TAG_CALL,            /* 20 CALL statement */
        CB_TAG_GOTO,            /* 21 GO TO statement */
        CB_TAG_IF,              /* 22 IF statement */
        CB_TAG_PERFORM,         /* 23 PERFORM statement */
        CB_TAG_STATEMENT,       /* 24 general statement */
        CB_TAG_CONTINUE,        /* 25 CONTINUE statement */
        /* miscellaneous */
        CB_TAG_PERFORM_VARYING, /* 26 PERFORM VARYING parameter */
        CB_TAG_PICTURE,         /* 27 PICTURE clause */
        CB_TAG_LIST             /* 28 list */
};
enum cb_usage
Enumerator:
CB_USAGE_BINARY 
CB_USAGE_BIT 
CB_USAGE_COMP_5 
CB_USAGE_COMP_X 
CB_USAGE_DISPLAY 
CB_USAGE_FLOAT 
CB_USAGE_DOUBLE 
CB_USAGE_INDEX 
CB_USAGE_NATIONAL 
CB_USAGE_OBJECT 
CB_USAGE_PACKED 
CB_USAGE_POINTER 
CB_USAGE_PROGRAM 
CB_USAGE_LENGTH 
CB_USAGE_PROGRAM_POINTER 
CB_USAGE_UNSIGNED_CHAR 
CB_USAGE_SIGNED_CHAR 
CB_USAGE_UNSIGNED_SHORT 
CB_USAGE_SIGNED_SHORT 
CB_USAGE_UNSIGNED_INT 
CB_USAGE_SIGNED_INT 
CB_USAGE_UNSIGNED_LONG 
CB_USAGE_SIGNED_LONG 

Definition at line 174 of file tree.h.


Function Documentation

void ambiguous_error ( cb_tree  x)

Definition at line 197 of file error.c.

{
        struct cb_word  *w;
        struct cb_field *p;
        struct cb_label *l2;
        cb_tree         l;
        cb_tree         y;

        w = CB_REFERENCE (x)->word;
        if (w->error == 0) {
                if (!errnamebuff) {
                        errnamebuff = cobc_malloc (COB_NORMAL_BUFF);
                }
                /* display error on the first time */
                snprintf (errnamebuff, COB_NORMAL_MAX, "'%s'", CB_NAME (x));
                for (l = CB_REFERENCE (x)->chain; l; l = CB_REFERENCE (l)->chain) {
                        strcat (errnamebuff, " in '");
                        strcat (errnamebuff, CB_NAME (l));
                        strcat (errnamebuff, "'");
                }
                cb_error_x (x, _("%s ambiguous; need qualification"), errnamebuff);
                w->error = 1;

                /* display all fields with the same name */
                for (l = w->items; l; l = CB_CHAIN (l)) {
                        y = CB_VALUE (l);
                        snprintf (errnamebuff, COB_NORMAL_MAX, "'%s' ", w->name);
                        switch (CB_TREE_TAG (y)) {
                        case CB_TAG_FIELD:
                                for (p = CB_FIELD (y)->parent; p; p = p->parent) {
                                        strcat (errnamebuff, "in '");
                                        strcat (errnamebuff, p->name);
                                        strcat (errnamebuff, "' ");
                                }
                                break;
                        case CB_TAG_LABEL:
                                l2 = CB_LABEL (y);
                                if (l2->section) {
                                        strcat (errnamebuff, "in '");
                                        strcat (errnamebuff, (const char *)(l2->section->name));
                                        strcat (errnamebuff, "' ");
                                }
                                break;
                        default:
                                break;
                        }
                        strcat (errnamebuff, _("defined here"));
                        cb_error_x (y, errnamebuff);
                }
        }
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct cb_file* build_file ( cb_tree  name) [read]

Definition at line 1577 of file tree.c.

{
        struct cb_file *p;

        p = make_tree (CB_TAG_FILE, CB_CATEGORY_UNKNOWN, sizeof (struct cb_file));
        p->name = cb_define (name, CB_TREE (p));
        p->cname = to_cname (p->name);

        p->organization = COB_ORG_SEQUENTIAL;
        p->access_mode = COB_ACCESS_SEQUENTIAL;
        p->handler = CB_LABEL (cb_standard_error_handler);
        p->handler_prog = current_program;
        return p;
}

Here is the call graph for this function:

struct cb_literal* build_literal ( enum cb_category  category,
const unsigned char *  data,
size_t  size 
) [read]

Definition at line 426 of file tree.c.

{
        struct cb_literal *p;

        p = make_tree (CB_TAG_LITERAL, category, sizeof (struct cb_literal));
        p->data = cobc_malloc ((size_t) (size + 1));
        p->size = size;
        memcpy (p->data, data, (size_t) size);
        /* RXW - malloc zeroes
        p->data[size] = 0;
        */
        return p;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void cb_add_78 ( struct cb_field f)

Here is the caller graph for this function:

cb_tree cb_build_add ( cb_tree  v,
cb_tree  n,
cb_tree  round_opt 
)

Definition at line 2591 of file typeck.c.

{
        cb_tree         opt;
        struct cb_field *f;

#ifdef  COB_NON_ALIGNED
        if (CB_INDEX_P (v)) {
                return cb_build_move (cb_build_binary_op (v, '+', n), v);
        }
        if (CB_TREE_CLASS (v) == CB_CLASS_POINTER) {
                current_program->gen_ptrmanip = 1;
                return cb_build_funcall_3 ("cob_pointer_manip", v, n, cb_int0);
        }
#else
        if (CB_INDEX_P (v) || CB_TREE_CLASS (v) == CB_CLASS_POINTER) {
                return cb_build_move (cb_build_binary_op (v, '+', n), v);
        }
#endif

        if (CB_REF_OR_FIELD_P (v)) {
                f = cb_field (v);
                f->count++;
        }
        if (CB_REF_OR_FIELD_P (n)) {
                f = cb_field (n);
                f->count++;
        }
        if (round_opt == cb_high) {
                if (cb_fits_int (n)) {
                        return cb_build_optim_add (v, n);
                } else {
                        return cb_build_funcall_3 ("cob_add", v, n, cb_int0);
                }
        }
        opt = build_store_option (v, round_opt);
        if (opt == cb_int0 && cb_fits_int (n)) {
                return cb_build_optim_add (v, n);
        }
        return cb_build_funcall_3 ("cob_add", v, n, opt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

cb_tree cb_build_address ( cb_tree  x)

Definition at line 1027 of file typeck.c.

{
        if (x == cb_error_node ||
            (CB_REFERENCE_P (x) && cb_ref (x) == cb_error_node)) {
                return cb_error_node;
        }

        return cb_build_cast_address (x);
}

Here is the call graph for this function:

Here is the caller graph for this function:

cb_tree cb_build_alphabet_name ( cb_tree  name,
enum cb_alphabet_name_type  type 
)

Definition at line 923 of file tree.c.

{
        struct cb_alphabet_name *p;

        p = make_tree (CB_TAG_ALPHABET_NAME, CB_CATEGORY_UNKNOWN, sizeof (struct cb_alphabet_name));
        p->name = cb_define (name, CB_TREE (p));
        p->cname = to_cname (p->name);
        p->type = type;
        return CB_TREE (p);
}

Here is the call graph for this function:

cb_tree cb_build_alphanumeric_literal ( const unsigned char *  data,
size_t  size 
)

Definition at line 999 of file tree.c.

Here is the call graph for this function:

Here is the caller graph for this function:

cb_tree cb_build_any_intrinsic ( cb_tree  args)

Definition at line 2253 of file tree.c.

{
        struct cb_intrinsic_table       *cbp;

        cbp = lookup_intrinsic ("LENGTH", 0);
        return make_intrinsic (NULL, cbp, args, NULL, NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

cb_tree cb_build_assign ( cb_tree  var,
cb_tree  val 
)

Definition at line 2098 of file tree.c.

{
        struct cb_assign *p;

        p = make_tree (CB_TAG_ASSIGN, CB_CATEGORY_UNKNOWN, sizeof (struct cb_assign));
        p->var = var;
        p->val = val;
        return CB_TREE (p);
}

Here is the caller graph for this function:

cb_tree cb_build_assignment_name ( struct cb_file curfile,
cb_tree  name 
)

Definition at line 677 of file typeck.c.

{
        const char      *s;
        const char      *p;

        if (name == cb_error_node) {
                return cb_error_node;
        }

        switch (CB_TREE_TAG (name)) {
        case CB_TAG_LITERAL:
                if (strcmp ((char *)(CB_LITERAL(name)->data), "$#@DUMMY@#$") == 0) {
                        cfile->special = 2;
                }
                return name;

        case CB_TAG_REFERENCE:
                s = CB_REFERENCE (name)->word->name;
                if (strcasecmp (s, "KEYBOARD") == 0) {
                        s = "#DUMMY#";
                        cfile->special = 1;
                        return cb_build_alphanumeric_literal ((ucharptr)s, strlen (s));
                }
                switch (cb_assign_clause) {
                case CB_ASSIGN_COBOL2002:
                        /* TODO */
                        return cb_error_node;

                case CB_ASSIGN_MF:
                        if (cfile->external_assign) {
                                p = strrchr (s, '-');
                                if (p) {
                                        s = p + 1;
                                }
                                return cb_build_alphanumeric_literal ((ucharptr)s, strlen (s));
                        }
                        current_program->reference_list =
                            cb_list_add (current_program->reference_list, name);
                        return name;

                case CB_ASSIGN_IBM:
                        /* check organization */
                        if (strncmp (s, "S-", 2) == 0 ||
                            strncmp (s, "AS-", 3) == 0) {
                                goto org;
                        }
                        /* skip the device label if exists */
                        if ((p = strchr (s, '-')) != NULL) {
                                s = p + 1;
                        }
                        /* check organization again */
                        if (strncmp (s, "S-", 2) == 0 ||
                            strncmp (s, "AS-", 3) == 0) {
org:
                                /* skip it for now */
                                s = strchr (s, '-') + 1;
                        }
                        /* convert the name into literal */
                        return cb_build_alphanumeric_literal ((ucharptr)s, strlen (s));
                }

        default:
                return cb_error_node;
        }
}

Here is the call graph for this function:

cb_tree cb_build_binary_list ( cb_tree  l,
int  op 
)

Definition at line 2019 of file tree.c.

{
        cb_tree e;

        e = CB_VALUE (l);
        for (l = CB_CHAIN (l); l; l = CB_CHAIN (l)) {
                e = cb_build_binary_op (e, op, CB_VALUE (l));
        }
        return e;
}

Here is the call graph for this function:

cb_tree cb_build_binary_op ( cb_tree  x,
int  op,
cb_tree  y 
)

Definition at line 1954 of file tree.c.

{
        struct cb_binary_op     *p;
        enum cb_category        category = CB_CATEGORY_UNKNOWN;

        switch (op) {
        case '+':
        case '-':
        case '*':
        case '/':
        case '^':
                /* arithmetic operators */
                if (CB_TREE_CLASS (x) == CB_CLASS_POINTER ||
                    CB_TREE_CLASS (y) == CB_CLASS_POINTER) {
                        category = CB_CATEGORY_DATA_POINTER;
                        break;
                }
                x = cb_check_numeric_value (x);
                y = cb_check_numeric_value (y);
                if (x == cb_error_node || y == cb_error_node) {
                        return cb_error_node;
                }
                category = CB_CATEGORY_NUMERIC;
                break;

        case '=':
        case '~':
        case '<':
        case '>':
        case '[':
        case ']':
                /* relational operators */
                category = CB_CATEGORY_BOOLEAN;
                break;

        case '!':
        case '&':
        case '|':
                /* logical operators */
                if (CB_TREE_CLASS (x) != CB_CLASS_BOOLEAN ||
                    (y && CB_TREE_CLASS (y) != CB_CLASS_BOOLEAN)) {
                        cb_error (_("Invalid expression"));
                        return cb_error_node;
                }
                category = CB_CATEGORY_BOOLEAN;
                break;

        case '@':
                /* parentheses */
                category = CB_TREE_CATEGORY (x);
                break;

        default:
                fprintf (stderr, "Unexpected operator -> %d\n", op);
                ABORT ();
        }

        p = make_tree (CB_TAG_BINARY_OP, category, sizeof (struct cb_binary_op));
        p->op = op;
        p->x = x;
        p->y = y;
        return CB_TREE (p);
}

Here is the call graph for this function:

Here is the caller graph for this function:

cb_tree cb_build_call ( cb_tree  name,
cb_tree  args,
cb_tree  stmt1,
cb_tree  stmt2,
cb_tree  returning,
int  is_system_call 
)

Definition at line 2149 of file tree.c.

{
        struct cb_call *p;

        p = make_tree (CB_TAG_CALL, CB_CATEGORY_UNKNOWN, sizeof (struct cb_call));
        p->name = name;
        p->args = args;
        p->stmt1 = stmt1;
        p->stmt2 = stmt2;
        p->returning = returning;
        p->is_system = is_system_call;
        return CB_TREE (p);
}

Here is the caller graph for this function:

cb_tree cb_build_cast ( enum cb_cast_type  type,
cb_tree  val 
)

Definition at line 2060 of file tree.c.

{
        struct cb_cast          *p;
        enum cb_category        category;

        if (type == CB_CAST_INTEGER) {
                category = CB_CATEGORY_NUMERIC;
        } else {
                category = CB_CATEGORY_UNKNOWN;
        }
        p = make_tree (CB_TAG_CAST, category, sizeof (struct cb_cast));
        p->type = type;
        p->val = val;
        return CB_TREE (p);
}
cb_tree cb_build_class_name ( cb_tree  name,
cb_tree  list 
)

Definition at line 939 of file tree.c.

{
        struct cb_class_name    *p;
        char                    buff[COB_MINI_BUFF];

        p = make_tree (CB_TAG_CLASS_NAME, CB_CATEGORY_BOOLEAN, sizeof (struct cb_class_name));
        p->name = cb_define (name, CB_TREE (p));
        snprintf (buff, COB_MINI_MAX, "is_%s", to_cname (p->name));
        p->cname = strdup (buff);
        p->list = list;
        return CB_TREE (p);
}

Here is the call graph for this function:

cb_tree cb_build_cond ( cb_tree  x)

Definition at line 2354 of file typeck.c.

{
        int                     size1;
        int                     size2;
        struct cb_field         *f;
        struct cb_binary_op     *p;
        cb_tree                 d1;
        cb_tree                 d2;

        switch (CB_TREE_TAG (x)) {
        case CB_TAG_CONST:
        case CB_TAG_FUNCALL:
                return x;
        case CB_TAG_REFERENCE:
                if (!CB_FIELD_P (cb_ref (x))) {
                        return cb_build_cond (cb_ref (x));
                }

                f = cb_field (x);

                /* level 88 condition */
                if (f->level == 88) {
                        /* We need to build a 88 condition at every occurrence
                           instead of once at the beginning because a 88 item
                           may be subscripted (i.e., it is not a constant tree). */
                        return cb_build_cond (build_cond_88 (x));
                }

                cb_error_x (x, _("Invalid expression"));
                return cb_error_node;
        case CB_TAG_BINARY_OP:
                p = CB_BINARY_OP (x);
                switch (p->op) {
                case '!':
                        return cb_build_negation (cb_build_cond (p->x));
                case '&':
                case '|':
                        return cb_build_binary_op (cb_build_cond (p->x), p->op, cb_build_cond (p->y));
                default:
                        if (CB_INDEX_P (p->x) || CB_INDEX_P (p->y)
                            || CB_TREE_CLASS (p->x) == CB_CLASS_POINTER
                            || CB_TREE_CLASS (p->y) == CB_CLASS_POINTER) {
                                x = cb_build_binary_op (p->x, '-', p->y);
                        } else if (CB_BINARY_OP_P (p->x) || CB_BINARY_OP_P (p->y)) {
                                /* decimal comparison */
                                d1 = decimal_alloc ();
                                d2 = decimal_alloc ();

                                decimal_expand (d1, p->x);
                                decimal_expand (d2, p->y);
                                dpush (cb_build_funcall_2 ("cob_decimal_cmp", d1, d2));
                                decimal_free ();
                                decimal_free ();
                                x = cb_list_reverse (decimal_stack);
                                decimal_stack = NULL;
                        } else {
                                if (cb_chk_num_cond (p->x, p->y)) {
                                        size1 = cb_field_size (p->x);
                                        x = cb_build_funcall_3 ("memcmp",
                                                cb_build_cast_address (p->x),
                                                cb_build_cast_address (p->y),
                                                cb_int (size1));
                                        break;
                                }
                                if (CB_TREE_CLASS (p->x) == CB_CLASS_NUMERIC
                                    && CB_TREE_CLASS (p->y) == CB_CLASS_NUMERIC
                                    && cb_fits_int (p->y)) {
                                        x = cb_build_optim_cond (p);
                                        break;
                                }

                                /* field comparison */
                                if ((CB_REF_OR_FIELD_P (p->x))
                                   && (CB_TREE_CATEGORY (p->x) == CB_CATEGORY_ALPHANUMERIC ||
                                       CB_TREE_CATEGORY (p->x) == CB_CATEGORY_ALPHABETIC)
                                   && (cb_field_size (p->x) == 1)
                                   && (!current_program->alphabet_name_list)
                                   && (p->y == cb_space || p->y == cb_low ||
                                       p->y == cb_high || p->y == cb_zero)) {
                                        x = cb_build_funcall_2 ("$G", p->x, p->y);
                                        break;
                                }
                                if (cb_chk_alpha_cond (p->x) && cb_chk_alpha_cond (p->y)) {
                                        size1 = cb_field_size (p->x);
                                        size2 = cb_field_size (p->y);
                                } else {
                                        size1 = 0;
                                        size2 = 0;
                                }
                                if (size1 == 1 && size2 == 1) {
                                        x = cb_build_funcall_2 ("$G", p->x, p->y);
                                } else if (size1 != 0 && size1 == size2) {
                                        x = cb_build_funcall_3 ("memcmp",
                                                cb_build_cast_address (p->x),
                                                cb_build_cast_address (p->y),
                                                cb_int (size1));
                                } else {
                                        if (CB_TREE_CLASS (p->x) == CB_CLASS_NUMERIC && p->y == cb_zero) {
                                                x = cb_build_optim_cond (p);
                                        } else {
                                                x = cb_build_funcall_2 ("cob_cmp", p->x, p->y);
                                        }
                                }
                        }
                }
                return cb_build_binary_op (x, p->op, p->y);
        default:
                cb_error_x (x, _("Invalid expression"));
                return cb_error_node;
        }
/* NOT REACHED */
        return x;
}

Here is the call graph for this function:

Here is the caller graph for this function:

cb_tree cb_build_const_length ( cb_tree  x)

Definition at line 956 of file typeck.c.

{
        struct cb_field         *f;
        char                    buff[64];

        if (x == cb_error_node) {
                return cb_error_node;
        }
        if (CB_REFERENCE_P (x) && cb_ref (x) == cb_error_node) {
                return cb_error_node;
        }

        memset (buff, 0, sizeof (buff));
        f = CB_FIELD (cb_ref (x));
        if (f->flag_any_length) {
                cb_error (_("ANY LENGTH item not allowed here"));
                return cb_error_node;
        }
        if (f->level == 88) {
                cb_error (_("88 level item not allowed here"));
                return cb_error_node;
        }
        if (!f->flag_is_verified) {
                cb_validate_field (f);
        }
        sprintf (buff, "%d", f->memory_size);
        return cb_build_numeric_literal (0, (ucharptr)buff, 0);
}

Here is the call graph for this function:

cb_tree cb_build_constant ( cb_tree  name,
cb_tree  value 
)

Definition at line 1446 of file tree.c.

{
        cb_tree x;

        x = cb_build_field (name);
        x->category = cb_tree_category (value);
        CB_FIELD (x)->storage = CB_STORAGE_CONSTANT;
        CB_FIELD (x)->values = cb_list_init (value);
        return x;
}

Here is the call graph for this function:

Here is the caller graph for this function:

cb_tree cb_build_continue ( void  )

Definition at line 2240 of file tree.c.

{
        struct cb_continue *p;

        p = make_tree (CB_TAG_CONTINUE, CB_CATEGORY_UNKNOWN, sizeof (struct cb_continue));
        return CB_TREE (p);
}

Here is the caller graph for this function:

cb_tree cb_build_converting ( cb_tree  x,
cb_tree  y,
cb_tree  l 
)

Definition at line 3847 of file typeck.c.

{
        return cb_list_add (l, cb_build_funcall_2 ("cob_inspect_converting", x, y));
}

Here is the call graph for this function:

cb_tree cb_build_decimal ( int  id)

Definition at line 1076 of file tree.c.

{
        struct cb_decimal *p;

        p = make_tree (CB_TAG_DECIMAL, CB_CATEGORY_NUMERIC, sizeof (struct cb_decimal));
        p->id = id;
        return CB_TREE (p);
}
cb_tree cb_build_display_upon ( cb_tree  x)

Definition at line 3406 of file typeck.c.

{
        if (x == cb_error_node) {
                return cb_error_node;
        }

        switch (CB_SYSTEM_NAME (cb_ref (x))->token) {
        case CB_DEVICE_CONSOLE:
        case CB_DEVICE_SYSOUT:
                return cb_int0;
        case CB_DEVICE_SYSERR:
                return cb_int1;
        default:
                cb_error_x (x, _("Invalid output stream"));
                return cb_error_node;
        }
}

Here is the call graph for this function:

cb_tree cb_build_display_upon_direct ( cb_tree  x)

Definition at line 3425 of file typeck.c.

{
        const char      *name;
        cb_tree         sys;

        if (x == cb_error_node) {
                return cb_error_node;
        }
        name = CB_NAME (x);
        if (CB_REFERENCE (x)->word->count == 0) {
                sys = lookup_system_name (CB_NAME (x));
                if (sys != cb_error_node) {
                        switch (CB_SYSTEM_NAME (sys)->token) {
                        case CB_DEVICE_CONSOLE:
                        case CB_DEVICE_SYSOUT:
                                cb_warning_x (x, _("'%s' undefined in SPECIAL-NAMES"), name);
                                return cb_int0;
                        case CB_DEVICE_SYSERR:
                                cb_warning_x (x, _("'%s' undefined in SPECIAL-NAMES"), name);
                                return cb_int1;
                        default:
                                break;
                        }
                }
        }

        cb_error_x (x, _("'%s' undefined in SPECIAL-NAMES"), name);
        return cb_error_node;
}

Here is the call graph for this function:

cb_tree cb_build_expr ( cb_tree  list)

Definition at line 1820 of file typeck.c.

{
        cb_tree l;
/* RXW
        cb_tree x;
*/
        int     op;

        cb_expr_init ();

        for (l = list; l; l = CB_CHAIN (l)) {
                op = CB_PURPOSE_INT (l);
                switch (op) {
                case '9': /* NUMERIC */
                        cb_expr_shift_class ("cob_is_numeric");
                        break;
                case 'A': /* ALPHABETIC */
                        cb_expr_shift_class ("cob_is_alpha");
                        break;
                case 'L': /* ALPHABETIC_LOWER */
                        cb_expr_shift_class ("cob_is_lower");
                        break;
                case 'U': /* ALPHABETIC_UPPER */
                        cb_expr_shift_class ("cob_is_upper");
                        break;
                case 'P': /* POSITIVE */
                        cb_expr_shift_sign ('>');
                        break;
                case 'N': /* NEGATIVE */
                        cb_expr_shift_sign ('<');
                        break;
                case 'O': /* OMITTED */
                        current_statement->null_check = NULL;
                        cb_expr_shift_class ("cob_is_omitted");
                        break;
/* RXW
                case 'x':
                        if (CB_VALUE (l) && CB_REFERENCE_P (CB_VALUE (l))) {
                                x = CB_CHAIN (l);
                                if (x && cb_field (CB_VALUE (l))->level == 88) {
                                        switch (CB_PURPOSE_INT (x)) {
                                        case '&':
                                        case '|':
                                        case '(':
                                        case ')':
                                                break;
                                        default:
                                                cb_error (_("Invalid condition"));
                                                break;
                                        }
                                }
                        }
                        cb_expr_shift (op, CB_VALUE (l));
                        break;
*/
                default:
                        cb_expr_shift (op, CB_VALUE (l));
                        break;
                }
        }

        return cb_expr_finish ();
}
cb_tree cb_build_field ( cb_tree  name)

Definition at line 1417 of file tree.c.

{
        struct cb_field *p;

        p = make_tree (CB_TAG_FIELD, CB_CATEGORY_UNKNOWN, sizeof (struct cb_field));
        p->id = cb_field_id++;
        p->name = cb_define (name, CB_TREE (p));
        p->ename = NULL;
        p->usage = CB_USAGE_DISPLAY;
        p->storage = CB_STORAGE_WORKING;
        p->occurs_max = 1;
        return CB_TREE (p);
}

Here is the call graph for this function:

Here is the caller graph for this function:

cb_tree cb_build_field_reference ( struct cb_field f,
cb_tree  ref 
)

Definition at line 1752 of file tree.c.

{
        cb_tree         x;
        struct cb_word  *word;

        x = cb_build_reference (f->name);
        word = CB_REFERENCE (x)->word;
        if (ref) {
                memcpy (x, ref, sizeof (struct cb_reference));
        }
        x->category = CB_CATEGORY_UNKNOWN;
        CB_REFERENCE (x)->word = word;
        CB_REFERENCE (x)->value = CB_TREE (f);
        return x;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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 
)

Definition at line 78 of file field.c.

{
        struct cb_reference     *r;
        struct cb_field         *f;
        struct cb_field         *p;
        struct cb_field         *field_fill;
        cb_tree                 dummy_fill;
        cb_tree                 l;
        cb_tree                 x;
        int                     lv;

        if (level == cb_error_node || name == cb_error_node) {
                return cb_error_node;
        }

        /* check the level number */
        lv = cb_get_level (level);
        if (!lv) {
                return cb_error_node;
        }

        /* build the field */
        r = CB_REFERENCE (name);
        f = CB_FIELD (cb_build_field (name));
        f->storage = storage;
        last_real_field = last_field;
        if (lv == 78) {
                f->level = 01;
                f->flag_item_78 = 1;
                return CB_TREE (f);
        } else {
                f->level = lv;
        }
        if (f->level == 01 && storage == CB_STORAGE_FILE) {
                if (fn->external) {
                        f->flag_external = 1;
                        has_external = 1;
                } else if (fn->global) {
                        f->flag_is_global = 1;
                }
        }
        if (last_field) {
                if (last_field->level == 77 && f->level != 01 &&
                    f->level != 77 && f->level != 66 && f->level != 88) {
                        cb_error_x (name, _("Level number must begin with 01 or 77"));
                        return cb_error_node;
                }
        }

        /* checks for redefinition */
        if (cb_warn_redefinition) {
                if (r->word->count > 1) {
                        if (f->level == 01 || f->level == 77) {
                                redefinition_warning (name, NULL);
                        } else {
                                for (l = r->word->items; l; l = CB_CHAIN (l)) {
                                        x = CB_VALUE (l);
                                        if (!CB_FIELD_P (x)
                                            || CB_FIELD (x)->level == 01
                                            || CB_FIELD (x)->level == 77
                                            || (f->level == last_field->level
                                                && CB_FIELD (x)->parent == last_field->parent)) {
                                                redefinition_warning (name, x);
                                                break;
                                        }
                                }
                        }
                }
        }

        if (last_field && last_field->level == 88) {
                last_field = last_field->parent;
        }

        /* link the field into the tree */
        if (f->level == 01 || f->level == 77) {
                /* top level */
                cb_needs_01 = 0;
                if (last_field) {
/*
                        cb_field_add (cb_field_founder (last_field), f);
*/
                        cb_field_founder (last_field)->sister = f;
                }
        } else if (!last_field || cb_needs_01) {
                /* invalid top level */
                cb_error_x (name, _("Level number must begin with 01 or 77"));
                return cb_error_node;
        } else if (f->level == 66) {
                /* level 66 */
                f->parent = cb_field_founder (last_field);
                for (p = f->parent->children; p && p->sister; p = p->sister) ;
                if (p) {
                        p->sister = f;
                }
        } else if (f->level == 88) {
                /* level 88 */
                f->parent = last_field;
        } else if (f->level > last_field->level) {
                /* lower level */
                last_field->children = f;
                f->parent = last_field;
        } else if (f->level == last_field->level) {
                /* same level */
same_level:
                last_field->sister = f;
                f->parent = last_field->parent;
        } else {
                /* upper level */
                for (p = last_field->parent; p; p = p->parent) {
                        if (p->level == f->level) {
                                last_field = p;
                                goto same_level;
                        }
                        if (cb_relax_level_hierarchy && p->level < f->level) {
                                break;
                        }
                }
                if (cb_relax_level_hierarchy) {
                        dummy_fill = cb_build_filler ();
                        field_fill = CB_FIELD (cb_build_field (dummy_fill));
                        cb_warning_x (name, _("No previous data item of level %02d"), f->level);
                        field_fill->level = f->level;
                        field_fill->storage = storage;
                        field_fill->children = p->children;
                        field_fill->parent = p;
                        for (p = p->children; p != NULL; p = p->sister) {
                                p->parent = field_fill;
                        }
                        field_fill->parent->children = field_fill;
                        field_fill->sister = f;
                        f->parent = field_fill->parent;
                        last_field = field_fill;
                } else {
                        cb_error_x (name, _("No previous data item of level %02d"), f->level);
                        return cb_error_node;
                }
        }

        /* inherit parent's properties */
        if (f->parent) {
                f->usage = f->parent->usage;
                f->indexes = f->parent->indexes;
                f->flag_sign_leading = f->parent->flag_sign_leading;
                f->flag_sign_separate = f->parent->flag_sign_separate;
                f->flag_is_global = f->parent->flag_is_global;
        }
        return CB_TREE (f);
}

Here is the call graph for this function:

cb_tree cb_build_filler ( void  )

Definition at line 1740 of file tree.c.

{
        cb_tree         x;
        char            name[16];

        sprintf (name, "WORK$%d", filler_id++);
        x = cb_build_reference (name);
        x->source_line = cb_source_line;
        return x;
}

Here is the call graph for this function:

Here is the caller graph for this function:

cb_tree cb_build_funcall ( const char *  name,
int  argc,
cb_tree  a1,
cb_tree  a2,
cb_tree  a3,
cb_tree  a4,
cb_tree  a5,
cb_tree  a6,
cb_tree  a7 
)

Definition at line 2035 of file tree.c.

{
        struct cb_funcall *p;

        p = make_tree (CB_TAG_FUNCALL, CB_CATEGORY_BOOLEAN, sizeof (struct cb_funcall));
        p->name = name;
        p->argc = argc;
        p->varcnt = 0;
        p->screenptr = gen_screen_ptr;
        p->argv[0] = a1;
        p->argv[1] = a2;
        p->argv[2] = a3;
        p->argv[3] = a4;
        p->argv[4] = a5;
        p->argv[5] = a6;
        p->argv[6] = a7;
        return CB_TREE (p);
}
cb_tree cb_build_goto ( cb_tree  target,
cb_tree  depending 
)

Definition at line 2168 of file tree.c.

{
        struct cb_goto *p;

        p = make_tree (CB_TAG_GOTO, CB_CATEGORY_UNKNOWN, sizeof (struct cb_goto));
        p->target = target;
        p->depending = depending;
        return CB_TREE (p);
}

Here is the caller graph for this function:

cb_tree cb_build_identifier ( cb_tree  x)

Definition at line 763 of file typeck.c.

{
        struct cb_reference     *r;
        struct cb_field         *f;
        struct cb_field         *p;
        const char              *name;
        cb_tree                 v;
        cb_tree                 e1;
        cb_tree                 e2;
        cb_tree                 l;
        cb_tree                 sub;
        int                     offset;
        int                     length;
        int                     n;

        if (x == cb_error_node) {
                return cb_error_node;
        }

        r = CB_REFERENCE (x);
        name = r->word->name;

        /* resolve reference */
        v = cb_ref (x);
        if (v == cb_error_node) {
                return cb_error_node;
        }

        /* check if it is a data name */
        if (!CB_FIELD_P (v)) {
                if (r->subs) {
                        cb_error_x (x, _("'%s' cannot be subscripted"), name);
                        return cb_error_node;
                }
                if (r->offset) {
                        cb_error_x (x, _("'%s' cannot be reference modified"), name);
                        return cb_error_node;
                }
                return x;
        }
        f = CB_FIELD (v);

        /* BASED check */
        if (CB_EXCEPTION_ENABLE (COB_EC_BOUND_PTR)) {
                for (p = f; p->parent; p = p->parent) {
                        ;
                }
                if (current_statement) {
                        if (p->flag_item_based ||
                           (f->storage == CB_STORAGE_LINKAGE &&
                            !p->flag_is_pdiv_parm)) {
                                current_statement->null_check = cb_build_funcall_2 (
                                        "cob_check_based",
                                        cb_build_address (cb_build_field_reference (p, NULL)),
                                        cb_build_string0 ((ucharptr)name));
                        }
                }
        }

        /* check the number of subscripts */
        if (!r->all && cb_list_length (r->subs) != f->indexes) {
                switch (f->indexes) {
                case 0:
                        cb_error_x (x, _("'%s' cannot be subscripted"), name);
                        return cb_error_node;
                case 1:
                        cb_error_x (x, _("'%s' requires 1 subscript"), name);
                        return cb_error_node;
                default:
                        cb_error_x (x, _("'%s' requires %d subscripts"), name, f->indexes);
                        return cb_error_node;
                }
        }

        /* subscript check */
        if (!r->all && r->subs) {
                l = r->subs;
                for (p = f; p; p = p->parent) {
                        if (p->flag_occurs) {
                                sub = cb_check_integer_value (CB_VALUE (l));

                                l = CB_CHAIN (l);

                                if (sub == cb_error_node) {
                                        continue;
                                }

                                /* compile-time check */
                                if (CB_LITERAL_P (sub)) {
                                        n = cb_get_int (sub);
                                        if (n < 1 || n > p->occurs_max) {
                                                cb_error_x (x, _("Subscript of '%s' out of bounds: %d"),
                                                            name, n);
                                        }
                                }

                                /* run-time check */
                                if (CB_EXCEPTION_ENABLE (COB_EC_BOUND_SUBSCRIPT)) {
                                        if (p->occurs_depending) {
                                                e1 = cb_build_funcall_4 ("cob_check_odo",
                                                         cb_build_cast_integer (p->occurs_depending),
                                                         cb_int (p->occurs_min),
                                                         cb_int (p->occurs_max),
                                                         cb_build_string0
                                                         ((ucharptr)(cb_field (p->occurs_depending)->name)));
                                                e2 = cb_build_funcall_4 ("cob_check_subscript",
                                                         cb_build_cast_integer (sub),
                                                         cb_int1,
                                                         cb_build_cast_integer (p->occurs_depending),
                                                         cb_build_string0 ((ucharptr)name));
                                                r->check = cb_list_add (r->check, e1);
                                                r->check = cb_list_add (r->check, e2);
                                        } else {
                                                if (!CB_LITERAL_P (sub)) {
                                                        e1 = cb_build_funcall_4 ("cob_check_subscript",
                                                                cb_build_cast_integer (sub),
                                                                cb_int1,
                                                                cb_int (p->occurs_max),
                                                                cb_build_string0 ((ucharptr)name));
                                                        r->check = cb_list_add (r->check, e1);
                                                }
                                        }
                                }
                        }
                }
        }

        /* reference modification check */
        if (r->offset) {
                /* compile-time check */
                if (CB_LITERAL_P (r->offset)) {
                        offset = cb_get_int (r->offset);
                        if (offset < 1 || offset > f->size) {
                                cb_error_x (x, _("Offset of '%s' out of bounds: %d"), name, offset);
                        } else if (r->length && CB_LITERAL_P (r->length)) {
                                length = cb_get_int (r->length);
                                if (length < 1 || length > f->size - offset + 1) {
                                        cb_error_x (x, _("Length of '%s' out of bounds: %d"),
                                                    name, length);
                                }
                        }
                }

                /* run-time check */
                if (CB_EXCEPTION_ENABLE (COB_EC_BOUND_REF_MOD)) {
                        if (!CB_LITERAL_P (r->offset)
                            || (r->length && !CB_LITERAL_P (r->length))) {
                                e1 = cb_build_funcall_4 ("cob_check_ref_mod",
                                                         cb_build_cast_integer (r->offset),
                                                         r->length ? cb_build_cast_integer (r->length) :
                                                         cb_int1, cb_int (f->size),
                                                         cb_build_string0 ((ucharptr)f->name));
                                r->check = cb_list_add (r->check, e1);
                        }
                }
        }

        if (f->storage == CB_STORAGE_CONSTANT) {
                return CB_VALUE (f->values);
        }

        return x;
}

Here is the call graph for this function:

cb_tree cb_build_if ( cb_tree  test,
cb_tree  stmt1,
cb_tree  stmt2 
)

Definition at line 2183 of file tree.c.

{
        struct cb_if *p;

        p = make_tree (CB_TAG_IF, CB_CATEGORY_UNKNOWN, sizeof (struct cb_if));
        p->test = test;
        p->stmt1 = stmt1;
        p->stmt2 = stmt2;
        return CB_TREE (p);
}

Here is the caller graph for this function:

cb_tree cb_build_implicit_field ( cb_tree  name,
int  len 
)

Definition at line 1432 of file tree.c.

{
        cb_tree x;
        char    pic[32];

        x = cb_build_field (name);
        memset (pic, 0, sizeof(pic));
        sprintf (pic, "X(%d)", len);
        CB_FIELD (x)->pic = CB_PICTURE (cb_build_picture (pic));
        cb_validate_field (CB_FIELD (x));
        return x;
}

Here is the call graph for this function:

Here is the caller graph for this function:

cb_tree cb_build_index ( cb_tree  name,
cb_tree  values,
int  indexed_by,
struct cb_field qual 
)

Definition at line 744 of file typeck.c.

{
        struct cb_field *f;

        f = CB_FIELD (cb_build_field (x));
        f->usage = CB_USAGE_INDEX;
        cb_validate_field (f);
        if (values) {
                f->values = cb_list_init (values);
        }
        if (qual) {
                f->index_qual = qual;
        }
        f->flag_indexed_by = indexed_by;
        current_program->working_storage = cb_field_add (current_program->working_storage, f);
        return x;
}

Here is the call graph for this function:

Here is the caller graph for this function:

cb_tree cb_build_initialize ( cb_tree  var,
cb_tree  val,
cb_tree  rep,
cb_tree  def,
int  flag 
)

Definition at line 2113 of file tree.c.

{
        struct cb_initialize *p;

        p = make_tree (CB_TAG_INITIALIZE, CB_CATEGORY_UNKNOWN, sizeof (struct cb_initialize));
        p->var = var;
        p->val = val;
        p->rep = rep;
        p->def = def;
        p->flag_statement = flag;
        return CB_TREE (p);
}

Here is the caller graph for this function:

cb_tree cb_build_inspect_region ( cb_tree  l,
cb_tree  pos,
cb_tree  x 
)

Definition at line 3859 of file typeck.c.

{
        if (pos == CB_BEFORE) {
                return cb_list_add (l, cb_build_funcall_1 ("cob_inspect_before", x));
        } else {
                return cb_list_add (l, cb_build_funcall_1 ("cob_inspect_after", x));
        }
}

Here is the call graph for this function:

cb_tree cb_build_inspect_region_start ( void  )

Definition at line 3853 of file typeck.c.

{
        return cb_list_init (cb_build_funcall_0 ("cob_inspect_start"));
}
cb_tree cb_build_intrinsic ( cb_tree  name,
cb_tree  args,
cb_tree  refmod 
)

Definition at line 2262 of file tree.c.

{
        struct cb_intrinsic_table       *cbp;
        cb_tree                         x;
        int                             numargs;

        numargs = cb_list_length (args);

        cbp = lookup_intrinsic (CB_NAME (name), 0);
        if (cbp) {
                if ((cbp->args != -1 && numargs != cbp->args) ||
                    (cbp->args == -1 && cbp->intr_enum != CB_INTR_RANDOM && numargs < 1)) {
                        cb_error_x (name, _("FUNCTION %s has wrong number of arguments"), cbp->name);
                        return cb_error_node;
                }
                if (refmod) {
                        if (!cbp->refmod) {
                                cb_error_x (name, _("FUNCTION %s can not have reference modification"), cbp->name);
                                return cb_error_node;
                        }
                        if (CB_LITERAL_P(CB_PAIR_X(refmod)) &&
                            cb_get_int (CB_PAIR_X(refmod))< 1) {
                                cb_error_x (name, _("FUNCTION %s has invalid reference modification"), cbp->name);
                                return cb_error_node;
                        }
                        if (CB_PAIR_Y(refmod) && CB_LITERAL_P(CB_PAIR_Y(refmod)) &&
                            cb_get_int (CB_PAIR_Y(refmod))< 1) {
                                cb_error_x (name, _("FUNCTION %s has invalid reference modification"), cbp->name);
                                return cb_error_node;
                        }
                }
                /* cb_tree      x; */
                switch (cbp->intr_enum) {
                case CB_INTR_LENGTH:
                case CB_INTR_BYTE_LENGTH:
                        x = CB_VALUE (args);
                        if (CB_INTRINSIC_P (x)) {
                                return make_intrinsic (name, cbp, args, NULL, NULL);
                        } else if ((CB_FIELD_P (x) || CB_REFERENCE_P (x)) &&
                                    cb_field(x)->flag_any_length) {
                                return make_intrinsic (name, cbp, args, NULL, NULL);
                        } else {
                                return cb_build_length (CB_VALUE (args));
                        }

                case CB_INTR_WHEN_COMPILED:
                        if (refmod) {
                                return make_intrinsic (name, cbp,
                                        cb_list_init (cb_intr_whencomp), NULL, refmod);
                        } else {
                                return cb_intr_whencomp;
                        }
                case CB_INTR_PI:
                        return cb_intr_pi;
                case CB_INTR_E:
                        return cb_intr_e;

                case CB_INTR_LOWER_CASE:
                case CB_INTR_UPPER_CASE:
                case CB_INTR_REVERSE:
/* RXW Why did I do this ? - still do not know
                        if (CB_INTRINSIC_P (CB_VALUE (args))) {
                                return make_intrinsic (name, cbp, args, cb_int0);
                        } else {
                                return make_intrinsic (name, cbp, args,
                                                       cb_build_length (CB_VALUE (args)));
                        }
RXW */

                case CB_INTR_ABS:
                case CB_INTR_ACOS:
                case CB_INTR_ANNUITY:
                case CB_INTR_ASIN:
                case CB_INTR_ATAN:
                case CB_INTR_CHAR:
                case CB_INTR_COMBINED_DATETIME:
                case CB_INTR_COS:
                case CB_INTR_CURRENT_DATE:
                case CB_INTR_DATE_OF_INTEGER:
                case CB_INTR_DAY_OF_INTEGER:
                case CB_INTR_EXCEPTION_FILE:
                case CB_INTR_EXCEPTION_LOCATION:
                case CB_INTR_EXCEPTION_STATUS:
                case CB_INTR_EXCEPTION_STATEMENT:
                case CB_INTR_EXP:
                case CB_INTR_EXP10:
                case CB_INTR_FACTORIAL:
                case CB_INTR_FRACTION_PART:
                case CB_INTR_INTEGER:
                case CB_INTR_INTEGER_OF_DATE:
                case CB_INTR_INTEGER_OF_DAY:
                case CB_INTR_INTEGER_PART:
                case CB_INTR_LOCALE_DATE:
                case CB_INTR_LOCALE_TIME:
                case CB_INTR_LOCALE_TIME_FROM_SECS:
                case CB_INTR_LOG:
                case CB_INTR_LOG10:
                case CB_INTR_MOD:
                case CB_INTR_NUMVAL:
                case CB_INTR_NUMVAL_C:
                case CB_INTR_ORD:
                case CB_INTR_REM:
                case CB_INTR_SECONDS_FROM_FORMATTED_TIME:
                case CB_INTR_SECONDS_PAST_MIDNIGHT:
                case CB_INTR_SIGN:
                case CB_INTR_SIN:
                case CB_INTR_SQRT:
                case CB_INTR_STORED_CHAR_LENGTH:
                case CB_INTR_TAN:
                case CB_INTR_TEST_DATE_YYYYMMDD:
                case CB_INTR_TEST_DAY_YYYYDDD:
                case CB_INTR_TRIM:
                        return make_intrinsic (name, cbp, args, NULL, refmod);

                case CB_INTR_CONCATENATE:
                        return make_intrinsic (name, cbp, args, cb_int1, refmod);
                case CB_INTR_DATE_TO_YYYYMMDD:
                case CB_INTR_DAY_TO_YYYYDDD:
                case CB_INTR_MAX:
                case CB_INTR_MEAN:
                case CB_INTR_MEDIAN:
                case CB_INTR_MIDRANGE:
                case CB_INTR_MIN:
                case CB_INTR_ORD_MAX:
                case CB_INTR_ORD_MIN:
                case CB_INTR_PRESENT_VALUE:
                case CB_INTR_RANDOM:
                case CB_INTR_RANGE:
                case CB_INTR_STANDARD_DEVIATION:
                case CB_INTR_SUM:
                case CB_INTR_VARIANCE:
                case CB_INTR_YEAR_TO_YYYY:
                        return make_intrinsic (name, cbp, args, cb_int1, NULL);
                case CB_INTR_SUBSTITUTE:
                case CB_INTR_SUBSTITUTE_CASE:
                        if (numargs < 3 || (numargs % 2) == 0) {
                                cb_error_x (name, _("FUNCTION %s has wrong number of arguments"), cbp->name);
                                return cb_error_node;
                        }
                        return make_intrinsic (name, cbp, args, cb_int1, refmod);

                default:
                        break;
                }
        }
        cb_error_x (name, _("FUNCTION %s not implemented"), CB_NAME (name));
        return cb_error_node;
}

Here is the call graph for this function:

cb_tree cb_build_label ( cb_tree  name,
struct cb_label section 
)

Definition at line 2081 of file tree.c.

{
        struct cb_label *p;

        p = make_tree (CB_TAG_LABEL, CB_CATEGORY_UNKNOWN, sizeof (struct cb_label));
        p->id = cb_id++;
        p->name = (const unsigned char *)cb_define (name, CB_TREE (p));
        p->orig_name = p->name;
        p->section = section;
        return CB_TREE (p);
}

Here is the call graph for this function:

cb_tree cb_build_length ( cb_tree  x)

Definition at line 986 of file typeck.c.

{
        struct cb_field         *f;
        struct cb_literal       *l;
        cb_tree                 temp;
        char                    buff[64];

        if (x == cb_error_node) {
                return cb_error_node;
        }
        if (CB_REFERENCE_P (x) && cb_ref (x) == cb_error_node) {
                return cb_error_node;
        }

        memset (buff, 0, sizeof (buff));
        if (CB_LITERAL_P (x)) {
                l = CB_LITERAL (x);
                sprintf (buff, "%d", (int)l->size);
                return cb_build_numeric_literal (0, (ucharptr)buff, 0);
        }
        if (CB_REF_OR_FIELD_P (x)) {
                f = CB_FIELD (cb_ref (x));
                if (f->flag_any_length) {
                        return cb_build_any_intrinsic (cb_list_init (x));
                }
                if (cb_field_variable_size (f) == NULL) {
                        sprintf (buff, "%d", cb_field_size (x));
                        return cb_build_numeric_literal (0, (ucharptr)buff, 0);
                }
        }
        if (CB_INTRINSIC_P (x)) {
                return cb_build_any_intrinsic (cb_list_init (x));
        }
        temp = cb_build_index (cb_build_filler (), NULL, 0, NULL);
        CB_FIELD (cb_ref (temp))->usage = CB_USAGE_LENGTH;
        CB_FIELD (cb_ref (temp))->count++;
        cb_emit (cb_build_assign (temp, cb_build_length_1 (x)));
        return temp;
}

Here is the call graph for this function:

Here is the caller graph for this function:

cb_tree cb_build_list ( cb_tree  purpose,
cb_tree  value,
cb_tree  rest 
)

Definition at line 769 of file tree.c.

{
        struct cb_list *p;

        p = make_tree (CB_TAG_LIST, CB_CATEGORY_UNKNOWN, sizeof (struct cb_list));
        p->purpose = purpose;
        p->value = value;
        p->chain = rest;
        return CB_TREE (p);
}
cb_tree cb_build_locale_name ( cb_tree  name,
cb_tree  list 
)

Definition at line 957 of file tree.c.

{
        struct cb_class_name    *p;

        p = make_tree (CB_TAG_LOCALE_NAME, CB_CATEGORY_UNKNOWN, sizeof (struct cb_locale_name));
        p->name = cb_define (name, CB_TREE (p));
        p->cname = to_cname (p->name);
        p->list = list;
        return CB_TREE (p);
}

Here is the call graph for this function:

cb_tree cb_build_move ( cb_tree  src,
cb_tree  dst 
)

Definition at line 4964 of file typeck.c.

{
        struct cb_field *f;
        struct cb_field *p;

        if (src == cb_error_node || dst == cb_error_node) {
                return cb_error_node;
        }

        if (validate_move (src, dst, 0) < 0) {
                return cb_error_node;
        }

        if (CB_REFERENCE_P (src)) {
                CB_REFERENCE (src)->type = CB_SENDING_OPERAND;
        }
        if (CB_REFERENCE_P (dst)) {
                CB_REFERENCE (dst)->type = CB_RECEIVING_OPERAND;
        }

        if (CB_TREE_CLASS (dst) == CB_CLASS_POINTER) {
                return cb_build_assign (dst, src);
        }

        if (CB_REFERENCE_P (src) && CB_ALPHABET_NAME_P(CB_REFERENCE(src)->value)) {
                return cb_build_move_call (src, dst);
        }
        if (CB_INDEX_P (dst)) {
                if (src == cb_null) {
                        return cb_build_assign (dst, cb_zero);
                }
                return cb_build_assign (dst, src);
        }

        if (CB_INDEX_P (src)) {
                return cb_build_funcall_2 ("cob_set_int", dst, cb_build_cast_integer (src));
        }

        if (CB_INTRINSIC_P (src) || CB_INTRINSIC_P (dst)) {
                return cb_build_move_call (src, dst);
        }

        f = cb_field (dst);

        if (CB_EXCEPTION_ENABLE (COB_EC_BOUND_SUBSCRIPT)) {
                for (p = f; p; p = p->parent) {
                        if (p->flag_occurs) {
                                return cb_build_move_call (src, dst);
                        }
                }
                if (CB_REF_OR_FIELD_P (src)) {
                        for (p = cb_field (src); p; p = p->parent) {
                                if (p->flag_occurs) {
                                        return cb_build_move_call (src, dst);
                                }
                        }
                }
        }

        /* output optimal code */
        if (src == cb_zero) {
                return cb_build_move_zero (dst);
        } else if (src == cb_space) {
                return cb_build_move_space (dst);
        } else if (src == cb_high) {
                return cb_build_move_high (dst);
        } else if (src == cb_low) {
                return cb_build_move_low (dst);
        } else if (src == cb_quote) {
                return cb_build_move_quote (dst);
        } else if (CB_LITERAL_P (src)) {
                return cb_build_move_literal (src, dst);
        }
        return cb_build_move_field (src, dst);
}

Here is the call graph for this function:

Here is the caller graph for this function:

cb_tree cb_build_numeric_literal ( int  sign,
const unsigned char *  data,
int  scale 
)

Definition at line 988 of file tree.c.

{
        struct cb_literal *p;

        p = build_literal (CB_CATEGORY_NUMERIC, data, strlen ((char *)data));
        p->sign = (char)sign;
        p->scale = (char)scale;
        return CB_TREE (p);
}

Here is the call graph for this function:

Here is the caller graph for this function:

cb_tree cb_build_perform ( int  type)

Definition at line 2199 of file tree.c.

{
        struct cb_perform *p;

        p = make_tree (CB_TAG_PERFORM, CB_CATEGORY_UNKNOWN, sizeof (struct cb_perform));
        p->type = type;
        return CB_TREE (p);
}

Here is the caller graph for this function:

cb_tree cb_build_perform_exit ( struct cb_label label)

Definition at line 5156 of file typeck.c.

{
        cb_tree x;

        x = cb_build_perform (CB_PERFORM_EXIT);
        CB_PERFORM (x)->data = CB_TREE (label);
        return x;
}

Here is the call graph for this function:

cb_tree cb_build_perform_forever ( cb_tree  body)

Definition at line 5143 of file typeck.c.

{
        cb_tree x;

        if (body == cb_error_node) {
                return cb_error_node;
        }
        x = cb_build_perform (CB_PERFORM_FOREVER);
        CB_PERFORM (x)->body = body;
        return x;
}

Here is the call graph for this function:

cb_tree cb_build_perform_once ( cb_tree  body)

Definition at line 5105 of file typeck.c.

{
        cb_tree x;

        if (body == cb_error_node) {
                return cb_error_node;
        }
        x = cb_build_perform (CB_PERFORM_ONCE);
        CB_PERFORM (x)->body = body;
        return x;
}

Here is the call graph for this function:

Here is the caller graph for this function:

cb_tree cb_build_perform_times ( cb_tree  count)

Definition at line 5118 of file typeck.c.

{
        cb_tree x;

        if (cb_check_integer_value (times) == cb_error_node) {
                return cb_error_node;
        }

        x = cb_build_perform (CB_PERFORM_TIMES);
        CB_PERFORM (x)->data = times;
        return x;
}

Here is the call graph for this function:

cb_tree cb_build_perform_until ( cb_tree  condition,
cb_tree  varying 
)

Definition at line 5132 of file typeck.c.

{
        cb_tree x;

        x = cb_build_perform (CB_PERFORM_UNTIL);
        CB_PERFORM (x)->test = condition;
        CB_PERFORM (x)->varying = varying;
        return x;
}

Here is the call graph for this function:

cb_tree cb_build_perform_varying ( cb_tree  name,
cb_tree  from,
cb_tree  step,
cb_tree  until 
)

Definition at line 2209 of file tree.c.

{
        struct cb_perform_varying *p;

        p = make_tree (CB_TAG_PERFORM_VARYING, CB_CATEGORY_UNKNOWN, sizeof (struct cb_perform_varying));
        p->name = name;
        p->from = from;
        p->step = name ? cb_build_add (name, by, cb_high) : NULL;
        p->until = until;
        return CB_TREE (p);
}

Here is the call graph for this function:

cb_tree cb_build_picture ( const char *  str)

Definition at line 1090 of file tree.c.

{
        struct cb_picture       *pic;
        const char              *p;
        size_t                  idx = 0;
        size_t                  buffcnt = 0;
        size_t                  at_beginning;
        size_t                  at_end;
        size_t                  p_char_seen;
        size_t                  s_char_seen;
        int                     category = 0;
        int                     size = 0;
        int                     allocated = 0;
        int                     digits = 0;
        int                     scale = 0;
        int                     s_count = 0;
        int                     v_count = 0;
        int                     i;
        int                     n;
        unsigned char           c;
        unsigned char           lastonechar = 0;
        unsigned char           lasttwochar = 0;
        unsigned char           buff[COB_SMALL_BUFF];

        pic = make_tree (CB_TAG_PICTURE, CB_CATEGORY_UNKNOWN, sizeof (struct cb_picture));
        if (strlen (str) > 50) {
                goto error;
        }
        memset (buff, 0, sizeof (buff));
        p_char_seen = 0;
        s_char_seen = 0;
        for (p = str; *p; p++) {
                n = 1;
                c = *p;
repeat:
                /* count the number of repeated chars */
                while (p[1] == c) {
                        p++, n++;
                }

                /* add parenthesized numbers */
                if (p[1] == '(') {
                        i = 0;
                        p += 2;
                        for (; *p == '0'; p++) {
                                ;
                        }
                        for (; *p != ')'; p++) {
                                if (!isdigit (*p)) {
                                        goto error;
                                } else {
                                        allocated++;
                                        if (allocated > 9) {
                                                goto error;
                                        }
                                        i = i * 10 + (*p - '0');
                                }
                        }
                        if (i == 0) {
                                goto error;
                        }
                        n += i - 1;
                        goto repeat;
                }

                /* check grammar and category */
                /* FIXME: need more error check */
                switch (c) {
                case 'A':
                        if (s_char_seen || p_char_seen) {
                                goto error;
                        }
                        category |= PIC_ALPHABETIC;
                        break;

                case 'X':
                        if (s_char_seen || p_char_seen) {
                                goto error;
                        }
                        category |= PIC_ALPHANUMERIC;
                        break;

                case '9':
                        category |= PIC_NUMERIC;
                        digits += n;
                        if (v_count) {
                                scale += n;
                        }
                        break;

                case 'N':
                        if (s_char_seen || p_char_seen) {
                                goto error;
                        }
                        category |= PIC_NATIONAL;
                        break;

                case 'S':
                        category |= PIC_NUMERIC;
                        if (category & PIC_ALPHABETIC) {
                                goto error;
                        }
                        s_count += n;
                        if (s_count > 1 || idx != 0) {
                                goto error;
                        }
                        s_char_seen = 1;
                        continue;

                case ',':
                case '.':
                        category |= PIC_NUMERIC_EDITED;
                        if (s_char_seen || p_char_seen) {
                                goto error;
                        }
                        if (c != current_program->decimal_point) {
                                break;
                        }
                        /* fall through */
                case 'V':
                        category |= PIC_NUMERIC;
                        if (category & PIC_ALPHABETIC) {
                                goto error;
                        }
                        v_count += n;
                        if (v_count > 1) {
                                goto error;
                        }
                        break;

                case 'P':
                        category |= PIC_NUMERIC;
                        if (category & PIC_ALPHABETIC) {
                                goto error;
                        }
                        if (p_char_seen) {
                                goto error;
                        }
                        at_beginning = 0;
                        at_end = 0;
                        switch (buffcnt) {
                        case 0:
                                /* P..... */
                                at_beginning = 1;
                                break;
                        case 1:
                                /* VP.... */
                                /* SP.... */
                                if (lastonechar == 'V' || lastonechar == 'S') {
                                        at_beginning = 1;
                                }
                                break;
                        case 2:
                                /* SVP... */
                                if (lasttwochar == 'S' && lastonechar == 'V') {
                                        at_beginning = 1;
                                }
                                break;
                        }
                        if (p[1] == 0 || (p[1] == 'V' && p[2] == 0)) {
                                /* .....P */
                                /* ....PV */
                                at_end = 1;
                        }
                        if (!at_beginning && !at_end) {
                                goto error;
                        }
                        p_char_seen = 1;
                        if (at_beginning) {
                                v_count++;      /* implicit V */
                        }
                        digits += n;
                        if (v_count) {
                                scale += n;
                        } else {
                                scale -= n;
                        }
                        break;

                case '0':
                case 'B':
                case '/':
                        category |= PIC_EDITED;
                        if (s_char_seen || p_char_seen) {
                                goto error;
                        }
                        break;

                case '*':
                case 'Z':
                        category |= PIC_NUMERIC_EDITED;
                        if (category & PIC_ALPHABETIC) {
                                goto error;
                        }
                        if (s_char_seen || p_char_seen) {
                                goto error;
                        }
                        digits += n;
                        if (v_count) {
                                scale += n;
                        }
                        break;

                case '+':
                case '-':
                        category |= PIC_NUMERIC_EDITED;
                        if (category & PIC_ALPHABETIC) {
                                goto error;
                        }
                        if (s_char_seen || p_char_seen) {
                                goto error;
                        }
                        digits += n - 1;
                        s_count++;
                        /* FIXME: need more check */
                        break;

                case 'C':
                        category |= PIC_NUMERIC_EDITED;
                        if (!(p[1] == 'R' && p[2] == 0)) {
                                goto error;
                        }
                        if (s_char_seen || p_char_seen) {
                                goto error;
                        }
                        p++;
                        s_count++;
                        break;

                case 'D':
                        category |= PIC_NUMERIC_EDITED;
                        if (!(p[1] == 'B' && p[2] == 0)) {
                                goto error;
                        }
                        if (s_char_seen || p_char_seen) {
                                goto error;
                        }
                        p++;
                        s_count++;
                        break;

                default:
                        if (c == current_program->currency_symbol) {
                                category |= PIC_NUMERIC_EDITED;
                                digits += n - 1;
                                /* FIXME: need more check */
                                break;
                        }

                        goto error;
                }

                /* calculate size */
                if (c != 'V' && c != 'P') {
                        size += n;
                }
                if (c == 'C' || c == 'D' || c == 'N') {
                        size += n;
                }

                /* store in the buffer */
                buff[idx++] = c;
                lasttwochar = lastonechar;
                lastonechar = c;
                memcpy (&buff[idx], (unsigned char *)&n, sizeof(int));
                idx += sizeof(int);
                ++buffcnt;
        }
        buff[idx] = 0;

        if (size == 0 && v_count) {
                goto error;
        }
        /* set picture */
        pic->orig = strdup (str);
        pic->size = size;
        pic->digits = (unsigned char)digits;
        pic->scale = (signed char)scale;
        pic->have_sign = (unsigned char)s_count;

        /* set picture category */
        switch (category) {
        case PIC_ALPHABETIC:
                pic->category = CB_CATEGORY_ALPHABETIC;
                break;
        case PIC_NUMERIC:
                pic->category = CB_CATEGORY_NUMERIC;
                if (digits > 36) {
                        cb_error (_("Numeric field cannot be larger than 36 digits"));
                }
                break;
        case PIC_ALPHANUMERIC:
        case PIC_NATIONAL:
                pic->category = CB_CATEGORY_ALPHANUMERIC;
                break;
        case PIC_NUMERIC_EDITED:
                pic->str = cobc_malloc (idx + 1);
                memcpy (pic->str, buff, idx);
                pic->category = CB_CATEGORY_NUMERIC_EDITED;
                pic->lenstr = idx;
                break;
        case PIC_EDITED:
        case PIC_ALPHABETIC_EDITED:
        case PIC_ALPHANUMERIC_EDITED:
        case PIC_NATIONAL_EDITED:
                pic->str = cobc_malloc (idx + 1);
                memcpy (pic->str, buff, idx);
                pic->category = CB_CATEGORY_ALPHANUMERIC_EDITED;
                pic->lenstr = idx;
                break;
        default:
                goto error;
        }
        goto end;

error:
        cb_error (_("Invalid picture string - '%s'"), str);

end:
        return CB_TREE (pic);
}

Here is the call graph for this function:

Here is the caller graph for this function:

cb_tree cb_build_ppointer ( cb_tree  x)

Definition at line 1038 of file typeck.c.

{
        struct cb_field *f;

        if (x == cb_error_node ||
            (CB_REFERENCE_P (x) && cb_ref (x) == cb_error_node)) {
                return cb_error_node;
        }

        if (CB_REFERENCE_P (x)) {
                f = cb_field (cb_ref(x));
                f->count++;
        }
        return cb_build_cast_ppointer (x);
}

Here is the call graph for this function:

struct cb_program* cb_build_program ( struct cb_program last_program,
int  nest_level 
) [read]

Definition at line 841 of file tree.c.

{
        struct cb_program *p;

        cb_reset_78 ();
        cb_reset_in_procedure ();
        cb_clear_real_field ();
        p = cobc_malloc (sizeof (struct cb_program));
        p->next_program = last_program;
        p->nested_level = nest_level;
        p->decimal_point = '.';
        p->currency_symbol = '$';
        p->numeric_separator = ',';
        if (nest_level) {
                p->global_file_list = last_program->global_file_list;
                p->collating_sequence = last_program->collating_sequence;
                p->function_spec_list = last_program->function_spec_list;
                p->class_spec_list = last_program->class_spec_list;
                p->interface_spec_list = last_program->interface_spec_list;
                p->program_spec_list = last_program->program_spec_list;
                p->property_spec_list = last_program->property_spec_list;
                p->alphabet_name_list = last_program->alphabet_name_list;
                p->class_name_list = last_program->class_name_list;
                p->locale_list = last_program->locale_list;
                p->symbolic_list = last_program->symbolic_list;
                p->decimal_point = last_program->decimal_point;
                p->numeric_separator = last_program->numeric_separator;
                p->currency_symbol = last_program->currency_symbol;
                p->cb_return_code = last_program->cb_return_code;
        } else {
                functions_are_all = cb_flag_functions_all;
        }
        return p;
}

Here is the call graph for this function:

const char* cb_build_program_id ( cb_tree  name,
cb_tree  alt_name 
)

Definition at line 591 of file typeck.c.

{
        const char      *s;

/* This needs some more thought, should we generate an entry
        point per program source name ?
        if (alt_name) {
                s = (char *)CB_LITERAL (alt_name)->data;
        } else if (CB_LITERAL_P (name)) {
                s = (char *)CB_LITERAL (name)->data;
        } else {
                s = (char *)CB_NAME (name);
        }

        if (!cb_flag_main && strcmp (s, source_name)) {
                cb_warning (_("Source name '%s' differs from PROGRAM-ID '%s'"),
                                source_name, s);
                current_program->source_name = strdup (source_name);
        }
 End comment out */

        if (alt_name) {
                current_program->orig_source_name = strdup ((char *)CB_LITERAL (alt_name)->data);
                s = (char *)CB_LITERAL (alt_name)->data;
        } else if (CB_LITERAL_P (name)) {
                current_program->orig_source_name = strdup ((char *)CB_LITERAL (name)->data);
                s = cb_encode_program_id ((char *)CB_LITERAL (name)->data);
        } else {
                current_program->orig_source_name = strdup (CB_NAME (name));
                s = cb_encode_program_id (CB_NAME (name));
        }
        if (cobc_check_valid_name (current_program->orig_source_name)) {
                cb_error (_("PROGRAM-ID '%s' invalid"), current_program->orig_source_name);
        }
        return s;
}

Here is the call graph for this function:

cb_tree cb_build_reference ( const char *  name)

Definition at line 1730 of file tree.c.

{
        struct cb_reference *p;

        p = make_tree (CB_TAG_REFERENCE, CB_CATEGORY_UNKNOWN, sizeof (struct cb_reference));
        p->word = lookup_word (name);
        return CB_TREE (p);
}

Here is the caller graph for this function:

void cb_build_registers ( void  )

Definition at line 494 of file typeck.c.

{
#if !defined(__linux__) && !defined(__CYGWIN__) && defined(HAVE_TIMEZONE)
        long    contz;
#endif
        time_t  t;
        char    buff[48];

        /* RETURN-CODE */
        if (!current_program->nested_level) {
                current_program->cb_return_code =
                        cb_build_index (cb_build_reference ("RETURN-CODE"),
                                        cb_zero, 0, NULL);
                cb_field (current_program->cb_return_code)->flag_is_global = 1;
        }

        /* SORT-RETURN */
        current_program->cb_sort_return =
                cb_build_index (cb_build_reference ("SORT-RETURN"), cb_zero, 0, NULL);
        cb_field (current_program->cb_sort_return)->flag_no_init = 1;

        /* NUMBER-OF-CALL-PARAMETERS */
        current_program->cb_call_params =
                cb_build_index (cb_build_reference ("NUMBER-OF-CALL-PARAMETERS"), cb_zero, 0, NULL);
        cb_field (current_program->cb_call_params)->flag_no_init = 1;

        /* TALLY */
        /* 01 TALLY GLOBAL PICTURE 9(9) USAGE COMP-5 VALUE ZERO. */
        /* TALLY/EXAMINE  not standard/supported */

        t = time (NULL);

        /* WHEN-COMPILED */
        memset (buff, 0, sizeof (buff));
        strftime (buff, 17, "%m/%d/%y%H.%M.%S", localtime (&t));
        cb_build_constant (cb_build_reference ("WHEN-COMPILED"),
                           cb_build_alphanumeric_literal ((ucharptr)buff, 16));

        /* FUNCTION WHEN-COMPILED */
        memset (buff, 0, sizeof (buff));
#if defined(__linux__) || defined(__CYGWIN__)
        strftime (buff, 22, "%Y%m%d%H%M%S00%z", localtime (&t));
#elif defined(HAVE_TIMEZONE)
        strftime (buff, 17, "%Y%m%d%H%M%S00", localtime (&t));
        if (timezone <= 0) {
                contz = -timezone;
                buff[16] = '+';
        } else {
                contz = timezone;
                buff[16] = '-';
        }
        sprintf (&buff[17], "%2.2ld%2.2ld", contz / 3600, contz % 60);
#else
        strftime (buff, 22, "%Y%m%d%H%M%S0000000", localtime (&t));
#endif
        cb_intr_whencomp = cb_build_alphanumeric_literal ((ucharptr)buff, 21);

        /* FUNCTION PI */
        memset (buff, 0, sizeof (buff));
        strcpy (buff, "31415926535897932384626433832795029");
        cb_intr_pi = cb_build_numeric_literal (0, (ucharptr)buff, 34);

        /* FUNCTION E */
        memset (buff, 0, sizeof (buff));
        strcpy (buff, "27182818284590452353602874713526625");
        cb_intr_e = cb_build_numeric_literal (0, (ucharptr)buff, 34);
}

Here is the call graph for this function:

cb_tree cb_build_replacing_all ( cb_tree  x,
cb_tree  y,
cb_tree  l 
)

Definition at line 3823 of file typeck.c.

{
        return cb_list_add (l, cb_build_funcall_2 ("cob_inspect_all", y, x));
}

Here is the call graph for this function:

cb_tree cb_build_replacing_characters ( cb_tree  x,
cb_tree  l 
)

Definition at line 3817 of file typeck.c.

{
        return cb_list_add (l, cb_build_funcall_1 ("cob_inspect_characters", x));
}

Here is the call graph for this function:

cb_tree cb_build_replacing_first ( cb_tree  x,
cb_tree  y,
cb_tree  l 
)

Definition at line 3835 of file typeck.c.

{
        return cb_list_add (l, cb_build_funcall_2 ("cob_inspect_first", y, x));
}

Here is the call graph for this function:

cb_tree cb_build_replacing_leading ( cb_tree  x,
cb_tree  y,
cb_tree  l 
)

Definition at line 3829 of file typeck.c.

{
        return cb_list_add (l, cb_build_funcall_2 ("cob_inspect_leading", y, x));
}

Here is the call graph for this function:

cb_tree cb_build_replacing_trailing ( cb_tree  x,
cb_tree  y,
cb_tree  l 
)

Definition at line 3841 of file typeck.c.

{
        return cb_list_add (l, cb_build_funcall_2 ("cob_inspect_trailing", y, x));
}

Here is the call graph for this function:

cb_tree cb_build_search ( int  flag_all,
cb_tree  table,
cb_tree  var,
cb_tree  end_stmt,
cb_tree  whens 
)

Definition at line 2131 of file tree.c.

{
        struct cb_search *p;

        p = make_tree (CB_TAG_SEARCH, CB_CATEGORY_UNKNOWN, sizeof (struct cb_search));
        p->flag_all = flag_all;
        p->table = table;
        p->var = var;
        p->end_stmt = end_stmt;
        p->whens = whens;
        return CB_TREE (p);
}

Here is the caller graph for this function:

cb_tree cb_build_section_name ( cb_tree  name,
int  sect_or_para 
)

Definition at line 653 of file typeck.c.

{
        cb_tree x;

        if (name == cb_error_node) {
                return cb_error_node;
        }

        if (CB_REFERENCE (name)->word->count > 0) {
                x = CB_VALUE (CB_REFERENCE (name)->word->items);
                /* Used as a non-label name or used as a section name.
                   Duplicate paragraphs are allowed if not referenced;
                   Checked in typeck.c */
                if (!CB_LABEL_P (x) || sect_or_para == 0
                    || (sect_or_para && CB_LABEL_P (x) && CB_LABEL (x)->is_section)) {
                        redefinition_error (name);
                        return cb_error_node;
                }
        }

        return name;
}

Here is the call graph for this function:

struct cb_statement* cb_build_statement ( const char *  name) [read]

Definition at line 2226 of file tree.c.

{
        struct cb_statement *p;

        p = make_tree (CB_TAG_STATEMENT, CB_CATEGORY_UNKNOWN, sizeof (struct cb_statement));
        p->name = name;
        return p;
}
cb_tree cb_build_string ( const unsigned char *  data,
size_t  size 
)

Definition at line 908 of file tree.c.

{
        struct cb_string *p;

        p = make_tree (CB_TAG_STRING, CB_CATEGORY_ALPHANUMERIC, sizeof (struct cb_string));
        p->size = size;
        p->data = data;
        return CB_TREE (p);
}
cb_tree cb_build_sub ( cb_tree  v,
cb_tree  n,
cb_tree  round_opt 
)

Definition at line 2633 of file typeck.c.

{
        cb_tree         opt;
        struct cb_field *f;

#ifdef  COB_NON_ALIGNED
        if (CB_INDEX_P (v)) {
                return cb_build_move (cb_build_binary_op (v, '-', n), v);
        }
        if (CB_TREE_CLASS (v) == CB_CLASS_POINTER) {
                current_program->gen_ptrmanip = 1;
                return cb_build_funcall_3 ("cob_pointer_manip", v, n, cb_int1);
        }
#else
        if (CB_INDEX_P (v) || CB_TREE_CLASS (v) == CB_CLASS_POINTER) {
                return cb_build_move (cb_build_binary_op (v, '-', n), v);
        }
#endif

        if (CB_REF_OR_FIELD_P (v)) {
                f = cb_field (v);
                f->count++;
        }
        if (CB_REF_OR_FIELD_P (n)) {
                f = cb_field (n);
                f->count++;
        }
        opt = build_store_option (v, round_opt);
        if (opt == cb_int0 && cb_fits_int (n)) {
                return cb_build_optim_sub (v, n);
        }
        return cb_build_funcall_3 ("cob_sub", v, n, opt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

cb_tree cb_build_system_name ( enum cb_system_name_category  category,
int  token 
)

Definition at line 973 of file tree.c.

{
        struct cb_system_name *p;

        p = make_tree (CB_TAG_SYSTEM_NAME, CB_CATEGORY_UNKNOWN, sizeof (struct cb_system_name));
        p->category = category;
        p->token = token;
        return CB_TREE (p);
}

Here is the caller graph for this function:

cb_tree cb_build_tarrying_all ( void  )

Definition at line 3778 of file typeck.c.

{
        if (inspect_data == NULL) {
                cb_error (_("Data name expected before ALL"));
        }
        inspect_func = "cob_inspect_all";
        return NULL;
}

Here is the call graph for this function:

cb_tree cb_build_tarrying_characters ( cb_tree  l)

Definition at line 3768 of file typeck.c.

{
        if (inspect_data == NULL) {
                cb_error (_("Data name expected before CHARACTERS"));
        }
        inspect_func = NULL;
        return cb_list_add (l, cb_build_funcall_1 ("cob_inspect_characters", inspect_data));
}

Here is the call graph for this function:

cb_tree cb_build_tarrying_data ( cb_tree  x)

Definition at line 3761 of file typeck.c.

{
        inspect_data = x;
        return NULL;
}
cb_tree cb_build_tarrying_leading ( void  )

Definition at line 3788 of file typeck.c.

{
        if (inspect_data == NULL) {
                cb_error (_("Data name expected before LEADING"));
        }
        inspect_func = "cob_inspect_leading";
        return NULL;
}

Here is the call graph for this function:

cb_tree cb_build_tarrying_trailing ( void  )

Definition at line 3798 of file typeck.c.

{
        if (inspect_data == NULL) {
                cb_error (_("Data name expected before TRAILING"));
        }
        inspect_func = "cob_inspect_trailing";
        return NULL;
}

Here is the call graph for this function:

cb_tree cb_build_tarrying_value ( cb_tree  x,
cb_tree  l 
)

Definition at line 3808 of file typeck.c.

{
        if (inspect_func == NULL) {
                cb_error_x (x, _("ALL, LEADING or TRAILING expected before '%s'"), cb_name (x));
        }
        return cb_list_add (l, cb_build_funcall_2 (inspect_func, inspect_data, x));
}

Here is the call graph for this function:

cb_tree cb_build_unstring_delimited ( cb_tree  all,
cb_tree  value 
)

Definition at line 5866 of file typeck.c.

{
        if (cb_validate_one (value)) {
                return cb_error_node;
        }
        return cb_build_funcall_2 ("cob_unstring_delimited", value, all);
}
cb_tree cb_build_unstring_into ( cb_tree  name,
cb_tree  delimiter,
cb_tree  count 
)

Definition at line 5875 of file typeck.c.

{
        if (cb_validate_one (name)) {
                return cb_error_node;
        }
        if (delimiter == NULL) {
                delimiter = cb_int0;
        }
        if (count == NULL) {
                count = cb_int0;
        }
        return cb_build_funcall_3 ("cob_unstring_into", name, delimiter, count);
}
cb_tree cb_build_write_advancing_lines ( cb_tree  pos,
cb_tree  lines 
)

Definition at line 5957 of file typeck.c.

{
        cb_tree e;
        int     opt;

        opt = (pos == CB_BEFORE) ? COB_WRITE_BEFORE : COB_WRITE_AFTER;
        e = cb_build_binary_op (cb_int (opt | COB_WRITE_LINES), '+', lines);
        return cb_build_cast_integer (e);
}

Here is the call graph for this function:

cb_tree cb_build_write_advancing_mnemonic ( cb_tree  pos,
cb_tree  mnemonic 
)

Definition at line 5968 of file typeck.c.

{
        int     opt;
        int     token;

        token = CB_SYSTEM_NAME (cb_ref (mnemonic))->token;
        switch (token) {
        case CB_FEATURE_FORMFEED:
                opt = (pos == CB_BEFORE) ? COB_WRITE_BEFORE : COB_WRITE_AFTER;
                return cb_int (opt | COB_WRITE_PAGE);
        case CB_FEATURE_C01:
        case CB_FEATURE_C02:
        case CB_FEATURE_C03:
        case CB_FEATURE_C04:
        case CB_FEATURE_C05:
        case CB_FEATURE_C06:
        case CB_FEATURE_C07:
        case CB_FEATURE_C08:
        case CB_FEATURE_C09:
        case CB_FEATURE_C10:
        case CB_FEATURE_C11:
        case CB_FEATURE_C12:
                opt = (pos == CB_BEFORE) ? COB_WRITE_BEFORE : COB_WRITE_AFTER;
                return cb_int (opt | COB_WRITE_CHANNEL | COB_WRITE_PAGE | token);
        default:
                cb_error_x (mnemonic, _("Invalid mnemonic name"));
                return cb_error_node;
        }
}

Here is the call graph for this function:

cb_tree cb_build_write_advancing_page ( cb_tree  pos)

Definition at line 5999 of file typeck.c.

{
        int opt = (pos == CB_BEFORE) ? COB_WRITE_BEFORE : COB_WRITE_AFTER;

        return cb_int (opt | COB_WRITE_PAGE);
}

Here is the call graph for this function:

cb_tree cb_check_numeric_value ( cb_tree  x)

Definition at line 426 of file typeck.c.

{
        if (x == cb_error_node) {
                return cb_error_node;
        }

        if (CB_TREE_CATEGORY (x) == CB_CATEGORY_NUMERIC) {
                return x;
        }

        cb_error_x (x, _("'%s' is not a numeric value"), cb_name (x));
        return cb_error_node;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void cb_clear_real_field ( void  )

Definition at line 1050 of file field.c.

{
        last_real_field = NULL;
}

Here is the caller graph for this function:

cb_tree cb_concat_literals ( cb_tree  x1,
cb_tree  x2 
)

Definition at line 1005 of file tree.c.

{
        unsigned char           *buff;
        cb_tree                 x;
        unsigned char           *data1;
        unsigned char           *data2;
        size_t                  size1;
        size_t                  size2;

        if (x1 == cb_error_node || x2 == cb_error_node) {
                return cb_error_node;
        }
        if (CB_LITERAL_P (x1)) {
                data1 = CB_LITERAL (x1)->data;
                size1 = CB_LITERAL (x1)->size;
        } else if (CB_CONST_P (x1)) {
                size1 = 1;
                if (x1 == cb_space) {
                        data1 = (unsigned char *)" ";
                } else if (x1 == cb_zero) {
                        data1 = (unsigned char *)"0";
                } else if (x1 == cb_quote) {
                        data1 = (unsigned char *)"\"";
                } else if (x1 == cb_norm_low) {
                        data1 = (unsigned char *)"\0";
                } else if (x1 == cb_norm_high) {
                        data1 = (unsigned char *)"\255";
                } else if (x1 == cb_null) {
                        data1 = (unsigned char *)"\0";
                } else {
                        return cb_error_node;
                }
        } else {
                return cb_error_node;
        }
        if (CB_LITERAL_P (x2)) {
                data2 = CB_LITERAL (x2)->data;
                size2 = CB_LITERAL (x2)->size;
        } else if (CB_CONST_P (x2)) {
                size2 = 1;
                if (x2 == cb_space) {
                        data2 = (unsigned char *)" ";
                } else if (x2 == cb_zero) {
                        data2 = (unsigned char *)"0";
                } else if (x2 == cb_quote) {
                        data2 = (unsigned char *)"\"";
                } else if (x2 == cb_norm_low) {
                        data2 = (unsigned char *)"\0";
                } else if (x2 == cb_norm_high) {
                        data2 = (unsigned char *)"\255";
                } else if (x2 == cb_null) {
                        data2 = (unsigned char *)"\0";
                } else {
                        return cb_error_node;
                }
        } else {
                return cb_error_node;
        }
        buff = cobc_malloc (size1 + size2 + 3);
        memcpy (buff, data1, size1);
        memcpy (buff + size1, data2, size2);
        x = cb_build_alphanumeric_literal (buff, size1 + size2);
        free (buff);
        return x;
}

Here is the call graph for this function:

const char* cb_define ( cb_tree  name,
cb_tree  val 
)

Definition at line 1769 of file tree.c.

{
        struct cb_word *w;

        w = CB_REFERENCE (name)->word;
        w->items = cb_list_add (w->items, val);
        w->count++;
        val->source_file = name->source_file;
        val->source_line = name->source_line;
        CB_REFERENCE (name)->value = val;
        return w->name;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void cb_define_switch_name ( cb_tree  name,
cb_tree  sname,
cb_tree  flag,
cb_tree  ref 
)

Definition at line 629 of file typeck.c.

{
        cb_tree switch_id;
        cb_tree value;

        if (name == cb_error_node) {
                return;
        }
        if (sname == cb_error_node) {
                return;
        }
        if (CB_SYSTEM_NAME (sname)->category != CB_SWITCH_NAME) {
                cb_error_x (ref, _("Switch-name is expected '%s'"), CB_NAME (ref));
        } else {
                switch_id = cb_int (CB_SYSTEM_NAME (sname)->token);
                value = cb_build_funcall_1 ("cob_get_switch", switch_id);
                if (flag == cb_int0) {
                        value = cb_build_negation (value);
                }
                cb_build_constant (name, value);
        }
}

Here is the call graph for this function:

void cb_define_system_name ( const char *  name)

Definition at line 1783 of file tree.c.

{
        cb_tree x;

        x = cb_build_reference (name);
        if (CB_REFERENCE (x)->word->count == 0) {
                cb_define (x, lookup_system_name (name));
        }
}

Here is the call graph for this function:

void cb_emit_accept ( cb_tree  var,
cb_tree  pos,
cb_tree  fgc,
cb_tree  bgc,
cb_tree  scroll,
int  dispattrs 
)

Definition at line 2802 of file typeck.c.

{
        cb_tree line;
        cb_tree column;

        if (cb_validate_one (var)) {
                return;
        }
        if (cb_validate_one (pos)) {
                return;
        }
        if (cb_validate_one (fgc)) {
                return;
        }
        if (cb_validate_one (bgc)) {
                return;
        }
        if (cb_validate_one (scroll)) {
                return;
        }
        if (current_program->flag_screen) {
                /* Bump ref count to force CRT STATUS field generation */
                cb_field (current_program->crt_status)->count++;
                if ((CB_REF_OR_FIELD_P (var)) &&
                     CB_FIELD (cb_ref (var))->storage == CB_STORAGE_SCREEN) {
                        output_screen_from (CB_FIELD (cb_ref (var)), 0);
                        gen_screen_ptr = 1;
                        if (pos) {
                                if (CB_PAIR_P (pos)) {
                                        line = CB_PAIR_X (pos);
                                        column = CB_PAIR_Y (pos);
                                        cb_emit (cb_build_funcall_3 ("cob_screen_accept",
                                                var, line, column));
                                } else {
                                        cb_emit (cb_build_funcall_3 ("cob_screen_accept",
                                                var, pos, NULL));
                                }
                        } else {
                                cb_emit (cb_build_funcall_3 ("cob_screen_accept",
                                        var, NULL, NULL));
                        }
                        gen_screen_ptr = 0;
                        output_screen_to (CB_FIELD (cb_ref (var)), 0);
                } else {
                        if (pos || fgc || bgc) {
                                if (!pos) {
                                        cb_emit (cb_build_funcall_7 ("cob_field_accept",
                                                var, NULL, NULL, fgc, bgc,
                                                scroll, cb_int (dispattrs)));
                                } else if (CB_PAIR_P (pos)) {
                                        line = CB_PAIR_X (pos);
                                        column = CB_PAIR_Y (pos);
                                        cb_emit (cb_build_funcall_7 ("cob_field_accept",
                                                var, line, column, fgc, bgc,
                                                scroll, cb_int (dispattrs)));
                                } else {
                                        cb_emit (cb_build_funcall_7 ("cob_field_accept",
                                                var, pos, NULL, fgc, bgc,
                                                scroll, cb_int (dispattrs)));
                                }
                        } else {
                                cb_emit (cb_build_funcall_7 ("cob_field_accept",
                                        var, NULL, NULL, fgc, bgc,
                                        scroll, cb_int (dispattrs)));
                        }
                }
        } else if (pos || fgc || bgc || scroll) {
                /* Bump ref count to force CRT STATUS field generation */
                cb_field (current_program->crt_status)->count++;
                if (!pos) {
                        cb_emit (cb_build_funcall_7 ("cob_field_accept",
                                var, NULL, NULL, fgc, bgc, scroll,
                                cb_int (dispattrs)));
                } else if (CB_PAIR_P (pos)) {
                        line = CB_PAIR_X (pos);
                        column = CB_PAIR_Y (pos);
                        cb_emit (cb_build_funcall_7 ("cob_field_accept",
                                var, line, column, fgc, bgc, scroll,
                                cb_int (dispattrs)));
                } else {
                        cb_emit (cb_build_funcall_7 ("cob_field_accept",
                                var, pos, NULL, fgc, bgc, scroll,
                                cb_int (dispattrs)));
                }
        } else {
                cb_emit (cb_build_funcall_1 ("cob_accept", var));
        }
}

Here is the call graph for this function:

void cb_emit_accept_arg_number ( cb_tree  var)

Definition at line 2986 of file typeck.c.

{
        if (cb_validate_one (var)) {
                return;
        }
        cb_emit (cb_build_funcall_1 ("cob_accept_arg_number", var));
}
void cb_emit_accept_arg_value ( cb_tree  var)

Definition at line 2995 of file typeck.c.

{
        if (cb_validate_one (var)) {
                return;
        }
        cb_emit (cb_build_funcall_1 ("cob_accept_arg_value", var));
}
void cb_emit_accept_command_line ( cb_tree  var)

Definition at line 2956 of file typeck.c.

{
        if (cb_validate_one (var)) {
                return;
        }
        cb_emit (cb_build_funcall_1 ("cob_accept_command_line", var));
}
void cb_emit_accept_date ( cb_tree  var)

Definition at line 2902 of file typeck.c.

{
        if (cb_validate_one (var)) {
                return;
        }
        cb_emit (cb_build_funcall_1 ("cob_accept_date", var));
}
void cb_emit_accept_date_yyyymmdd ( cb_tree  var)

Definition at line 2911 of file typeck.c.

{
        if (cb_validate_one (var)) {
                return;
        }
        cb_emit (cb_build_funcall_1 ("cob_accept_date_yyyymmdd", var));
}
void cb_emit_accept_day ( cb_tree  var)

Definition at line 2920 of file typeck.c.

{
        if (cb_validate_one (var)) {
                return;
        }
        cb_emit (cb_build_funcall_1 ("cob_accept_day", var));
}
void cb_emit_accept_day_of_week ( cb_tree  var)

Definition at line 2938 of file typeck.c.

{
        if (cb_validate_one (var)) {
                return;
        }
        cb_emit (cb_build_funcall_1 ("cob_accept_day_of_week", var));
}
void cb_emit_accept_day_yyyyddd ( cb_tree  var)

Definition at line 2929 of file typeck.c.

{
        if (cb_validate_one (var)) {
                return;
        }
        cb_emit (cb_build_funcall_1 ("cob_accept_day_yyyyddd", var));
}
void cb_emit_accept_environment ( cb_tree  var)

Definition at line 2977 of file typeck.c.

{
        if (cb_validate_one (var)) {
                return;
        }
        cb_emit (cb_build_funcall_1 ("cob_accept_environment", var));
}
void cb_emit_accept_line_or_col ( cb_tree  var,
const int  l_or_c 
)

Definition at line 2893 of file typeck.c.

{
        if (cb_validate_one (var)) {
                return;
        }
        cb_emit (cb_build_funcall_2 ("cob_screen_line_col", var, cb_int (l_or_c)));
}

Here is the call graph for this function:

void cb_emit_accept_mnemonic ( cb_tree  var,
cb_tree  mnemonic 
)

Definition at line 3004 of file typeck.c.

{
        if (cb_validate_one (var)) {
                return;
        }
        switch (CB_SYSTEM_NAME (cb_ref (mnemonic))->token) {
        case CB_DEVICE_CONSOLE:
        case CB_DEVICE_SYSIN:
                cb_emit (cb_build_funcall_1 ("cob_accept", var));
                break;
        default:
                cb_error_x (mnemonic, _("Invalid input stream '%s'"),
                            cb_name (mnemonic));
                break;
        }
}

Here is the call graph for this function:

void cb_emit_accept_name ( cb_tree  var,
cb_tree  name 
)

Definition at line 3022 of file typeck.c.

{
        cb_tree sys;

        if (cb_validate_one (var)) {
                return;
        }
        if (CB_REFERENCE (name)->word->count == 0) {
                sys = lookup_system_name (CB_NAME (name));

                if (sys != cb_error_node) {
                        switch (CB_SYSTEM_NAME (sys)->token) {
                        case CB_DEVICE_CONSOLE:
                        case CB_DEVICE_SYSIN:
                                cb_warning_x (name, _("'%s' undefined in SPECIAL-NAMES"), CB_NAME (name));
                                cb_emit (cb_build_funcall_1 ("cob_accept", var));
                                return;
                        default:
                                break;
                        }
                }
        }

        cb_error_x (name, _("'%s' undefined in SPECIAL-NAMES"), CB_NAME (name));
}

Here is the call graph for this function:

void cb_emit_accept_time ( cb_tree  var)

Definition at line 2947 of file typeck.c.

{
        if (cb_validate_one (var)) {
                return;
        }
        cb_emit (cb_build_funcall_1 ("cob_accept_time", var));
}
void cb_emit_allocate ( cb_tree  target1,
cb_tree  target2,
cb_tree  size,
cb_tree  initialize 
)

Definition at line 3053 of file typeck.c.

{
        cb_tree x;
        char    buff[32];

        if (cb_validate_one (target1)) {
                return;
        }
        if (cb_validate_one (target2)) {
                return;
        }
        if (cb_validate_one (size)) {
                return;
        }
        if (target1) {
                if (!(CB_REFERENCE_P(target1) &&
                      cb_field (target1)->flag_item_based)) {
                        cb_error_x (CB_TREE(current_statement),
                                _("Target of ALLOCATE is not a BASED item"));
                }
        }
        if (target2) {
                if (!(CB_REFERENCE_P(target2) &&
                      CB_TREE_CLASS (target2) == CB_CLASS_POINTER)) {
                        cb_error_x (CB_TREE(current_statement),
                                _("Target of RETURNING is not a data pointer"));
                }
        }
        if (size) {
                if (CB_TREE_CLASS (size) != CB_CLASS_NUMERIC) {
                        cb_error_x (CB_TREE(current_statement),
                                _("The CHARACTERS field of ALLOCATE must be numeric"));
                }
        }
        if (target1) {
                sprintf (buff, "%d", cb_field (target1)->memory_size);
                x = cb_build_numeric_literal (0, (ucharptr)buff, 0);
                cb_emit (cb_build_funcall_3 ("cob_allocate",
                         cb_build_cast_addr_of_addr (target1), target2, x));
        } else {
                cb_emit (cb_build_funcall_3 ("cob_allocate",
                         NULL, target2, size));
        }
        if (initialize && target1) {
                current_statement->handler2 =
                        cb_build_initialize (target1, cb_true, NULL, cb_true, 0);
        }
}

Here is the call graph for this function:

void cb_emit_arg_number ( cb_tree  value)

Definition at line 3273 of file typeck.c.

{
        if (cb_validate_one (value)) {
                return;
        }
        cb_emit (cb_build_funcall_1 ("cob_display_arg_number", value));
}
void cb_emit_arithmetic ( cb_tree  vars,
int  op,
cb_tree  val 
)

Definition at line 2094 of file typeck.c.

{
        cb_tree         l;
        struct cb_field *f;

        val = cb_check_numeric_value (val);
        if (op) {
                cb_list_map (cb_check_numeric_name, vars);
        } else {
                cb_list_map (cb_check_numeric_edited_name, vars);
        }

        if (cb_validate_one (val)) {
                return;
        }
        if (cb_validate_list (vars)) {
                return;
        }

        if (!CB_BINARY_OP_P (val)) {
                if (op == '+' || op == '-') {
                        if (CB_EXCEPTION_ENABLE (COB_EC_DATA_INCOMPATIBLE) &&
                           (CB_REF_OR_FIELD_P (val))) {
                                f = cb_field (val);
                                if (f->usage == CB_USAGE_DISPLAY ||
                                    f->usage == CB_USAGE_PACKED) {
                                        cb_emit (cb_build_funcall_2 ("cob_check_numeric",
                                                        val,
                                                        cb_build_string0 ((ucharptr)(f->name))));
                                }
                        }
                        for (l = vars; l; l = CB_CHAIN (l)) {
                                if (CB_EXCEPTION_ENABLE (COB_EC_DATA_INCOMPATIBLE) &&
                                   (CB_REF_OR_FIELD_P (CB_VALUE(l)))) {
                                        f = cb_field (CB_VALUE(l));
                                        if (f->usage == CB_USAGE_DISPLAY ||
                                            f->usage == CB_USAGE_PACKED) {
                                                cb_emit (cb_build_funcall_2 ("cob_check_numeric",
                                                        CB_VALUE(l),
                                                        cb_build_string0 ((ucharptr)(f->name))));
                                        }
                                }
                                if (op == '+') {
                                        CB_VALUE (l) = cb_build_add (CB_VALUE (l), val, CB_PURPOSE (l));
                                } else {
                                        CB_VALUE (l) = cb_build_sub (CB_VALUE (l), val, CB_PURPOSE (l));
                                }
                        }
                        cb_emit_list (vars);
                        return;
                }
        }

        cb_emit (build_decimal_assign (vars, op, val));
}

Here is the call graph for this function:

void cb_emit_call ( cb_tree  prog,
cb_tree  using,
cb_tree  returning,
cb_tree  on_exception,
cb_tree  not_on_exception 
)

Definition at line 3108 of file typeck.c.

{
        cb_tree                         l;
        cb_tree                         x;
        const struct system_table       *psyst;
        int                             is_sys_call = 0;

        if (CB_INTRINSIC_P (prog)) {
                if (CB_INTRINSIC(prog)->intr_tab->category != CB_CATEGORY_ALPHANUMERIC) {
                        cb_error (_("Only alphanumeric FUNCTION types are allowed here"));
                        return;
                }
        }
        if (returning) {
                if (CB_TREE_CLASS(returning) != CB_CLASS_NUMERIC &&
                    CB_TREE_CLASS(returning) != CB_CLASS_POINTER) {
                        cb_error (_("Invalid RETURNING field"));
                        return;
                }
        }
        for (l = using; l; l = CB_CHAIN (l)) {
                x = CB_VALUE (l);
                if (x == cb_error_node) {
                        continue;
                }
                if (CB_CONST_P (x) && x != cb_null) {
                        cb_error_x (x, _("Figurative constant invalid here"));
                }
                if ((CB_REFERENCE_P (x) && CB_FIELD_P(CB_REFERENCE(x)->value))
                     || CB_FIELD_P (x)) {
                        if (cb_field (x)->level == 88) {
                                cb_error_x (x, _("'%s' Not a data name"), CB_NAME (x));
                                return;
                        }
                        if (cb_warn_call_params &&
                            CB_PURPOSE_INT (l) == CB_CALL_BY_REFERENCE) {
                                if (cb_field (x)->level != 01 &&
                                    cb_field (x)->level != 77) {
                                        cb_warning_x (x, _("'%s' is not 01 or 77 level item"), CB_NAME (x));
                                }
                        }
                }
        }

        if (CB_LITERAL_P(prog)) {
                for (psyst = (const struct system_table *)&system_tab[0]; psyst->syst_name; psyst++) {
                        if (!strcmp((const char *)CB_LITERAL(prog)->data,
                             (const char *)psyst->syst_name)) {
                                if (psyst->syst_params > cb_list_length (using)) {
                                        cb_error (_("Wrong number of CALL parameters for '%s'"),
                                                    (char *)psyst->syst_name);
                                        return;
                                }
                                is_sys_call = 1;
                                break;
                        }
                }
        }

        cb_emit (cb_build_call (prog, using, on_exception, not_on_exception,
                 returning, is_sys_call));
}

Here is the call graph for this function:

void cb_emit_cancel ( cb_tree  prog)

Definition at line 3177 of file typeck.c.

{
        if (cb_validate_one (prog)) {
                return;
        }
        cb_emit (cb_build_funcall_1 ("cob_field_cancel", prog));
}
void cb_emit_close ( cb_tree  file,
cb_tree  opt 
)

Definition at line 3190 of file typeck.c.

{
        if (file == cb_error_node) {
                return;
        }
        file = cb_ref (file);
        if (file == cb_error_node) {
                return;
        }
        current_statement->file = file;
        if (CB_FILE (file)->organization == COB_ORG_SORT) {
                cb_error_x (CB_TREE (current_statement),
                _("Operation not allowed on SORT files"));
        }
        cb_emit (cb_build_funcall_3 ("cob_close", file, opt,
                CB_FILE(file)->file_status));
}

Here is the call graph for this function:

void cb_emit_command_line ( cb_tree  value)

Definition at line 3282 of file typeck.c.

{
        if (cb_validate_one (value)) {
                return;
        }
        cb_emit (cb_build_funcall_1 ("cob_display_command_line", value));
}
void cb_emit_commit ( void  )

Definition at line 3213 of file typeck.c.

{
        cb_emit (cb_build_funcall_0 ("cob_commit"));
}
void cb_emit_continue ( void  )

Definition at line 3223 of file typeck.c.

Here is the call graph for this function:

void cb_emit_corresponding ( cb_tree(*)(cb_tree f1, cb_tree f2, cb_tree f3)  func,
cb_tree  x1,
cb_tree  x2,
cb_tree  opt 
)

Definition at line 2695 of file typeck.c.

{
        x1 = cb_check_group_name (x1);
        x2 = cb_check_group_name (x2);

        if (cb_validate_one (x1)) {
                return;
        }
        if (cb_validate_one (x2)) {
                return;
        }

        emit_corresponding (func, x1, x2, opt);
}
void cb_emit_delete ( cb_tree  file)

Definition at line 3233 of file typeck.c.

{
        if (file == cb_error_node) {
                return;
        }
        file = cb_ref (file);
        if (file == cb_error_node) {
                return;
        }
        current_statement->file = file;
        if (CB_FILE (file)->organization == COB_ORG_SORT) {
                cb_error_x (CB_TREE (current_statement),
                _("Operation not allowed on SORT files"));
        }
        cb_emit (cb_build_funcall_2 ("cob_delete", file, CB_FILE(file)->file_status));
}

Here is the call graph for this function:

void cb_emit_display ( cb_tree  values,
cb_tree  upon,
cb_tree  no_adv,
cb_tree  pos,
cb_tree  fgc,
cb_tree  bgc,
cb_tree  scroll,
int  dispattrs 
)

Definition at line 3291 of file typeck.c.

{
        cb_tree l;
        cb_tree x;
        cb_tree line;
        cb_tree column;
        cb_tree p;

        if (cb_validate_list (values)) {
                return;
        }
        if (cb_validate_one (pos)) {
                return;
        }
        if (cb_validate_one (fgc)) {
                return;
        }
        if (cb_validate_one (bgc)) {
                return;
        }
        if (cb_validate_one (scroll)) {
                return;
        }
        for (l = values; l; l = CB_CHAIN (l)) {
                x = CB_VALUE (l);
                if (x == cb_error_node) {
                        return;
                }

                switch (CB_TREE_TAG (x)) {
                case CB_TAG_LITERAL:
                case CB_TAG_INTRINSIC:
                case CB_TAG_CONST:
                case CB_TAG_STRING:
                case CB_TAG_INTEGER:
                        break;
                case CB_TAG_REFERENCE:
                        if (!CB_FIELD_P(CB_REFERENCE(x)->value)) {
                                cb_error_x (x, _("'%s' is an invalid type for DISPLAY operand"), cb_name (x));
                                return;
                        }
                        break;
                default:
                        cb_error_x (x, _("Invalid type for DISPLAY operand"));
                        return;
                }
        }
        if (upon == cb_error_node) {
                return;
        }
        
        x = CB_VALUE (values);
        if ((CB_REF_OR_FIELD_P (x)) &&
             CB_FIELD (cb_ref (x))->storage == CB_STORAGE_SCREEN) {
                output_screen_from (CB_FIELD (cb_ref (x)), 0);
                gen_screen_ptr = 1;
                if (pos) {
                        if (CB_PAIR_P (pos)) {
                                line = CB_PAIR_X (pos);
                                column = CB_PAIR_Y (pos);
                                if (line == NULL) {
                                        line = cb_one;
                                }
                                if (column == NULL) {
                                        column = cb_one;
                                }
                                cb_emit (cb_build_funcall_3 ("cob_screen_display", x,
                                        line, column));
                        } else {
                                cb_emit (cb_build_funcall_3 ("cob_screen_display", x,
                                        pos, NULL));
                        }
                } else {
                        cb_emit (cb_build_funcall_3 ("cob_screen_display", x,
                                NULL, NULL));
                }
                gen_screen_ptr = 0;
        } else if (pos || fgc || bgc || scroll || dispattrs) {
                if (!pos) {
                        cb_emit (cb_build_funcall_7 ("cob_field_display",
                                CB_VALUE (values), NULL, NULL, fgc, bgc,
                                scroll, cb_int (dispattrs)));
                } else if (CB_PAIR_P (pos)) {
                        line = CB_PAIR_X (pos);
                        column = CB_PAIR_Y (pos);
                        if (line == NULL) {
                                line = cb_one;
                        }
                        if (column == NULL) {
                                column = cb_one;
                        }
                        cb_emit (cb_build_funcall_7 ("cob_field_display",
                                CB_VALUE (values), line, column, fgc, bgc,
                                scroll, cb_int (dispattrs)));
                } else {
                        cb_emit (cb_build_funcall_7 ("cob_field_display",
                                CB_VALUE (values), pos, NULL, fgc, bgc,
                                scroll, cb_int (dispattrs)));
                }
        } else {
                /* DISPLAY x ... [UPON device-name] */
                p = cb_build_funcall_3 ("cob_display", upon, no_adv, values);
                CB_FUNCALL(p)->varcnt = cb_list_length (values);
                cb_emit (p);
                for (l = values; l; l = CB_CHAIN (l)) {
                        x = CB_VALUE (l);
                        if (CB_FIELD_P (x)) {
                                CB_FIELD (cb_ref (x))->count++;
                        }
                }
        }
}

Here is the call graph for this function:

void cb_emit_divide ( cb_tree  dividend,
cb_tree  divisor,
cb_tree  quotient,
cb_tree  remainder 
)

Definition at line 3460 of file typeck.c.

{
        if (cb_validate_one (dividend)) {
                return;
        }
        if (cb_validate_one (divisor)) {
                return;
        }
        CB_VALUE (quotient) = cb_check_numeric_edited_name (CB_VALUE (quotient));
        CB_VALUE (remainder) = cb_check_numeric_edited_name (CB_VALUE (remainder));

        if (cb_validate_one (CB_VALUE (quotient))) {
                return;
        }
        if (cb_validate_one (CB_VALUE (remainder))) {
                return;
        }

        cb_emit (cb_build_funcall_4 ("cob_div_quotient", dividend, divisor,
                                     CB_VALUE (quotient),
                                     build_store_option (CB_VALUE (quotient), CB_PURPOSE (quotient))));
        cb_emit (cb_build_funcall_2 ("cob_div_remainder", CB_VALUE (remainder),
                                     build_store_option (CB_VALUE (remainder), cb_int0)));
}
void cb_emit_env_name ( cb_tree  value)

Definition at line 3255 of file typeck.c.

{
        if (cb_validate_one (value)) {
                return;
        }
        cb_emit (cb_build_funcall_1 ("cob_display_environment", value));
}
void cb_emit_env_value ( cb_tree  value)

Definition at line 3264 of file typeck.c.

{
        if (cb_validate_one (value)) {
                return;
        }
        cb_emit (cb_build_funcall_1 ("cob_display_env_value", value));
}
void cb_emit_evaluate ( cb_tree  subject_list,
cb_tree  case_list 
)

Definition at line 3601 of file typeck.c.

{
        cb_emit (build_evaluate (subject_list, case_list));
}
void cb_emit_exit ( size_t  goback)

Definition at line 3675 of file typeck.c.

{
        if (goback) {
                cb_emit (cb_build_goto (cb_int1, NULL));
        } else {
                cb_emit (cb_build_goto (NULL, NULL));
        }
}

Here is the call graph for this function:

void cb_emit_free ( cb_tree  vars)

Definition at line 3611 of file typeck.c.

{
        cb_tree         l;
        struct cb_field *f;
        int             i;

        if (cb_validate_list (vars)) {
                return;
        }
        for (l = vars, i = 1; l; l = CB_CHAIN (l), i++) {
                if (CB_TREE_CLASS (CB_VALUE (l)) == CB_CLASS_POINTER) {
                        if (CB_CAST_P (CB_VALUE (l))) {
                                f = cb_field (CB_CAST (CB_VALUE(l))->val);
                                if (!f->flag_item_based) {
                                        cb_error_x (CB_TREE (current_statement),
                                                _("Target %d of FREE, a data address identifier, must address a BASED data item"), i);
                                }
                                cb_emit (cb_build_funcall_2 ("cob_free_alloc",
                                        cb_build_cast_address (CB_VALUE (l)), NULL));
                        } else {
                                cb_emit (cb_build_funcall_2 ("cob_free_alloc",
                                        NULL, cb_build_cast_address (CB_VALUE (l))));
                        }
                } else if (CB_REF_OR_FIELD_P (CB_VALUE (l))) {
                                f = cb_field (CB_VALUE (l));
                                if (!f->flag_item_based) {
                                        cb_error_x (CB_TREE (current_statement),
                                                _("Target %d of FREE, a data address identifier, must address a BASED data item"), i);
                                }
                                cb_emit (cb_build_funcall_2 ("cob_free_alloc",
                                        cb_build_cast_addr_of_addr (CB_VALUE (l)), NULL));
                } else {
                        cb_error_x (CB_TREE (current_statement),
                                _("Target %d of FREE must be a data pointer"), i);
                }
        }
}

Here is the call graph for this function:

void cb_emit_get_environment ( cb_tree  envvar,
cb_tree  envval 
)

Definition at line 2965 of file typeck.c.

{
        if (cb_validate_one (envvar)) {
                return;
        }
        if (cb_validate_one (envval)) {
                return;
        }
        cb_emit (cb_build_funcall_2 ("cob_get_environment", envvar, envval));
}
void cb_emit_goto ( cb_tree  target,
cb_tree  depending 
)

Definition at line 3654 of file typeck.c.

{
        if (target == cb_error_node) {
                return;
        }
        if (depending) {
                /* GO TO procedure-name ... DEPENDING ON identifier */
                cb_emit (cb_build_goto (target, depending));
        } else {
                /* GO TO procedure-name */
                if (target == NULL) {
                        cb_verify (cb_goto_statement_without_name, "GO TO without procedure-name");
                } else if (CB_CHAIN (target)) {
                        cb_error (_("GO TO with multiple procedure-names"));
                } else {
                        cb_emit (cb_build_goto (CB_VALUE (target), NULL));
                }
        }
}

Here is the call graph for this function:

void cb_emit_if ( cb_tree  cond,
cb_tree  stmt1,
cb_tree  stmt2 
)

Definition at line 3689 of file typeck.c.

{
        cb_emit (cb_build_if (cond, stmt1, stmt2));
}

Here is the call graph for this function:

void cb_emit_initialize ( cb_tree  vars,
cb_tree  fillinit,
cb_tree  value,
cb_tree  replacing,
cb_tree  def 
)

Definition at line 3699 of file typeck.c.

{
        cb_tree l;
        int fill_init = 1;

        if (cb_validate_list (vars)) {
                return;
        }
        if (value == NULL && replacing == NULL) {
                def = cb_true;
        }
        if (fillinit == cb_true) {
                fill_init = 0;
        }
        for (l = vars; l; l = CB_CHAIN (l)) {
                cb_emit (cb_build_initialize (CB_VALUE (l), value, replacing, def, fill_init));
        }
}

Here is the call graph for this function:

void cb_emit_inspect ( cb_tree  var,
cb_tree  body,
cb_tree  replacing,
int  replconv 
)

Definition at line 3723 of file typeck.c.

{
        switch (CB_TREE_TAG(var)) {
        case CB_TAG_REFERENCE:
                break;
        case CB_TAG_INTRINSIC:
                switch (CB_TREE_CATEGORY(var)) {
                case CB_CATEGORY_ALPHABETIC:
                case CB_CATEGORY_ALPHANUMERIC:
                case CB_CATEGORY_NATIONAL:
                        break;
                default:
                        cb_error (_("Invalid target for INSPECT"));
                        return;
                }
                break;
        case CB_TAG_LITERAL:
                break;
        default:
                cb_error (_("Invalid target for REPLACING/CONVERTING"));
                return;
        }
        if (replconv && sending_id) {
                cb_error (_("Invalid target for REPLACING/CONVERTING"));
        }
        cb_emit (cb_build_funcall_2 ("cob_inspect_init", var, replacing));
        cb_emit_list (body);
        cb_emit (cb_build_funcall_0 ("cob_inspect_finish"));
}

Here is the call graph for this function:

void cb_emit_move ( cb_tree  src,
cb_tree  dsts 
)

Definition at line 5041 of file typeck.c.

{
        cb_tree l;

        if (cb_validate_one (src)) {
                return;
        }
        if (cb_validate_list (dsts)) {
                return;
        }

        for (l = dsts; l; l = CB_CHAIN (l)) {
                cb_emit (cb_build_move (src, CB_VALUE (l)));
        }
}

Here is the call graph for this function:

void cb_emit_move_corresponding ( cb_tree  x1,
cb_tree  x2 
)

Definition at line 2738 of file typeck.c.

{
        cb_tree         l;
        cb_tree         v;

        x1 = cb_check_group_name (x1);
        if (cb_validate_one (x1)) {
                return;
        }
        for (l = x2; l; l =