aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2016-11-08 16:48:34 +0000
committerbloodstalker <thabogre@gmail.com>2016-11-08 16:48:34 +0000
commitbc8a21c92c42ca1219efaba49f30fa0062be0555 (patch)
tree0cdd9839f76452866a17b0ebc16bb01da487a26f
parentminor fixes to keep the root projectr folder cleaner after a build and run (diff)
downloadmutator-bc8a21c92c42ca1219efaba49f30fa0062be0555.tar.gz
mutator-bc8a21c92c42ca1219efaba49f30fa0062be0555.zip
the folder thats gonna contain some tools to ease the dev process. dumper dumps the AST.
-rwxr-xr-xextra-tools/dumper.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/extra-tools/dumper.sh b/extra-tools/dumper.sh
new file mode 100755
index 0000000..3efe7a3
--- /dev/null
+++ b/extra-tools/dumper.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+INPUT="./testFuncs1.c"
+OUTPUT="./dump"
+OPTIONS="--"
+RUN="1"
+
+while [[ $# -gt 0 ]]
+do
+ passarg="$1"
+
+ case $passarg in
+ -i|--input)
+ INPUT="$2"
+ shift
+ ;;
+ -o|--output)
+ OUTPUT="$2"
+ shift
+ ;;
+ -op|--options)
+ OPTIONS="$2"
+ shift
+ ;;
+ -h|--help)
+ echo "the script simply dumps the AST of the input."
+ echo "-i|--input the input file full path."
+ echo "-o|--output the output fule full path."
+ echo "-op|--options extra options to pass to clang"
+ echo "-h|--help prints out the help."
+ RUN="0"
+ ;;
+ *)
+ echo $1 is not a valid argument...
+ RUN="0"
+ shift
+ esac
+ shift
+done
+
+if [[ "$RUN" == "1" ]]; then
+ "/home/bloodstalker/llvm/llvm/build/bin/clang" -Xclang -ast-dump -fsyntax-only "$INPUT" "$OPTIONS" > "$OUTPUT"
+fi