initial (hacky af)

This commit is contained in:
2017-02-24 18:38:35 +01:00
commit ffeacdcb6c
8 changed files with 267 additions and 0 deletions

9
examples/calc.py Normal file
View File

@@ -0,0 +1,9 @@
import gll
ws = gll.skipmany(gll.whitespace(), tag="spaces")
num = gll.many1(gll.digit(), tag="number")
op = gll.string("+", tag="op") | gll.string("-", tag="op")
expr = gll.seq(num, ws, op, ws, num, tag="expr")
parser = gll.many(expr)