
// global variables

int debug;

int string_pool[POOL_SIZE];
int pool_idx;

int vector_pool[VECTOR_POOL_SIZE];
int vector_pool_idx;

int string[256];
int string_idx;

int first_char;
int lookahead_ch;
int ch;
int line_count;

int dummy;
int token_size;

int token_ring[TOKEN_RING_SIZE];
int token_ring_line_count[TOKEN_RING_SIZE];
int token_ring_idx;

int hash_table_key[HASH_TABLE_SIZE];
int hash_table_value[HASH_TABLE_SIZE];
int hash_count_threshold;
int hash_count;

int semi_colon_tok;
int colon_tok;
int open_paren_tok;
int close_paren_tok;
int open_bracket_tok;
int close_bracket_tok;
int period_tok;
int comma_tok;
int assignment_tok;
int succ_tok;
int pred_tok;
int plus_tok;
int minus_tok;
int times_tok;
int div_tok;
int mod_tok;
int bit_and_tok;
int bit_or_tok;
int bit_xor_tok;
int bit_not_tok;
int shr_tok;
int shl_tok;
int abs_tok;
int not_tok;
int and_tok;
int or_tok;
int equal_tok;
int not_equals_tok;
int less_than_tok;
int greater_than_tok;
int less_or_equal_tok;
int greater_or_equal_tok;
int pound_tok;
int include_tok;
int define_tok;
int exit_tok;
int getchar_tok;
int putchar_tok;
int printf_tok;
int integer_tok;
int void_tok;
int return_tok;
int main_tok;
int char_tok;
int if_tok;
int then_tok;
int else_tok;
int for_tok;
int do_tok;
int while_tok;
int case_tok;
int switch_tok;
int break_tok;
int goto_tok;
int begin_tok;
int end_tok;
int zero_tok;
int one_tok;

// hidden tokens

int unary_minus_tok;

int label_count;

int errors[ERRORS_SIZE];
int errors_token[ERRORS_SIZE];
int errors_line_number[ERRORS_SIZE];
int error_idx;

int constant_name;
int constant_value;
int sorted_constant;
int constant_idx;

int top_level_variable_name;
int top_level_variable_position;
int top_level_variable_size;
int sorted_top_level_variable;
int top_level_variable_idx;

int variable_name;
int variable_position;
int variable_size;
int variable_is_reference;
int variable_idx;

int function_name;
int function_value;
int sorted_function;
int function_idx;
int current_function;
int global_found_function_idx;

int procedure_name;
int procedure_value;
int sorted_procedure;
int procedure_idx;
int global_found_procedure_idx;

int formal_parameter_name[MAX_FORMAL_PARAMETERS];
int formal_parameter_idx;

int tokens[MAX_TOKENS];
int tokens_idx;
int fast_expression;
int is_fast_relop;
int expression_depth;
int is_simple_assignment_expression;
int is_simple_assignment_inc_dec_expression;
int inc_dec_stack_offset;

int stack[MAX_STACK];
int stack_idx;
int save_stack_idx;

int cons_cell[MAX_CONS_CELL];
int cons_cell_idx;

int output_queue[MAX_OUTPUT_QUEUE];
int output_queue_idx;
int global_annotation;
int binary_tree;

int case_label;
int case_label_idx;

int branch_2_label;
int label_2_address;
int label_2_address_idx;
int bytecode;
int bytecode_idx;
int function_address;
int procedure_address;
int main_tok;

int comment_arr[MAX_COMMENT_SIZE];
int comment_arr_idx;

// data stream structures

int data_stream[500];
int is_data_stream;
int data_stream_idx;

// following used in arm code generation

int instruction_run_count;
int instruction_run_count_threshold;

int arm_constants;
int arm_constants_idx;

int register_idx;
int max_register_idx;
