Click here to Skip to main content
15,894,825 members
Articles / Programming Languages / C++

Writing own regular expression parser

Rate me:
Please Sign up or sign in to vote.
4.91/5 (132 votes)
14 Nov 200322 min read 988.9K   12.3K   237  
Explains principles behind writing regular expression parsers.
// AG_FindDialog.cpp : implementation file
//

#include "stdafx.h"
#include "RegExDemo.h"
#include "AG_FindDialog.h"

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

/////////////////////////////////////////////////////////////////////////////
// CAG_FindDialog dialog


CAG_FindDialog::CAG_FindDialog(CWnd* pParent /*=NULL*/)
	: CDialog(CAG_FindDialog::IDD, pParent)
{
	//{{AFX_DATA_INIT(CAG_FindDialog)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CAG_FindDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAG_FindDialog)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CAG_FindDialog, CDialog)
	//{{AFX_MSG_MAP(CAG_FindDialog)
	ON_BN_CLICKED(IDC_CLOSE_BUTTON, OnCloseButton)
	ON_BN_CLICKED(IDC_FIND_NEXT, OnFindNext)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAG_FindDialog message handlers

void CAG_FindDialog::OnCloseButton() 
{
	ShowWindow(SW_HIDE);
}

void CAG_FindDialog::OnFindNext() 
{
	if(AfxGetMainWnd()->SendMessage(WM_FIND_NEXT, 0, 0) == -1)
		AfxMessageBox(_T("Done!"));
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
President Infinity Software Solutions, LLC.
United States United States
Originally from Bosnia and Herzegovina, but lived for 6 years in Germany where I did majority of education, then moved to US, where I live since 1999. I like programming, computers in general, but also Basketball, Soccer, Tennis, and many other things. Masters graduate from Grand Valley State University in CIS and working as a full time software developer. Please visit my website www.amergerzic.com

Comments and Discussions