diff options
| author | partain <unknown> | 1996-03-19 09:11:07 +0000 |
|---|---|---|
| committer | partain <unknown> | 1996-03-19 09:11:07 +0000 |
| commit | 6c381e873e222417d9a67aeec77b9555eca7b7a8 (patch) | |
| tree | 32cbd1de14ff19e21dd48e94051ccbe58b5fbdf5 /ghc/compiler/parser/main.c | |
| parent | 8147a9f0bcc48ef0db1e91f8b985a4f5c3fed560 (diff) | |
| download | haskell-6c381e873e222417d9a67aeec77b9555eca7b7a8.tar.gz | |
[project @ 1996-03-19 08:58:34 by partain]
simonpj/sansom/partain/dnt 1.3 compiler stuff through 96/03/18
Diffstat (limited to 'ghc/compiler/parser/main.c')
| -rw-r--r-- | ghc/compiler/parser/main.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/ghc/compiler/parser/main.c b/ghc/compiler/parser/main.c new file mode 100644 index 0000000000..8463644a77 --- /dev/null +++ b/ghc/compiler/parser/main.c @@ -0,0 +1,54 @@ +/* This is the "top-level" file for the *standalone* hsp parser. + See also hsclink.c. (WDP 94/10) +*/ + +#include <stdio.h> + +#include "hspincl.h" +#include "constants.h" +#include "utils.h" + +/*OLD:static char *progname;*/ /* The name of the program. */ + + +/********************************************************************** +* * +* * +* The main program * +* * +* * +**********************************************************************/ + +int +main(int argc, char **argv) +{ + Lnil = mklnil(); /* The null list -- used in lsing, etc. */ + + process_args(argc,argv); + + hash_init(); + +#ifdef HSP_DEBUG + fprintf(stderr,"input_file_dir=%s\n",input_file_dir); +#endif + + yyinit(); + + if(yyparse() == 0 && !etags) + { + /* No syntax errors. */ + pprogram(root); + printf("\n"); + exit(0); + } + else if(etags) + { + exit(0); + } + else + { + /* There was a syntax error. */ + printf("\n"); + exit(1); + } +} |
