Skip to content

amespi22/code_rewrite

Repository files navigation

    Copyright (C) 2022  Pemma Reiter and Antonio Espinoza, Center for Biocomputing, Security and Society at ASU

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

# README
The file, set_env.sh is only used if you need to re-generate the grammar files.

## If you need to regenerate the grammar files:
- Make sure to setup the environment
        - `source set_env.sh`
- Make the python files.
	- `antlr4 -Dlanguage=Python3 <GRAMMARFILE>`
- This all assumes that you have antlr4 properly installed.

## File Naming
- Please name your generated files `new_<filename>.c`.
- The .gitignore file will ignore all things named in this way.

## To run PREP evaluation on CodeFlaws:
- `source ./set_env.sh`
- Install the APR tools looking to evaluate with Codeflaws
- cd $CODE_EXPAND_PATH/prep-eval/Codeflaws
- `source ./setup.bash`  which
  1. Clones the Codeflaws dataset from git 
  2. Generates infrastructure to evaluate both original and PREP-enabled APR tool results
  3. Applies PREP-transforms to this dataset and tests each transform
  4. Copies baseline and PREP scripts for Codeflaws run and validation.
- To evaluate PREP on Codeflaws
  1. As a user, you need to install GenProg, f1x, and Prophet 
  2. And then manually update 'run-version*.sh' scripts to account for these tool paths in the `codeflaws_repo/all-script/` subdirectory
-