From f1b7a39751d4e67ad173d348a400f59001875de1 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Sun, 21 Mar 2021 13:00:56 +0200 Subject: [PATCH] Added some future data structure stubs for type checking --- source/tlang/compiler/symbols.d | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/source/tlang/compiler/symbols.d b/source/tlang/compiler/symbols.d index 9497da7..5264dbe 100644 --- a/source/tlang/compiler/symbols.d +++ b/source/tlang/compiler/symbols.d @@ -295,6 +295,38 @@ public bool isMathOp(Token token) tokenStr[0] == '*' || tokenStr[0] == '/'; } + +/** +* TODO: Implement the blow and use them +* +* These are just to use for keeping track of what +* valid identifiers are. +* +* The are NOT used for code gen +*/ + +public class Program +{ + private Variable[] globals; + private Function[] functions; +} + +public class Function +{ + /* The residing program */ + private Program program; + + private Variable[] locals; +} + +public class Variable +{ + private string type; + private string identifier; +} + + + /* Test: Character literal */ unittest {