private static void PrintSemantico(Semantico s, List <Token.Tok> lt, ExitMode mode) { StreamWriter sr; switch (mode) { case ExitMode.Console: Console.Out.Write("\n\n######Analise Semantica######\n\n"); sr = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = true }; Console.SetOut(sr); Console.OutputEncoding = System.Text.Encoding.UTF8; PrintArvoreSintatica(lt, sr); s.WriteOutput(lt, sr); break; default: Console.Out.Write("Escrevendo AnaliseSemantica.txt\n\n"); sr = new StreamWriter(@"AnaliseSemantica.txt"); PrintArvoreSintatica(lt, sr); s.WriteOutput(lt, sr); sr.Flush(); sr.Close(); break; } }