Fixed formatting in lex; Updated Makefile t#30
This commit is contained in:
34
src/runner.h
34
src/runner.h
@ -1,29 +1,35 @@
|
||||
#define ALPHA_OFFSET 6
|
||||
#define TOK_LEN 3
|
||||
#define ST_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"
|
||||
//use to set flags for arg types
|
||||
#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"
|
||||
// use to set flags for arg types
|
||||
#define SET_FLAG 1
|
||||
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "../tmp/flex.h"
|
||||
#include "typedefs.h"
|
||||
#include <stdbool.h>
|
||||
#include "symbol_table.h"
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "../tmp/flex.h"
|
||||
#include "symbol_table.h"
|
||||
#include "typedefs.h"
|
||||
|
||||
extern int line_number, column_number;
|
||||
extern char *yytext;
|
||||
extern FILE *yyin;
|
||||
int arg;
|
||||
|
||||
SymbolTable * top;
|
||||
SymbolTable * curr;
|
||||
SymbolTable *top;
|
||||
SymbolTable *curr;
|
||||
|
||||
// int main(int argc, char* argv[]);
|
||||
char *is_tok(int argc, char* argv[]);
|
||||
char *is_tok(int argc, char *argv[]);
|
||||
// int is_alpha_file(char *file, int file_len);
|
||||
void enter_scope(int, int);
|
||||
void exit_scope(void);
|
||||
@ -33,9 +39,9 @@ FILE *tok_flag = NULL;
|
||||
FILE *st_flag = NULL;
|
||||
int no_flag = 0;
|
||||
|
||||
int main(int argc, char* argv[]);
|
||||
int main(int argc, char *argv[]);
|
||||
int new_file(char *arg, char *alpha);
|
||||
int is_alpha_file(char *alpha, int file_len);
|
||||
bool is_help(char * input);
|
||||
int run(FILE*alpha);
|
||||
int check_flag(char * arg, char* alpha);
|
||||
bool is_help(char *input);
|
||||
int run(FILE *alpha);
|
||||
int check_flag(char *arg, char *alpha);
|
||||
|
Reference in New Issue
Block a user