Python Domain Specific Language Tools
Project description
DESCRIPTION
pydsl is a language library written in python. It provides some verbs for Grammars.
from pydsl.File.BNF import load_bnf_file grammardefinition = loand_bnf_file(‘myfile.bnf’) grammardefinition.alphabet # Returns the alphabet used by this grammar grammardefinition.minsize grammardefinition.maxsize grammardefinition.enumerate # Returns a generator that generates every accepted word
from pydsl.Checker import check check(grammardefinition,’mystring’) # returns True or False
from pydsl.Parser import parse parse(grammardefinition,’mystring’) # returns a ParseTree
from pydsl.Extract import extract extract(grammardefinition,’abcmystringabc’) # returns (‘mystring’,3,11)
INSTALLATION
disttools: * python3 setup.py install
pip: * pip install pydsl
CONTRIBUTIONS
check existing issues: https://github.com/nesaro/pydsl
read the project’s blog: http://pydsl.blogspot.co.uk
pull requests :)
REQUIREMENTS
python >= 2.7
optional: ply library ( http://www.dabeaz.com/ply/ )
ABOUT
Copyright (C) 2008-2014 Nestor Arocha (nesaro@gmail.com)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.