3 \details The driver assumes the existence of a bison-generated parser,
4 referenced by the external function 'yyparse'.
5 It also assumes the existence of a lexer which must be initialized
6 before parsing, referenced by the external function 'lexer_init'
7 which assumes standard error handling.
8 All input arguments are made available through the exposed (that is,
9 non-static) array of character pointers 'cargs', which point
10 to the non-duplicated strings in 'argv' directly from the system.
11 \author Jordan Lavatai
13 ----------------------------------------------------------------------------*/
17 #include <unistd.h> //getopt
19 int main(int, char*[]);
21 const char* cargs
['Z'] = {0};
28 /* Main entry from terminal
29 parses the command line and kicks off recursive scanning
35 #define MAXERR "-%c allows at most " #MAX_STR_LEN " input characters", opt
36 #define USAGE "Usage: %s [-r root]\n", argv[0]
41 switch (opt
= getopt(argc
, argv
, "r:o:"))
46 if (strnlen(optarg
, MAX_STR_LEN
) != MAX_STR_LEN
)
47 { cargs
[opt
] = optarg
;
50 fprintf(stderr
, MAXERR
);
52 fprintf(stderr
, USAGE
);