8 /* stuff from util.c */
13 extern BOOLEAN nonstandardFlag;
14 extern BOOLEAN hashIds;
15 extern BOOLEAN acceptPrim;
18 extern BOOLEAN ignoreSCC;
20 extern BOOLEAN implicitPrelude;
21 extern BOOLEAN ignorePragmas;
23 extern int minAcceptablePragmaVersion;
24 extern int maxAcceptablePragmaVersion;
25 extern int thisIfacePragmaVersion;
27 extern unsigned hash_table_size;
28 extern char *input_file_dir;
30 extern list imports_dirlist;
31 extern list sys_imports_dirlist;
33 extern char HiSuffix[];
34 extern char PreludeHiSuffix[];
36 void process_args PROTO((int, char **));
38 /* end of util.c stuff */
40 list mklcons PROTO((void *h, list t)); /* if we have PROTO, we have "void *" */
41 list lapp PROTO((list l1, void *l2));
42 list lconc PROTO((list l1, list l2));
44 #define lsing(l) mklcons(l, Lnil) /* Singleton Lists */
45 #define ldub(l1, l2) mklcons(l1, lsing(l2)) /* Two-element Lists */
47 #define FN fns[icontexts]
48 #define SAMEFN samefn[icontexts]
49 #define PREVPATT prevpatt[icontexts]
51 id installid PROTO((char *)); /* Create a new identifier */
52 hstring installHstring PROTO((int, char *)); /* Create a new literal string */
54 id install_literal PROTO((char *));
55 char *id_to_string PROTO((id));
57 id qid_to_id PROTO((qid));
58 char *qid_to_string PROTO((qid));
59 char *qid_to_mod PROTO((qid)); /* NULL if unqual */
60 char *qid_to_pmod PROTO((qid)); /* "?" if unqual */
61 qid creategid PROTO((long));
63 /* partain additions */
65 char *xmalloc PROTO((unsigned)); /* just a GNU-style error-checking malloc */
66 int printf PROTO((const char *, ...));
67 int fprintf PROTO((FILE *, const char *, ...));
68 /*varies (sun/alpha): int fputc PROTO((char, FILE *)); */
69 int fputs PROTO((const char *, FILE *));
70 int sscanf PROTO((const char *, const char *, ...));
71 long strtol PROTO((const char *, char **, int));
72 size_t fread PROTO((void *, size_t, size_t, FILE *));
73 int fclose PROTO((FILE *));
74 int isatty PROTO((int));
75 /*extern ??? _filbuf */
76 /*extern ??? _flsbuf */
78 void pprogram PROTO((tree));
80 void format_string PROTO((FILE *, unsigned char *, int));
81 list type2context PROTO((ttype));
82 pbinding createpat PROTO((pbinding, binding));
83 void process_args PROTO((int, char **));
84 void hash_init PROTO((void));
85 void print_hash_table PROTO((void));
86 long int hash_index PROTO((id));
87 void yyinit PROTO((void));
88 int yyparse PROTO((void));
89 int yylex PROTO((void));
90 void setyyin PROTO((char *));
91 void yyerror PROTO((char *));
92 void error PROTO((char *));
93 void hsperror PROTO((char *));
95 void makeinfix PROTO((id, int, int, id, long, long, id, id, long, long, long, list));
96 struct infix *infixlookup PROTO((qid));
97 int pprecedence PROTO((struct infix *));
98 int pfixity PROTO((struct infix *));
99 char * infixstr PROTO((int));
100 long infixint PROTO((int));
102 void hsincindent PROTO((void));
103 void hssetindent PROTO((void));
104 void hsendindent PROTO((void));
105 void hsindentoff PROTO((void));
107 int checkfixity PROTO((char *));
108 void checksamefn PROTO((qid));
109 void checkinpat PROTO((void));
111 void expORpat PROTO((int,tree));
112 /* the "int" arg says what we want; it is one of: */
116 BOOLEAN lhs_is_patt PROTO((tree));
117 tree function PROTO((tree));
118 void extendfn PROTO((binding, binding));
119 void checkorder PROTO((binding));
121 void checkdostmts PROTO((list));
122 void checknobangs PROTO((ttype));
123 void splittyconapp PROTO((ttype, qid *, list *));
126 void precparse PROTO((tree));
127 void checkprec PROTO((tree, qid, BOOLEAN));
130 BOOLEAN isconstr PROTO((char *));
131 void setstartlineno PROTO((void));
132 void find_module_on_imports_dirlist PROTO((char *, BOOLEAN, char *));
134 /* mattson additions */
135 char *xstrdup PROTO((char *)); /* Duplicate a string */
136 char *xstrndup PROTO((char *, unsigned)); /* Duplicate a substring */
137 char *xrealloc PROTO((char *, unsigned)); /* Re-allocate a string */
139 #endif /* __UTILS_H */