#include "stdafx.h"
#include "UtilStr.h"		// For WStrNewCpy.
#include "SearchToken.h"	// This header.

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

/*************************************************************************
 * <_xZkqqHx_jCoIiLgA_xHqqkZx_>	_xZkqqHx_iKpJjCoIiDgHiBfLiDeOiDjDiCmJjBmOiJjOiClHiCoJjFlGiOjKjHpB_xHqqkZx_
 *************************************************************************/
//----- 01.01.17 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//const _TCHAR* FDST_STR_NONE			= _T("");
//const _TCHAR* FDST_STR_NOT			= _T("!");
//const _TCHAR* FDST_STR_AND			= _T("&");
//const _TCHAR* FDST_STR_OR			= _T("|");
//const _TCHAR* FDST_STR_LEFT_PARE	= _T("(");
//const _TCHAR* FDST_STR_RIGHT_PARE	= _T(")");
//
//const _TCHAR* FDST_STR_AND2			= _T("AND");
//const _TCHAR* FDST_STR_OR2			= _T("OR");
//
//const _TCHAR* FDST_STR_SLASH		= _T("/");
//const _TCHAR* FDST_STR_ESC			= _T("\\");
//
//const int FDST_LEN_NONE			= _tcslen(FDST_STR_NONE);
//const int FDST_LEN_NOT			= _tcslen(FDST_STR_NOT);
//const int FDST_LEN_AND			= _tcslen(FDST_STR_AND);
//const int FDST_LEN_OR			= _tcslen(FDST_STR_OR);
//const int FDST_LEN_LEFT_PARE	= _tcslen(FDST_STR_LEFT_PARE);
//const int FDST_LEN_RIGHT_PARE	= _tcslen(FDST_STR_RIGHT_PARE);
//
//const int FDST_LEN_AND2			= _tcslen(FDST_STR_AND2);
//const int FDST_LEN_OR2			= _tcslen(FDST_STR_OR2);
//
//const int FDST_LEN_SLASH		= _tcslen(FDST_STR_SLASH);
//const int FDST_LEN_ESC			= _tcslen(FDST_STR_ESC);
//----- 01.01.17 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
const wchar_t* FDST_STR_NONE		= L"";
const wchar_t* FDST_STR_NOT			= L"!";
const wchar_t* FDST_STR_AND			= L"&";
const wchar_t* FDST_STR_OR			= L"|";
const wchar_t* FDST_STR_LEFT_PARE	= L"(";
const wchar_t* FDST_STR_RIGHT_PARE	= L")";

// 01.09.24 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
const wchar_t* FDST_STR_NOT2		= L"NOT";
const wchar_t* FDST_STR_AND2		= L"AND";
const wchar_t* FDST_STR_OR2			= L"OR";
const wchar_t* FDST_STR_OR3			= L",";


const int FDST_LEN_NONE			= wcslen(FDST_STR_NONE);
const int FDST_LEN_NOT			= wcslen(FDST_STR_NOT);
const int FDST_LEN_AND			= wcslen(FDST_STR_AND);
const int FDST_LEN_OR			= wcslen(FDST_STR_OR);
const int FDST_LEN_LEFT_PARE	= wcslen(FDST_STR_LEFT_PARE);
const int FDST_LEN_RIGHT_PARE	= wcslen(FDST_STR_RIGHT_PARE);

// 01.09.24 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
const int FDST_LEN_NOT2			= wcslen(FDST_STR_NOT2);
const int FDST_LEN_AND2			= wcslen(FDST_STR_AND2);
const int FDST_LEN_OR2			= wcslen(FDST_STR_OR2);
const int FDST_LEN_OR3			= wcslen(FDST_STR_OR3);

//----- 01.01.17 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----

//////////////////////////////////////////////////////////////////////////
// static_xZkqqHx_iKnGjAjE_xHqqkZx_

//----- 01.01.21 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	SkipSpace
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFlGiOjKjHpBiCmMjAoGjDkKiCkJiCoHiLpDjEjCiBeBiDfOiDhFiBeBiJpMiNhDiCpAiDfIiDeMiDgCiDhGiClHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	wcpStr	:_xZkqqHx_jFlGiOjKjHpBiCmMjAoGjDkKiDhMiDeDiDjDiDfOiCpAjHfOiCkGiCoJiBeCiInKjDkOiMoDiCmMjCgMiCkKjFnEiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.04.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//static void SkipSpace (const wchar_t*& wcpStr)
//{
//	for (;;)
//	{
//		switch (*wcpStr)
//		{
//		case L' ':
//		case L'\t':
//		case L'\r':
//		case L'\n':
//			wcpStr++;
//			break;
//		default:
//			return;
//		}
//	}
//} // SkipSpace.
//----- 01.01.21 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

