トークン読み込み用クラス (大文字・小文字を意識する 言語用)

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

TokenReaderCase.vb


'*******************************************************************************************************
' トークンごとに その種類と、内容を返す ( 大文字・小文字を意識する 言語用 )
'*******************************************************************************************************
Public Class TokenReaderCase
Inherits TokenReaderCommon
'---------------------------------------------------------------------------------------------------
' 初期化
'---------------------------------------------------------------------------------------------------
Friend Sub New(ByVal aReader As Reader, ByVal langType As String)
MyBase.New(aReader, langType)
End Sub
'---------------------------------------------------------------------------------------------------
' 終了
'---------------------------------------------------------------------------------------------------
Protected Overrides Sub Finalize()
End Sub
'---------------------------------------------------------------------------------------------------
' 文字列か?
'---------------------------------------------------------------------------------------------------
Protected Overrides Function IsString() As Boolean
Return (_context.currChar = """"c)
End Function
'---------------------------------------------------------------------------------------------------
' 文字か?
'---------------------------------------------------------------------------------------------------
Protected Overrides Function IsChar() As Boolean
Return (_context.currChar = "'"c)
End Function
'---------------------------------------------------------------------------------------------------
' ディレクティブか?
'---------------------------------------------------------------------------------------------------
Protected Overrides Function IsDirective() As Boolean
Return (_context.currChar = "#"c)
End Function
'---------------------------------------------------------------------------------------------------
' 予約語ではないか?
'---------------------------------------------------------------------------------------------------
Protected Overrides Function getKeyWord() As String
'識別子が 予約語であれば、その文字列を返す
If (_keyWords.Contains(_context.currToken.tokenString)) Then
Return _context.currToken.tokenString
End If

Return ""
End Function
'---------------------------------------------------------------------------------------------------
' 状態を更新 (文字列)
'---------------------------------------------------------------------------------------------------
Protected Overrides Sub getNextStateStr()
MyBase.getNextStateCha()

If (_context.currChar = """"c) Then
_context.State = "その他"

ElseIf (_context.currChar = "\"c)
_context.State = "文字列中のエスケープシーケンス"
End If
End Sub
'---------------------------------------------------------------------------------------------------
' 状態を更新 (文字)
'---------------------------------------------------------------------------------------------------
Protected Overrides Sub getNextStateCha()
MyBase.getNextStateCha()

If (_context.currChar = "'"c) Then
_context.State = "その他"

ElseIf (_context.currChar = "\"c) Then
_context.State = "文字中のエスケープシーケンス"
End If
End Sub
'---------------------------------------------------------------------------------------------------
' 状態を更新 (ディレクティブ)
'---------------------------------------------------------------------------------------------------
Protected Overrides Sub getNextStateDir()
MyBase.getNextStateDir()

If (_context.currChar = NEWLINE) Then
_context.State = "その他"
ElseIf (Not Char.IsLetter(_context.currChar)) Then
_context.State = "不明"
End If
End Sub
End Class