由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - math expression
相关主题
Introducting a better way of pattern handling最近node.js real time web 很火
请教:parse CSV文件String newvalue = value.replaceAll("%"," ");
Design thought.. Sugguestions?Re: Regular Expression in Java
Do you guys use lex to parsing input?问一个题
ft, BSF documentation?谁用过JAVA1.4带的REGULAR EXPRESSION PACKAGE吗
What's new in Java 6?Stupid IBM JVM: operator precedence
新手问题 -- dynamic variable and dynamic functions.这个是什么意思?
Java的主要就业领域有哪些?[转载] Java Regular Expression Question //bow !
相关话题的讨论汇总
话题: expression话题: math话题: antlr话题: cookcc话题: x2
进入Java版参与讨论
1 (共1页)
w*r
发帖数: 64
1
需要用一个简单的math expression parser。类似于做:
f(x1, x2,... xn) = (a1x1 + x2 *x3)*a2 -x4 ..
基本上都是四则运算。有没有什么open source的上手就可以用的library?谢谢!
m******t
发帖数: 2416
2

antlr? It's fairly straightfoward.

【在 w*r 的大作中提到】
: 需要用一个简单的math expression parser。类似于做:
: f(x1, x2,... xn) = (a1x1 + x2 *x3)*a2 -x4 ..
: 基本上都是四则运算。有没有什么open source的上手就可以用的library?谢谢!

F****n
发帖数: 3271
3
Why not use Rhino, hoho.

【在 m******t 的大作中提到】
:
: antlr? It's fairly straightfoward.

c*****t
发帖数: 1879
4
No need to use antlr. My CookCC is smaller, faster and better :)
In fact, operator precedence is the worst nightmare for LL parsers
such as antlr.
CookCC even comes with a calculator example (well, a mini script
interpreter of a few hundred lines) that you just need to do minor
modifcations:
http://code.google.com/p/cookcc/source/browse/trunk/tests/javaap/calc/Calculator.java

【在 m******t 的大作中提到】
:
: antlr? It's fairly straightfoward.

w*r
发帖数: 64
5
thanks!
永远向唐僧大师学习!

【在 c*****t 的大作中提到】
: No need to use antlr. My CookCC is smaller, faster and better :)
: In fact, operator precedence is the worst nightmare for LL parsers
: such as antlr.
: CookCC even comes with a calculator example (well, a mini script
: interpreter of a few hundred lines) that you just need to do minor
: modifcations:
: http://code.google.com/p/cookcc/source/browse/trunk/tests/javaap/calc/Calculator.java

1 (共1页)
进入Java版参与讨论
相关主题
[转载] Java Regular Expression Question //bow !ft, BSF documentation?
Re: [转载] Java Regular Expression QuestioWhat's new in Java 6?
expression in unicode新手问题 -- dynamic variable and dynamic functions.
java问题:如何match两个正规表达式Java的主要就业领域有哪些?
Introducting a better way of pattern handling最近node.js real time web 很火
请教:parse CSV文件String newvalue = value.replaceAll("%"," ");
Design thought.. Sugguestions?Re: Regular Expression in Java
Do you guys use lex to parsing input?问一个题
相关话题的讨论汇总
话题: expression话题: math话题: antlr话题: cookcc话题: x2