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();
            }
        }
Exemple #2
0
 public ALittleScriptClassCtorDecElement GetClassCtorDec()
 {
     if (m_flag_ClassCtorDec)
     {
         return(m_cache_ClassCtorDec);
     }
     m_flag_ClassCtorDec = true;
     foreach (var child in m_childs)
     {
         if (child is ALittleScriptClassCtorDecElement)
         {
             m_cache_ClassCtorDec = child as ALittleScriptClassCtorDecElement;
             break;
         }
     }
     return(m_cache_ClassCtorDec);
 }