A simple parser and grammar definition library
Project description
Introduction
Alteraparser is a library that provides functions to define a grammar that can be passed to a parser.
Basic Usage
Code sample:
from alteraparser.parser import Parser from alteraparser import char_range, fork, many, grammar, ... ALPHA = fork(char_range('a', 'z'), char_range('A', 'Z')) NUM = char_range('0', '9') ALPHA_NUM = fork(ALPHA, NUM) ... variable = fork([ALPHA, many(ALPHA_NUM)]).set_name('var') ... my_grammar = grammar(variable, ...) my_parser = Parser(my_grammar) ast = my_parser.parse_file("my_code.txt")
Changes
- 0.5.0.a2:
added transform_ast method to enable transformation of AST nodes
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.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
alteraparser-1.1.0-py3.4.egg
(46.4 kB
view details)
File details
Details for the file alteraparser-1.1.0-py3.4.egg
.
File metadata
- Download URL: alteraparser-1.1.0-py3.4.egg
- Upload date:
- Size: 46.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d9722821e96bf92c8a147132f82a0a7d85e6cd6a3809d4d8fa5b09d0ce8e59c |
|
MD5 | 50e93a41bcfe9d9ef56df3311b796d91 |
|
BLAKE2b-256 | c2a8db2c12dc624631b408a12163cb16d14809697cf6fa7c26c026a4f6070827 |