Caustic's parsing framework
Project description
Caustic's Parser -- uses grammar specification to compile Caustic source code into a CST (Caustic AST)
Uses ParGlare for parsing, meant to work with CausticGrammar to create a CST (Caustic AST)
CLI usage
See cap --help
Example module usage
import sys
import parglare
from pathlib import Path
from caustic.parser import CausticParser
from caustic.parser.error import format_exc
# CausticParser.from_file() loads the grammar using ParGlare,
# then invokes CausticParser.from_grammar(), which creates a ParGlare
# parser instance and uses that to finally create the parser
p = CausticParser.from_file(Path('<your-grammar-file>'))
try:
print(p.parse(input()))
except parglare.ParseError as e:
# custom error formatting (optional)
print(format_exc(e), file=sys.stderr)
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 Distribution
caustic.parser-2.2.6.post1.tar.gz
(10.0 kB
view hashes)
Built Distribution
Close
Hashes for caustic.parser-2.2.6.post1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c99ecd8cac342c9d63f5e9c5a58e7d1b41cc425653f10a6064556458aa311e19 |
|
MD5 | 9ed5635eeca20a6c95c2bbaf079a9c33 |
|
BLAKE2b-256 | f7e843e43b56d5cfd8a4cdddfcd1fac1746f8ed2d91a200c276d3c014d141975 |
Close
Hashes for caustic.parser-2.2.6.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 503e7ba2a56f8e0c6c2d1af5e13c51f92facfd8ad5e5230408c6ae39614a1c46 |
|
MD5 | f548824d05c2a5ae3a6af798dee447fa |
|
BLAKE2b-256 | 00a466ae92cebf83031f5d3b3b93700a3761b93748316f438f58cbec5e036132 |