トークン読み込み用クラス (T-SQL用)

これまでC# で作成してきた「SourceToHTML」を、VC++.NET に焼きなおしてみます。

TokenReaderTsql.h


#pragma once

#include ".\TokenReaderNoCase.h"

namespace SourceToHtml
{
using namespace System;
//*******************************************************************************************************
// トークンごとに 文字列と その種類を返す ( T-SQL用 )
//*******************************************************************************************************
public __gc class TokenReaderTsql : public TokenReaderNoCase
{
protected:
// 単一行コメントか?
bool IsComSingle();
// エスケープされた識別子か?
bool IsEscape();
// 状態を更新 (エスケープされた識別子)
void getNextStateIdwEsc();

public:
// 初期化
TokenReaderTsql(Reader* reader, String* langType);
// 終了
~TokenReaderTsql();
};
}

TokenReaderTsql.cpp


#include "StdAfx.h"
#include ".\TokenReaderTsql.h"

namespace SourceToHtml
{
//*******************************************************************************************************
// トークンごとに 文字列と その種類を返す ( T-SQL用 )
//*******************************************************************************************************
//-------------------------------------------------------------------------------------------------------
// 初期化
//-------------------------------------------------------------------------------------------------------
TokenReaderTsql::TokenReaderTsql(Reader* reader, String* langType):TokenReaderNoCase(reader, langType)
{
}
//-------------------------------------------------------------------------------------------------------
// 終了
//-------------------------------------------------------------------------------------------------------
TokenReaderTsql::~TokenReaderTsql()
{
}
//-------------------------------------------------------------------------------------------------------
// 単一行コメントか?
//-------------------------------------------------------------------------------------------------------
bool TokenReaderTsql::IsComSingle()
{
return ((_context->currChar == '-') && (_context->nextChar == '-'));
}
//-------------------------------------------------------------------------------------------------------
// エスケープされた識別子か?
//-------------------------------------------------------------------------------------------------------
bool TokenReaderTsql::IsEscape()
{
return ((_context->currChar == '\"') || (_context->currChar == '['));
}
//-------------------------------------------------------------------------------------------------------
// 状態を更新 (エスケープされた識別子)
//-------------------------------------------------------------------------------------------------------
void TokenReaderTsql::getNextStateIdwEsc()
{
TokenReaderNoCase::getNextStateIdwEsc();

if (_context->currToken->tokenString->Length > 1)
{
if ((_context->currToken->tokenString->Chars[0] == '\"') && (_context->currChar == '\"'))
_context->State = S"その他";

else if ((_context->currToken->tokenString->Chars[0] == '[') && (_context->currChar == ']'))
_context->State = S"その他";
}
}
}