void register_SetAndElem ( ) { lf_8_recursivesym = ATmakeSymbol ( "prod([lit(\"set\"),cf(opt(layout)),lit(\"(\"),cf(opt(layout)),cf(iter-star-sep(sort(\"ID\"),lit(\";\"))),cf(opt(layout)),lit(\")\")],cf(iter-star-sep(sort(\"ID\"),lit(\";\"))),attrs([term(\"cons\"(\"sepset\"))]))" , 1 , ATtrue ) ; ATprotectSymbol ( lf_8_recursivesym ) ; lf_5_recursivesym = ATmakeSymbol ( "prod([lit(\"set\"),cf(opt(layout)),lit(\"(\"),cf(opt(layout)),cf(iter-star(sort(\"ID\"))),cf(opt(layout)),lit(\")\")],cf(iter-star(sort(\"ID\"))),attrs([term(\"cons\"(\"set\"))]))" , 1 , ATtrue ) ; ATprotectSymbol ( lf_5_recursivesym ) ; lf_list_1sym = ATmakeSymbol ( "list(cf(iter-star(sort(\"ID\"))))" , 1 , ATtrue ) ; ATprotectSymbol ( lf_list_1sym ) ; lf_2sym = ATmakeSymbol ( "prod([lit(\"elem\"),cf(opt(layout)),lit(\"(\"),cf(opt(layout)),cf(sort(\"ID\")),cf(opt(layout)),lit(\",\"),cf(opt(layout)),cf(iter-star(sort(\"ID\"))),cf(opt(layout)),lit(\")\")],cf(sort(\"BOOL\")),attrs([term(\"cons\"(\"elem\"))]))" , 2 , ATtrue ) ; ATprotectSymbol ( lf_2sym ) ; lf_3sym = ATmakeSymbol ( "prod([lit(\"true\")],cf(sort(\"BOOL\")),no-attrs)" , 0 , ATtrue ) ; ATprotectSymbol ( lf_3sym ) ; lf_4sym = ATmakeSymbol ( "prod([lit(\"false\")],cf(sort(\"BOOL\")),no-attrs)" , 0 , ATtrue ) ; ATprotectSymbol ( lf_4sym ) ; lf_5sym = ATmakeSymbol ( "prod([lit(\"set\"),cf(opt(layout)),lit(\"(\"),cf(opt(layout)),cf(iter-star(sort(\"ID\"))),cf(opt(layout)),lit(\")\")],cf(iter-star(sort(\"ID\"))),attrs([term(\"cons\"(\"set\"))]))" , 1 , ATtrue ) ; ATprotectSymbol ( lf_5sym ) ; lf_list_6sym = ATmakeSymbol ( "list(cf(iter-star-sep(sort(\"ID\"),lit(\";\"))))" , 1 , ATtrue ) ; ATprotectSymbol ( lf_list_6sym ) ; lf_7sym = ATmakeSymbol ( "prod([lit(\"elem\"),cf(opt(layout)),lit(\"(\"),cf(opt(layout)),cf(sort(\"ID\")),cf(opt(layout)),lit(\",\"),cf(opt(layout)),cf(iter-star-sep(sort(\"ID\"),lit(\";\"))),cf(opt(layout)),lit(\")\")],cf(sort(\"BOOL\")),attrs([term(\"cons\"(\"sepelem\"))]))" , 2 , ATtrue ) ; ATprotectSymbol ( lf_7sym ) ; lf_8sym = ATmakeSymbol ( "prod([lit(\"set\"),cf(opt(layout)),lit(\"(\"),cf(opt(layout)),cf(iter-star-sep(sort(\"ID\"),lit(\";\"))),cf(opt(layout)),lit(\")\")],cf(iter-star-sep(sort(\"ID\"),lit(\";\"))),attrs([term(\"cons\"(\"sepset\"))]))" , 1 , ATtrue ) ; ATprotectSymbol ( lf_8sym ) ; register_prod ( ATparse ( "list(cf(iter-star(sort(\"ID\"))))" ) , lf_list_1 , lf_list_1sym ) ; register_prod ( ATparse ( "prod([lit(\"elem\"),cf(opt(layout)),lit(\"(\"),cf(opt(layout)),cf(sort(\"ID\")),cf(opt(layout)),lit(\",\"),cf(opt(layout)),cf(iter-star(sort(\"ID\"))),cf(opt(layout)),lit(\")\")],cf(sort(\"BOOL\")),attrs([term(\"cons\"(\"elem\"))]))" ) , lf_2 , lf_2sym ) ; register_prod ( ATparse ( "prod([lit(\"true\")],cf(sort(\"BOOL\")),no-attrs)" ) , lf_3 , lf_3sym ) ; register_prod ( ATparse ( "prod([lit(\"false\")],cf(sort(\"BOOL\")),no-attrs)" ) , lf_4 , lf_4sym ) ; register_prod ( ATparse ( "prod([lit(\"set\"),cf(opt(layout)),lit(\"(\"),cf(opt(layout)),cf(iter-star(sort(\"ID\"))),cf(opt(layout)),lit(\")\")],cf(iter-star(sort(\"ID\"))),attrs([term(\"cons\"(\"set\"))]))" ) , lf_5 , lf_5sym ) ; register_prod ( ATparse ( "prod([lit(\"set\"),cf(opt(layout)),lit(\"(\"),cf(opt(layout)),cf(iter-star(sort(\"ID\"))),cf(opt(layout)),lit(\")\")],cf(iter-star(sort(\"ID\"))),attrs([term(\"cons\"(\"set\"))]))" ) , lf_5_recursive , lf_5_recursivesym ) ; register_prod ( ATparse ( "list(cf(iter-star-sep(sort(\"ID\"),lit(\";\"))))" ) , lf_list_6 , lf_list_6sym ) ; register_prod ( ATparse ( "prod([lit(\"elem\"),cf(opt(layout)),lit(\"(\"),cf(opt(layout)),cf(sort(\"ID\")),cf(opt(layout)),lit(\",\"),cf(opt(layout)),cf(iter-star-sep(sort(\"ID\"),lit(\";\"))),cf(opt(layout)),lit(\")\")],cf(sort(\"BOOL\")),attrs([term(\"cons\"(\"sepelem\"))]))" ) , lf_7 , lf_7sym ) ; register_prod ( ATparse ( "prod([lit(\"set\"),cf(opt(layout)),lit(\"(\"),cf(opt(layout)),cf(iter-star-sep(sort(\"ID\"),lit(\";\"))),cf(opt(layout)),lit(\")\")],cf(iter-star-sep(sort(\"ID\"),lit(\";\"))),attrs([term(\"cons\"(\"sepset\"))]))" ) , lf_8 , lf_8sym ) ; register_prod ( ATparse ( "prod([lit(\"set\"),cf(opt(layout)),lit(\"(\"),cf(opt(layout)),cf(iter-star-sep(sort(\"ID\"),lit(\";\"))),cf(opt(layout)),lit(\")\")],cf(iter-star-sep(sort(\"ID\"),lit(\";\"))),attrs([term(\"cons\"(\"sepset\"))]))" ) , lf_8_recursive , lf_8_recursivesym ) ; }
static void register_strategies (void) { int initial_size = 117; int max_load = 75; struct str_closure * closures; int closures_index = 0; if((strategy_table == NULL)) strategy_table = ATtableCreate(initial_size, max_load); closures = (struct str_closure*) malloc((sizeof(struct str_closure) * 3)); if((closures == NULL)) { perror("malloc error for registration of dynamic strategies"); exit(1); } closures[closures_index].fun = &(parse_stratego_file_0_0); closures[closures_index].sl = NULL; SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("parse_stratego_file_0_0", 0, ATtrue)), &(closures[closures_index])); closures_index++; closures[closures_index].fun = &(do_parse_0_0); closures[closures_index].sl = NULL; SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("do_parse_0_0", 0, ATtrue)), &(closures[closures_index])); closures_index++; closures[closures_index].fun = &(main_0_0); closures[closures_index].sl = NULL; SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("main_0_0", 0, ATtrue)), &(closures[closures_index])); closures_index++; }
int main (int argc, char * argv []) { ATerm out_term; ATermList in_term; int i; ATinit(argc, argv, &(out_term)); init_constructors(); in_term = ATempty; for ( i = (argc - 1) ; (i >= 0) ; i-- ) { in_term = ATinsert(in_term, (ATerm) ATmakeAppl0(ATmakeSymbol(argv[i], 0, ATtrue))); } SRTS_stratego_initialize(); memset(__tracing_table, 0, (sizeof(unsigned short) * TRACING_TABLE_SIZE)); __tracing_table_counter = 0; register_strategies(); out_term = main_0_0(NULL, (ATerm) in_term); if((out_term != NULL)) { ATfprintf(stdout, "%t\n", out_term); exit(0); } else { ATfprintf(stderr, "%s: rewriting failed, trace:\n", argv[0]); for ( i = 0 ; (__tracing_table[i] && (i < TRACING_TABLE_SIZE)) ; i++ ) ATfprintf(stderr, "\t%s\n", __tracing_table[i]); exit(1); } }
static void init_module_constant_terms (void) { ATprotect(&(term0)); term0 = (ATerm) ATmakeAppl(ATmakeSymbol("kaas", 0, ATtrue)); ATprotect(&(term1)); term1 = term0; }
static void init_module_constant_terms(void) { ATfprintf(stderr, "init_constant_terms (bar.c)()\n"); ATprotect(&(term_p_0)); term_p_0 = (ATerm) ATmakeAppl(ATmakeSymbol("a", 0, ATtrue)); ATfprintf(stderr, "init_constant_terms (bar.c) end()\n"); }
ATerm addVar(ATerm sum, ATerm varName, ATerm varSort){ ATermList vars = ATmakeList0(); ATerm var; AFun vTag = ATmakeSymbol("v",2, ATfalse); vars = (ATermList) ATgetArgument((ATermAppl) sum ,0); vars = ATinsert(vars,(ATerm)ATmakeAppl2(vTag,varName,varSort)); return (ATerm) ATsetArgument((ATermAppl) sum, (ATerm) vars, 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)
void register_OutermostList ( ) { lf_list_1sym = ATmakeSymbol ( "list(cf(iter-star(sort(\"ID\"))))" , 1 , ATtrue ) ; ATprotectSymbol ( lf_list_1sym ) ; register_prod ( ATparse ( "list(cf(iter-star(sort(\"ID\"))))" ) , lf_list_1 , lf_list_1sym ) ; }
static void init_module_constructors (void) { sym_Nil_0 = ATmakeSymbol("Nil", 0, ATfalse); ATprotectSymbol(sym_Nil_0); }
static void init_module_constructors() { ATfprintf(stderr, "init_constructors() (bar.c)\n"); sym__2 = ATmakeSymbol("", 2, ATfalse); }