How would you create an expression parser in c#?

后端 未结 3 781
春和景丽
春和景丽 2021-01-24 04:10

I am just curious. Like in interpreted languages or even statement calculators how do people convert the strings given by input or files to actual expressions? e.g \"Ent

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-24 04:33

    I believe this can be achieved using expression trees, which is how LINQ is implemented.

    http://msdn.microsoft.com/en-us/library/bb397951.aspx

提交回复
热议问题