-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.html
88 lines (60 loc) · 3.22 KB
/
README.html
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
<h1>Frequently asked questions</h1>
<pre>
Q. What are in the folder?
bin.* -- binaries
source -- source examples
source/norm -- user-defined normalisations
source/Java/java -- Java program examples
source/Verilog/v -- Verilog examples
result -- result of normalisations
result/norm -- normalisations transformed
result/Java/java -- normalised Java program examples
result/Verilog/verilog2 -- normalised Verilog examples
result/Verilog/v -- unparsed Verilog examples
grammar.txt -- the size related to the grammar transformations
jhotdraw.txt -- the size related to the jhotdraw experiments
gmf.txt -- the size related to the gmf experiments
cvs -- experiments on analysing the CVS of java projects
cvs/uart16650 -- UArt 16650 (Verilog)
cvs/jhotdraw -- JHotDraw (Java)
cvs/gmf -- GMF (Java)
scripts -- the high-level driving scripts of MCT
scripts/mct -- meaningful change detection
scripts/mct-mdsd -- meaningful change detection: comparing @generated NOT with @generated tags
scripts/mct-model -- meaningful change detection: extracting the @model members
scripts/mct-id -- meaningful change detection: extracting the identifiers
Q. How to define annotations?
Given a TXL grammar, enter the following annotations in the end of any
non-terminal rule [...]:
... [kept] [ordered by X] [ignored when Y] [preferred with Z]
where X is an optional user-defined ordering rule, Y is an optional
user-defined selection rule, and Z is one to many literal constants or a user-defined
function to be used to replace the term.
Q. How to generate normalisation transformations from the annotations?
First apply the `normc' to create the normalisation tools, e.g.,
> bin.*/normc source/norm/Java/simple.norm -o result/norm/Java/simple.norm
> bin.*/normc source/norm/Verilog/verilog2.norm -o result/norm/Verilog/verilog2.norm
> bin.*/norm-id-c source/norm/C/cid.norm -o result/norm/C/cid.norm
Then apply the following commands to generate the binary tools:
> bin.*/txlc result/norm/Java/simple.norm -o bin.*/Java/simple
> bin.*/txlc result/norm/Verilog/verilog2.norm -o bin.*/Verilog/verilog2c
> bin.*/txlc result/norm/C/cid.norm -o bin.*/C/cidc
Q. How to normalise the examples?
E.g.,
> bin.*/Java/simplec source/Java/java/HelloWorld.java -o result/Java/java/HelloWorld.java
> bin.*/Java/simplec source/Java/java/HelloWorld-2.java -o result/Java/java/HelloWorld-2.java
Q. How to remove clones in the normalised examples?
Either use the original sources, e.g.,
> bin.*/Java/simplec source/Java/java/HelloWorld.java -diff source/Java/java/HelloWorld-2.java
or use the normalised source:
> bin.*/Java/simplec result/Java/java/HelloWorld.java -diff result/Java/java/HelloWorld-2.java
Q. How to count the number of clones removed ?
Turn on the -attr option, e.g.,
> bin.*/Java/simplec -attr source/Java/java/HelloWorld.java -diff source/Java/java/HelloWorld-2.java
Q. How to compare the code with comments?
We use the "cc" tool to delegate the check differences with comments
> bin.*/Java/simplecc -attr source/Java/java/HelloWorld-2.java -diff source/Java/java/HelloWorld-3.java
Q. How to extract identifiers from any programs?
We use the "id" tool to extract the identifiers of any programs, e.g.,
> bin.*/C/cidc source/C/vim73/eval.c
</pre>