python里实现DSL


以后用到的话可以参考如下链接:

http://safehammad.com/downloads/domain-specific-languages-and-python-2011-04-21.pdf

http://www.dabeaz.com/ply/PLYTalk.pdf

http://www.ptmcg.com/geo/python/confs/pyCon2006_pres2.html

 

Python的DSL无非三种实现思路:

  • PyParsing – An easy to use Pythonic parser where the grammar is written directly in Python.
  • PLY – A more traditional Python parser based on lex and yacc.
  •  import re – Compact and easy to use for simple languages.


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM