Basic declaration adn assignation recognition

This commit is contained in:
tonitch
2025-03-17 17:35:44 +01:00
parent f082c3f7d8
commit efa1776155
3 changed files with 55 additions and 32 deletions

6
spf.py
View File

@ -29,11 +29,13 @@ def main():
print("Trace activated (TODO)", file=sys.stderr)
with open("spf.lark") as grammar:
spf_parser = lark.Lark(grammar, parser="lalr", transformer=SPFTransformer)
spf_parser = lark.Lark(grammar, parser="lalr", strict=True, debug=True)
with open(args.spf_file) as spf_input:
program = spf_input.read()
spf_parser.parse(program)
parsed = spf_parser.parse(program)
print(parsed.pretty())
if __name__ == "__main__":