1 /**********************************************************************
7 **********************************************************************/
10 #include "constants.h"
13 #define PARSER_VERSION "2.01 (Haskell 1.3)"
15 tree root; /* The root of the built syntax tree. */
18 BOOLEAN nonstandardFlag = FALSE; /* Set if non-std Haskell extensions to be used. */
19 BOOLEAN haskell1_2Flag = FALSE; /* Set if we are compiling for 1.2 */
20 BOOLEAN etags = FALSE; /* Set if we're parsing only to produce tags. */
21 BOOLEAN hashIds = FALSE; /* Set if Identifiers should be hashed. */
23 BOOLEAN ignoreSCC = TRUE; /* Set if we ignore/filter scc expressions. */
25 /**********************************************************************
31 **********************************************************************/
34 # include "constants.h"
39 process_args(argc,argv)
43 BOOLEAN keep_munging_option = FALSE;
45 while (argc > 0 && argv[0][0] == '-') {
47 keep_munging_option = TRUE;
49 while (keep_munging_option && *++*argv != '\0') {
53 nonstandardFlag = TRUE;
57 haskell1_2Flag = TRUE;
72 /* -Hn -- Use Hash Table, Size n (if given) */
76 hash_table_size = atoi(*argv+1);
86 if(argc >= 1 && freopen(argv[0], "r", stdin) == NULL) {
87 fprintf(stderr, "Cannot open %s.\n", argv[0]);
91 if(argc >= 2 && freopen(argv[1], "w", stdout) == NULL) {
92 fprintf(stderr, "Cannot open %s.\n", argv[1]);
101 fprintf(stderr, "PARSER: Error %s\n", s);
112 if (tlist(l1) == lnil)
114 for(t = l1; tlist(ltl(t)) != lnil; t = ltl(t))
121 lapp(list l1, VOID_STAR l2)
125 if (tlist(l1) == lnil)
126 return(mklcons(l2, mklnil()));
127 for(t = l1; tlist(ltl(t)) != lnil; t = ltl(t))
129 ltl(t) = mklcons(l2, mklnil());