Some more complex 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
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
RemoveWhiteSpaces {
e.Head ' ' '+' e.Tail = <RemoveWhiteSpaces e.Head '+' e.Tail>;
e.Head '+' ' ' e.Tail = <RemoveWhiteSpaces e.Head '+' e.Tail>;
e.Head ' ' '*' e.Tail = <RemoveWhiteSpaces e.Head '*' e.Tail>;
e.Head '*' ' ' e.Tail = <RemoveWhiteSpaces e.Head '*' e.Tail>;
e.All = e.All;
}
static refalrts::FnResult RemoveWhiteSpaces(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 eHead;
refalrts::use(eHead);
static refalrts::Node eTail;
refalrts::use(eTail);
rope_0_lshift_saved = rope_0_lshift;
rope_0_rshift_saved = rope_0_rshift;
for(rope_0_lshift=rope_0_lshift_saved+1; rope_0_lshift<rope_0_rshift; rope_0_lshift++) {
get_closed_evar(eHead, rope_0, rope_0_lshift_saved, rope_0_lshift);
std::vector<refalrts::Node> v_0_left_0 = read_vector_left(rope_0, rope_0_lshift, rope_0_rshift, 2);
if (!char_check( v_0_left_0[0], ' '))
continue;
if (!char_check( v_0_left_0[1], '+'))
continue;
get_closed_evar( eTail, rope_0, rope_0_lshift, rope_0_rshift);
}
refalrts::reset_allocator();
auto res = refalrts::alloc_node_list(5);
refalrts::fill_open_call_node(res[0], & RemoveWhiteSpaces, "RemoveWhiteSpaces");
refalrts::fill_evar_node(res[1], eHead);
refalrts::fill_char_node(res[2], '+');
refalrts::fill_evar_node(res[3], eTail);
refalrts::fill_close_call_node(res[4]);
refalrts::push_stack( res[4] );
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 );
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 eHead;
refalrts::use(eHead);
static refalrts::Node eTail;
refalrts::use(eTail);
rope_0_lshift_saved = rope_0_lshift;
rope_0_rshift_saved = rope_0_rshift;
for(rope_0_lshift=rope_0_lshift_saved+1; rope_0_lshift<rope_0_rshift; rope_0_lshift++) {
get_closed_evar(eHead, rope_0, rope_0_lshift_saved, rope_0_lshift);
std::vector<refalrts::Node> v_0_left_0 = read_vector_left(rope_0, rope_0_lshift, rope_0_rshift, 2);
if (!char_check( v_0_left_0[0], '+'))
continue;
if (!char_check( v_0_left_0[1], ' '))
continue;
get_closed_evar( eTail, rope_0, rope_0_lshift, rope_0_rshift);
}
refalrts::reset_allocator();
auto res = refalrts::alloc_node_list(5);
refalrts::fill_open_call_node(res[0], & RemoveWhiteSpaces, "RemoveWhiteSpaces");
refalrts::fill_evar_node(res[1], eHead);
refalrts::fill_char_node(res[2], '+');
refalrts::fill_evar_node(res[3], eTail);
refalrts::fill_close_call_node(res[4]);
refalrts::push_stack( res[4] );
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 );
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 eHead;
refalrts::use(eHead);
static refalrts::Node eTail;
refalrts::use(eTail);
rope_0_lshift_saved = rope_0_lshift;
rope_0_rshift_saved = rope_0_rshift;
for(rope_0_lshift=rope_0_lshift_saved+1; rope_0_lshift<rope_0_rshift; rope_0_lshift++) {
get_closed_evar(eHead, rope_0, rope_0_lshift_saved, rope_0_lshift);
std::vector<refalrts::Node> v_0_left_0 = read_vector_left(rope_0, rope_0_lshift, rope_0_rshift, 2);
if (!char_check( v_0_left_0[0], ' '))
continue;
if (!char_check( v_0_left_0[1], '*'))
continue;
get_closed_evar( eTail, rope_0, rope_0_lshift, rope_0_rshift);
}
refalrts::reset_allocator();
auto res = refalrts::alloc_node_list(5);
refalrts::fill_open_call_node(res[0], & RemoveWhiteSpaces, "RemoveWhiteSpaces");
refalrts::fill_evar_node(res[1], eHead);
refalrts::fill_char_node(res[2], '*');
refalrts::fill_evar_node(res[3], eTail);
refalrts::fill_close_call_node(res[4]);
refalrts::push_stack( res[4] );
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 );
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 eHead;
refalrts::use(eHead);
static refalrts::Node eTail;
refalrts::use(eTail);
rope_0_lshift_saved = rope_0_lshift;
rope_0_rshift_saved = rope_0_rshift;
for(rope_0_lshift=rope_0_lshift_saved+1; rope_0_lshift<rope_0_rshift; rope_0_lshift++) {
get_closed_evar(eHead, rope_0, rope_0_lshift_saved, rope_0_lshift);
std::vector<refalrts::Node> v_0_left_0 = read_vector_left(rope_0, rope_0_lshift, rope_0_rshift, 2);
if (!char_check( v_0_left_0[0], '*'))
continue;
if (!char_check( v_0_left_0[1], ' '))
continue;
get_closed_evar( eTail, rope_0, rope_0_lshift, rope_0_rshift);
}
refalrts::reset_allocator();
auto res = refalrts::alloc_node_list(5);
refalrts::fill_open_call_node(res[0], & RemoveWhiteSpaces, "RemoveWhiteSpaces");
refalrts::fill_evar_node(res[1], eHead);
refalrts::fill_char_node(res[2], '*');
refalrts::fill_evar_node(res[3], eTail);
refalrts::fill_close_call_node(res[4]);
refalrts::push_stack( res[4] );
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 );
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 eAll;
refalrts::use(eAll);
get_closed_evar( eAll, rope_0, rope_0_lshift, rope_0_rshift);
refalrts::reset_allocator();
auto res = refalrts::alloc_node_list(1);
refalrts::fill_evar_node(res[0], eAll);
refalrts::splice_to_freelist( begin, end );
refalrts::insert_sublist( begin, res[0], res[res.size() - 1]);
return refalrts::cSuccess;
} while ( 0 );
return refalrts::cRecognitionImpossible;
}