示例#1
0
 private void Recompile()
 {
     AbstractSyntaxTree   = null;
     IntermediateLanguage = null;
     CompilerErrors       = string.Empty;
     try
     {
         var program = Parser.parse(_sourceCode);
         AbstractSyntaxTree = program.Select(x => new DeclarationItem(x));
         var semanticAnalysisResult = SemanticAnalysis.analyze(program);
         IntermediateLanguage = new ILBuilder(semanticAnalysisResult).BuildClass(program);
     }
     catch (CompilerException ex)
     {
         CompilerErrors = ex.Message;
     }
 }
示例#2
0
		private void Recompile()
		{
			AbstractSyntaxTree = null;
			IntermediateLanguage = null;
			CompilerErrors = string.Empty;
			try
			{
				var program = Parser.parse(_sourceCode);
				AbstractSyntaxTree = program.Select(x => new DeclarationItem(x));
				var semanticAnalysisResult = SemanticAnalysis.analyze(program);
				IntermediateLanguage = new ILBuilder(semanticAnalysisResult).BuildClass(program);
			}
			catch (CompilerException ex)
			{
				CompilerErrors = ex.Message;
			}
		}