fly3ds 发表于 2013-10-18 20:11
https://github.com/fly3ds/linux_test
有兴趣看看这里面的expre.c,还是没有完成,不过照这个思路编下去 ...
fly3ds 发表于 2013-10-20 11:41
已经可以识别并计算浮点数!
-bash-4.1$ ./expre
12 + 3 - 4 / 5 * 2.1 + 5
12 + 3 - 4 / 5 * 2.1 + 5
12 + 3 - 4 / 10.500000 + 5
12 + 3 - 0.380952 + 5
15 - 0.380952 + 5
15 - 5.380952
9.619048
-bash-4.1$
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |