Writing a compiler for a DSL in python

前端 未结 8 1961
囚心锁ツ
囚心锁ツ 2021-02-02 03:51

I am writing a game in python and have decided to create a DSL for the map data files. I know I could write my own parser with regex, but I am wondering if there are existing py

8条回答
  •  轮回少年
    2021-02-02 04:21

    On the lines of declarative python, I wrote a helper module called 'bpyml' which lets you declare data in python in a more XML structured way without the verbose tags, it can be converted to/from XML too, but is valid python.

    https://svn.blender.org/svnroot/bf-blender/trunk/blender/release/scripts/modules/bpyml.py

    Example Use http://wiki.blender.org/index.php/User:Ideasman42#Declarative_UI_In_Blender

提交回复
热议问题