This repository holds the C/C++ source files that represent various features of each language.
CACTI (Compiler Analysis, Comparison & Testing Infrastructure) is a project being developed by four software-engineering students, for the Capstone Project curricular unit.
As the name suggests, CACTI wishes to study and compare the capabilities of different compilers, by collecting/creating several input C and C++ files that represent various functionalities of each language, and by defining and implementing tests for each transpiliation task (parsing, code generation, querying and transformation).
- Fábio Morais (202008052) - Faculty of Engineering, University of Porto, Portugal
- Francisco Prada (202004646) - Faculty of Engineering, University of Porto, Portugal
- Guilherme Sequeira (202004648) - Faculty of Engineering, University of Porto, Portugal
- Pedro Ramalho (202004715) - Faculty of Engineering, University of Porto, Portugal
- João Bispo - Faculty of Engineering, University of Porto, Portugal
- Luís Sousa - Faculty of Engineering, University of Porto, Portugal
Most of the scripts of this directory are inside the aux_scripts folder. They all support a "-h" flag for information on how to run them. Here is a compilation on how to run some of them:
Note: This tool was meant to be used strictly with the output of our CACTI tool.
$ python3 report.py [-h] -S SRC_PATH -T TRANSPILER
-S SRC_PATH
- specify the path to the directory where the generated outputs are-T TRANSPILER
- the name of the transpiler which is to be tested
Note: You may use this tool on your own tests, as long as the directory of tests adheres to our convention:
- The directory's direct descendents are all directories
- The first nested directories' names are standard names
- Inside those directories there aren't any other directories or files named after a standard
- The last nested directory contains a
src
file with the correct suffix (e.g..c
for C files). Ametadata.json
file may also be present with additional information about the test, although its structure must also equal our conventions. - The last nested directory's name is the test's name (e.g. bool/ for a test that tests bools)
$ python3 metadata_gen.py [-h] -S SRC_PATH
-S SRC_PATH
- specify the path to the directory where the tests currently are
$ python3 extract_keywords.py <directory_path>
<directory_path>
- define the directory to extract the keywords from
python3 extract_single_file_keywords.py <cpp_standard> <file_path>
<cpp_standard>
- specify from which standard are the desired keywords<file_path>
- identify the path of the file from which the keywords should be extracted
$ python3 graph.py [-h] -S SRC_PATH [-c] [-l] [-v] [-O OUTPUT_PATH] [-F FORMAT]
-S SRC_PATH
- path to the directory with the test files.-c
- print all the cycles found to standard output.-l
- print all the leaf nodes, that is, nodes with no dependencies.-v
- open a pop-up window that allows for a visual analysis of the graph.-O OUTPUT_PATH
- save an svg of the visual representation of the graph to a given directory.-F FORMAT
- Specify a file format to save the visual representation in. Must be supported by pyplot's savefig.
- cppreference - the source files in this repository were adapted from the example code available here.