Esempio n. 1
0
 void RunCSharpNRefactoryVisitorClick(object sender, EventArgs e)
 {
     try {
         Clear();
         using (NRefactory.IParser parser = NRefactory.ParserFactory.CreateParser(NRefactory.SupportedLanguage.CSharp, new StringReader(codeTextBox.Text))) {
             parser.ParseMethodBodies = false;
             parser.Parse();
             NRefactoryAstVisitor visitor = new NRefactoryAstVisitor(this);
             visitor.VisitCompilationUnit(parser.CompilationUnit, null);
         }
     } catch (Exception ex) {
         walkerOutputTextBox.Text = ex.ToString();
     }
 }
Esempio n. 2
0
		void RunCSharpNRefactoryVisitorClick(object sender, EventArgs e)
		{
			try {
				Clear();
				using (NRefactory.IParser parser = NRefactory.ParserFactory.CreateParser(NRefactory.SupportedLanguage.CSharp, new StringReader(codeTextBox.Text))) {
					parser.ParseMethodBodies = false;
					parser.Parse();
					NRefactoryAstVisitor visitor = new NRefactoryAstVisitor(this);
					visitor.VisitCompilationUnit(parser.CompilationUnit, null);
				}
			} catch (Exception ex) {
				walkerOutputTextBox.Text = ex.ToString();
			}			
		}