-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest1.c
52 lines (46 loc) · 979 Bytes
/
test1.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "Evic.c"
int main(int argc, char const *argv[])
{
EVIC_expr *ec_expr;
char *info;
int rt;
double x, y, rrr;
char expr[1024] = "x";
rt = EVIC_Cut(expr, &ec_expr);
if (rt == 0)
{
printf("cut failed\n");
}
else
{
info = EVIC_Print(ec_expr);
printf(info);
free(info);
}
EVIC_ValueLink(ec_expr, "x", &x);
EVIC_ValueLink(ec_expr, "y", &y);
rt = EVIC_Compile(&ec_expr);
if (rt == 0)
{
printf("compile failed\n");
}
else
{
printf("------------------------\nresult:\n");
info = EVIC_Print(ec_expr);
printf(info);
free(info);
}
x = 2;
y = 20;
rt = EVIC_Calculate(ec_expr, &rrr);
if (rt == 0)
{
printf("calculat failed\n");
}
else
{
printf("------------------------\nresult: %lf", rrr);
}
EVIC_Free(ec_expr);
}