编写一个小型的语言 [英] Writing a mini-language
本文介绍了编写一个小型的语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个需要允许用户编写EX pressions应用程序类似擅长:
I have an application that needs to allow users to write expressions similar to excel:
(H1 +(D1 / C3))* I8
(H1 + (D1 / C3)) * I8
和更复杂的事情像
如果(H1 ='真',D3 * 2,D3 * .5)
If(H1 = 'True', D3 * .2, D3 * .5)
我只能做这么多的普通恩pressions。任何建议,正确的方法做这个问题,以及任何资源,我可以从中学习会更AP preciated。
I can only do so much with regular expressions. Any suggestions as to the right approach to doing this as well as any resources I can learn from would be much appreciated.
谢谢!
推荐答案
其他的一些问题,你会发现提示:
Some other question, you will find hints in:
- How to write a programming language?
- Learning to write a compiler
- Writing a compiler for a DSL in python
祝你好运!
这篇关于编写一个小型的语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文