Add semantics analyzer function to process file components

This commit is contained in:
Kyler Olsen 2025-02-10 18:37:07 -07:00
parent a340fe7936
commit 16a3446d48
1 changed files with 16 additions and 0 deletions

View File

@ -1977,6 +1977,22 @@ class Context:
raise KeyError
def semantics_analyzer(file: File) -> Context:
screen: Screen | None = None
constraints: dict[str, int | float] = {}
animations: dict[str, ContextAnimation] = {}
graphs: list[ContextGraph] = []
for child in file.children:
if isinstance(child, Screen):
pass
elif isinstance(child, Constant):
pass
elif isinstance(child, Animation):
pass
elif isinstance(child, Graph):
pass
if __name__ == '__main__':
try:
with open("example.graph", encoding='utf-8') as file: