Skip to main content

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


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 Distributions

If you're not sure about the file name format, learn more about wheel file names.

alteraparser-1.0.2.macosx-10.6-intel.tar.gz (32.0 kB view details)

Uploaded Source

alteraparser-1.0.2-py3.4.egg (45.4 kB view details)

Uploaded Egg

File details

Details for the file alteraparser-1.0.2.macosx-10.6-intel.tar.gz.

File metadata

File hashes

Hashes for alteraparser-1.0.2.macosx-10.6-intel.tar.gz
Algorithm Hash digest
SHA256 17b5f730d22da65643c7fa54c5c4b342f3f027a09dcb8f0d25e5a3995ab128eb
MD5 b8aa7610b8ac8611fee975a8d023d28c
BLAKE2b-256 7a5bd88592ca9a58c426dd020e4b8a2522d0bdf055aedf3a67c9f5286c238d4d

See more details on using hashes here.

File details

Details for the file alteraparser-1.0.2-py3.4.egg.

File metadata

File hashes

Hashes for alteraparser-1.0.2-py3.4.egg
Algorithm Hash digest
SHA256 02a2c0703e2deb1e9f3341c622fd9dfec788733a094c7bffa815866068adbfa8
MD5 2acb465e642c609018a719fffc1b7265
BLAKE2b-256 8623807368d1240891c54199f70ebce71543f746834e9f863248b16656c96230

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page