anchor.diff:              | JSON.Parser.NUMBER (l,br) -> e "NUMBER" l br
               | JSON.Parser.STRING1 (l,br) -> e "STRING1" l br
               | _ -> failwith "error in addErrorJSON function"
  -
           
           let addErrorTSQL tok =
               let e t l (brs:array<AbstractLexer.Core.Position<#ITreeNode>>) =
  
positive.code:             | WEIGHT (sourceText,brs) -> e "WEIGHT" sourceText.text brs
              | _ -> failwith "error in addErrorTSQL function"
  
          graphs
          |> ResizeArray.iter 
              (fun (lang, graph) ->
                  match lang with
                  | Calc -> 
                      xmlPath <- Calc.xmlPath
                      language <- Calc
                      processLang graph Calc.tokenize Calc.parse lexerErrors.Add  addError Calc.translate Calc.printAstToDot
                  | JSON -> 
                      xmlPath <- JSON.xmlPath
                      language <- JSON
                      processLang graph JSON.tokenize JSON.parse lexerErrors.Add  addErrorJSON JSON.translate JSON.printAstToDot
                  | TSQL -> 
                      xmlPath <- TSQL.xmlPath
                      language <- TSQL
                      processLang graph TSQL.tokenize TSQL.parse lexerErrors.Add  addErrorTSQL TSQL.translate TSQL.printAstToDot
              )
  
          lexerErrors, parserErrors
  
      member this.XmlPath = xmlPath
      
      member this.GetNextTree() = 
          let translate = 
              match language with
              | Calc -> Calc.translate
              | JSON -> JSON.translate
              | TSQL -> TSQL.translate
  
          if forest.Length <= count 
          then null
          else 
              let mutable curAst, errors = List.nth forest count
              let mutable unproc = 
                  if unprocessed.Length = 0
                  then Array.init curAst.TokensCount (fun i -> i) |> List.ofArray
                  else unprocessed
              
              let nextTree, unproc = curAst.GetNextTree unproc (fun _ -> true)
              if unproc.Length = 0
              then 
                  count <- count + 1
              unprocessed <- unproc
              
              let treeNodeList = translate nextTree errors :> seq<ITreeNode>
              treeNodeList.ToTreeNodeCollection().First()
  
  
      member this.GetForestWithToken range = 
          let translate = 
              match language with
              | Calc -> Calc.translate
              | JSON -> JSON.translate
              | TSQL -> TSQL.translate
  
          let calcPos token  = 
              let tokenData = 
                  match language with
                  | Calc -> Calc.AbstractParser.tokenData
                  | JSON -> JSON.Parser.tokenData
                  | TSQL -> tokenData
              
              let (_ : string), (position : AbstractLexer.Core.Position<ICSharpLiteralExpression>[]) 
                  = unbox <| tokenData token
                  
              calculatePos position
  
          let res = new ResizeArray<_>()
          for ast, errors in forest do
              let trees = ast.GetForestWithToken range calcPos
              for tree in trees do
                  let treeNodeList = translate tree errors :> seq<ITreeNode>
                  res.Add <| treeNodeList.ToTreeNodeCollection().First()
          res
negative.code:                 (t, (brs :?> array<AbstractLexer.Core.Position<ICSharpLiteralExpression>>).[0].back_ref.GetDocumentRange())
                  |> addLError
                  None
  
          tokenize graph |> Option.map parse
          |> Option.iter
              (function 
               | Yard.Generators.RNGLR.Parser.Success (ast, errors) -> 
                      addAST (ast, errors)
               | Yard.Generators.RNGLR.Parser.Error(_,tok,_,_,errors) -> tok |> Array.iter addPError 
              )
          
  