Javascript parser for simple expression

后端 未结 6 2243
再見小時候
再見小時候 2020-12-05 03:57

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 sup

6条回答
  •  悲哀的现实
    2020-12-05 04:14

    See this tutorial for how to build arbitrary parsers/compilers. (Basically it automates the construction of recursive descent parsers from grammars, meaning you can change your expression syntax easily). The whole tutorial is done in JavaScript, so it applies directly to you.

    http://www.bayfronttechnologies.com/mc_tutorial.html

提交回复
热议问题