まとめ 【文脈情報クラス】

Context.cs


using System;

namespace SourceToHtml
{
//*******************************************************************************************************
// 文脈情報クラス
//*******************************************************************************************************
public class Context
{
public string State = "その他";// トークンリーダーの状態

public char prevChar = '\0'; // 前の文字
public char currChar = '\0'; // 現在の文字
public char nextChar = '\0'; // 次の文字

public Token prevToken; // 前のトークン
public Token currToken; // 現在のトークン
public Token nextToken; // 次のトークン
//---------------------------------------------------------------------------------------------------
// 初期化
//---------------------------------------------------------------------------------------------------
public Context()
{
//未確定トークン を 初期化
currToken = new Token("", "その他");
nextToken = new Token("", "その他");

//確定済みトークン を 初期化
prevToken = new Token("", "その他");
}
//---------------------------------------------------------------------------------------------------
// 終了
//---------------------------------------------------------------------------------------------------
~Context()
{
currToken = null;
nextToken = null;
prevToken = null;
}
}
}