-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdriver.c
More file actions
48 lines (47 loc) · 1.21 KB
/
Copy pathdriver.c
File metadata and controls
48 lines (47 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "lexer.h"
#include "parser.h"
int main()
{
// char* fileName = "test_cases_for_lexer/t2.txt";
char* fileName = "parser_test_cases/t5.txt";
int keepRunning = 1;
populateKeywords();
initialiseParser();
while(keepRunning){
printf("Enter your choice: ");
int choice;
scanf("%d", &choice);
switch (choice)
{
case 0:
printf("Exiting the code....\n");
keepRunning = 0;
break;
case 1:
removeComments(fileName);
break;
case 2:
printLexemes(fileName);
break;
case 3:
printLexemesinFile(fileName);
parse_input_get_tree();
printTree(root, "", 1);
printTreeInOrder(root);
break;
case 4:
//timeTaken(fileName);
break;
default:
keepRunning=0;
break;
}
if(keepRunning == 0){
break;
}
}
}