Context-free grammars and parsing
Project description
cfgrammar : Context-free grammars, parsing and semantic
Table of Contents
Main features
- Grammar properties
- accessible and productive rules / variables
- ε-productive rules / variables
- reduced grammar
- "First" and "Follow" sets
- LL1 parsing
- computes and displays LL(1) table
- constructs parser
- LR parsing
- computes and displays LR(0) automaton
- constructs LR(0), SLR(1), LALR(1) tables and parsers
- Semantic
- parsing with semantic actions
- Abstract Syntax Tree
- predefined semantic classes to produce AST
- Graphviz / dot output
- Latex + Tikz output
- predefined semantic classes to produce AST
Example
from cfgrammar import Grammar
g = Grammar.from_string('S -> ( S ) S | a')
print(g)
print('productives variables : ', g.productive.vars)
print('Follow sets : ', g.follow)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cfgrammar-0.0.9.3.tar.gz
(37.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cfgrammar-0.0.9.3.tar.gz.
File metadata
- Download URL: cfgrammar-0.0.9.3.tar.gz
- Upload date:
- Size: 37.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7ac25672a5d35d9c3eccd3df1415539bd9e4ac35c9b748672d2b54ff8356e0a
|
|
| MD5 |
6fb1c9f6b4d47675d2f6227a4a6cbb2f
|
|
| BLAKE2b-256 |
0ce16c97b8c7dca90de7899c9e4ae9db02e446d03ed160154b917f5f5c98a884
|
File details
Details for the file cfgrammar-0.0.9.3-py3-none-any.whl.
File metadata
- Download URL: cfgrammar-0.0.9.3-py3-none-any.whl
- Upload date:
- Size: 40.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
113d250e12c73b79210b8f8098cf39d66b36ca5b6c6591c46d1112fa29712547
|
|
| MD5 |
83f5f3a5eab6fb76f67d7ff557ea8411
|
|
| BLAKE2b-256 |
f1cb1eeb768120b878931e0fd797aa6c32659bac1523a4795fc2300c36ab3502
|