public NameTableNode(FileSourceInfo source, HashSet <UXPropertyClass> propClasses, ClassNode self, NameTableNode parentTable, IDataType nameTableType, DocumentScope scope, IEnumerable <RawProperty> rawProperties) : base(source, "__g_nametable", nameTableType, InstanceType.Local, rawProperties) { ParentTable = parentTable; _scope = scope; _nameTableType = nameTableType; Entries = _scope.NodesIncludingRoot.Where(x => x.Scope == scope && x.Name != null && x.InstanceType == InstanceType.Local).Select(x => new NameTableEntry(x.Name, x)).ToArray(); if (self != null) { var selfProp = TryFindBindableProperty(self, "This"); selfProp.Bind(self); var propsProp = TryFindBindableProperty(self, "Properties"); foreach (var p in self.DeclaredUXProperties) { var pr = self.Properties.First(x => x.Facet.Name == p.Name); propsProp.Bind(self, pr); propClasses.Add(new UXPropertyClass(pr, self)); } } var objs = TryFindBindableProperty(scope.ContainingClass, "Objects"); BindEntries(objs); }
public NameTableNode GetNameTable(Compiler c) { if (_nameTable == null) { var pt = ParentScope?.GetNameTable(c); _nameTable = new NameTableNode(Source, c._uxProperties, this as ClassNode, pt, c.NameTableType, this, RawProperties); c.AddNode(new object(), _nameTable); AddChild(_nameTable); _nameTable.CreateMembers(); } return(_nameTable); }