added -debug option to -help output

This commit is contained in:
Annie
2025-04-04 18:49:04 -04:00
parent e566069418
commit 0b33ea4dea

View File

@ -4,6 +4,7 @@
#define ALPHA_OFFSET 6 #define ALPHA_OFFSET 6
#define TOK_LEN 3 #define TOK_LEN 3
#define ST_LEN 2 #define ST_LEN 2
#define TC_LEN 2
#define HELP \ #define HELP \
"HELP:\nHow to run the alpha compiler:\n./alpha [options] " \ "HELP:\nHow to run the alpha compiler:\n./alpha [options] " \
"program\nValid " \ "program\nValid " \
@ -13,7 +14,8 @@
"symbol " \ "symbol " \
"table for the program to the .st file\n-help print this message " \ "table for the program to the .st file\n-help print this message " \
"and exit " \ "and exit " \
"the alpha compiler\n" "the alpha compiler\n-debug print debugging messages in grammar rules \n"
#define SET_FLAG 1 // Used to set flags for arg types #define SET_FLAG 1 // Used to set flags for arg types
#define INVALID \ #define INVALID \
"INVALID INPUT: Include a .alpha file or use -help for more inputs \n" "INVALID INPUT: Include a .alpha file or use -help for more inputs \n"
@ -39,6 +41,7 @@ SymbolTable *cur;
FILE *alpha_file; FILE *alpha_file;
FILE *tok_flag = NULL; FILE *tok_flag = NULL;
FILE *st_flag = NULL; FILE *st_flag = NULL;
FILE *tc_flag = NULL;
bool DEBUG = false; bool DEBUG = false;
int no_flag = 0; int no_flag = 0;
int arg; int arg;