home *** CD-ROM | disk | FTP | other *** search
- /*
- C* -- global header for variables and functions.
-
- Source: glb.h
- Started: June 20, 1986
- Version: February 20, 1987
-
- PUBLIC DOMAIN SOFTWARE
-
- The CSTAR program was placed in the public domain on June 15, 1991,
- by its author and sole owner,
-
- Edward K. Ream
- 1617 Monroe Street
- Madison, WI 53711
- (608) 257-0802
-
- CSTAR may be used for any commercial or non-commercial purpose.
-
- See cstar.h or cstar.c for a DISCLAIMER OF WARRANTIES.
- */
-
- /*
- To compile under DRI, change ^void * to byte *
- DRI does not allow a function to return (void *)
- */
-
- /*
- Constants describing limits.
- */
- #define MAX_INCLUDE 20 /* Max depth of #include's */
- #define MAX_SYMBOL 1000 /* Max len of symbols/strings. */
- #define MAX_FILE_NAME 200 /* Maximum length of file names. */
- #define MAX_IF 50 /* Max nesting level of #if's. */
- #define MAX_EVAL 500 /* Max complexity of #if expr. */
-
-
- /* exclude the rest if glb.c is the lead-in file */
- /* this material can easily be prepared by editing glb.c */
- #ifndef no_extern
-
- /*
- ============= global tables =============
- */
- extern char * xzp_tab [];
- extern char * xlentab [];
- extern char * arp_tab [];
- extern int reg_itb[];
- extern int d_rtb[];
- extern int a_rtb[];
- extern int x_rtb[];
- extern char * kp_tab [];
-
- /*
- ============= global variables =============
- */
-
- /*
- The variable ch should be allocated a register if possible.
- */
- extern unsigned char ch; /* The current character. */
-
- extern int nest_flag; /* TRUE if comments can nest. */
- extern int full_c; /* TRUE if full C allowed. */
- extern int array_opt; /* TRUE for strict array subscript handling */
- extern int no_local; /* TRUE to output no local names in ass'y */
-
- extern bool nomacro_flag;
- extern bool noparse_flag;
- extern bool nogen_flag;
- extern bool nopeep_flag;
-
- extern bool token_flag;
- extern bool tree_flag;
- extern bool code1_flag;
- extern bool code2_flag;
-
- /*
- Globals describing tokens.
-
- The code assumes that no token or string will ever be longer than
- MAX_SYMBOL. If that ever is not so the program may crash. Thus,
- MAX_SYMBOL should be very large -- say 1000 or more.
- */
- extern char t_symbol [MAX_SYMBOL]; /* The spelling of the token. */
- extern int t_length; /* The length of the token (in the text)*/
- extern folded t_value; /* Value of integer constants. */
- extern int t_type; /* The token itself or it's class. */
- extern int t_subtype; /* The subtype of token class. */
-
- /*
- The following globals are set ONLY by the system module and
- used by the preprocessor.
- */
- extern char * t_file; /* Name of current input file. */
- extern int t_line; /* Line number within file. */
- extern int t_inlevel; /* Current input file level. */
-
- /*
- Globals for use internally to the token routines.
- */
- extern short t_ifstack [MAX_IF]; /* Stack for nexted #if's */
- extern int t_iflevel; /* Nexting depth of #if's */
- extern long t_errcount; /* Number of errors seen. */
-
- extern int t_evalstk [MAX_EVAL]; /* Operator/operand stack. */
- extern int t_opptr; /* Operator index to evalstk[]. */
- extern int t_valptr; /* Operand index to evalstk[]. */
-
- extern struct u_node undef_list; /* Initial undef list for PP. */
-
- /*
- Defines for the path table.
- This table is used to search for #include files.
- */
- extern char * paths [MAX_PATHS]; /* Pointers to path names. */
- extern int n_paths; /* Number of paths defined. */
-
- /*
- ----- PARSING -----
- */
-
- /*
- this is just too inconvenient to return as a return-value
- it is needed for code generation
- */
- extern int call_1arg; /* Incremented by the parser when it sets up a
- call to a function having one argument */
-
- /*
- ----- CODE GENERATION -----
- */
- extern int segment;
- extern struct node * code_head; /* Head of list of global code list. */
- extern struct node * code_tail; /* Pointer to last node in list. */
-
- /* fixed nodes set up by g1.c */
- extern struct type_node * byte_type; /* Fixed byte node for g2.c */
- extern struct type_node * int_type; /* Fixed int node for g2.c */
- extern struct type_node * long_type; /* Fixed long node */
-
- extern int cur_lab; /* Number of the current internal label. */
- extern int u_lab; /* Number of the current user label. */
- extern struct scope_node scope; /* Current scope. */
-
- extern int f_base; /* See par.c; this has no conceivable
- use as an integer */
-
- /* these nodes are NOT to be returned by any routine, but only used as
- arguments to g_ routines which guarantee not to change them */
-
- extern struct node * a0_loc;
- extern struct node * d0_loc;
- extern struct node * a6_loc; /* stack frame */
- extern struct node * a7_loc; /* stack itself */
- extern struct node * sr_loc; /* sr */
- extern struct node * ccr_loc; /* ccr */
- extern struct node * push_loc; /* *--sp */
- extern struct node * nopush_loc; /* *sp */
- extern struct node * pop_loc; /* *sp++ */
- extern struct node * one_loc; /* constant 1 */
- extern struct node * zero_loc;
-
- /*
- ----- PL68K REGISTERS -----
- */
-
- /* ------ comment out, this is for simulation
- extern long d0, d1, d2, d3, d4, d5, d6, d7;
- extern char *a0, *a1, *a2, *a3, *a4, *a5, *a6, *a7, *sp;
- extern int a0w, a1w, a2w, a3w, a4w, a5w, a6w;
- extern char ccr;
- extern int ssr, spw;
- ------ */
-
- #endif /* no_extern */
-