-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAEPCli.c
More file actions
46 lines (38 loc) · 1.08 KB
/
AEPCli.c
File metadata and controls
46 lines (38 loc) · 1.08 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
#include <stdio.h>
#include <string.h>
#include <conio.h>
#include <stdlib.h>
#include "aparse.h"
int main(int argc, char* argv[]){
char buffer[BUFFER];
printf("--------------------------------------------\n");
printf(" ARITHMETIC EXPRESSION PARSER |\n");
printf(" (ENTER \"exit\" TO EXIT) |\n");
printf("--------------------------------------------\n");
char iExpression[BUFFER];
char iKeyword[30];
while (1){
fflush(stdin);
zeroFill(buffer, BUFFER);
zeroFill(iExpression, BUFFER);
zeroFill(iKeyword, 30);
printf("\n[>] ");
gets(buffer);
gin(buffer, iKeyword, iExpression);
switch(inparse(iKeyword, iExpression)){
case 1:
return 0;
break;
case -1:
printf("[*] Invalid Keyword.\n");
continue;
case -2:
printf("[*] Invalid Arithmetic Expression.\n");
continue;
default:
continue;
}
getKeyword(buffer, iKeyword);
}
return 0;
}