Simple function example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Summation {
s.Num1 s.Num2 = <Sum s.Num1 s.Num2>;
}
static refalrts::FnResult Summation(refalrts::Rope<refalrts::Node> arg, refalrts::Iter begin, refalrts::Iter end) {
refalrts::this_is_generated_function();
do {
refalrts::Rope<refalrts::Node> rope_0 = arg;
size_t rope_0_lshift = 0;
size_t rope_0_rshift = 0;
size_t rope_0_lshift_saved = 0;
size_t rope_0_rshift_saved = 0;
static refalrts::Node sNum1;
refalrts::use(sNum1);
static refalrts::Node sNum2;
refalrts::use(sNum2);
std::vector<refalrts::Node> v_0_left_0 = read_vector_left(rope_0, rope_0_lshift, rope_0_rshift, 2);
if (!is_svar(v_0_left_0[0]))
break;
sNum1 = v_0_left_0[0];
if (!is_svar(v_0_left_0[1]))
break;
sNum2 = v_0_left_0[1];
refalrts::reset_allocator();
auto res = refalrts::alloc_node_list(4);
refalrts::fill_open_call_node(res[0], & Sum, "Sum");
refalrts::fill_svar_node(res[1], sNum1);
refalrts::fill_svar_node(res[2], sNum2);
refalrts::fill_close_call_node(res[3]);
refalrts::push_stack( res[3] );
refalrts::push_stack( res[0] );
refalrts::splice_to_freelist( begin, end );
refalrts::insert_sublist( begin, res[0], res[res.size() - 1]);
return refalrts::cSuccess;
} while ( 0 );
return refalrts::cRecognitionImpossible;
}