// Process catalog to add all entries from persistent level // Called functions should discard duplicates, or flag errors??? public void Import(CatalogScope catalogscope) { Logger.WriteLine(3, "SymbolTable Import: {0}", catalogscope); foreach (var entry in catalogscope.GetEntries()) { var value = entry.Value; if (_globalscope.Find(entry.Name) == null) { Logger.WriteLine(4, "From catalog add {0}:{1}", entry.Name, entry.DataType.BaseType.Name); } if (entry.Kind == EntryKinds.Type) { _globalscope.Add(MakeUserType(entry.Name, entry.DataType as DataTypeUser)); } else if (entry.Kind == EntryKinds.Value) { _globalscope.Add(MakeVariable(entry.Name, entry.DataType, SymKinds.CATVAR, true)); } else if (entry.Kind == EntryKinds.Code) { _globalscope.Add(MakeDeffun(entry.Name, entry.DataType, entry.CodeValue.Value.Lookup.Columns, entry.CodeValue.Value.AccumCount)); } } Logger.WriteLine(3, "[SSTI {0}]", this); }
// Process catalog to add all entries from persistent level // Called functions should discard duplicates, or flag errors??? public void Import(CatalogScope catalogscope) { foreach (var entry in catalogscope.GetEntries()) { var value = entry.Value; if (_importscope.Find(entry.Name) == null) { Logger.WriteLine(3, "From catalog add {0}:{1}", entry.Name, entry.DataType.BaseType.Name); } if (entry.Kind == EntryKinds.Type) { _importscope.Add(MakeUserType(entry.Name, entry.DataType as DataTypeUser)); } else if (entry.Kind == EntryKinds.Value) { _importscope.Add(MakeCatVar(entry.Name, entry.DataType)); } else if (entry.Kind == EntryKinds.Code) { _importscope.Add(MakeDeferred(entry.Name, entry.DataType, entry.CodeValue.Value.Lookup.Columns)); } } }