public void Visit(Tunnel tunnel) { _sb.Append("self.addTunnel(Tunnel('" + tunnel.Typed.Id); switch (tunnel.Typed.SmclType.SmclT) { case SmclT.IntT: case SmclT.SintT: _sb.Append("', 0))"); break; case SmclT.BoolT: case SmclT.SboolT: _sb.Append("', False))"); break; default: throw new Exception("Visitor logic fails."); } _sb.Append("\n"); }
public void Visit(Tunnel tunnel) { _sb.Append("tunnel of "); tunnel.Typed.Accept(this); }
public void Visit(Tunnel tunnel) { tunnel.Typed.Accept(this); if (_env.VisitPartEnv.Tunnels.ContainsKey(tunnel.Typed.Id.Name)) throw new TypeCheckingException("there's another tunnel with the same name --> " + tunnel.Typed.Id.Name); _env.VisitPartEnv.Tunnels.Add(tunnel.Typed.Id.Name, tunnel.Typed.SmclType); tunnel.SmclType = new TunnelType(tunnel.Typed.SmclType); }