int switch_getOutputCount(Term* term) { Branch* contents = nested_contents(term); // check if term is still being initialized: if (contents->length() == 0) return 1; Branch* outerRebinds = contents->getFromEnd(0)->contents(); return outerRebinds->length() + 1; }
const char* switch_getOutputName(Term* term, int outputIndex) { Branch* contents = nested_contents(term); // check if term is still being initialized: if (contents->length() == 0) return ""; Branch* outerRebinds = contents->getFromEnd(0)->contents(); return outerRebinds->get(outputIndex - 1)->name.c_str(); }
Type* switch_getOutputType(Term* term, int outputIndex) { if (outputIndex == 0) return &VOID_T; Branch* contents = nested_contents(term); // check if term is still being initialized: if (contents->length() == 0) return &ANY_T; Branch* outerRebinds = contents->getFromEnd(0)->contents(); return outerRebinds->get(outputIndex - 1)->type; }
Branch* get_for_loop_outer_rebinds(Term* forTerm) { Branch* contents = nested_contents(forTerm); return contents->getFromEnd(0)->contents(); }