private void ReloadInfo() { m_class_dec = null; m_class_ctor_dec = null; m_class_setter_dec = null; m_class_method_dec = null; m_class_static_dec = null; ABnfElement parent = m_element; while (true) { if (parent == null) { break; } if (parent is ALittleScriptNamespaceDecElement) { break; } else if (parent is ALittleScriptClassDecElement) { m_class_dec = (ALittleScriptClassDecElement)parent; break; } else if (parent is ALittleScriptClassCtorDecElement) { m_class_ctor_dec = (ALittleScriptClassCtorDecElement)parent; } else if (parent is ALittleScriptClassGetterDecElement) { m_class_getter_dec = (ALittleScriptClassGetterDecElement)parent; var modifier = (m_class_getter_dec.GetParent() as ALittleScriptClassElementDecElement).GetModifierList(); m_is_const = ALittleScriptUtility.IsConst(modifier); } else if (parent is ALittleScriptClassSetterDecElement) { m_class_setter_dec = (ALittleScriptClassSetterDecElement)parent; var modifier = (m_class_setter_dec.GetParent() as ALittleScriptClassElementDecElement).GetModifierList(); m_is_const = ALittleScriptUtility.IsConst(modifier); } else if (parent is ALittleScriptClassMethodDecElement) { m_class_method_dec = (ALittleScriptClassMethodDecElement)parent; var modifier = (m_class_method_dec.GetParent() as ALittleScriptClassElementDecElement).GetModifierList(); m_is_const = ALittleScriptUtility.IsConst(modifier); } else if (parent is ALittleScriptClassStaticDecElement) { m_class_static_dec = (ALittleScriptClassStaticDecElement)parent; } else if (parent is ALittleScriptGlobalMethodDecElement) { m_global_method_dec = (ALittleScriptGlobalMethodDecElement)parent; } parent = parent.GetParent(); } }
public ALittleScriptClassSetterDecElement GetClassSetterDec() { if (m_flag_ClassSetterDec) { return(m_cache_ClassSetterDec); } m_flag_ClassSetterDec = true; foreach (var child in m_childs) { if (child is ALittleScriptClassSetterDecElement) { m_cache_ClassSetterDec = child as ALittleScriptClassSetterDecElement; break; } } return(m_cache_ClassSetterDec); }