Click here to Skip to main content
13,345,744 members (49,886 online)
Click here to Skip to main content


43 bookmarked
Posted 18 Apr 2001

Fast tokenizer

, 5 Sep 2001
Fast tokenizer for C++ - like 'lexx'
// cooLexxerMapData.h: interface for the cooLexxerMapData class.

Class:      cooLexxerMapData
Author:     Alexander Berthold
Copyright:  Alexander Berthold
Date:       19.4.2001
Purpose:    Contains the data of one node in the tree of tokens.
            See cooLexxerMap for more details.

#if !defined(AFX_COOLEXXERMAPDATA_H__91BAE3D7_529C_42AB_B513_8396B264530D__INCLUDED_)
#define AFX_COOLEXXERMAPDATA_H__91BAE3D7_529C_42AB_B513_8396B264530D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class cooLexxerTokenRule;
class cooLexxerContext;

class cooLexxerMapData : 
	public std::multimap<TCHAR,cooLexxerMapData*>,
	public ctkCheckValid
// Construction/Destruction
	virtual ~cooLexxerMapData();

// Attributes
	bool					m_fComputed;
	cooLexxerTokenRule*		m_pRule;		// m_pRule: The rule (if any)

// Operations

#ifdef _DEBUG
	virtual bool			fCheckValid() const;
	static bool				fRunDiagnostics();
	virtual bool			fCheckValid() const { return true; };

	bool				fIsLeaf()		{	return (m_pRule!=NULL);	};
	cooLexxerTokenRule*	pltrGetRule()	{	return m_pRule; };
	const cooLexxerTokenRule* pltrGetRuleConst() const { return m_pRule; };

	cooLexxerMapData	*plmdInsert(TCHAR tcChar, cooLexxerTokenRule* pRule);
	cooLexxerMapData	*plmdDoesApply(const cooLexxerContext* plcContextInfo, TCHAR tcChar, bool *pfComplete, 
									   int nStartPos, int nCurPos);
	void				vApplied(cooLexxerContext* plcContextInfo, TCHAR tcChar, bool fComplete, 
								 int nStartPos, int nCurPos);

	friend class cooLexxerMap;

#endif // !defined(AFX_COOLEXXERMAPDATA_H__91BAE3D7_529C_42AB_B513_8396B264530D__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.


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


About the Author

Alexander Berthold
Web Developer
Germany Germany
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180111.1 | Last Updated 6 Sep 2001
Article Copyright 2001 by Alexander Berthold
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid