Click here to Skip to main content
15,891,607 members
Articles / Programming Languages / C++

Tokenizer and analyzer package supporting precedence prioritized rules

Rate me:
Please Sign up or sign in to vote.
5.00/5 (4 votes)
1 Jan 20023 min read 182.4K   2.8K   54  
A library allowing you to conveniently build a custom tokenizer and analyzer supporting precedence priorized rules
#if !defined(AFX_PANEEDITORWND_H__A642FFF0_0BC3_4CC8_9C00_A968EC8A3C35__INCLUDED_)
#define AFX_PANEEDITORWND_H__A642FFF0_0BC3_4CC8_9C00_A968EC8A3C35__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PaneEditorWnd.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CPaneEditorWnd dialog

enum	esection
	{
	section_tokens,
	section_seperators,
	section_rules,
	section_grammar
	};

class CGrammarIDEDoc;
class CPaneEditorWnd : public CDialog
{
// Construction
public:
	CPaneEditorWnd(CGrammarIDEDoc* pDoc, CWnd* pParent = NULL);   // standard constructor

// Operations
public:
	void			Renumber(bool fStrict);
	bool			IsInIdRange(int pos);
	bool			IsLineWellFormed(int nLine);
	bool			IsSectionLine(int nLine);
	void			FormatLine(int nLine);
	BOOL			Create(CWnd *pParentWnd) { return CDialog::Create(IDD,pParentWnd); };
	void			SetSection(esection eSection);
	void			OnUpdate();
	void			UpdateDocStatus();
	bool			IsModified() const { return m_fModified; };

// Attributes
protected:
	int				m_nFmtMin, m_nFmtMax;
	CGrammarIDEDoc* m_pDoc;
	bool			m_fModified;
	static UINT		WMU_FORMATLINES;

public:
// Dialog Data
	//{{AFX_DATA(CPaneEditorWnd)
	enum { IDD = IDD_EDITOR_PANE };
	CRichEditCtrl	m_richEdit;
	int		m_nSection;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CPaneEditorWnd)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL
	virtual void OnCancel();

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CPaneEditorWnd)
	afx_msg void OnSize(UINT nType, int cx, int cy);
	virtual BOOL OnInitDialog();
	afx_msg void OnProtectedRichEdit(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	afx_msg LRESULT OnFormatLines(WPARAM wP, LPARAM lP);
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_PANEEDITORWND_H__A642FFF0_0BC3_4CC8_9C00_A968EC8A3C35__INCLUDED_)

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
Web Developer
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions