public DogeSymbolTable(DogeSymbolTableType symbolTableType = DogeSymbolTableType.Namespace) : this( name : "", fullName : new List <string>(), symbolTableType : symbolTableType, parent : null) { }
public DogeSymbolTable GetOrAddSymbolTable(string key, DogeSymbolTableType symbolTableType) => SymbolTables.TryGetValue(key, out var newSymbolTable) ? newSymbolTable : (SymbolTables[key] = new DogeSymbolTable( key, FullName.With(key), symbolTableType, this));
public DogeSymbolTable(string name, IList <string> fullName, DogeSymbolTableType symbolTableType, DogeSymbolTable?parent = null) : this( name : name, fullName : fullName, symbolTables : new Dictionary <string, DogeSymbolTable>(), symbols : new Dictionary <string, DogeSymbol>(), symbolTableType : symbolTableType, parent : parent) { }
public DogeSymbolTable(string name, IList <string> fullName, IDictionary <string, DogeSymbolTable> symbolTables, IDictionary <string, DogeSymbol> symbols, DogeSymbolTableType symbolTableType, DogeSymbolTable?parent = null) { Name = name; FullName = fullName; SymbolTables = symbolTables; Symbols = symbols; SymbolTableType = symbolTableType; Parent = parent; }
public DogeSymbolTable GetOrAddSymbolTable(ICollection <string> key, DogeSymbolTableType symbolTableType) { DogeSymbolTable symbolTable = this; foreach (var subkey in key) { symbolTable = symbolTable.GetOrAddSymbolTable(subkey, symbolTableType); } return(symbolTable); }