anchor.diff:          then new Tree<_>([||], getEpsilon startNonTerm, parserSource.Rules) |> Success
           else Error (0, Unchecked.defaultof<'TokenType>, "This grammar cannot accept empty string")
       else
  -        let v = addVertex startV startState
  +        let _,_ = addVertex startV startState startV.unprocessedGssVertices
           while errorIndex = -1 && verticesToProcess.Count > 0 do
               let curV = verticesToProcess.Dequeue()
               processVertex curV
  -            verticesSeenBefore.[curV.vNum] <- true
   
           if errorIndex <> -1 then
               Error (errorIndex - 1, Unchecked.defaultof<'TokenType>, "Parse error")
           else
               let root = ref None
  -            //printfn "accs: %A" [for i = 0 to parserSource.AccStates.Length-1 do
  -            //                        if parserSource.AccStates.[i] then yield i]
               let addTreeTop res =
                   let children = new Family(parserSource.StartRule, new Nodes([|res|]))
                   new AST(children, null)
  
positive.code:     new (edge) = new Path (edge, null, 1)
  
  let buildAstAbstract<'TokenType> (parserSource : ParserSource<'TokenType>) (tokens : ParserInputGraph<'TokenType>) =
      //printfn "\n__________________________________________________________"
      let statesCount = parserSource.Gotos.Length
      let startV, finalV, innerGraph =
          let verticesMap = Array.zeroCreate (Seq.max tokens.Vertices + 1)            
          for i in tokens.Vertices do
               verticesMap.[i] <- new VInfo<_> (i, statesCount)
          let g = new QuickGraph.AdjacencyGraph<_,_>()
          let added = 
              tokens.Edges |> Seq.map (fun e -> new QuickGraph.TaggedEdge<_,_>(verticesMap.[e.Source], verticesMap.[e.Target], e.Tag))
              |> g.AddVerticesAndEdgeRange
          //if added <> tokens.EdgeCount then failwithf "Error while convertion input parser graph to iier representation. Expected edges: %A, actual: %A" tokens.EdgeCount added
          verticesMap.[tokens.InitState], verticesMap.[tokens.FinalState], g
      
      let nodes = new BlockResizeArray<AstNode>()
      let debugNodes = new BlockResizeArray<AstNode>()
      let terminals = new BlockResizeArray<'TokenType>()
      // Must be number of non-terminals, but doesn't matter
      let nonTermsCountLimit = 1 + (Array.max parserSource.LeftSide)
      let startState = 0
      let inline getEpsilon i = new Epsilon(-1-i)
      let startNonTerm = parserSource.LeftSide.[parserSource.StartRule]
      let verticesToProcess = new Queue<_>()
      verticesToProcess.Enqueue (startV)
      let mutable errorIndex = -1
      let verticesSeenBefore = Array.init (Seq.max tokens.Vertices + 1) (fun _ -> false)
      let outEdgesInnerGraph = Array.init (Seq.max tokens.Vertices + 1) (fun _ -> [||])
      for v in innerGraph.Vertices do
          outEdgesInnerGraph.[v.vNum] <- innerGraph.OutEdges v |> Array.ofSeq
      
      let customEnqueue (elem : VInfo<_>) =
          //printf "%A" elem.vNum
          if verticesToProcess.Count = 0 || (verticesToProcess.ElementAt (verticesToProcess.Count - 1) = elem |> not)
          then
              //printfn " +"
              verticesToProcess.Enqueue(elem)
          //else printfn " -"
  
      let edgesToTerms = new Dictionary<_,_>()
      let push (currentGraphV:VInfo<_>) gssVertex state =
          let reductions = new ResizeArray<_>(10)
          let newUnprocessedGssVs = new ResizeArray<_>(2)
          for e in outEdgesInnerGraph.[currentGraphV.vNum] do
          //printfn "v(%d,%d)" state num
              let push = parserSource.Gotos.[state].[parserSource.TokenToNumber e.Tag]
              if push <> 0 
              then
                  let findGssVertex (target : VInfo<_>) = 
                      let srcV = target.processedGssVertices |> ResizeArray.tryFind(fun v -> v.State = push)
                      match srcV with
                      | Some v -> v, false
                      | None -> 
                          let srcV = target.unprocessedGssVertices |> ResizeArray.tryFind(fun v -> v.State = push)
                          match srcV with
                          | Some v -> v, false
                          | None -> 
                              let v = new Vertex(push, target.vNum)
                              if currentGraphV.vNum = target.vNum
                              then newUnprocessedGssVs.Add v
                              else target.unprocessedGssVertices.Add v
                              v, true
                  let targetGssV, isNew = findGssVertex e.Target
  
                  let mutable edge = Unchecked.defaultof<_>
                  if edgesToTerms.ContainsKey e
                  then
                      edge <- new Edge(gssVertex, edgesToTerms.[e])
                  else 
                      terminals.Add e.Tag
                      nodes.Add <| Terminal (terminals.Count - 1)
                      edgesToTerms.Add(e, nodes.Count - 1)
                      edge <- new Edge(gssVertex, nodes.Count - 1)
  
                  if targetGssV.FindIndex gssVertex.State gssVertex.Level = -1
                  then
  
negative.code:             if (pos > 0)
              then
                  for e in outEdgesInnerGraph.[startV.vNum] do
                      addNonZeroReduction newVertex state e.Tag edge startV
                  if startV.reductions.Count > 0 then customEnqueue startV
              addChildren nodes.[nodes.Count - 1] path prod
  
  