Skip to content

Annotated CAST Part 5: Running the pipeline

jobagy edited this page May 20, 2022 · 5 revisions

Pipeline scripts

The scripts to run the pipeline or portions of the pipeline are in the following location:

automates/automates/scripts/program_analysis

C source to GrFN

To run the entire pipeline and generate the GrFN json and pdf files from a C source file, use the script run_gcc_to_grfn.py. This script has an optional flag that is used when generating GrFN 2.2. Below is an example of its use for GrFN 2.2:

python ~/Desktop/automates/automates/scripts/program_analysis/run_gcc_to_grfn.py --grfn_2_2 -p 
    /Users/username/Desktop/automates/automates/automates/program_analysis/gcc_plugin/plugin/ast_dump.so -Cg -i example.c

Note that the full pathname of the plugin must be provided.

For GrFN 2.3, leave off the --grfn_2_2 flag:

python ~/Desktop/automates/automates/scripts/program_analysis/run_gcc_to_grfn.py  -p 
    /Users/username/Desktop/automates/automates/automates/program_analysis/gcc_plugin/plugin/ast_dump.so -Cg -i example.c

Python source to CAST json

To generate the CAST json from a Python file, use the script python2cast.py. An example use is shown below:

python python2cast.py example.py

CAST json to GrFN

To run the pipeline on a CAST json file, use the script run_ann_cast_pipeline.py. An example use is shown below:

python run_ann_cast_pipeline.py --grfn_2_2 example--CAST.json

To generate GrFN 2.3, leave off the --grfn_2_2 flag as shown here:

python run_ann_cast_pipeline.py example--CAST.json

Clone this wiki locally