private void AnalyBase(ContextClass context) { SuperTable = null; if (BaseTypeToken == null) { IsStatic = false; BaseZType = ZTypeManager.ZOBJECT; SuperTable = new SuperSymbolTable("SUPER-唯一", ZTypeManager.ZOBJECT); } else { BaseTypeName = BaseTypeToken.GetText(); if (BaseTypeName == "唯一") { IsStatic = true; SuperTable = new SuperSymbolTable("SUPER-唯一", null); } else { IsStatic = false; var ztypes = ZTypeManager.GetByMarkName(BaseTypeName); if (ztypes.Length == 0) { errorf(BaseTypeToken.Position, "类型'{0}'不存在", BaseTypeName); } else if (ztypes.Length == 1) { BaseZType = ztypes[0] as ZClassType; SuperTable = new SuperSymbolTable("SUPER-" + BaseZType.ZName, BaseZType); } else if (ztypes.Length == 0) { errorf(BaseTypeToken.Position, "'{0}'存在{1}个同名类型", BaseTypeName, ztypes.Length); SuperTable = new SuperSymbolTable("SUPER", null); } } } if (SuperTable == null) { SuperTable = new SuperSymbolTable("SUPER-STATIC", null); } SuperTable.ParentTable = FileContext.UseContext.SymbolTable; context.SetSuperTable(SuperTable); context.BaseZType = BaseZType; }
public void SetSuperTable(SuperSymbolTable superTable) { SuperTable = superTable; CurrentTable.ParentTable = SuperTable; }