Beispiel #1
0
 public bool Close(string filePath)
 {
     if (this.SyntaxTrees.ContainsKey(filePath))
     {
         ALSyntaxTree syntaxTree = this.SyntaxTrees[filePath];
         syntaxTree.OpenCount--;
         if (syntaxTree.OpenCount <= 0)
         {
             this.SyntaxTrees.Remove(filePath);
             return(true);
         }
         return(false);
     }
     return(true);
 }
Beispiel #2
0
        public ALSyntaxTree FindOrCreate(string path, bool open)
        {
            ALSyntaxTree syntaxTree = null;

            if (this.SyntaxTrees.ContainsKey(path))
            {
                syntaxTree = this.SyntaxTrees[path];
                if (open)
                {
                    syntaxTree.OpenCount++;
                }
            }
            else
            {
                syntaxTree           = new ALSyntaxTree(path, this.SyntaxTreeReader);
                syntaxTree.OpenCount = 1;
                this.SyntaxTrees.Add(path, syntaxTree);
            }
            return(syntaxTree);
        }