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 etags = FALSE; /* Set if we're parsing only to produce tags. */
18 BOOLEAN hashIds = FALSE; /* Set if Identifiers should be hashed. */
20 BOOLEAN ignoreSCC = TRUE; /* Set if we ignore/filter scc expressions. */
21 BOOLEAN warnSCC = FALSE; /* Set if we want to inform the user what _scc_s are
24 /**********************************************************************
30 **********************************************************************/
33 # include "constants.h"
38 process_args(argc,argv)
42 BOOLEAN keep_munging_option = FALSE;
44 while (argc > 0 && argv[0][0] == '-') {
46 keep_munging_option = TRUE;
48 while (keep_munging_option && *++*argv != '\0') {
63 /* -Hn -- Use Hash Table, Size n (if given) */
67 hash_table_size = atoi(*argv+1);
70 nonstandardFlag = TRUE;
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);
105 /* lconc l1 l2 appends l2 to the end of l1 */
113 if (tlist(l1) == lnil)
115 for(t = l1; tlist(ltl(t)) != lnil; t = ltl(t))
121 /* lapp( l, x ) appends [x] to the end of list l */
123 lapp(list l1, VOID_STAR l2)
127 if (tlist(l1) == lnil)
128 return(mklcons(l2, mklnil()));
129 for(t = l1; tlist(ltl(t)) != lnil; t = ltl(t))
131 ltl(t) = mklcons(l2, mklnil());