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.
相關文章
相關標籤/搜索