public void Visit(Prog prog) { appendSocketLibrary(); try { using (StreamReader sr = new StreamReader(_clientPySourcePath)) { _sb.Append(sr.ReadToEnd()); } } catch (Exception e) { Console.WriteLine("The client python support file could not be read:"); Console.WriteLine(e.Message); } _sb.Append("#BEGIN AUTO-GEN CLASS FOR CLIENT\n" + _separator); foreach (var c in prog.Clients) { c.Accept(this); _sb.Append("\n\n"); } _sb.Append(_separator + "#END AUTO-GEN CLASS FOR CLIENT\n\n"); appendClientPyMain(); _sb.Append("\n\n#ENDOFCLIENTSDEF\n\n"); appendSocketLibrary(); try { using (StreamReader sr = new StreamReader(_serverPySourcePath)) { _sb.Append(sr.ReadToEnd()); } } catch (Exception e) { Console.WriteLine("The server python support file could not be read:"); Console.WriteLine(e.Message); } _sb.Append("#BEGIN AUTO-GEN CLASS FOR SERVER\n" + _separator); _visitingServer = true; prog.Server.Accept(this); _sb.Append(_separator + "#END AUTO-GEN CLASS FOR SERVER\n\n"); appendServerPyMain(); }
public void Visit(Prog prog) { foreach (var c in prog.Clients) { c.Accept(this); _sb.Append("\n\n"); } prog.Server.Accept(this); }
public void Visit(Prog prog) { foreach (var c in prog.Clients) { c.Accept(this); } prog.Server.Accept(this); }