文件名称:LangTrans:自定义编程语言
文件大小:23KB
文件格式:ZIP
更新时间:2024-04-19 07:18:09
preprocessor transpiler syntax-sugar source-to-source syntactic-sugar
自定义任何编程语言 LangTrans是语法预处理器它可以帮助您自定义任何编程语言的语法它将自定义语法转换为原始语法。 它使用正则表达式,但支持嵌套(称为部分调用)。 例子 LISP的定制语法 func printhis ( s ): format ( t , s ) printhis ( "Customized!" ) 原始语法 ( defun printhis (s) ( format t s) ) (printhis " Customized! " ) 使用LangTrans自定义 首先,您应该使用新语法编写代码。 (例如example / source.clisp) 其次,您应该在yaml文件中编写正则表达式以从自定义语言中提取标记(例如example / source.yaml) 第三,在提取的令牌帮助下用原始语法替换自定义语法,编写原始语法模板。 (例如example
【文件预览】:
LangTrans-main
----LangTrans.py(12KB)
----LICENSE(1KB)
----README.md(2KB)
----example()
--------source.clisp(69B)
--------source.yaml(3KB)
--------target.yaml(1KB)
----docs()
--------Makefile(634B)
--------index.rst(7KB)
--------conf.py(2KB)
--------_static()
--------make.bat(795B)