Ejemplo n.º 1
0
		public static void BeginAddOrUpdatePaths (IEnumerable<string> basePaths, bool skipFunctionBodies = false, ParseFinishedHandler finishedHandler = null)
		{
			if (basePaths == null)
				throw new ArgumentNullException ("basePaths");

			if (System.Diagnostics.Debugger.IsAttached) {
				Console.WriteLine ("BeginAddOrUpdatePaths: ");
				foreach (var p in basePaths)
					Console.WriteLine (p);
				Console.WriteLine ("---------");
			}

			GC.Collect ();

			parseCompletedEvent.Reset ();
			stopParsing = false;

			var c = basePaths.Count ();

			if (c == 0) {
				var im = new StatIntermediate();
				if(finishedHandler!=null)
					im.parseSubTasksUntilFinished.Add (new ParseSubtaskContainer(1,finishedHandler));
				im.completed.Set ();
				Interlocked.Increment (ref parsingThreads);
				noticeFinish (new ParseIntermediate (im, null, null));
				return;
			}

			var countObj = new ParseSubtaskContainer (c, finishedHandler);

			foreach (var path in basePaths) {
				Interlocked.Increment (ref parsingThreads);
				basePathQueue.Push (new PathQueueArgs (path, skipFunctionBodies, countObj));
			}
			preparationThreadStartEvent.Set ();

			LaunchPreparationThread ();
		}
Ejemplo n.º 2
0
        public static void UpdateParseCacheAsync(IEnumerable <string> Cache, bool skipfunctionbodies = false, ParseFinishedHandler onfinished = null)
        {
            if (Cache == null)
            {
                throw new ArgumentNullException("Cache");
            }

            GlobalParseCache.BeginAddOrUpdatePaths(Cache, skipfunctionbodies, onfinished);
        }
Ejemplo n.º 3
0
			public ParseSubtaskContainer (int i, ParseFinishedHandler f)
			{
				this.i = i;
				this.finishedHandler = f;
			}
Ejemplo n.º 4
0
        public static void UpdateParseCacheAsync(IEnumerable <string> Cache, string fallBack, string solutionPath, bool skipfunctionbodies = false, ParseFinishedHandler onfinished = null)
        {
            if (Cache == null)
            {
                throw new ArgumentNullException("Cache");
            }

            GlobalParseCache.BeginAddOrUpdatePaths(Parser.DParserWrapper.EnsureAbsolutePaths(Cache, fallBack, solutionPath), skipfunctionbodies, finishedHandler: onfinished);
        }
Ejemplo n.º 5
0
        public static void BeginAddOrUpdatePaths(IEnumerable <string> basePaths, bool skipFunctionBodies = false, ParseFinishedHandler finishedHandler = null)
        {
            if (basePaths == null)
            {
                throw new ArgumentNullException("basePaths");
            }

            if (System.Diagnostics.Debugger.IsAttached)
            {
                Console.WriteLine("BeginAddOrUpdatePaths: ");
                foreach (var p in basePaths)
                {
                    Console.WriteLine(p);
                }
                Console.WriteLine("---------");
            }

            GC.Collect();

            parseCompletedEvent.Reset();
            stopParsing = false;

            var c = basePaths.Count();

            if (c == 0)
            {
                var im = new StatIntermediate();
                if (finishedHandler != null)
                {
                    im.parseSubTasksUntilFinished.Add(new ParseSubtaskContainer(1, finishedHandler));
                }
                im.completed.Set();
                Interlocked.Increment(ref parsingThreads);
                noticeFinish(new ParseIntermediate(im, null, null));
                return;
            }

            var countObj = new ParseSubtaskContainer(c, finishedHandler);

            foreach (var path in basePaths)
            {
                Interlocked.Increment(ref parsingThreads);
                basePathQueue.Push(new PathQueueArgs(path, skipFunctionBodies, countObj));
            }
            preparationThreadStartEvent.Set();

            LaunchPreparationThread();
        }
Ejemplo n.º 6
0
 public ParseSubtaskContainer(int i, ParseFinishedHandler f)
 {
     this.i = i;
     this.finishedHandler = f;
 }
Ejemplo n.º 7
0
		public static void UpdateParseCacheAsync (IEnumerable<string> Cache, bool skipfunctionbodies= false, ParseFinishedHandler onfinished = null)
		{
			if (Cache == null)
				throw new ArgumentNullException ("Cache");

			GlobalParseCache.BeginAddOrUpdatePaths (Cache, skipfunctionbodies, onfinished);
		}
Ejemplo n.º 8
0
		public static void UpdateParseCacheAsync (IEnumerable<string> Cache, string fallBack, string solutionPath, bool skipfunctionbodies= false, ParseFinishedHandler onfinished = null)
		{
			if (Cache == null)
				throw new ArgumentNullException ("Cache");

			GlobalParseCache.BeginAddOrUpdatePaths (Parser.DParserWrapper.EnsureAbsolutePaths(Cache, fallBack, solutionPath), skipfunctionbodies, finishedHandler:onfinished);
		}