Evaluating mathematical expressions

前端 未结 5 981
囚心锁ツ
囚心锁ツ 2020-11-30 01:11

I am looking for an algorithm that I can use to evaluate mathematical expressions. I\'ve seen a few questions on SO that are simmilar but the answers are C#/Delphi or pytho

5条回答
  •  一向
    一向 (楼主)
    2020-11-30 01:25

    I asked Google for "recursive descent expression parser" (I don't blame you for not knowing what to look for) and found Parsing Expressions by Recursive Descent which provides an introduction to some useful parsing techniques.

    Also, the Wikipedia article on Recursive descent parser includes a fairly complete example in C.

提交回复
热议问题