Download this script to your home account and open it in your favourite editor.
Start up grok by simply typing
grokWe will cut and paste line by line from the script to this interactive grok session.
Download the following RSF factbase: rawFacts.rsf.
Write a grok script called ex1.grok that computes and outputs dependencies between files for this small system.
You can load an RSF factbase in grok with getdb rawFacts.rsf
Place the output in a file called ex1.out.rsf
Write a grok script called ex2.grok that does the following:
Test that your script works with tab2ps.ta as well.
Write a grok script called ex3.grok that adds a new attribute to every method called fullName. Its value is the name of the class containing the method, followed by a dot, followed by the method name.
The script should take two arguments: the input TA file, and the output TA file.
Write a grok script called ex4.grok that reads TA facts and outputs RSF containment facts between top-level directories and methods only, i.e. shows what top-level directory contains which method. For each method, output its fullName (calculated in Exercise 3).
The script should take two arguments: the input TA file, and the output RSF file.
Extend the ex2.grok script into one called ex5.grok that substitutes human readable names for all relations rather than just contain.
It should also take two arguments as above.
You can access grok's help by typing ? after you run grok. You can then select from a number of different sections.
Notice the second-last section in the TA documentation link called "Relations with special meanings". It pertains to how grok treats TA.