home *** CD-ROM | disk | FTP | other *** search
- /*
- Global function declarations.
-
- source: tmp.h
- version: March 7, 1989
-
- 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.
- */
-
- /* cstar.c */
- void begin_line();
- void do_nl();
- void get_token();
-
- /* dcl.c */
- void pd_tcopy (struct type_node *s, struct type_node *d);
- bool pd_teq (struct type_node *t1, struct type_node *t2);
- bool pd_t1eq (struct type_node *t1, struct type_node *t2);
- bool pd_taeq (struct type_node *t1, struct type_node *t2);
- void reg_check (struct type_node *type, int regtype, char *symbol);
- unsigned long m_size (int m);
- bool pd_is1func (struct type_node *t);
- void pd_orphan (struct type_node *t);
- struct type_node *
- pd_cast (void);
- struct type_node *
- pd_stmt (int kind, int plural, struct type_node **head_x);
- unsigned long
- m_size (int m);
-
- /* def.c */
- void pp_def (void);
- void pp_expand (int nargs, unsigned char * rtext);
-
- /* dir.c */
- void do_pp(void);
-
- /* exp.c */
- struct node * pe_list (register int type);
- struct node * pe_expr (void);
- struct node * pe_expr1 (bool comma_ok);
- bool pe_check (struct node * p, int type);
- void pe_massage (register struct type_node *t1,
- register struct node *p2, int op);
- void pe_retype (int mclass, register struct node * p2,
- int op);
- int pe_oversize (int mclass, long value);
- int pe_number (struct node * p);
-
- /* g1.c */
- void gen_init(void);
- void gen_function(struct fbody *p);
-
- /* g2.c */
- void gen_bool (struct node *p,
- struct node *true_lab, struct node *false_lab);
- void gen_expr (struct node *p);
- void gen_a0exp (struct node *p);
- void gen_d0exp (struct node *p);
- struct node * gen_dexpr (struct node *p);
- void gen_bpost (struct node *p);
-
- /* g3.c */
- void g_init (void);
- void g_line (int i);
- void g_lit (char *s);
- void g_1lab (int opcode, struct node *p);
- void g_2lab (int opcode, struct node *p1, struct node *p2);
- void g_0 (int opcode);
- void g_1 (int opcode, struct node *p);
- void g_1l (int opcode, struct node *p);
- void g_1l2 (int opcode, struct node *p);
- void g_2 (int opcode, struct node *p1, struct node *p2);
- void g_2l1 (int opcode, struct node *p1, struct node *p2);
- void g_qmove (struct node *loc1, struct node *loc2);
- void g_2l2 (int opcode, struct node *p1, struct node *p2);
- void g_label (struct node * p);
- int mlen (struct node *p);
-
- /* in.c */
- bool is_reserved (char * name, int length);
- struct x_ex * x_exists (struct node *q);
-
- /* mem.c */
- struct node * new_pnode (int size);
- void * node_dupl (byte *s, int size);
- struct type_node *
- new_tnode (void);
- struct node * new_cnode (void);
- struct node * new_rloc (int regfield);
- struct node * new_grloc (int regfield);
- struct node * new_cloc (long constant);
- struct node * new_clabel (void);
- struct node * new_culabel (char * symbol);
- struct iblock * new_iblock (unsigned long size);
- void * mg_alloc (int n);
- void mg_free (char *p);
- void * ml_alloc (int n);
- void ml_release (void);
- void mm_init (void);
- void mm_stat (void);
-
- /* mst.c */
- void mst_delete (char * symbol);
- struct mst_node *
- mst_enter (char * symbol, char * txt, int nargs);
- void mst_init (void);
- void mst2_init (void);
- struct mst_node *
- mst_lookup (char * symbol);
-
- /* out.c */
- void out_arg (struct node * p);
- void out_decl (struct type_node *t);
- void out_function (struct fbody *p, unsigned long link_size,
- int r_push, int do_addq);
- void out_list (register struct node *p);
- void out_tree (struct node * p);
-
- /* par.c */
- void mark_noneed (struct node * p);
- void need (int token);
- bool needend (int token);
- void pn_init (void);
- void program (void);
-
- /* ph.c */
- void peep_hole (void);
-
- /* pr.c */
- void pr_arg (struct node *p);
- void pr_expr (struct node *p);
- void pr_iblock (struct iblock *p);
- void pr_list (struct node *p);
- void pr_loc (struct node *p);
- void pr_sclass (int sclass);
- void pr_type (struct type_node *t);
- char * ps_tok (int token);
-
- /* reg.c */
- void regs_clear (void);
- unsigned long pd_alloc (struct type_node *t, int mode);
- struct node * locn_xconst (long value);
- struct node * locn_dupl (struct node *s);
- struct node * locn_xdupl (struct node *s);
- struct node * locn_chmod (struct node *loc, int mode);
- struct node * locn_reg (int reg);
- static int get_free (int sx_free[]);
- struct node * get_temp (struct node * loc);
- struct node * get_dtemp (void);
- struct node * get_atemp (void);
- void free_temp (struct node *loc);
- void free_xtemp (struct node *loc1, struct node *loc2);
- void force_free (int reg);
- void push_scratch (void);
- void free_reg (int reg);
- bool alloc_reg (int reg);
- void regs_init (void);
- void free_all (void);
- bool is_equiv (struct node *loc1, struct node *loc2);
- bool is_cloc (struct node * loc);
- struct node * fix_cloc (register struct node * loc);
- bool is_zloc (struct node * loc);
- bool is_xloc (struct node * loc);
- bool is_xtloc (struct node * loc);
- bool is_aloc (struct node * loc);
- bool is_atloc (struct node * loc);
- bool is_atreg (int reg);
- bool is_dtreg (int reg);
- bool is_dloc (struct node * loc);
- bool is_dtloc (struct node * loc);
- bool has_dtreg (struct node * loc);
- bool has_atreg (struct node * loc);
- bool is_storloc (struct node *p);
- void ss_push (struct node * loc);
- struct node * ss_pop (void);
- struct node * ss_restore (void);
-
- /* st.c */
- struct st_node * ast_lookup (char * symbol);
-
- struct st_node * gst_enter (char * symbol,
- struct type_node * type, int class);
- static int gst_hash (char * symbol);
- struct st_node * gst_lookup (char * symbol);
- struct st_node * lst_enter (char * symbol,
- struct type_node * type, int class);
- static int lst_hash (char * symbol);
- void lst_init (void);
- struct st_node * lst_lookup (char * symbol);
- struct st_node * rst_lookup (char * symbol);
- struct st_node * rst_enter (char * symbol,
- struct type_node * type, int class);
- void st_init (void);
- struct st_node * st_lookup (char * symbol);
-
- /* str.c */
- void str_cat (register char *s1, register char *s2);
- int str_cmp (register char *s1, register char *s2);
- void str_cpy (register char *s1, register char *s2);
- bool str_eq (register char *s1, register char *s2);
- char * str_galloc (register char *s);
- char * str_gcat (register char *s1, register char *s2);
- char * str_lalloc (register char *s);
- char * str_lcat (register char *s1, register char *s2);
- int str_len (register char *s);
- char * str_name (void);
- char * str_salloc (register char *s);
- char * chr_salloc (register char *s, int n);
-
- /* sys.c */
- void sysabort (void);
- void sysnext (void);
- void syspush (int c);
- void sysspush (char *s);
- void sysiclose (void);
- bool sysopen (char * name);
- bool syscreat (char * name);
- void sysoclose (void);
- void sysnlput (void);
- void syscput (char c);
- void syssput (char * s);
- void sysend (void);
- void sysinit (void);
- int syscsts (void);
-
- /* tok.c */
- int t_number (void);
- void t_string (char * symbol);
- void t_comment (void);
- void t_id (char * symbol);
-
- /* utl.c */
- int char_val (register char *s);
- void conv2s (int a, char *s);
- void convl2s (long a, char *s);
- void conul2sc (unsigned long n, char *s, int c);
- void conl2h (unsigned long n, char *s, int c);
- void fatal (char * message);
- void revcpy (char *s1, char *s2);
- void scan_number (int base);
- void skip_bl (void);
- bool skip_crlf (void);
- void skip_1line (void);
- void skip_past (void);
- void skip_pp (void);
- void skip_ws (void);
- void t_error (char * message);
- void t_2error (char * mess1, char *mess2);
- void t_3serr (struct node *p, char * mess1, char *mess2,
- char *mess3);
- void t_warning (char * message);
- void t_2warning (char * mess1, char *mess2);
- void t_help (char * message);
- void t_2help (char * mess1, char *mess2);
- void g_error (struct node * p, char * message);
- void g_help (struct node *p, char * message);
- unsigned int str_val (unsigned char *d);
-
- /* x2.c */
- struct node * x_addpsi(register struct node *locp,
- register struct node *loci,
- register int x_op);
- int x_shift (register unsigned long scale);
- struct node * x_scale (register struct node * loc1, unsigned long scale);
- struct node * x_subp (register struct node *loc1, struct node *loci,
- unsigned long scale);
- struct node * x_cast (register struct node *loc1,
- int len1, int imod1, int len3, bool dloc_ok);
- struct node * resolve (register struct node *loc1);
- void x_lookat(register struct node *loc1);
- struct node * x_sspush(register struct node *loc1);
- void gen_pp (struct node *p);
-