From: Method-level code clone detection through LWH (Light Weight Hybrid) approach
S.No | Equivalence category | Possible constructs | Proposed pattern |
---|---|---|---|
1 | Iterative equivalence | for | iteration |
while | <initial> | ||
do-while | <condition> | ||
 | <incre/decre> | ||
2 | Conditional equivalence | if | selection |
else | <condition> | ||
else-if | Â | ||
?: | Â | ||
switch | Â | ||
3 | Input equivalence | scanf | read <variable> |
system.in | Â | ||
input.readline | Â | ||
4 | Output equivalence | printf | write <variable> |
system.out | Â | ||
5 | Declaration equivalence | int | Multiple Declaration |
char | to Single line declaration | ||
float | Â | ||
double | Example | ||
string | int x | ||
 | int y | ||
Example | int z | ||
int x,y,z | char c | ||
char c,s | char s | ||
6 | Braces | { } | Braces are removed in the code |