Updated documentation of preprocessing scripts and deleted comments.

This commit is contained in:
Tobias Reinhard 2022-12-31 09:55:39 -05:00
parent 1b0869dac0
commit 9df86117b8
3 changed files with 19 additions and 35 deletions

View file

@ -2,9 +2,12 @@
ps -o comm= -p $$ ps -o comm= -p $$
# This script expects the following command line arguments: # This script expects the following command line arguments:
# $1 : Absolute path to the root dir of this repository # $1 : Absolute path to the source file that should be prepared for VeriFast.
# $2 : Absolute path to the root of the directory containing the VeriFast proofs # $2 : Absolute path to which the result shall be written.
# $3 : Absolute path to the VeriFast directory # $3 : Absolute path under which preprocessor error shall be logged.
# $4 : Absolute path to the root dir of this repository
# $5 : Absolute path to the root of the directory containing the VeriFast proofs
# $6 : Absolute path to the VeriFast directory
SRC_FILE="$1" SRC_FILE="$1"
OUT_FILE="$2" OUT_FILE="$2"
@ -13,18 +16,6 @@ REPO_BASE_DIR="$4"
VF_PROOF_BASE_DIR="$5" VF_PROOF_BASE_DIR="$5"
VF_DIR="$6" VF_DIR="$6"
echo SRC_FILE
echo "$1"
echo OUT_FILE
echo "$2"
echo FILE_PP_ERR_LOG
echo "$3"
echo REPO_BASE_DIR
echo "$4"
echo VF_PROOF_BASE_DIR
echo "$5"
echo VF_DIR
echo "$6"
# Load functions used to compute paths. # Load functions used to compute paths.
. "$VF_PROOF_BASE_DIR/paths.sh" . "$VF_PROOF_BASE_DIR/paths.sh"

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# This script preprocesses an given source file annotated with VeriFast proof # This script preprocesses a given source file annotated with VeriFast proof
# steps. Include paths are configured to fit 'tasks.c', but it might also be # steps. Include paths are configured to fit 'tasks.c', but it might also be
# useful for other source files. The preprocessor is configured to include the # useful for other source files. The preprocessor is configured to include the
# proper proof files from VeriFast's standard library and to also include # proper proof files from VeriFast's standard library and to also include
@ -23,18 +23,6 @@ REPO_BASE_DIR="$4"
VF_PROOF_BASE_DIR="$5" VF_PROOF_BASE_DIR="$5"
VF_DIR="$6" VF_DIR="$6"
echo SRC_FILE
echo "$1"
echo OUT_FILE
echo "$2"
echo ERR_FILE
echo "$3"
echo REPO_BASE_DIR
echo "$4"
echo VF_PROOF_BASE_DIR
echo "$5"
echo VF_DIR
echo "$6"
# Load functions used to compute paths. # Load functions used to compute paths.

View file

@ -33,12 +33,18 @@ echo "Commenting out line/file pragmas"
rewrite "^#" "// &" rewrite "^#" "// &"
echo "Fixing order of 'long', 'unsigned'" echo "Fixing order of 'long', 'unsigned'"
echo "Reported issue 338:"
echo "https://github.com/verifast/verifast/issues/338"
rewrite "long unsigned int" "unsigned long int" rewrite "long unsigned int" "unsigned long int"
echo "Delete fixed-sized array typedefs" echo "Delete fixed-sized array typedefs"
echo "Reported issue 339:"
echo "https://github.com/verifast/verifast/issues/339"
rewrite "typedef .*\[[0-9]*\];" "" rewrite "typedef .*\[[0-9]*\];" ""
echo "Delete attributes" echo "Delete attributes"
echo "Reported issue 340:"
echo "https://github.com/verifast/verifast/issues/340"
rewrite "__attribute__(([_a-z]*))" "" rewrite "__attribute__(([_a-z]*))" ""
# Note: `\s` or `:space:` not work on MacOs. # Note: `\s` or `:space:` not work on MacOs.
rewrite "__attribute__( ( [_a-z]* ) )" "" rewrite "__attribute__( ( [_a-z]* ) )" ""
@ -57,4 +63,3 @@ rewrite "const [*]" "*"
echo "Uncomment special includes to allow VeriFast proofs to refer to config macros" echo "Uncomment special includes to allow VeriFast proofs to refer to config macros"
rewrite "//VF_include #include" "#include" rewrite "//VF_include #include" "#include"
rewrite "//VF_macro #" "#" rewrite "//VF_macro #" "#"