-
Notifications
You must be signed in to change notification settings - Fork 0
/
catCE.c
36 lines (30 loc) · 938 Bytes
/
catCE.c
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
#include <stdlib.h>
#include <stdio.h>
int main(void) {
int result;
// Execute "flex cat_oracle.l" command
result = system("flex cat_oracle.l");
if (result != 0) {
printf("Failed to execute 'flex cat_oracle.l'\n");
return 1;
}
// Execute "bison -d cat_oracle.y" command
result = system("bison -d cat_oracle.y");
if (result != 0) {
printf("Failed to execute 'bison -d cat_oracle.y'\n");
return 1;
}
// Execute "gcc -o cat_oracle cat_oracle.tab.c lex.yy.c" command
result = system("gcc -o cat_oracle cat_oracle.tab.c lex.yy.c");
if (result != 0) {
printf("Failed to execute 'gcc -o cat_oracle cat_oracle.tab.c lex.yy.c -lfl'\n");
return 1;
}
// Execute "./cat_oracle" command
result = system("./cat_oracle");
if (result != 0) {
printf("Failed to execute './cat_oracle'\n");
return 1;
}
return 0;
}