00001 /* global.h: The global variables for bc. */ 00002 00003 /* This file is part of bc written for MINIX. 00004 Copyright (C) 1991, 1992 Free Software Foundation, Inc. 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License , or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; see the file COPYING. If not, write to 00018 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 00019 00020 You may contact the author by: 00021 e-mail: phil@cs.wwu.edu 00022 us-mail: Philip A. Nelson 00023 Computer Science Department, 9062 00024 Western Washington University 00025 Bellingham, WA 98226-9062 00026 00027 *************************************************************************/ 00028 00029 00030 /* For the current "break level" and if statements. */ 00031 EXTERN int break_label; 00032 EXTERN int if_label; 00033 EXTERN int continue_label; 00034 00035 /* Label numbers. */ 00036 EXTERN int next_label; 00037 00038 /* Used for "code" generation. */ 00039 EXTERN char genstr[80]; 00040 EXTERN int out_count; 00041 EXTERN char did_gen; 00042 00043 /* Interactive and other flags. */ 00044 EXTERN char interactive; 00045 EXTERN char compile_only; 00046 EXTERN char use_math; 00047 EXTERN char warn_not_std; 00048 EXTERN char std_only; 00049 00050 /* global variables for the bc machine. All will be dynamic in size.*/ 00051 /* Function storage. main is (0) and functions (1-f_count) */ 00052 00053 EXTERN bc_function *functions; 00054 EXTERN char **f_names; 00055 EXTERN int f_count; 00056 00057 /* Variable stoarge and reverse names. */ 00058 00059 EXTERN bc_var **variables; 00060 EXTERN char **v_names; 00061 EXTERN int v_count; 00062 00063 /* Array Variable storage and reverse names. */ 00064 00065 EXTERN bc_var_array **arrays; 00066 EXTERN char **a_names; 00067 EXTERN int a_count; 00068 00069 /* Execution stack. */ 00070 EXTERN estack_rec *ex_stack; 00071 00072 /* Function return stack. */ 00073 EXTERN fstack_rec *fn_stack; 00074 00075 /* Other "storage". */ 00076 EXTERN int i_base; 00077 EXTERN int o_base; 00078 EXTERN int scale; 00079 EXTERN char c_code; 00080 EXTERN int out_col; 00081 EXTERN char runtime_error; 00082 EXTERN program_counter pc; 00083 00084 /* Input Line numbers and other error information. */ 00085 EXTERN int line_no; 00086 EXTERN int had_error; 00087 00088 /* For larger identifiers, a tree, and how many "storage" locations 00089 have been allocated. */ 00090 00091 EXTERN int next_array; 00092 EXTERN int next_func; 00093 EXTERN int next_var; 00094 00095 EXTERN id_rec *name_tree; 00096 00097 /* For error message production */ 00098 EXTERN char **g_argv; 00099 EXTERN int g_argc; 00100 EXTERN char is_std_in; 00101 00102 /* defined in number.c */ 00103 extern bc_num _zero_; 00104 extern bc_num _one_; 00105 00106 /* For use with getopt. Do not declare them here.*/ 00107 extern int optind; 00108
1.4.6