//////////////////////////////////////////////////////////////////////////
// FCSearchToken_xZkqqHx_iDeDiDjDiDhGiDiKiDiBiDjDiDgHiBeC_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCSearchToken::ReqInit
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgHiBfLiDeOiDjDiDgFiBfLiDhFiDiLiCpAiPiJiKpKiJlLiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	vTokenTbl	:_xZkqqHx_iDgHiBfLiDeOiDjDiDgFiBfLiDhFiDiL_xHqqkZx_.
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iDgHiBfLiDeOiDjDiDgFiBfLiDhFiDiLjCiGiCmMiDgHiBfLiDeOiDjDiCpAiPmBiLiOiClFiBeBiNmFiPiJiCmMjFjEjFkKiCmJiKpJjCoIiDgHiBfLiDeOiDjD_xHqqkZx_
 *			_xZkqqHx_iBgJiDeJiDhJiDiMiBfLiDfOjDjJiBgKiCpAjAnNjCoIiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.04.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCSearchToken::ReqInit (WStringVector& vTokenTbl)
{
	vTokenTbl.clear();
//----- 01.01.17 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	vTokenTbl.push_back(WORDAuto(WStrNewCpy(FDST_STR_NONE)));
//	vTokenTbl.push_back(WORDAuto(WStrNewCpy(FDST_STR_NOT)));
//	vTokenTbl.push_back(WORDAuto(WStrNewCpy(FDST_STR_AND)));
//	vTokenTbl.push_back(WORDAuto(WStrNewCpy(FDST_STR_OR)));
//	vTokenTbl.push_back(WORDAuto(WStrNewCpy(FDST_STR_LEFT_PARE)));
//	vTokenTbl.push_back(WORDAuto(WStrNewCpy(FDST_STR_RIGHT_PARE)));
//----- 01.01.17 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	vTokenTbl.push_back(FDST_STR_NONE);
	vTokenTbl.push_back(FDST_STR_NOT);
	vTokenTbl.push_back(FDST_STR_AND);
	vTokenTbl.push_back(FDST_STR_OR);
	vTokenTbl.push_back(FDST_STR_LEFT_PARE);
	vTokenTbl.push_back(FDST_STR_RIGHT_PARE);
//----- 01.01.17 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
} // FCSearchToken::ReqInit.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCSearchToken::FCSearchToken
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	nToken	:_xZkqqHx_jAnNjCoIiClHiCoJiDgHiBfLiDeOiDjDiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.04.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
FCSearchToken::FCSearchToken (short nToken) : m_nToken(nToken) {}

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCSearchToken::ExtractWordToken
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFlGiOjKjHpBiCpAiCnMiCmGiCnPiCmEjCfAiMoKiDgHiBfLiDeOiDjDiCmGiClFiCmEiOoGiCoIiPgPiClFiBeB_xHqqkZx_
 *			_xZkqqHx_iDgHiBfLiDeOiDjDiDgFiBfLiDhFiDiLiCmJiLeMjIfOiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	wcpStr		:_xZkqqHx_iDgHiBfLiDeOiDjDiCpAiOoGiCoIiPgPiClHjFlGiOjKjHpBiBeC_xHqqkZx_
 *			vTokenTbl	:_xZkqqHx_iDgHiBfLiDeOiDjDiDgFiBfLiDhFiDiLiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.05.19 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCSearchToken::ExtractWordToken (const wchar_t*& wcpStr, WStringVector& vTokenTbl)
{
	if (*wcpStr == L'\0')
	//----- _xZkqqHx_jFlGiOjKjHpBiNmFiMoDiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDeHiDiJiBfLiBeC_xHqqkZx_
		m_nToken = FDTKN_ERR;
	} else
	{
		// _xZkqqHx_iDgHiBfLiDeOiDjDjAnNjCoIiBeC_xHqqkZx_
		m_nToken = vTokenTbl.size();
		vTokenTbl.push_back(wcpStr);
		// _xZkqqHx_jFlGiOjKjHpBiPeJiCoNiCoIiCmJiInKjDkOiBeC_xHqqkZx_
		wcpStr += wcslen(wcpStr);
	}
} // FCSearchToken::ExtractWordToken.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCSearchToken::ExtractLToken
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFlGiOjKjHpBiCkJiCoHiNlGiDgHiBfLiDeOiDjDiCpAiOoGiCoIiPgPiClFiBeBjFlGiOjKjHpBiCmMiDhMiDeDiDjDiDfOiCpAiClLiCmMjFkKiClOiCkP_xHqqkZx_
 *			_xZkqqHx_iInKjDkOiClHiCoJiBeCiOoGiCoIiPgPiClFiClNiDgHiBfLiDeOiDjDiCmNiBeBiDgHiBfLiDeOiDjDiDgFiBfLiDhFiDiLiCmJiLeMjIfOiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	wcpStr		:_xZkqqHx_iDgHiBfLiDeOiDjDiCpAiOoGiCoIiPgPiClHjFlGiOjKjHpBiBeC_xHqqkZx_
 *			vTokenTbl	:_xZkqqHx_iDgHiBfLiDeOiDjDiDgFiBfLiDhFiDiLiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iDgHiBfLiDeOiDjDiOoGiCoIiPgPiClFiCmMiDiLiBfLiDiLiCmNiImIiJlKiCmMjCmKiCoIiBeC_xHqqkZx_
 *			_xZkqqHx_iNlGiKiHiMmK_xHqqkZx_
 *			_xZkqqHx_iBeF_xHqqkZx_ (
 *			_xZkqqHx_jCfAiNiAiJiJiOfKiOhB_xHqqkZx_
 *			_xZkqqHx_iBeF_xHqqkZx_ !
 *			_xZkqqHx_jCfAiMoKiDgHiBfLiDeOiDjD_xHqqkZx_
 *			_xZkqqHx_iBeF_xHqqkZx_ /_xZkqqHx_iCmFiImNiCnMiCoKiClNjEmNiImNiBeC_xHqqkZx_
// *			_xZkqqHx_iBeF_xHqqkZx_ _xZkqqHx_iPoDiLeMiImIiKePiCmMjFlGiOjKiCmFiOgOiCnMiCoIiBeBiLpDjFlGiOjKiCnMiCmFiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	_xZkqqHx_iLpDjFlGiOjKiCmNiBeBiJeFiDgHiBfLiDeOiDjDiCmFiCkAiCoJiClBiCmGiCmJjCiNiInDiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.04.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCSearchToken::ExtractLToken (const wchar_t*& wcpStr, WStringVector& vTokenTbl)
{
	// _xZkqqHx_iNmFiPiJiCmMiLpDjEjCiBeFiDfOiDhFjDjJiCmNiDfIiDeMiDgCiDhGiBeC_xHqqkZx_
	FFSkipSpace(wcpStr);

	if (*wcpStr == L'\0')
	//----- _xZkqqHx_jFlGiOjKjHpBiNmFiMoDiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDeHiDiJiBfLiBeC_xHqqkZx_
		m_nToken = FDTKN_ERR;
	} else if (_wcsnicmp(wcpStr, FDST_STR_NOT, FDST_LEN_NOT) == 0)
	//----- NOT_xZkqqHx_iJiJiOfKiOhB_xHqqkZx_(!)_xZkqqHx_iCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDgHiBfLiDeOiDjDjAnNjCoIiBeC_xHqqkZx_
		m_nToken = FDTKN_NOT;
		// _xZkqqHx_iOjPiCmMjFlGiOjKiCmJiInKjDkOiBeC_xHqqkZx_
		wcpStr += FDST_LEN_NOT;
//----- 01.09.24 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	} else if (_wcsnicmp(wcpStr, FDST_STR_NOT2, FDST_LEN_NOT2) == 0)
	//----- _xZkqqHx_jFlGiOjKiMfOiCmM_xHqqkZx_NOT_xZkqqHx_iJiJiOfKiOhBiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDgHiBfLiDeOiDjDjAnNjCoIiBeC_xHqqkZx_
		m_nToken = FDTKN_NOT;
		// _xZkqqHx_iOjPiCmMjFlGiOjKiCmJiInKjDkOiBeC_xHqqkZx_
		wcpStr += FDST_LEN_NOT2;
//----- 01.09.24 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
	} else if (_wcsnicmp(wcpStr, FDST_STR_LEFT_PARE, FDST_LEN_LEFT_PARE) == 0)
	//----- _xZkqqHx_iNlGiKiHiMmKiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDgHiBfLiDeOiDjDjAnNjCoIiBeC_xHqqkZx_
		m_nToken = FDTKN_LEFT_PARE;
		// _xZkqqHx_iOjPiCmMjFlGiOjKiCmJiInKjDkOiBeC_xHqqkZx_
		wcpStr += FDST_LEN_LEFT_PARE;
	} else if (*wcpStr == FDST_CHR_SLASH)
	//----- _xZkqqHx_iDfIiDiJiDgCiDfGiDiFiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iOjPiCmMjFlGiOjKiCmJiInKjDkOiBeC_xHqqkZx_
		wcpStr++;
		// _xZkqqHx_jDkKiCmMiImKjChFiCpAiKgPiCkGiCmEiCkIiCkNiBeC_xHqqkZx_
		const wchar_t* wcpStrTop = wcpStr;
		// _xZkqqHx_jEpBiDeHiDfIiDfAiBfLiDhGiPpDjBnEiCpAjAnNjCoIiBeC_xHqqkZx_
		BOOL bEsc = FALSE;
		for (;;)
		{
			if (*wcpStr == L'\0')
			//----- _xZkqqHx_jFlGiOjKjHpBiNmFiMoDiCmMiPoKiNiH_xHqqkZx_ -----
			{
				// _xZkqqHx_iDeHiDiJiBfLiCmFiDiLiBfLiDhGiCpAjElCiCkPiCoJiBeC_xHqqkZx_
				m_nToken = FDTKN_ERR;
				break;
			}
			if (bEsc)
			//----- _xZkqqHx_iDeHiDfIiDfAiBfLiDhGiPpDjBnEiCmMiPoKiNiH_xHqqkZx_ -----
			{
				// _xZkqqHx_jEpBiDeHiDfIiDfAiBfLiDhGiPpDjBnEiCmJiBeCiBeC_xHqqkZx_
				bEsc = FALSE;
				// _xZkqqHx_iOjPiCmMjFlGiOjKiCmJiInKjDkOiBeC_xHqqkZx_
				wcpStr++;
				// _xZkqqHx_iOjPiCmMiDiLiBfLiDhGiCnGiDfHiDiDiDjDiDhGiBeC_xHqqkZx_
				continue;
			}
			//----- _xZkqqHx_jEpBiDeHiDfIiDfAiBfLiDhGiPpDjBnEiCmMiPoKiNiH_xHqqkZx_ -----
			if (*wcpStr == FDST_CHR_SLASH)
			//----- _xZkqqHx_iDfIiDiJiDgCiDfGiDiFiCmMiPoKiNiH_xHqqkZx_ -----
			{
				// _xZkqqHx_iDgHiBfLiDeOiDjDjAnNjCoIiBeC_xHqqkZx_
				m_nToken = vTokenTbl.size();
				vTokenTbl.push_back(WString(wcpStrTop, wcpStr));
				// _xZkqqHx_iOjPiCmMjFlGiOjKiCmJiInKjDkOiBeC_xHqqkZx_
				wcpStr++;
				break;
			}
			if (*wcpStr == FDST_CHR_ESC)
			//----- _xZkqqHx_iDeHiDfIiDfAiBfLiDhGjFlGiOjKiCmMiPoKiNiH_xHqqkZx_ -----
			{
				bEsc = TRUE;
				// _xZkqqHx_iOjPiCmMjFlGiOjKiCmJiInKjDkOiBeC_xHqqkZx_
				wcpStr++;
				// _xZkqqHx_iOjPiCmMiDiLiBfLiDhGiCnGiDfHiDiDiDjDiDhGiBeC_xHqqkZx_
				continue;
			}
			// _xZkqqHx_iOjPiCmMjFlGiOjKiCmJiInKjDkOiBeC_xHqqkZx_
			wcpStr++;
		}
	} else
	//----- _xZkqqHx_iClLiCmMjBlMiCmMjFlGiOjKiCmMiPoKiNiH_xHqqkZx_ -----
	{
//----- 01.05.19 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//		// _xZkqqHx_iDgHiBfLiDeOiDjDjAnNjCoIiBeC_xHqqkZx_
//		m_nToken = vTokenTbl.size();
//		vTokenTbl.push_back(wcpStr);
//		// _xZkqqHx_jFlGiOjKjHpBiPeJiCoNiCoIiCmJiInKjDkOiBeC_xHqqkZx_
//		wcpStr += wcslen(wcpStr);
//----- 01.05.19 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
		// _xZkqqHx_iDeHiDiJiBfLiBeC_xHqqkZx_
		m_nToken = FDTKN_ERR;
//----- 01.05.19 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	}
} // FCSearchToken::ExtractLToken.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCSearchToken::ExtractRToken
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFlGiOjKjHpBiCkJiCoHiJeFiDgHiBfLiDeOiDjDiCpAiOoGiCoIiPgPiClFiBeBjFlGiOjKjHpBiCmMiDhMiDeDiDjDiDfOiCpAiClLiCmMjFkKiClOiCkP_xHqqkZx_
 *			_xZkqqHx_iInKjDkOiClHiCoJiBeCiOoGiCoIiPgPiClFiClNiDgHiBfLiDeOiDjDiCmNiBeBiDgHiBfLiDeOiDjDiDgFiBfLiDhFiDiLiCmJiLeMjIfOiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	wcpStr		:_xZkqqHx_iDgHiBfLiDeOiDjDiCpAiOoGiCoIiPgPiClHjFlGiOjKjHpBiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iDgHiBfLiDeOiDjDiOoGiCoIiPgPiClFiCmMiDiLiBfLiDiLiCmNiImIiJlKiCmMjCmKiCoIiBeC_xHqqkZx_
 *			_xZkqqHx_iJeFiKiHiMmK_xHqqkZx_
 *			_xZkqqHx_iBeF_xHqqkZx_ )
 *			_xZkqqHx_iCfBiNiAiJiJiOfKiOhB_xHqqkZx_
 *			_xZkqqHx_iBeF_xHqqkZx_ & , | , AND , OR
 *			_xZkqqHx_iLpDjFlGiOjK_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	_xZkqqHx_iLpDjFlGiOjKiCmNiBeBiJeFiDgHiBfLiDeOiDjDiCmFiCkAiCoJiClBiCmGiCmJjCiNiInDiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.04.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCSearchToken::ExtractRToken (const wchar_t*& wcpStr)
{
	// _xZkqqHx_iNmFiPiJiCmMiLpDjEjCiBeFiDfOiDhFjDjJiCmNiDfIiDeMiDgCiDhGiBeC_xHqqkZx_
	FFSkipSpace(wcpStr);
	if (*wcpStr == L'\0')
	//----- _xZkqqHx_jFlGiOjKjHpBiNmFiMoDiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDgHiBfLiDeOiDjDjAnNjCoIiBeC_xHqqkZx_
		m_nToken = FDTKN_NONE;
	} else if (_wcsnicmp(wcpStr, FDST_STR_AND, FDST_LEN_AND) == 0)
	//----- _xZkqqHx_iCfBiNiAiJiJiOfKiOhB_xHqqkZx_(&)_xZkqqHx_iCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDgHiBfLiDeOiDjDjAnNjCoIiBeC_xHqqkZx_
		m_nToken = FDTKN_AND;
		// _xZkqqHx_iOjPiCmMjFlGiOjKiCmJiInKjDkOiBeC_xHqqkZx_
		wcpStr += FDST_LEN_AND;
	} else if (_wcsnicmp(wcpStr, FDST_STR_AND2, FDST_LEN_AND2) == 0)
	//----- _xZkqqHx_jFlGiOjKjHpBiMfOiCmMiCfBiNiAiJiJiOfKiOhB_xHqqkZx_(AND)_xZkqqHx_iCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDgHiBfLiDeOiDjDjAnNjCoIiBeC_xHqqkZx_
		m_nToken = FDTKN_AND;
		// _xZkqqHx_iOjPiCmMjFlGiOjKiCmJiInKjDkOiBeC_xHqqkZx_
		wcpStr += FDST_LEN_AND2;
	} else if (_wcsnicmp(wcpStr, FDST_STR_OR, FDST_LEN_OR) == 0)
	//----- _xZkqqHx_iCfBiNiAiJiJiOfKiOhB_xHqqkZx_(|)_xZkqqHx_iCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDgHiBfLiDeOiDjDjAnNjCoIiBeC_xHqqkZx_
		m_nToken = FDTKN_OR;
		// _xZkqqHx_iOjPiCmMjFlGiOjKiCmJiInKjDkOiBeC_xHqqkZx_
		wcpStr += FDST_LEN_OR;
	} else if (_wcsnicmp(wcpStr, FDST_STR_OR2, FDST_LEN_OR2) == 0)
	//----- _xZkqqHx_jFlGiOjKjHpBiMfOiCmMiCfBiNiAiJiJiOfKiOhB_xHqqkZx_(OR)_xZkqqHx_iCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDgHiBfLiDeOiDjDjAnNjCoIiBeC_xHqqkZx_
		m_nToken = FDTKN_OR;
		// _xZkqqHx_iOjPiCmMjFlGiOjKiCmJiInKjDkOiBeC_xHqqkZx_
		wcpStr += FDST_LEN_OR2;
	} else if (_wcsnicmp(wcpStr, FDST_STR_OR3, FDST_LEN_OR3) == 0)
	//----- _xZkqqHx_jFlGiOjKjHpBiMfOiCmMiCfBiNiAiJiJiOfKiOhB_xHqqkZx_(OR)_xZkqqHx_iCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDgHiBfLiDeOiDjDjAnNjCoIiBeC_xHqqkZx_
		m_nToken = FDTKN_OR;
		// _xZkqqHx_iOjPiCmMjFlGiOjKiCmJiInKjDkOiBeC_xHqqkZx_
		wcpStr += FDST_LEN_OR3;
	} else if (_wcsnicmp(wcpStr, FDST_STR_RIGHT_PARE, FDST_LEN_RIGHT_PARE) == 0)
	//----- _xZkqqHx_iJeFiKiHiMmKiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDgHiBfLiDeOiDjDjAnNjCoIiBeC_xHqqkZx_
		m_nToken = FDTKN_RIGHT_PARE;
		// _xZkqqHx_iOjPiCmMjFlGiOjKiCmJiInKjDkOiBeC_xHqqkZx_
		wcpStr += FDST_LEN_RIGHT_PARE;
	} else
	//----- _xZkqqHx_iClLiCmMjBlMiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDeHiDiJiBfLjAnNjCoIiBeC_xHqqkZx_
		m_nToken = FDTKN_ERR;
	}
} // FCSearchToken::ExtractRToken.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCSearchToken::IsOperator1
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgHiBfLiDeOiDjDiCkKjCfAiNiAiJiJiOfKiOhBiCkJiCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	TRUE :_xZkqqHx_jCfAiNiAiJiJiOfKiOhBiCmMiPoKiNiHiBeC_xHqqkZx_ FALSE :_xZkqqHx_jCfAiNiAiJiJiOfKiOhBiImIiKePiCmMiPoKiNiHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.04.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCSearchToken::IsOperator1 () const
{
	return m_nToken == FDTKN_NOT;
} // FCSearchToken::IsOperator1.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCSearchToken::IsOperator2
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgHiBfLiDeOiDjDiCkKiCfBiNiAiJiJiOfKiOhBiCkJiCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	TRUE :_xZkqqHx_iCfBiNiAiJiJiOfKiOhBiCmMiPoKiNiHiBeC_xHqqkZx_ FALSE :_xZkqqHx_iCfBiNiAiJiJiOfKiOhBiImIiKePiCmMiPoKiNiHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.04.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCSearchToken::IsOperator2 () const
{
	return (m_nToken == FDTKN_AND) || (m_nToken == FDTKN_OR);
} // FCSearchToken::IsOperator2.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCSearchToken::IsWord
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgHiBfLiDeOiDjDiCkKiIoKjEmKjCfAiMoKiCmMiDgHiBfLiDeOiDjDiCkJiCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	TRUE :_xZkqqHx_jCfAiMoKiCmMiDgHiBfLiDeOiDjDiBeC_xHqqkZx_ FALSE :_xZkqqHx_iDeJiDhJiDiMiBfLiDfOjDjJiCmMiKpJjCoIiDgHiBfLiDeOiDjDiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.04.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCSearchToken::IsWord () const
{
	return FDTKN_END_OF <= m_nToken;
} // FCSearchToken::IsWord.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCSearchToken::short
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgHiBfLiDeOiDjDjCgMiCpA_xHqqkZx_short_xZkqqHx_iMfOiCmFiOoGiCoIiPgPiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDgHiBfLiDeOiDjDjCgMiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.04.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
FCSearchToken::operator short () const
{
	return m_nToken;
} // FCSearchToken::operator short.

