VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "VarVarParse"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Implements InterpChain
Private nextChain As InterpChain
Private stk As Stack
Private ichain As New InterpChain
Private has_chain As Boolean
'-----
Private Sub InterpChain_addArgsToVerb()
  ichain.addArgsToVerb
End Sub
'-----
Private Sub InterpChain_addToChain(c As InterpChain)
  Set nextChain = c
  has_chain = True
End Sub
'-----
Public Sub init(stk_ As Stack)
  Set stk = stk_
  ichain.init stk
End Sub
'-----
Private Function InterpChain_getChain() As InterpChain
  Set InterpChain_getChain = nextChain
End Function
'-----
Private Function InterpChain_hasChain() As Boolean
  InterpChain_hasChain = has_chain
End Function
'-----
Private Sub InterpChain_init(stk_ As Stack)
  Set stk = stk_
  init stk_
End Sub
'-----
Private Function InterpChain_interpret() As Boolean
  Dim v As ParseObject, v1 As ParseObject, mv As Multvar
  If (stk.topStack(VAR_TYPE, VAR_TYPE)) Then
    'Redukuj parę (Var Var) do Multvar
    Set v = stk.pop()
    Set v1 = stk.pop()
    Set mv = New Multvar
    mv.init v1, v
    stk.push mv
    InterpChain_interpret = True
  Else
    InterpChain_interpret = False
  End If
End Function
'-----
Private Sub InterpChain_sendToChain(stk_ As Stack)
  'Spróbuj zinterpretować element na szczycie stosu
  If Not InterpChain_interpret Then
    'Jeśli się nie udało, to przekaż go dalej
    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
