+/*
+ Protects the parameter from being garbage collected. The object is
+ protected until the next disconnect_from_context call.
+
+ Whenever a child translator hears an event, the event is added to
+ this list. This eliminates the need for derived_mark methods in most
+ translators; all incoming events are instead protected by the
+ translator group.
+
+ TODO: Should the list also be flushed at the beginning of each new
+ moment?
+ */
+void
+Translator_group::protect_event (SCM ev)
+{
+ protected_events_ = scm_cons (ev, protected_events_);
+}
+
+/*
+ Create a new translator for a newly created child context. Triggered
+ by AnnounceNewContext events.
+ */
+IMPLEMENT_LISTENER (Translator_group, create_child_translator);
+void
+Translator_group::create_child_translator (SCM sev)
+{
+ Stream_event *ev = unsmob_stream_event (sev);
+ // get from AnnounceNewContext
+ SCM cs = ev->get_property ("context");
+ Context *new_context = unsmob_context (cs);
+ Context_def *def = unsmob_context_def (new_context->get_definition ());
+ SCM ops = new_context->get_definition_mods ();
+
+ SCM trans_names = def->get_translator_names (ops);
+
+ Translator_group *g = get_translator_group (def->get_translator_group_type ());
+ SCM trans_list = SCM_EOL;
+
+ for (SCM s = trans_names; scm_is_pair (s); s = scm_cdr (s))