也许有人已经回答了以下概念性问题:
我正在写一个(相对微不足道的)应用程序,它从表格中记录记录(每行都是记录,圆柱是字段),处理记录,然后将新记录写进新的表格。
问题是,规格(即产出记录看起来如何以及如何计算)将随时发生变化,用户在编程方面没有多少经验。
我想把应用程序设置在UI 中, 也就是说, 我想让用户能够指定表达式, 例如
x * y - 3
或
z.Substring (2)
somewhere in the UI (similar to Excel, where you can give f或mulas f或 cells).
Question: What is the best language f或 specifying simple mathematical, boolean, and string expressions?
我考虑了以下各点:
- allow the users to enter PowerShell code
- allow the users to enter C# code
- writing a parser myself
但是在我看来 这一切似乎都非常复杂 你有更好的主意吗?