public void Visit(Server server)
 {
     _sb.Append("declare server " + server.Name + " : \n\t");
     foreach (var g in server.Groups)
     {
         g.Accept(this);
         _sb.Append(";\n\t");
     }
     foreach (var f in server.Functions)
     {
         f.Accept(this);
     }
 }
        public void Visit(Server server)
        {
            _className = server.Name;
            _sb.Append("class " + _className + "(Server): \n");
            ++Level;
            Indent();
            _sb.Append("def __init__(self, srvAddr, nPlayers, xmlConfigPath):\n");
            ++Level;
            Indent();
            _sb.Append("gpl = [");

            foreach (var g in server.Groups)
            {
                g.Accept(this);
                _sb.Append(", ");
            }
            _sb.Remove(_sb.Length - 2, 2);
            _sb.Append("]\n");
            Indent();
            _sb.Append("super(" + _className + ", self).__init__(srvAddr, gpl, xmlConfigPath, nPlayers)\n");
            --Level;
            foreach (var f in server.Functions)
            {
                f.Accept(this);
            }
            --Level;
        }
 public void Add(Server s)
 {
     PartEnv ce = new PartEnvServer(s);
     Server = ce;
     VisitPartEnv = ce;
 }
Beispiel #4
0
 public Prog(IList<Client> @clients, Server server)
 {
     _clients = @clients;
     _server = server;
 }
 public void Visit(Server server)
 {
     _env.Add(server);
     server.SmclType = ServerType;
     foreach (var g in server.Groups)
     {
         g.Accept(this);
     }
     foreach (var f in server.Functions)
     {
         f.Accept(this);
     }
 }