-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathloop.h
60 lines (37 loc) · 1.35 KB
/
loop.h
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
#ifndef __LOOP_H
#define __LOOP_H
#include "variable.h"
#define v_FOR 0x10
#define V_WHILE 0x11
#define V_WHILE_DO 0x16
#define Size 150// satır ve sutun sayısı
#define c_Size_s 10//small
#define c_Size_l 30//large
typedef struct loop_s
{
int id;
int kind;
int start_end_line[2];
variable_s_pointer *dependent_variable;
int complexity;
char condition[10];
struct loop_s *next;
}loop_s;
typedef struct loop_s_pointer
{
loop_s *loop;
struct loop_s_pointer *next;
}loop_s_pointer;
int add_loop(loop_s *data, loop_s *loops);
int write_loop_data(loop_s *data,loop_s *loops);
int find_for(char text[][Size], loop_s *l_root); // for yerini ve artış oranını bulur
int find_line_end(int line_start, char text[][Size]); // iç içe for bulur
int find_while(char text[][Size], loop_s *l_root);
int find_do(char text[][Size], int end_while_line);
void connect_loop_and_variable(variable_s *v_root, loop_s *l_root);
int research_variable_connect_loop_same_line(variable_s *v_root, int loop_start_line);
int research_variable_connect_loop_different_line(variable_s *v_root, loop_s *l_root);
int find_line_end(int line_start, char text[][Size]); // iç içe for bulur
int add_variable_in_loop(char *veriable, int variable_line, variable_s *v_root, loop_s *loop_struct);
int find_loop_complexity(loop_s *l_root,int true);
#endif