Exemple #1
0
        private void ReloadInfo()
        {
            m_method_dec = null;
            ABnfElement parent = m_element;

            while (parent != null)
            {
                if (parent is ALittleScriptNamespaceDecElement)
                {
                    break;
                }
                else if (parent is ALittleScriptClassDecElement)
                {
                    break;
                }
                else if (parent is ALittleScriptClassCtorDecElement)
                {
                    m_method_dec      = parent;
                    m_method_body_dec = (parent as ALittleScriptClassCtorDecElement).GetMethodBodyDec();
                    break;
                }
                else if (parent is ALittleScriptClassSetterDecElement)
                {
                    m_method_dec      = parent;
                    m_method_body_dec = (parent as ALittleScriptClassSetterDecElement).GetMethodBodyDec();
                    break;
                }
                else if (parent is ALittleScriptClassGetterDecElement)
                {
                    m_method_dec      = parent;
                    m_method_body_dec = (parent as ALittleScriptClassGetterDecElement).GetMethodBodyDec();
                    break;
                }
                else if (parent is ALittleScriptClassMethodDecElement)
                {
                    m_method_dec      = parent;
                    m_method_body_dec = (parent as ALittleScriptClassMethodDecElement).GetMethodBodyDec();
                    break;
                }
                else if (parent is ALittleScriptClassStaticDecElement)
                {
                    m_method_dec      = parent;
                    m_method_body_dec = (parent as ALittleScriptClassStaticDecElement).GetMethodBodyDec();
                    break;
                }
                else if (parent is ALittleScriptGlobalMethodDecElement)
                {
                    m_method_dec      = parent;
                    m_method_body_dec = (parent as ALittleScriptGlobalMethodDecElement).GetMethodBodyDec();
                    break;
                }

                parent = parent.GetParent();
            }
        }
Exemple #2
0
 public ALittleScriptMethodBodyDecElement GetMethodBodyDec()
 {
     if (m_flag_MethodBodyDec)
     {
         return(m_cache_MethodBodyDec);
     }
     m_flag_MethodBodyDec = true;
     foreach (var child in m_childs)
     {
         if (child is ALittleScriptMethodBodyDecElement)
         {
             m_cache_MethodBodyDec = child as ALittleScriptMethodBodyDecElement;
             break;
         }
     }
     return(m_cache_MethodBodyDec);
 }