python里实现DSL

之后用到的话能够参考以下连接:html

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

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

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

 

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

  • 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.
相关文章
相关标签/搜索