Skip to content

pegtree - A PEG Parser Generator with Tree Annotation

License

Notifications You must be signed in to change notification settings

KuramitsuLab/pegtree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pegtree

Build Status Downloads Version License

Python Versions PyPI version

A PEG Parser Combinator Generator with Tree Annotation

Installation

Python3

pip3 install pegtree

Usage

Python3

import pegtree as pg

# 1. load a sample grammar 'math.tpeg'

peg = pg.grammar('math.tpeg')

# 2. generate parser from a grammar

parser = pg.generate(peg)

# 3. parse an input text, then you will obtain parse tree

tree = parser('1+2*3')

print(repr(tree))

About

pegtree - A PEG Parser Generator with Tree Annotation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages