Parse() private method

private Parse ( CompilationUnit file, ModuleContainer module ) : void
file CompilationUnit
module ModuleContainer
return void
Beispiel #1
0
        void ParseStartupFiles()
        {
            Driver d = new Driver(ctx);

            Location.Initialize(ctx.SourceFiles);

            for (int i = 0; i < startup_files; ++i)
            {
                var sf = ctx.Settings.SourceFiles [i];
                d.Parse(sf, module);
            }
        }
Beispiel #2
0
		void ParseStartupFiles ()
		{
			Driver d = new Driver (ctx);

			Location.Initialize (ctx.SourceFiles);

			var parser_session = new ParserSession ();
			for (int i = 0; i < startup_files; ++i) {
				var sf = ctx.SourceFiles [i];
				d.Parse (sf, module, parser_session, ctx.Report);
			}
		}
Beispiel #3
0
		void ParseStartupFiles ()
		{
			Driver d = new Driver (ctx);

			Location.Initialize (ctx.SourceFiles);

			for (int i = 0; i < startup_files; ++i) {
				var sf = ctx.SourceFiles [i];
				d.Parse (sf, module);
			}
		}
Beispiel #4
0
		void ParseStartupFiles ()
		{
			Driver d = new Driver (ctx);

			Location.Initialize (ctx.SourceFiles);

			var parser_session = new ParserSession ();
			for (int i = 0; i < startup_files; ++i) {
				var sf = ctx.SourceFiles [i];
				d.Parse (sf, module, parser_session, ctx.Report);
			}
		}
Beispiel #5
0
		public CompilationUnit Parse (Stream stream, string fileName, int lineModifier = 0)
		{
			lock (parseLock) {
				errorReportPrinter = new ErrorReportPrinter ("");
				var ctx = new CompilerContext (CompilerSettings, errorReportPrinter);
				ctx.Settings.TabSize = 1;
				var reader = new SeekableStreamReader (stream, Encoding.UTF8);
				var file = new SourceFile (fileName, fileName, 0);
				Location.Initialize (new List<SourceFile> (new [] { file }));
				var module = new ModuleContainer (ctx);
				var driver = new Driver (ctx);
				var parser = driver.Parse (reader, file, module);
				
				var top = new CompilerCompilationUnit () { 
					ModuleCompiled = module,
					LocationsBag = parser.LocationsBag,
					SpecialsBag = parser.Lexer.sbag
				};
				var unit = Parse (top, fileName, lineModifier);		
				unit.Errors.AddRange (errorReportPrinter.Errors);
				CompilerCallableEntryPoint.Reset ();
				return unit;
			}
		}