#include "arith.h"
#include "stack.h"
#include "def.h"
+#include "idf.h"
#include "type.h"
#include "proto.h"
#include "struct.h"
#include "field.h"
+#include "print.h"
#include "Lpars.h"
#include "label.h"
#include "expr.h"
-#include "static.h"
+/*#include "static.h"*/
#include "declar.h"
/* Some routines (symbol2str, type2str, qual2str) which should have
extern char options[];
-extern char *sprint();
extern struct idf *idf_hashtable[];
-extern char *symbol2str(), *type2str(), *qual2str(), *next_transient();
+extern char *symbol2str();
enum sdef_kind {selector, field}; /* parameter for dumpsdefs */
static int dumplevel;
-newline() {
+/* Forward declarations */
+static void dumpstack(void);
+static char *next_transient(void);
+static char *qual2str(int);
+static char *type2str(register struct type *);
+static void p1_indent(register int);
+static void dumpdefs(register struct def *, int);
+void dumpidf(register struct idf *, int);
+void dumptags(register struct tag *);
+void dumptype(register struct type *);
+void dumpsdefs(register struct sdef *, enum sdef_kind);
+static void p1_expr(int, register struct expr *);
+
+void newline(void)
+{
register int dl = dumplevel;
print("\n");
print(" ");
}
-int dumpidf();
-dumpidftab(msg, opt)
- char msg[];
+
+void dumpidftab(char msg[], int opt)
{
/* Dumps the identifier table in readable form (but in
arbitrary order).
print(">>> DUMPIDF, %s (end)\n", msg);
}
-dumpstack()
+static void dumpstack(void)
{
/* Dumps the identifier stack, starting at the top.
*/
print("\n");
}
-dumpidf(idf, opt)
- register struct idf *idf;
+void dumpidf(register struct idf *idf, int opt)
{
/* All information about the identifier idf is divulged in a
hopefully readable format.
}
}
-dumpdefs(def, opt)
- register struct def *def;
+void dumpdefs(register struct def *def, int opt)
{
dumplevel++;
while (def && ((opt&4) || def->df_level)) {
dumplevel--;
}
-dumptags(tag)
- register struct tag *tag;
+void dumptags(register struct tag *tag)
{
dumplevel++;
while (tag) {
dumplevel--;
}
-dumpsdefs(sdef, sdk)
- register struct sdef *sdef;
- enum sdef_kind sdk;
+void dumpsdefs(register struct sdef *sdef, enum sdef_kind sdk)
{
/* Since sdef's are members of two chains, there are actually
two dumpsdefs's, one following the chain of all selectors
dumplevel--;
}
-dumpproto(pl)
- register struct proto *pl;
+void dumpproto(register struct proto *pl)
{
register struct type *type;
register int argcnt = 0;
: (pl->pl_flag & PL_ELLIPSIS
? "ellipsis" : "unknown" ));
newline();
- if (type = pl->pl_type){
+ if ( (type = pl->pl_type) ){
dumptype(type);
newline();
}
print("dump proto type list (end)\n");
}
-dumptype(tp)
- register struct type *tp;
+void dumptype(register struct type *tp)
{
int ops = 1;
dumplevel--;
}
-char *
-type2str(tp)
- register struct type *tp;
+static char *type2str(register struct type *tp)
{
/* Yields a pointer to a one-line description of the type tp.
*/
return buf;
}
-char *
-qual2str(qual)
- int qual;
+static char *qual2str(int qual)
{
char *buf = next_transient();
GSTATIC char trans_buf[MAXTRANS][300];
-char * /* the ultimate transient buffer supplier */
-next_transient()
+static char * /* the ultimate transient buffer supplier */
+next_transient(void)
{
static int bnum;
return trans_buf[bnum];
}
-print_expr(msg, expr)
- char msg[];
- struct expr *expr;
+void print_expr(char msg[], struct expr *expr)
{
/* Provisional routine to print an expression preceded by a
message msg.
}
}
-p1_expr(lvl, expr)
- register struct expr *expr;
+static void p1_expr(int lvl, register struct expr *expr)
{
p1_indent(lvl);
if (!expr) {
}
}
-p1_indent(lvl)
- register int lvl;
+static void p1_indent(register int lvl)
{
while (lvl--)
print(" ");
{
extern int cnt_string_cst, cnt_formal,
cnt_decl_unary, cnt_def, cnt_expr, cnt_field,
- cnt_e_stack, cnt_localvar, cnt_proto, cnt_repl,
- cnt_args, cnt_macro, cnt_stack_level,
+ cnt_e_stack, cnt_localvar, cnt_proto,
+ cnt_stack_level,
cnt_stack_entry, cnt_stmt_block, cnt_sdef, cnt_tag,
cnt_switch_hdr, cnt_case_entry, cnt_type, cnt_brace,
cnt_lint_stack_entry, cnt_state, cnt_auto_def,
print("\
%6d string_cst\n%6d formal\n\
%6d decl_unary\n%6d def\n%6d expr\n%6d field\n\
-%6d e_stack\n%6d localvar\n%6d proto\n%6d repl\n\
-%6d args\n%6d macro\n%6d stack_level\n\
+%6d e_stack\n%6d localvar\n%6d proto\n\
+%6d stack_level\n\
%6d stack_entry\n%6d stmt_block\n%6d sdef\n%6d tag\n\
%6d switch_hdr\n%6d case_entry\n%6d type\n%6d brace\n\
%6d lint_stack_entry\n%6d state\n%6d auto_def\n\
%6d expr_state\n%6d argument\n",
cnt_string_cst, cnt_formal,
cnt_decl_unary, cnt_def, cnt_expr, cnt_field,
- cnt_e_stack, cnt_localvar, cnt_proto, cnt_repl,
- cnt_args, cnt_macro, cnt_stack_level,
+ cnt_e_stack, cnt_localvar, cnt_proto,
+ cnt_stack_level,
cnt_stack_entry, cnt_stmt_block, cnt_sdef, cnt_tag,
cnt_switch_hdr, cnt_case_entry, cnt_type, cnt_brace,
cnt_lint_stack_entry, cnt_state, cnt_auto_def,