forked from kripken/Relooper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test5.cpp
42 lines (33 loc) · 1.05 KB
/
test5.cpp
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
#include "Relooper.h"
int main() {
//Debugging::On = 1;
char buffer[10000];
rl_set_output_buffer(buffer);
void *r = rl_new_relooper();
void *b0 = rl_new_block("//0");
rl_relooper_add_block(r, b0);
void *b1 = rl_new_block("//1");
rl_relooper_add_block(r, b1);
void *b2 = rl_new_block("//2");
rl_relooper_add_block(r, b2);
void *b3 = rl_new_block("//3");
rl_relooper_add_block(r, b3);
void *b4 = rl_new_block("//4");
rl_relooper_add_block(r, b4);
void *b5 = rl_new_block("//5");
rl_relooper_add_block(r, b5);
rl_block_add_branch_to(b0, b1, "check(0)");
rl_block_add_branch_to(b0, b4, NULL);
rl_block_add_branch_to(b1, b1, "check(1)");
rl_block_add_branch_to(b1, b2, NULL);
rl_block_add_branch_to(b2, b2, "check(2)");
rl_block_add_branch_to(b2, b3, NULL);
rl_block_add_branch_to(b4, b4, "check(4)");
rl_block_add_branch_to(b4, b5, NULL);
rl_block_add_branch_to(b5, b3, "check(5)");
rl_block_add_branch_to(b5, b5, NULL);
rl_relooper_calculate(r, b0);
rl_relooper_render(r);
rl_delete_relooper(r);
puts(buffer);
}