资源简介

LL1文法mfc实现完整版 编译原理中的LL1文法 消除左递归

资源截图

代码片段和文件信息

// AnalyzeDlg.cpp : implementation file
//

#include “stdafx.h“
#include “ll1forwin.h“
#include “AnalyzeDlg.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CAnalyzeDlg dialog


CAnalyzeDlg::CAnalyzeDlg(CWnd* pParent /*=NULL*/)
: CResizingDialog(CAnalyzeDlg::IDD pParent)
{
//{{AFX_DATA_INIT(CAnalyzeDlg)
m_input = _T(““);
//}}AFX_DATA_INIT
m_strTempFilename = ““;
m_pTree = new CTreeDlg;
m_pTree->Create(IDD_DIALOG3 this);
m_pTree->SetControlInfo(IDC_TREE1 RESIZE_BOTH);
m_pTree->SetControlInfo(IDOK ANCHORE_BOTTOM | ANCHORE_RIGHT);
}

CAnalyzeDlg::~CAnalyzeDlg()
{
m_pTree->DestroyWindow();
delete m_pTree;
}

void CAnalyzeDlg::DoDataExchange(CDataExchange* pDX)
{
CResizingDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAnalyzeDlg)
DDX_Control(pDX IDC_EDIT1 m_edit1);
DDX_Text(pDX IDC_EDIT1 m_input);
DDX_Control(pDX IDC_EXPLORER1 m_web);
//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CAnalyzeDlg CResizingDialog)
//{{AFX_MSG_MAP(CAnalyzeDlg)
ON_BN_CLICKED(IDC_BUTTON1 OnButton1)
ON_BN_CLICKED(IDC_BUTTON2 OnButton2)
ON_WM_ACTIVATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAnalyzeDlg message handlers

void CAnalyzeDlg::OnButton1() 
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_pTree->m_tree.DeleteAllItems();
for(int i = 0; i < m_input.GetLength(); i ++)
{
if (!m_g.IsInVt(m_input.GetAt(i)))
{
MessageBox(“输入的句子不全部由终结符组成“ “错误“ MB_OK | MB_IConstop);
return;
}
}
char szTempPath[MAX_PATH]; 
char szTempName[MAX_PATH]; 
if (m_strTempFilename != ““)
::DeleteFile(m_strTempFilename.c_str());
::GetTempPath(100szTempPath);
::GetTempFileName(szTempPath“LL1“0szTempName);
m_strTempFilename = szTempName;
CStdioFile out;
out.Open(szTempName CFile::modeCreate | CFile::modeWrite);
out.WriteString(“\n“);
out.WriteString(“\n“);
out.WriteString(“tle>Untitled Documenttle>\n“);
out.WriteString(“ta http-equiv=\“Content-Type\“ content=\“text/html; charset=gb2312\“>\n“);
out.WriteString(“\n“);
out.WriteString(“\n“);
out.WriteString(“yle=\“border-collapse: collapse\“ bordercolor=\“#111111\“>\n“);
    out.WriteString(“ 步骤  符号栈  输入串  所用生成式 “);
stack  input;
input.push(‘#‘);
for(i = m_input.GetLength() -1; i >= 0; i --)
input.push(m_input.GetAt(i));
stack  s;
s.push(‘#‘);
s.push(m_g.GetStart());
Precept p;
bool error = false;
int iStep = 0;
stack  st;
HTREEITEM hRoot = m_pTree->m_tree.InsertItem(CString(m_g.Get

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件         56  2000-05-30 08:25  LL1ForWin\1.TXT

     文件         65  2000-05-30 08:26  LL1ForWin\2.TXT

     文件         63  2000-05-30 08:26  LL1ForWin\3.TXT

     文件         85  2000-05-30 08:26  LL1ForWin\4.TXT

     文件       7555  2002-05-19 00:49  LL1ForWin\AnalyzeDlg.cpp

     文件       1850  2002-05-19 00:47  LL1ForWin\AnalyzeDlg.h

     文件     143377  2011-06-29 21:28  LL1ForWin\Debug\AnalyzeDlg.obj

     文件     292485  2011-06-29 21:28  LL1ForWin\Debug\AnalyzeDlg.sbr

     文件      63038  2011-06-29 21:28  LL1ForWin\Debug\explorer1.obj

     文件      13304  2011-06-29 21:28  LL1ForWin\Debug\explorer1.sbr

     文件     156111  2011-06-29 21:28  LL1ForWin\Debug\Grammar.obj

     文件     264601  2011-06-29 21:28  LL1ForWin\Debug\Grammar.sbr

     文件     712753  2011-07-01 15:58  LL1ForWin\Debug\LL1ForWin.exe

     文件     479288  2011-07-01 15:58  LL1ForWin\Debug\LL1ForWin.ilk

     文件      15715  2011-06-30 22:19  LL1ForWin\Debug\LL1ForWin.obj

     文件    6875736  2011-06-29 21:28  LL1ForWin\Debug\LL1ForWin.pch

     文件     713728  2011-07-01 15:58  LL1ForWin\Debug\LL1ForWin.pdb

     文件     414900  2011-07-01 14:34  LL1ForWin\Debug\LL1ForWin.res

     文件       3988  2011-06-30 22:19  LL1ForWin\Debug\LL1ForWin.sbr

     文件      89322  2011-07-01 15:58  LL1ForWin\Debug\LL1ForWinDlg.obj

     文件     279509  2011-07-01 15:58  LL1ForWin\Debug\LL1ForWinDlg.sbr

     文件      17236  2011-06-29 21:28  LL1ForWin\Debug\Precept.obj

     文件     194226  2011-06-29 21:28  LL1ForWin\Debug\Precept.sbr

     文件      25244  2011-06-29 21:28  LL1ForWin\Debug\ResizingDialog.obj

     文件       4622  2011-06-29 21:28  LL1ForWin\Debug\ResizingDialog.sbr

     文件      43509  2011-06-29 21:28  LL1ForWin\Debug\Set.obj

     文件      90025  2011-06-29 21:28  LL1ForWin\Debug\Set.sbr

     文件     105633  2011-06-29 21:28  LL1ForWin\Debug\StdAfx.obj

     文件    1366574  2011-06-29 21:28  LL1ForWin\Debug\StdAfx.sbr

     文件      40281  2011-06-29 21:28  LL1ForWin\Debug\TableDlg.obj

............此处省略360个文件信息

评论

共有 条评论