#ifndef __SearchToken_h
#define __SearchToken_h

/*************************************************************************
 * <_xZkqqHx_jCoIiLgA_xHqqkZx_>	_xZkqqHx_iDgHiBfLiDeOiDjD_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	TKN_END_OF_xZkqqHx_jGkCjGjOiCmMiDgHiBfLiDeOiDjDiCmNiBeBiDgHiBfLiDeOiDjDiDgFiBfLiDhFiDiL_xHqqkZx_(m_vTokenTbl)_xZkqqHx_iCmJ_xHqqkZx_
 *			_xZkqqHx_jFnLjBlGiClDiCoKiCoJiBeCiClNiCmGiCkGiCmOiBeB_xHqqkZx_m_vTokenTbl[TKN_AND] == "&" _xZkqqHx_iCmFiCkAiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iDgHiBfLiDeOiDjDiDgFiBfLiDhFiDiLiCmM_xHqqkZx_TKN_END_OF_xZkqqHx_iImIiPoDiCmMjCgMiCmNiBeBiMjPiNpFiOkOiCmJiPgPiMlLiClFiClN_xHqqkZx_
 *			_xZkqqHx_jCfAiMoKiCmFiCkAiCoJiBeCiClNiCmGiCkGiCmOiBeBiMjPiNpFiOkOiCmJjCfAiMoK_xHqqkZx_'Microsoft'_xZkqqHx_iCkKiKnMiCnMiCoKiCoJiCmIiCoHiCmOiBeB_xHqqkZx_
 *			m_vTokenTbl[i] == "Microsoft" (TKN_END_OF <= i) 
 *			_xZkqqHx_iCmFiCkAiCoJiBeC_xHqqkZx_
 *			FDTKN2_XXXX_xZkqqHx_iCmNiBeB_xHqqkZx_GetChrToken_xZkqqHx_iCmFiOgHiCoNiCoKiCoJjCgMiCmFiCkAiCoIiBeBjAlDiKgNiCmJiCmN_xHqqkZx_
 *			_xZkqqHx_iDgHiBfLiDeOiDjDiCmFiCmNiCmIiCkCiBeCjFlGiOjKiCmMjFkKjHnOiCmJiOgHiCoNiCoKiCoJjCgMiCmFiCkAiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iClBiCmMjCgMiCkK_xHqqkZx_FCSearchToken::m_iToken_xZkqqHx_iCmJiOgHiCoNiCoKiCoJiClBiCmGiCmNiCmIiCkCiClFiBeB_xHqqkZx_
 *			_xZkqqHx_iDgHiBfLiDeOiDjDiDgFiBfLiDhFiDiLiCmJiOgHiCoNiCoKiCoJiClBiCmGiCoAiCmIiCkCiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHhAiMoK_xHqqkZx_>	_xZkqqHx_iNlGiDgHiBfLiDeOiDjD_xHqqkZx_	:_xZkqqHx_iOkOjCiGiCmFiNlGiBgJjAoGjDkKiBgKiCmJjChFiCkNiClBiCmGiCkKiCmFiCkLiCoJiDgHiBfLiDeOiDjDiBeC_xHqqkZx_
 *						 _xZkqqHx_jCfAiMoKiDgHiBfLiDeOiDjDiBeBjCfAiNiAiJiJiOfKiOhBiBeBiNlGiKiHiMmKiBeC_xHqqkZx_
 *			_xZkqqHx_iJeFiDgHiBfLiDeOiDjD_xHqqkZx_	:_xZkqqHx_iNlGiDgHiBfLiDeOiDjDiImIiKePiCmMiDgHiBfLiDeOiDjDiBeC_xHqqkZx_
 *						 _xZkqqHx_iCfBiNiAiJiJiOfKiOhBiBeBiJeFiKiHiMmKiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.04.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/

//#include "SearchParser.h"	// For WStringVector.

enum
{
	FDTKN_ERR = -1,		// _xZkqqHx_iDeHiDiJiBfLiBeC_xHqqkZx_
	FDTKN_NONE = 0,		// _xZkqqHx_iLpDiDgHiBfLiDeOiDjD_xHqqkZx_. _xZkqqHx_iLpDjFlGiOjK_xHqqkZx_.
	FDTKN_NOT,			// NOT. _xZkqqHx_jCfAiNiAiJiJiOfKiOhB_xHqqkZx_ : A kind of Operator1.
	FDTKN_AND,			// AND. _xZkqqHx_iCfBiNiAiJiJiOfKiOhB_xHqqkZx_ : A kind of Operator2.
	FDTKN_OR,			// OR.  _xZkqqHx_iCfBiNiAiJiJiOfKiOhB_xHqqkZx_ : A kind of Operator2.
	FDTKN_LEFT_PARE,	// _xZkqqHx_iNlGiKiHiMmK_xHqqkZx_. LeftPare.
	FDTKN_RIGHT_PARE,	// _xZkqqHx_iJeFiKiHiMmK_xHqqkZx_. RightPare.
	FDTKN_END_OF,		// _xZkqqHx_iDgHiBfLiDeOiDjDiCmMiPeJiCoNiCoI_xHqqkZx_.

	FDTKN2_SLASH,		// _xZkqqHx_iDfIiDiJiDgCiDfGiDiF_xHqqkZx_.
	FDTKN2_ESC,			// _xZkqqHx_iDgPiDgCiDeOiDfIiDiJiDgCiDfGiDiF_xHqqkZx_.
	FDTKN2_CHAR,		// _xZkqqHx_iCnDiCmCiCkEiCmMiDeMiDiDiDiJiDeOiDfO_xHqqkZx_.
	FDTKN2_SPACE,		// _xZkqqHx_iLpDjEjC_xHqqkZx_._xZkqqHx_iDfOiDhF_xHqqkZx_._xZkqqHx_iJpMiNhD_xHqqkZx_.
};

const wchar_t FDST_CHR_SLASH		= L'/';

/*************************************************************************
 * <_xZkqqHx_iDeOiDiJiDfI_xHqqkZx_>	FCSearchToken
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iMjPiNpFiOkOjCiGiCmJiPgPiMlLiClHiCoJiJiJiOfKiOhBiCoCjCfAiMoKiCpAiDgHiBfLiDeOiDjDiCmJjFmPiKlHiClFiBeBjFnLjBlGiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.04.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
class FCSearchToken
{
public:
	static void	ReqInit (WStringVector& vTokenTbl);

	FCSearchToken (short nToken = FDTKN_NONE);
	void	ExtractWordToken (const wchar_t*& tcpStr, WStringVector& vTokenTbl);
	void	ExtractLToken (const wchar_t*& tcpStr, WStringVector& vTokenTbl);
	void	ExtractRToken (const wchar_t*& tcpStr);
	BOOL	IsOperator1 () const;
	BOOL	IsOperator2 () const;
	BOOL	IsWord () const;
	operator short() const;

private:
	short	m_nToken;
}; // class FCSearchToken.

#endif//__SearchToken_h

