Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pygram/pygram
An open source grammar analyzer.
https://github.com/pygram/pygram
Last synced: 3 months ago
JSON representation
An open source grammar analyzer.
- Host: GitHub
- URL: https://github.com/pygram/pygram
- Owner: pygram
- Created: 2013-12-03T01:49:42.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2013-12-16T20:20:56.000Z (almost 11 years ago)
- Last Synced: 2024-06-15T01:46:44.783Z (5 months ago)
- Language: CSS
- Size: 660 KB
- Stars: 45
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-python-resources - Source
README
pygram
======
An open source grammar analyzer that uses [PLY](http://www.dabeaz.com/ply/) under the hood.
Its purpose is to serve as an educational aid for undergraduate students taking an introductory course on compilers.Features
========
* SLR(1) and LALR(1) grammar support.
* Augmented grammar.
* First and follow sets.
* Automaton state graph visualization.
* Parsing table.
* Parser simulator.Demo
====
There is a demo hosted on a Heroku free instance: [http://pygram.herokuapp.com](http://pygram.herokuapp.com).![alt text](http://i.imgur.com/xmMg8oE.png "Preview")
Example
------------**Terminals**
OPMULT OPDIV
OPADD OPSUB
FACTOR**Productions**
expr: expr OPADD term
| expr OPSUB term
| term;
term: term OPMULT FACTOR
| term OPDIV FACTOR
| FACTOR;Installation
============Dependencies
------------
The following are the main dependencies used by pygram, for the complete list refer to 'requirements.txt'.* flask: [http://flask.pocoo.org/](http://flask.pocoo.org/).
* graphviz: [http://www.graphviz.org/](http://www.graphviz.org/).
* ply: [http://www.dabeaz.com/ply/](http://www.dabeaz.com/ply/).
* pydot: [https://bitbucket.org/prologic/pydot/overview](https://bitbucket.org/prologic/pydot/overview).Note: pydot is included in the src folder 'pydot/'
Ubuntu
------$ virtualenv -p `which python3` pygram
$ source pygram/bin/activate
$ pip install -r requirements.txt
$ apt-get install graphvizDeployment on Heroku
--------------------
In order to install graphviz you need to use a custom buildpack.
The easiest way to do it is to use the [heroku-buildpack-multi](https://github.com/ddollar/heroku-buildpack-multi) together with the [heroku-buildpack-python](https://github.com/heroku/heroku-buildpack-python) and the [heroku-buildpack-graphviz](https://github.com/gokceneraslan/heroku-buildpack-graphviz) buildpacks.heroku login
heroku config:add BUILDPACK_URL:https://github.com/ddollar/heroku-buildpack-multi.git
heroku config:add PATH:/usr/local/bin:/usr/bin:/bin:/app/binTo-do
=====
* Add support for localization.
* Add support for LL(1) and LR(1) parsers.Similar tools
=============
The following is a list of other grammar analyzers. Please, feel free to add more references to the list below.
* [Anagra](http://webdiis.unizar.es/~ezpeleta/doku.php?id=material_de_apoyo)License
=======
Pygram uses the [MIT](http://opensource.org/licenses/MIT) license.
The dependencies used by Pygram are subject to their respective licenses.