modified main.c
-added Error-message from Logging API. -changed exit and moved after yyparse() -added extern for file name todo: make file name user input variable.
This commit is contained in:
parent
1cfe9485e9
commit
6fca12df39
10
src/main.c
10
src/main.c
|
@ -4,6 +4,8 @@
|
|||
|
||||
#define LOG_LEVEL LOG_LEVEL_DEBUG
|
||||
|
||||
extern FILE* yyin;
|
||||
|
||||
/**
|
||||
* @brief Log a debug message to inform about beginning exit procedures
|
||||
*
|
||||
|
@ -38,10 +40,10 @@ int main(void) {
|
|||
|
||||
FILE* input = fopen("program.gem", "r");
|
||||
|
||||
if (input == NULL)
|
||||
if (NULL == Input)
|
||||
{
|
||||
printf("Error opening file!\n");
|
||||
return 1; // Error when opening file
|
||||
ERROR("File couldn't be opened!");
|
||||
atexit();
|
||||
}
|
||||
|
||||
yyin = input;
|
||||
|
@ -49,5 +51,7 @@ int main(void) {
|
|||
fclose(input);
|
||||
|
||||
yyparse();
|
||||
|
||||
atexit();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue