anchor.diff:                  then 
                       pushesMap.[num].Add((oldPushes,newAstNode)) 
                   else pushesMap.Add(num,new ResizeArray<_>([|oldPushes,newAstNode|]))
  -            print "dot\stack_6_1_%A"
               pushesInitFun curTokens.Value.Tokens.Length
  -
  -        let print (fName:PrintfFormat<_,_,_,_>) =
  + 
  +        let print fName =
   #if DEBUG
  -            let path = fName.Value |> System.IO.Path.GetDirectoryName
  -            if path |> System.IO.Directory.Exists |> not
  -            then System.IO.Directory.CreateDirectory path |> ignore
  -            let vertices = usedStates.ToArray() |> Array.map (fun i -> stateToVertex.[i])
  -            drawDot parserSource.TokenToNumber tokens parserSource.LeftSide vertices parserSource.NumToString parserSource.ErrorIndex
  -                        <| sprintf fName !curLvl
  +            try
  +                let path = fName |> string |> System.IO.Path.GetDirectoryName
  +                if path |> System.IO.Directory.Exists |> not
  +                then System.IO.Directory.CreateDirectory path |> ignore
  +                let vertices = usedStates.ToArray() |> Array.map (fun i -> stateToVertex.[i])                    
  +                drawDot parserSource.TokenToNumber tokens parserSource.LeftSide vertices parserSource.NumToString parserSource.ErrorIndex
  +                            <| sprintf fName !curLvl     
  +            with
  +            | _ -> ()
   #endif
               ()
   
  -        let mutable errorList = []
  +        let mutable errorList = []                    
           let errorRuleExist = parserSource.ErrorRulesExists
  -        let mutable wasError = false
  +        let mutable wasError = ref false
           let lastErr = ref -1
           let pushesBackup = ref [||]
  -
  -        let errors = new ResizeArray<_>()
  -        
  -        let restorePushes () =
  -          if pushesMap.ContainsKey !curLvl
  -          then
  -              for vertex in usedStates do
  -                  stateToVertex.[vertex] <- null
  -              usedStates.Clear()
  -              for oldPushes,newAstNode in pushesMap.[!curLvl] do
  -                  for (vertex, state) in oldPushes do
  -                      let newVertex = addVertex [|state, !curLvl,  Some (vertex, newAstNode)|]
  -                      addSimpleEdge vertex newAstNode simpleEdges.[state]
  -              pushesMap.Remove(!curLvl) |> ignore
  -
  -        let erTok () = 
  -            //let shiftBase = tokens.Count - (!pushesBackup).Length 
  -            //let x = !pushesBackup |> Array.mapi (fun i (a:Stack<_>) -> if a.Count = 0  then Some (tokens.Item(shiftBase + i)) else None)
  -            rangeToSkip := !curLvl, try pushesMap.Keys |> Seq.min with _ -> !curLvl
  -            let x = !pushesBackup |> Array.mapi (fun i (a:Stack<_>) -> if a.Count = 0  then Some (curTokens.Value.Tokens.[i].Token) else None)
  -            x |> Array.choose id
  -            |> errors.AddRange
  -            //(try curTokens.Value.Tokens.[0].Token with _ -> tokens.[tokens.Count-1])
  -
  -        while not !isEnd && not wasError do
  -            print @"dot\stack_%A_1"
  +        while not !isEnd && not !wasError do
  +            print "dot\stack_1_%A"
               if usedStates.Count = 0 && reductions.Count = 0
               then
  -                if pushesMap.Count = 0
  -                then
  -                  let errInfo = !curTokens
  -                  errorList <- errInfo :: errorList
  -                  wasError <- true
  -                else
  -                    pushesBackup := !pushes
  -                    erTok()
  -                    curLvl := pushesMap.Keys |> Seq.min
  -                    restorePushes ()
  -                    makeReductions ()
  -                    attachEdges()
  -                    if not !isEOF then shift()
  +                let errInfo = !curTokens
  +                errorList <- errInfo :: errorList
  +                wasError <- ref true
               else
  -                print @"dot\stack_%A_2"
  +                print "dot\stack_2_%A"
                   if !isEOF
                   then
  -                    restorePushes ()
  -                    makeReductions()
  -                    attachEdges()
  -                    print @"dot\stack_%A_3"               
  +                    try 
  +                        for vertex in usedStates do
  +                            stateToVertex.[vertex] <- null
  +                        usedStates.Clear()
  +                        for  oldPushes,newAstNode in pushesMap.[!curLvl] do
  +                            for (vertex, state) in oldPushes do
  +                                let newVertex = addVertex [|state, !curLvl,  Some (vertex, newAstNode)|]
  +                                addSimpleEdge vertex newAstNode simpleEdges.[state]
  +                        pushesMap.Remove(!curLvl) |> ignore
  +                        makeReductions ()
  +                        attachEdges()
  +                        print "dot\stack_5_%A"
  +                    with _ -> () 
                       isEnd := true
                   else
  -                    print @"dot\stack_%A_4"
  +                    print "dot\stack_3_%A"
                       if !curLvl > 0
                       then
                           if pushesMap.ContainsKey !curLvl
  -                        then restorePushes ()
  +                        then
  +                            for vertex in usedStates do
  +                                stateToVertex.[vertex] <- null
  +                            usedStates.Clear()
  +                            for  oldPushes,newAstNode in pushesMap.[!curLvl] do
  +                                for (vertex, state) in oldPushes do
  +                                    let newVertex = addVertex [|state, !curLvl,  Some (vertex, newAstNode)|]
  +                                    addSimpleEdge vertex newAstNode simpleEdges.[state]
  +                            pushesMap.Remove(!curLvl) |> ignore
                           else
                               for vertex in usedStates do
                                   stateToVertex.[vertex] <- null
                               usedStates.Clear()
                       makeReductions ()
                       attachEdges()
  -                    let bad, good = !pushes |> Array.partition (fun x -> x.Count = 0)
  -                    if bad.Length > 0 || good.Length = 0
  -                    then
  -                        //()
  -                        pushesBackup := !pushes 
  -                        erTok ()
  -//                    if good.Length = 0
  -//                    then 
  -//                        //wasError <- true
  -//                        pushesBackup := !pushes
  -//                        erTok ()
  -//                        if pushesMap.Count > 0 
  -//                        then ()
  -//                          //curLvl := pushesMap.Keys |> Seq.min
  -//                          //restorePushes ()
  -//                        //else wasError <- true
  +                    if !pushes |> Array.exists (fun x -> x.Count = 0)
  +                    then 
  +                        wasError := true
  +                        pushesBackup := !pushes
                       shift ()
  -                    print "dot\stack_4_%A"
   
           let isAcceptState() = 
               let flag = ref false
  
positive.code: 
          ignore <| addVertex [|startState, 0, None|]
          let inline trd (_,_,x) = x
  
          let print fName =
  #if DEBUG
              let path = (sprintf fName !curLvl) |> string |> System.IO.Path.GetDirectoryName
              if path |> System.IO.Directory.Exists |> not
              then System.IO.Directory.CreateDirectory path |> ignore
              let vertices = usedStates.ToArray() |> Array.map (fun i -> stateToVertex.[i])                    
              drawDot parserSource.TokenToNumber tokens parserSource.LeftSide vertices parserSource.NumToString parserSource.ErrorIndex
                          <| sprintf fName !curLvl     
  #endif
              ()
  
          let makeReductions () =
              print "dot\stack_7_%A"
              while reductions.Count > 0 do
                  let vertex, prod, pos, edgeOpt = reductions.Pop()
                  let nonTerm = parserSource.LeftSide.[prod]
  
negative.code:                 if not !flag 
                  then
                      flag := parserSource.AccStates.[state]
              !flag                    
  
          // if finish isn't accepting state then error
          if !isEnd && usedStates.Count > 0 && not <| isAcceptState() 
          then
              //recovery()
              makeReductions ()
              attachEdges()
  
          let lastTokens count =
  