コード例 #1
0
 public void Visit(For ffor)
 {
     _sb.Append("for ");
     _noTypeFlag = true;
     ffor.Typed.Accept(this);
     _noTypeFlag = false;
     _sb.Append(" in self.groups['");
     ffor.Id.Accept(this);
     _sb.Append("']:");
     ffor.Body.Accept(this);
 }
コード例 #2
0
 public void Visit(For ffor)
 {
     _sb.Append("for ( ");
     ffor.Typed.Accept(this);
     _sb.Append(" in ");
     ffor.Id.Accept(this);
     _sb.Append(" )");
     ffor.Body.Accept(this);
 }
コード例 #3
0
 public void Visit(For ffor)
 {
     if (!_env.IsVisitingServer())
         throw new TypeCheckingException("you can use for cycle only within server.");
     ffor.Typed.Accept(this);
     MustBe(ffor.Typed.SmclType, ClientType, "for each only with Client, not --> " + ffor.Typed.SmclType);
     ffor.Id.Accept(this);
     foreach (var g in _env.VisitPartEnv.Groups.Keys)
     {
         if (g == ffor.Id.Name)
         {
             _env.AddClientForMethodInvocation(ffor.Typed, _env.VisitPartEnv.Groups[g]);
             ffor.Body.Accept(this);
             _env.RemoveClientForMethodInvocation(ffor.Typed);
             return;
         }
     }
     throw new TypeCheckingException("This is an undefined group --> " + ffor.Id.Name);
 }