まとめ 【トークン読み込み用クラス (T-SQL用)】

TokenReaderTsql.cs


using System;

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

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

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