Index of /mct/2011-07-17

[ICO]NameLast modifiedSizeDescription

[DIR]Parent Directory  -
[DIR]bin.Linux_x86_64/20-Mar-2012 19:24 -
[   ]eval.c.id20-Mar-2012 19:24 42K
[   ] 19:24 30K
[   ]mct-Linux.tar.gz20-Mar-2012 19:24 3.3M
[DIR]result/20-Mar-2012 19:24 -
[DIR]scripts/20-Mar-2012 19:24 -
[DIR]source/20-Mar-2012 19:24 -

Frequently asked questions

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/api_clone_java.norm -o result/norm/Java/api_clone_java.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/api_clone_java.norm -o bin.*/Java/api_clone_javac
> 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?


> bin.*/Java/api_clone_javac source/Java/java/ -o result/Java/java/
> bin.*/Java/api_clone_javac source/Java/java/ -o result/Java/java/

Q. How to remove clones in the normalised examples?

Either use the original sources, e.g.,
> bin.*/Java/api_clone_javac source/Java/java/ -diff source/Java/java/ 

or use the normalised source:
> bin.*/Java/api_clone_javac result/Java/java/ -diff result/Java/java/ 

Q. How to count the number of clones removed ?

Turn on the -attr option, e.g.,
> bin.*/Java/api_clone_javac -attr source/Java/java/ -diff source/Java/java/ 

Q. How to compare the code with comments?

We use the "cc" tool to delegate the check differences with comments
> bin.*/Java/api_clone_javacc -attr source/Java/java/ -diff source/Java/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