anchor.diff:              | WEIGHT (sourceText,brs) -> e "WEIGHT" sourceText.text brs
               | _ -> failwith "error in addErrorTSQL function"
   
  +
  +        let addCalcAst pair = calcForest <- calcForest @ [pair]
  +        let addJsonAst pair = jsonForest <- jsonForest @ [pair]
  +        let addTSqlAst pair =  tsqlForest <- tsqlForest @ [pair]
  +
           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
  +                    calcXmlPath <- Calc.xmlPath
  +                    processLang graph Calc.tokenize Calc.parse lexerErrors.Add  addError Calc.translate Calc.printAstToDot addCalcAst
                   | JSON -> 
  -                    xmlPath <- JSON.xmlPath
  -                    language <- JSON
  -                    processLang graph JSON.tokenize JSON.parse lexerErrors.Add  addErrorJSON JSON.translate JSON.printAstToDot
  +                    jsonXmlPath <- JSON.xmlPath
  +                    processLang graph JSON.tokenize JSON.parse lexerErrors.Add  addErrorJSON JSON.translate JSON.printAstToDot addJsonAst 
                   | TSQL -> 
  -                    xmlPath <- TSQL.xmlPath
  -                    language <- TSQL
  -                    processLang graph TSQL.tokenize TSQL.parse lexerErrors.Add  addErrorTSQL TSQL.translate TSQL.printAstToDot
  +                    tsqlXmlPath <- TSQL.xmlPath
  +                    processLang graph TSQL.tokenize TSQL.parse lexerErrors.Add  addErrorTSQL TSQL.translate TSQL.printAstToDot addTSqlAst
               )
  -
           lexerErrors, parserErrors
   
  -    member this.XmlPath = xmlPath
  +    member this.XmlPath = 
  +        if nowCalcTreeGen then calcXmlPath 
  +        elif nowJsonTreeGen then jsonXmlPath 
  +        elif nowTsqlTreeGen then tsqlXmlPath 
  +        else System.String.Empty
  +        
       
       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()
  -
  +        if not <| nowCalcTreeGen || nowJsonTreeGen || nowTsqlTreeGen 
  +        then
  +            nowCalcTreeGen <- true
  +
  +        let mutable res = null
  +        if nowCalcTreeGen 
  +        then 
  +            res <- getNextTree calcForest Calc.translate
  +            if res = null
  +            then 
  +                nowCalcTreeGen <- false
  +                nowJsonTreeGen <- true 
  +
  +        elif nowJsonTreeGen 
  +        then
  +            res <- getNextTree jsonForest JSON.translate
  +            if res = null
  +            then 
  +                nowJsonTreeGen <- false
  +                nowTsqlTreeGen <- true
  +
  +        elif nowTsqlTreeGen 
  +        then
  +            res <- getNextTree tsqlForest TSQL.translate
  +            if res = null
  +            then 
  +                nowTsqlTreeGen <- false
  +        res
   
       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()
  +        if calcForest.Length <> 0
  +        then
  +            res.AddRange <| getForestWithToken calcForest range Calc.AbstractParser.tokenData Calc.translate
  +        
  +        elif res.Count = 0 && jsonForest.Length <> 0
  +        then
  +            res.AddRange <| getForestWithToken jsonForest range JSON.Parser.tokenData JSON.translate 
  +        
  +        elif res.Count = 0 && tsqlForest.Length <> 0
  +        then
  +            res.AddRange <| getForestWithToken tsqlForest range tokenData TSQL.translate 
  +        
           res
positive.code:             | 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>>) =
  
negative.code:                     brs.[0].back_ref.GetDocumentRange())
          ranges    
  
  
      let getNextTree (forest : list<Yard.Generators.RNGLR.AST.Tree<'TokenType> * _>) translate = 
          if forest.Length <= count 
          then
              count <- 0 
              null
          else 
              let mutable curAst, errors = List.nth forest count
              if unprocessed.Length = 0
              then 
                  unprocessed <- Array.init curAst.TokensCount (fun i -> i) |> List.ofArray
              
              let nextTree, unproc = curAst.GetNextTree unprocessed (fun _ -> true)
              if unproc.Length = 0
              then 
                  count <- count + 1
              unprocessed  <- unproc
              let treeNodeList = translate nextTree errors :> seq<ITreeNode>
              treeNodeList.ToTreeNodeCollection().First()
  
      let getForestWithToken (forest : list<Yard.Generators.RNGLR.AST.Tree<'TokenType> * _>) 
                              range (tokenData: 'TokenType -> obj)  translate = 
          let tokenToPos (token : 'TokenType) = 
              let data = unbox <| tokenData token
              let str : string = fst data
              let pos : array<AbstractLexer.Core.Position<JetBrains.ReSharper.Psi.CSharp.Tree.ICSharpLiteralExpression>> 
                  = snd data
                  
              calculatePos pos
          
          let res = new ResizeArray<_>()
          for ast, errors in forest do
              let trees = ast.GetForestWithToken range tokenToPos
              for tree in trees do
                  let treeNodeList = translate tree errors :> seq<ITreeNode>
                  res.Add <| treeNodeList.ToTreeNodeCollection().First()
          res
  
  //(provider: ICSharpContextActionDataProvider) = 
      member this.Process () = 
          let parserErrors = new ResizeArray<_>()
  