/// /// The symbol table for the Z# compiler. /// public class Tab { public static readonly Struct noType = new Struct(Struct.Kind.None), intType = new Struct(Struct.Kind.Int), charType = new Struct(Struct.Kind.Char), nullType = new Struct(Struct.Kind.Class), objType = new Struct(Struct.Kind.Class); // Symbol to indicate that an error has occurred in the symbol table public static readonly Symbol noSym = new Symbol(Symbol.Kind.Const, "noSymbol", noType); public static Symbol chrSym, ordSym, lenSym; // current scope public static Scope topScope; private static Scope universe; public static void Init () { objType.sysType = typeof(object); // TODO // set up "universe" (= predefined names) } public static void OpenScope () { // TODO } public static void CloseScope () { // TODO } public static Symbol Insert (Symbol.Kind kind, string name, Struct type) { // TODO return noSym; } // Retrieves the Symbol with name from the innermost scope. public static Symbol Find (string name) { // TODO // name not found Parser.Error("Name not found: '" + name + "'"); return noSym; } // Retrieves the field name from the fields of type. public static Symbol FindField (string name, Struct type) { // TODO // name not found Parser.Error("Field not found: '" + name + "'"); return noSym; } public static void Dump() { if (universe != null) { universe.Dump(); } } }