python领域特定语言工具
pydsl的Python项目详细描述
描述是一个用python编写的语言库。它为语法提供一些动词。
from pydsl.file.bnf import load_bnf_file
grammardefinition=loand_bnf_file('myfile.bnf')
grammardefinition.alphabet返回此语法使用的字母表
grammardefinition.minSize
grammardefinition.maxsize
grammardefinition.enumerate返回从pydsl生成每个接受单词的生成器。check import check
check(grammardefinition,“mystring”)从pydsl返回true或false
。parser import parse
parse(grammardefinition,“mystring”)从pydsl返回parsetree
。extract import extract
extract(grammardefinition,'abcmystringabc') # returns ('mystring',3,11)
FORMATS
=======
Functions
---------
| Format |Check|Match|Search|Split|Extract|Translate|Validate|Diff|
| ------- |:---:|-----|------|-----|:-----:|:-------:|:------:|----|
| BNF | V | | | |V | Parse | V | |
| regexp | V|||| V属性
----
格式|First|Min|Max|Enumerate|
| ------- |:---:|---|---|---------|
| BNF | V | | | |
| regexp | | | | |
| ply | | | | |
| parsley | | | | |
|pyparsing| | | | |
INSTALLATION
============
* disttools:
* python3 < BR/>*PIP安装PyDSL< BR/>稿件
安装程序=2.7
*可选:ply库(http://www.dabeaz.com/ply/)
关于
=
版权所有(c)2008-2015 Nestor Arocha(nesaro@gmail.com)
from pydsl.file.bnf import load_bnf_file
grammardefinition=loand_bnf_file('myfile.bnf')
grammardefinition.alphabet返回此语法使用的字母表
grammardefinition.minSize
grammardefinition.maxsize
grammardefinition.enumerate返回从pydsl生成每个接受单词的生成器。check import check
check(grammardefinition,“mystring”)从pydsl返回true或false
。parser import parse
parse(grammardefinition,“mystring”)从pydsl返回parsetree
。extract import extract
extract(grammardefinition,'abcmystringabc') # returns ('mystring',3,11)
FORMATS
=======
Functions
---------
| Format |Check|Match|Search|Split|Extract|Translate|Validate|Diff|
| ------- |:---:|-----|------|-----|:-----:|:-------:|:------:|----|
| BNF | V | | | |V | Parse | V | |
| regexp | V|||| V属性
----
格式|First|Min|Max|Enumerate|
| ------- |:---:|---|---|---------|
| BNF | V | | | |
| regexp | | | | |
| ply | | | | |
| parsley | | | | |
|pyparsing| | | | |
INSTALLATION
============
* disttools:
* python3 < BR/>*PIP安装PyDSL< BR/>稿件
安装程序=2.7
*可选:ply库(http://www.dabeaz.com/ply/)
关于
=
版权所有(c)2008-2015 Nestor Arocha(nesaro@gmail.com)