Exemplo n.º 1
0
ATerm CO_unquoteAppl(ATerm appl) 
{
  AFun fun;
  int arity;
  char *name = NULL;
  ATermList args = NULL;

  assert(ATgetType(appl) == AT_APPL);

  fun = ATgetAFun((ATermAppl) appl);
  arity = ATgetArity(fun);
  name = ATgetName(fun);
  args = ATgetArguments((ATermAppl) appl);
  fun = ATmakeAFun(name, arity, ATfalse);

  return (ATerm) ATmakeApplList(fun, args);
}
Exemplo n.º 2
0
void *_mkterm()
{ 
  char *f;
  ATermList ts;
  MatchFunFC("TCons", 2, &&mkterm_fail);
  Arg(0);
  if(ATisString(Ttop()))
    { 
      f = t_string(Ttop());
      Tpop();
      Arg(1);
      Tdrop();
      MatchFunFC("TCons", 2, &&mkterm_fail);
      Arg(0);
      ts = (ATermList) consnil_to_list_shallow(Ttop());
      Tpop();
      Tset((ATerm) ATmakeApplList(ATmakeSymbol(f, ATgetLength(ts), ATfalse), ts));
    }
  else if(ATgetType(Ttop()) == AT_REAL)