Skip to main content

Build Status PyPI version Release Note MIT License

EBNFParser

Parse Many, Any, Every Doc

LR ::= LR 'a' 'b' | LR 'c' | 'd';

Install

  • Python

    • pip

    pip installl -U EBNFParser

    • setup

    git clone https://github.com/thautwarm/EBNFParser
    cd EBNFParser/Python
    python setup.py install

Usage

  • Command Line Tools

    • ruiko.

    ruiko ./<grammar File> ./<output filename>
            [--testTk] # print tokenized words or not
            [--test] # generate test script "test_lang.py"

    Use command ruiko to generate parser and token files, and then you can use test_lang.py to test your parser.

    python ./test_lang.py Stmt " (+ 1 2) " -o test.json --testTk
  • Integrated into your own project

    from Ruikowa.ObjectRegex.ASTDef import Ast
    from Ruikowa.ErrorHandler import ErrorHandler
    from Ruikowa.ObjectRegex.MetaInfo import MetaInfo
    from Ruikowa.ObjectRegex.Tokenizer import Tokenizer
    
    from <your own generated parser module> import <top parser>, token_table
    
    
    import typing as t
    
    def token_func(src_code: str) -> t.Iterable[Tokenizer]:
        return Tokenizer.from_raw_strings(src_code, token_table, ({<the names of tokenizers you would ignore>}, {<the string contents of tokenizers you would ignore>}))
    
    parser = ErrorHandler(<top parser>.match, token_func)
    
    def parse(filename: str) -> Ast:
    
        return parser.from_file(filename)
    
    
    print(parse(<filename of your dsl source code>))

Need more? See the documents.

Examples

Here are some examples to refer:

EBNFParser 2.0

  • Rem The Rem programming language.

Old version(Before EBNFParser 1.1).

  • A DSL for SQL development in Python areas.
  • A full featured modern language to enhance program readability based on CPython.
  • An attempt to making ASDL in CPython(unfinished yet)

Will support F# and Rem.

Metadata

Release files for EBNFParser 2.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for EBNFParser 2.1.3
File Interpreter ABI Platform
EBNFParser-2.1.3-py3-none-any.whl Python 3 none any Details

Release files / EBNFParser-2.1.3-py3-none-any.whl

Download URL EBNFParser-2.1.3-py3-none-any.whl
Size 26.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9c41cbfba10aec2f1f11a529d3e17c0a039f3a272b7cda18ba3d1a0a51491aa
BLAKE2b-256 checksum
How to use checksums
5a9bb874430f35575908b3ea93a85bf59b23939e74bcb97e6e509106cc3e49da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

2.1.3 This release

1 release file

2.1.2

1 release file

2.1.1

1 release file

2.1

1 release file

2.0.9.1

1 release file

2.0.9

1 release file

2.0

1 release file

1.1

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0

1 release file

0.1.4

1 release file

0.1.3.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page