1 /**********************************************************************
7 **********************************************************************/
10 #include "constants.h"
13 tree root; /* The root of the built syntax tree. */
16 BOOLEAN nonstandardFlag = FALSE; /* Set if non-std Haskell extensions to be used. */
17 BOOLEAN haskell1_2Flag = FALSE; /* Set if we are compiling for 1.2 */
18 BOOLEAN etags = FALSE; /* Set if we're parsing only to produce tags. */
19 BOOLEAN hashIds = FALSE; /* Set if Identifiers should be hashed. */
21 BOOLEAN ignoreSCC = TRUE; /* Set if we ignore/filter scc expressions. */
23 /**********************************************************************
29 **********************************************************************/
32 # include "constants.h"
37 process_args(argc,argv)
41 BOOLEAN keep_munging_option = FALSE;
43 while (argc > 0 && argv[0][0] == '-') {
45 keep_munging_option = TRUE;
47 while (keep_munging_option && *++*argv != '\0') {
51 nonstandardFlag = TRUE;
55 haskell1_2Flag = TRUE;
70 /* -Hn -- Use Hash Table, Size n (if given) */
74 hash_table_size = atoi(*argv+1);
84 if(argc >= 1 && freopen(argv[0], "r", stdin) == NULL) {
85 fprintf(stderr, "Cannot open %s.\n", argv[0]);
89 if(argc >= 2 && freopen(argv[1], "w", stdout) == NULL) {
90 fprintf(stderr, "Cannot open %s.\n", argv[1]);
99 fprintf(stderr, "PARSER: Error %s\n", s);
110 if (tlist(l1) == lnil)
112 for(t = l1; tlist(ltl(t)) != lnil; t = ltl(t))
119 lapp(list l1, VOID_STAR l2)
123 if (tlist(l1) == lnil)
124 return(mklcons(l2, mklnil()));
125 for(t = l1; tlist(ltl(t)) != lnil; t = ltl(t))
127 ltl(t) = mklcons(l2, mklnil());