forked from luna/jorts
package jortsc with setup.py
add lark parser as dep
This commit is contained in:
parent
a11d21873a
commit
9e8a5abdaa
4 changed files with 30 additions and 1 deletions
|
@ -0,0 +1,3 @@
|
|||
from .main import main
|
||||
|
||||
__all__ = ['main']
|
|
@ -3,7 +3,7 @@
|
|||
import sys
|
||||
import pprint
|
||||
|
||||
from parser.lexer import lex_jorts
|
||||
from jortsc.parser.lexer import lex_jorts
|
||||
|
||||
def main():
|
||||
"""main entry point"""
|
||||
|
|
12
jortsc/parser/parser.py
Normal file
12
jortsc/parser/parser.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
from lark import Lark
|
||||
|
||||
# TODO: write a grammar
|
||||
GRAMMAR = """
|
||||
yeet
|
||||
"""
|
||||
|
||||
def parse(string: str):
|
||||
"""Parse"""
|
||||
parser = Lark(GRAMMAR, parser='lalr', debug=True)
|
||||
return parser.parse(string)
|
Loading…
Add table
Add a link
Reference in a new issue