flag updates
This commit is contained in:
32
src/runner.h
32
src/runner.h
@ -5,20 +5,23 @@
|
||||
#define TOK_LEN 3
|
||||
#define ST_LEN 2
|
||||
#define TC_LEN 2
|
||||
#define HELP \
|
||||
"HELP:\nHow to run the alpha compiler:\n./alpha [options] " \
|
||||
"program\nValid " \
|
||||
"options:\n-tok output the token number, token, line number, and " \
|
||||
"column " \
|
||||
"number for each of the tokens to the .tok file\n-st output the " \
|
||||
"symbol " \
|
||||
"table for the program to the .st file\n-help print this message " \
|
||||
"and exit " \
|
||||
"the alpha compiler\n-debug print debugging messages in grammar rules \n"
|
||||
#define HELP \
|
||||
"HELP:\n" \
|
||||
" How to run the alpha compiler:\n" \
|
||||
" ./alpha [options] program\n" \
|
||||
"Valid options:\n" \
|
||||
" -tok output the token number, token, line number, and column number for each of the tokens to the .tok file\n" \
|
||||
" -st output the symbol table for the program to the .st file\n" \
|
||||
" -asc output the annotated source code for the program to the .asc file, including syntax errors\n" \
|
||||
" -tc run the type checker and report type errors to the .asc file\n" \
|
||||
" -ir run the intermediate representation generator, writing output to the .ir file\n" \
|
||||
" -cg run the (x86 assembly) code generator, writing output to the .s file\n" \
|
||||
" -debug produce debugging messages to stderr\n" \
|
||||
" -help print this message and exit the alpha compiler\n"
|
||||
|
||||
#define SET_FLAG 1 // Used to set flags for arg types
|
||||
#define INVALID \
|
||||
"INVALID INPUT: Include a .alpha file or use -help for more inputs \n"
|
||||
#define SET_FLAG 1 // Used to set flags for arg types
|
||||
#define INVALID \
|
||||
"INVALID INPUT: Include a .alpha file or use -help for more inputs \n"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
@ -42,6 +45,9 @@ FILE *alpha_file;
|
||||
FILE *tok_flag = NULL;
|
||||
FILE *st_flag = NULL;
|
||||
FILE *tc_flag = NULL;
|
||||
FILE *ir_flag = NULL;
|
||||
FILE *cg_flag = NULL;
|
||||
FILE *asc_flag = NULL;
|
||||
bool DEBUG = false;
|
||||
int no_flag = 0;
|
||||
int arg;
|
||||
|
Reference in New Issue
Block a user