Javascript parser for simple expression

I would like to find a javascript parser that can handle and evaluate simple expressions. The parser should be able to evaluate the regular mathematical expressions, and support custom functions with parameters. It also has to support strings handling. String concatenation with || operator support is preferred, but it is okay if + will do the trick. Examples of an expression that should be handled by the parser: 3 * (2 + 1) - 1 2 * func(2, 2) func('hello world', 0, 5) || ' you' Has anyone implemented such a thing or where can I find something similar?
are you looking for a javascript parser to run in a different language? like a c++ implementation of a javascript parser? Or something in javascript for javascript?

以上就是Javascript parser for simple expression的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准