VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Tokenizer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Option Explicit
'Klasa Tokenizer
Private s As String, i As Integer
Private sep As String             'znak rozdzielający tokeny
Private stokens() As String       'tablica tokenów

Public Sub init(ByVal st As String)
  s = st
  setSeparator " "
End Sub

Private Sub Class_Initialize()
  sep = " "                       'domyślnym separatorem jest odstęp
End Sub

Public Sub setSeparator(ByVal sp As String)
  sep = sp
  stokens = Split(s, sp)
  i = -1
End Sub

Public Function nextToken() As String
  Dim tok As String
  If i < UBound(stokens) Then
    i = i + 1
    tok = stokens(i)
  Else
    tok = ""
  End If
  nextToken = tok    'return token
End Function
