1.txt

来自「使用LR分析法对于if条件语句进行解释」· 文本 代码 · 共 44 行

TXT
44
字号
char   buf[30003]; 
        int   sz=m_cIn.GetWindowText(buf,30000); 
        buf[sz]=0; 
        strcpy(m_Compiler.GetTable()-> SourseBuffer,buf); 
        m_Compiler.CiFaFengXi(); 
        CifaResult   *   *   p=m_Compiler.GetTable()-> LexicalDuad; 
        int   s=0; 
        int   a=p[s]-> type; 
        while   ((p[s]-> type)> =0) 
                s++; 
        char   (*ep)[100]; 
        ep=m_Compiler.GetTable()-> ErrorMessageTable; 
        //result   to   :   p,s,ep 
        m_cOut.SetWindowText( " "); 
        CString   str; 
        int   ErrorCount=0; 
        str.Format( "输出格式:二元式序列(类型,值)单词\r\n\r\n "); 
        m_cOut.AppendText(str.GetBuffer(0)); 
        for   (int   i=0;i <s;i++) 
        { 
                if   (p[i]-> type> 0) 
                { 
                        str.Format( "(%d,%d)\t%s\r\n ",p[i]-> type,p[i]-> value,p[i]-> text); 
                        m_cOut.AppendText(str.GetBuffer(0)); 
                } 
                else 
                { 
                        ErrorCount++; 
                        if   (p[i]-> value==2   &&   (p[i]-> text[0]> 126   ||   p[i]-> text[0] <32)) 
                        { 
                                str.Format( "错误号:%d   %s   【   无法显示该字符!   】\r\n ", 
                                        p[i]-> value,ep[p[i]-> value]); 
                                m_cOut.AppendText(str.GetBuffer(0)); 
                        } 
                        else 
                        { 
                                str.Format( "错误号:%d   %s   【   %s   】\r\n ", 
                                        p[i]-> value,ep[p[i]-> value],p[i]-> text); 
                                m_cOut.AppendText(str.GetBuffer(0)); 
                        } 
                } 
        } 
        str.Format( "\r\n   发现   %d   个错误!\r\n ",ErrorCount); 
        m_cOut.AppendText(str.GetBuffer(0));

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?