VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "MultVarVarParse"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'Klasa MultVarVarParse
Implements InterpChain
Private nextChain As InterpChain
Private stk As Stack
Private ichain As New InterpChain
Private has_chain As Boolean

Public Sub init(stk_ As Stack)
  InterpChain_init stk_
End Sub

Private Sub InterpChain_addArgsToVerb()
  nextChain.addArgsToVerb
End Sub

Private Sub InterpChain_addToChain(c As InterpChain)
  Set nextChain = c
  has_chain = True
End Sub

Private Function InterpChain_getChain() As InterpChain
  Set InterpChain_getChain = ichain
End Function

Private Function InterpChain_hasChain() As Boolean
  InterpChain_hasChain = has_chain
End Function

Private Sub InterpChain_init(stk_ As Stack)
  Set stk = stk_
  ichain.init stk
End Sub

Private Function InterpChain_interpret() As Boolean
  Dim i As Integer
  'Zredukuj parê MULTVAR VAR do MULTVAR
  If (stk.topStack(MULT_VAR, VAR_TYPE)) Then
    Dim mv As New Multvar
    Dim mvo As Multvar
    Set mvo = stk.pop()
    Dim v As ParseVar
    Set v = stk.pop()
    mv.add v
    Dim mvec As Collection
    Set mvec = mvo.getVector()
    For i = 1 To mvec.Count
      mv.add mvec(i)
    Next i
    stk.push mv
    InterpChain_interpret = True
  Else
    InterpChain_interpret = False
  End If
End Function

Private Sub InterpChain_sendToChain(stk_ As Stack)
  If Not InterpChain_interpret Then
    nextChain.sendToChain stk_
  End If
End Sub

Private Function InterpChain_topStack(ByVal c1 As Integer, ByVal c2 As Integer) As Boolean
  InterpChain_topStack = stk.topStack(c1, c2)
End Function
