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 Distribution

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

alteraparser-0.6.0b1-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

Details for the file alteraparser-0.6.0b1-py3-none-any.whl.

File metadata

File hashes

Hashes for alteraparser-0.6.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 4ff7a2e081e93d75c276fc8116ca889b40b5ede3ede6a025a0addbc75bd42ca5
MD5 e0f45c11017b3c24814c3cb62c371b95
BLAKE2b-256 f3bf2c56d1f6903192263aed0d30fbc48e3a8c1e7d9a090187ff72811d218abb

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