summaryrefslogtreecommitdiffstats
path: root/petascope/test/wcps_grammar.sh
diff options
context:
space:
mode:
Diffstat (limited to 'petascope/test/wcps_grammar.sh')
-rwxr-xr-xpetascope/test/wcps_grammar.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/petascope/test/wcps_grammar.sh b/petascope/test/wcps_grammar.sh
new file mode 100755
index 0000000..a93dc1d
--- /dev/null
+++ b/petascope/test/wcps_grammar.sh
@@ -0,0 +1,16 @@
+#! /bin/bash
+# Run the grammar CLI tool
+
+if [ $# != 1 ]; then
+ echo "WCPS Abstract Syntax Grammar Test Tool."
+ echo "Parses an abstract syntax query and transforms it into XML for WCPS. "
+ echo "Third parameter (String) is the query. "
+ echo ""
+ echo "Usage: ./grammar queryString"
+ echo "For example: ./grammar \"for c in (nir) return encode(c,\"png\") "
+ exit 1
+fi
+
+CLASSPATH=.:../lib/wcps-all.jar:../lib/jaxb-api.jar:../lib/jaxb-impl.jar:../lib/postgresql-8.3-604.jdbc4.jar:../lib/jsr173_api.jar:../lib/rasj.jar:../lib/commons-math-1.1.jar:../lib/antlrworks-1.2.3.jar
+
+java -cp $CLASSPATH wcps.server.cli.grammar "$1"