まとめ【トークン読み込み用クラス (C#用)】

TokenReaderCSharp.cs


using System;

namespace SourceToHtml
{
//*******************************************************************************************************
// トークンごとに 文字列と その種類を返す ( C#用 )
//*******************************************************************************************************
public class TokenReaderCSharp : TokenReaderCase
{
//---------------------------------------------------------------------------------------------------
// 初期化
//---------------------------------------------------------------------------------------------------
public TokenReaderCSharp(Reader reader, string langType) : base(reader, langType) {}
//---------------------------------------------------------------------------------------------------
// 逐語的文字列か?
//---------------------------------------------------------------------------------------------------
protected override bool IsLiteral()
{
return ((_context.currChar == '@') && (_context.nextChar == '\"'));
}
//---------------------------------------------------------------------------------------------------
// 状態を更新 (逐語的文字列)
//---------------------------------------------------------------------------------------------------
protected override void getNextStateStrLit()
{
base.getNextStateStrLit();

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