adding command parser

This commit is contained in:
Debucquoy Anthony 2025-03-15 19:37:31 +01:00
parent a503b39524
commit 6db9bb1f3f
Signed by: tonitch
GPG Key ID: A78D6421F083D42E

28
spf.py Normal file → Executable file
View File

@ -1,10 +1,30 @@
# Projet de compilation Umons 2025
#!/usr/bin/env python
# Projet de compilation Umons 2025
# Par Debucquoy Anthony (231687)
import argparse
import lark
import sys
# TODO: utiliser argparse
# TODO: utiliser Interpreter de lark
def main():
print("Hello Wordl")
parser = argparse.ArgumentParser()
parser.add_argument("spf_file", help="Fichier source à interpréter")
parser.add_argument("-d", "--dump",
help="affichage de la mémoire du programme",
action="store_true")
parser.add_argument("-t", "--trace",
help="affichage de la mémoire au cours du programme",
action="store_true")
args = parser.parse_args()
if args.dump:
print("Dump activated", file=sys.stderr)
if args.trace:
print("Trace activated", file=sys.stderr)
if __name__ == "__main__":
main()