Commit 49500e8a authored by Fred Eisele's avatar Fred Eisele
Browse files

restructuring directories

parent 89c874cb
apply plugin: 'java-library'
apply plugin: 'maven'
apply plugin: 'antlr'
apply plugin: 'idea'
apply plugin: 'eclipse'
group = 'net.catdata'
version = '0.9-SNAPSHOT-maven'
description = "Categorical Data IDE"
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
configurations.all {
}
generateGrammarSource {
maxHeapSize = "64m"
// arguments << "-lib" << "src/main/antlr/catdata/aql/grammer"
arguments << "-visitor" << "-listener"
arguments << "-long-messages"
}
repositories {
maven { url "https://nexus.isis.vanderbilt.edu/repository/maven-releases" }
maven { url "https://nexus.isis.vanderbilt.edu/repository/maven-snapshots" }
maven { url "http://repo.maven.apache.org/maven2" }
}
dependencies {
compile group: 'net.sourceforge.collections', name: 'collections-generic', version:'4.01'
compile group: 'org.apache.commons', name: 'commons-csv', version:'1.5'
compile group: 'org.apache.commons', name: 'commons-exec', version:'1.3'
compile group: 'org.apache.commons', name: 'commons-lang3', version:'3.7'
compile group: 'com.h2database', name: 'h2', version:'1.4.196'
compile group: 'org.glassfish', name: 'javax.json', version:'1.1.2'
compile group: 'jgraph', name: 'jgraph', version:'5.12.3.2'
compile group: 'org.jparsec', name: 'jparsec', version:'3.0'
compile group: 'net.sf.jung', name: 'jung-algorithms', version:'2.1.1'
compile group: 'net.sf.jung', name: 'jung-api', version:'2.1.1'
compile group: 'net.sf.jung', name: 'jung-graph-impl', version:'2.1.1'
compile group: 'net.sf.jung', name: 'jung-visualization', version:'2.1.1'
compile group: 'org.antlr', name: 'antlr4', version:'4.7'
compile group: 'com.opencsv', name: 'opencsv', version:'4.1'
compile group: 'com.fifesoft', name: 'autocomplete', version:'2.6.1'
compile group: 'com.fifesoft', name: 'rstaui', version:'2.6.1'
compile group: 'com.fifesoft', name: 'rsyntaxtextarea', version:'2.6.1'
compile group: 'es.nitaur.markdown', name: 'txtmark', version:'0.16'
antlr group: 'org.antlr', name: 'antlr4', version: '4.7'
testCompile group: 'junit', name: 'junit', version:'4.12'
}
package org.babeloff
class ReleaseVersionTask {
}
package org.babeloff
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.OutputFile
import org.gradle.api.tasks.TaskAction
class ReleaseVersionTask extends DefaultTask {
@Input Boolean release
@OutputFile File destFile
ReleaseVersionTask() {
group = 'versioning'
description = 'Makes project a release version.'
}
@TaskAction
void start() {
project.version.release = true
ant.propertyfile(file: destFile) {
entry(key: 'release', type: 'string', operation: '=', value: 'true')
}
}
}
generateGrammarSource {
maxHeapSize = "64m"
arguments += ["-visitor", "-listener", "-long-messages",
"-package", "catdata.aql.grammar",
"-grammar", "AqlParser.g4"]
}
\ No newline at end of file
#Fri, 07 Sep 2018 15:15:28 -0500
year=2018
month=9
day=10
release=false
#Wed Sep 05 08:42:09 CDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
......@@ -106,8 +106,8 @@
</manifest>
</archive>
<descriptors>
<descriptor>src/assembly/bin.xml</descriptor>
<descriptor>src/assembly/jar-with-deps.xml</descriptor>
<descriptor>src/main/java/assembly/bin.xml</descriptor>
<descriptor>src/main/java/assembly/jar-with-deps.xml</descriptor>
</descriptors>
</configuration>
<executions>
......@@ -142,6 +142,23 @@
</executions>
</plugin>
-->
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr4-maven-plugin</artifactId>
<version>4.7.1</version>
<executions>
<execution>
<id>antlr</id>
<goals>
<goal>antlr4</goal>
</goals>
<configuration>
<listener>true</listener>
<visitor>true</visitor>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
......
rootProject.name = 'fql'
The antlr4 files are build by running the
boot promote
from catdata/aql/grammar
Once the java files have been built eclipse needs to
know about them.
The easiest way is to make a symbolic link.
ln -s ../../../gen/catdata/aql/grammar/ ./src/catdata/aql/grammar
This will confuse maven though so the link needs to be removed before running
mvn package
/**
* A lexical grammar for Aql
*/
lexer grammar AqlLexerRules;
options
{
// superClass = 'LexerAdaptor' ;
}
// Common set of fragments
import LexBasic;
channels {
HIDDEN_CHANNEL,
WHITESPACE_CHANNEL,
BLOCK_COMMENT_CHANNEL,
LINE_COMMENT_CHANNEL,
DOC_COMMENT_CHANNEL
}
// ======================================================
// Lexer specification
//
// -------------------------
// Comments
DOC_COMMENT
: DocComment -> channel (DOC_COMMENT_CHANNEL)
;
BLOCK_COMMENT
: BlockComment -> channel (BLOCK_COMMENT_CHANNEL)
;
BLOCK_COMMMENT
: BlockComment -> channel(HIDDEN_CHANNEL)
;
LINE_COMMENT
: LineComment -> channel(HIDDEN_CHANNEL)
;
// -------------------------
// Integer
//
INTEGER
: DecimalNumeral
;
NUMBER
// 1.35, 1.35E-9, 0.3, -4.5
: '-'? DecimalNumeral Dot DecimalNumeral Exponent?
// 1e10 -3e4
| '-'? DecimalNumeral Exponent
// -3, 45
| '-'? DecimalNumeral
;
// -------------------------
// Literal string
//
// Aql makes no distinction between a single character
// literal and a multi-character string.
// All literals are single quote delimited and
// may contain unicode escape sequences of the form \uxxxx, where x
// is a valid hexadecimal number (per Unicode standard).
STRING_LITERAL
: SQuoteLiteral
;
UNTERMINATED_STRING_LITERAL
: USQuoteLiteral
;
CHAR : CharLiteral ;
STRING : DQuoteLiteral ;
MULTI_STRING : DQuote MultiLine DQuote ;
// -------------------------
// Keywords
//
// Keywords may not be used as labels for rules or in any other context where
// they would be ambiguous with the keyword vs some other identifier.
// Some blocks are handled idiomatically
// as island grammars in dedicated lexical modes.
HTML
: 'html' Ws* LDocQuote -> pushMode (Html)
;
MARKDOWN
: 'md' Ws* LDocQuote -> pushMode (MarkDown)
;
OPTIONS
: 'options' // -> pushMode (Options)
;
LITERAL : 'literal' ;
IMPORTS : 'imports' ;
FORALL : 'forall' ;
WHERE : 'where' ;
EXISTS : 'exists' ;
UNIQUE : 'unique' ;
GRAPH : 'graph' ;
NODES : 'nodes' ;
EDGES : 'edges' ;
INSTANCE : 'instance' ;
EMPTY : 'empty' ;
SRC : 'src' ;
DST : 'dst' ;
DISTINCT : 'distinct' ;
EVAL : 'eval' ;
COEVAL : 'coeval' ;
DELTA : 'delta' ;
SIGMA : 'sigma' ;
COPRODUCT_SIGMA : 'coproduct_sigma' ;
COPRODUCT : 'coproduct' ;
UNION : 'union' ;
COPRODUCT_UNRESTRICTED: 'coproduct_unrestricted' ;
COEQUALIZE : 'coequalize' ;
COLIMIT : 'colimit' ;
IMPORT_JDBC : 'import_jdbc' ;
QUOTIENT_JDBC : 'quotient_jdbc' ;
QUOTIENT_CSV : 'quotient_csv' ;
IMPORT_JDBC_ALL : 'import_jdbc_all' ;
IMPORT_CSV : 'import_csv' ;
STATIC_TYPING : 'static_typing' ;
QUOTIENT : 'quotient' ;
CHASE : 'chase' ;
RANDOM : 'random' ;
GENERATORS : 'generators' ;
EQUATIONS : 'equations' ;
MULTI_EQUATIONS : 'multi_equations' ;
RANDOM_SEED : 'random_seed' ;
ANONYMIZE : 'anonymize' ;
FROZEN : 'frozen' ;
PI : 'pi' ;
MAPPING : 'mapping' ;
IDENTITY : 'identity' ;
ENTITY : 'entity' ;
ENTITIES : 'entities' ;
FOREIGN_KEYS : 'foreign_keys' ;
ATTRIBUTES : 'attributes' ;
LAMBDA : 'lambda' ;
IMPORT_JOINED : 'import_joined' ;
MAP_NULLS_ARBITRARILY_UNSAFE : 'map_nulls_arbitrarily_unsafe' ;
INTERPRET_AS_ALGEGRA : 'interpret_as_algebra' ;
PREPEND_ENTITY_ON_IDS : 'prepend_entity_on_ids' ;
NUM_THREADS : 'num_threads' ;
TIMEOUT : 'timeout' ;
REQUIRE_CONSISTENCY : 'require_consistency' ;
SCHEMA_ONLY : 'schema_only' ;
ALLOW_JAVA_EQS_UNSAFE : 'allow_java_eqs_unsafe' ;
DONT_VALIDATE_UNSAFE : 'dont_validate_unsafe' ;
ALWAYS_RELOAD : 'always_reload' ;
CSV_FIELD_DELIM_CHAR : 'csv_field_delim_char' ;
CSV_ESCAPE_CHAR : 'csv_escape_char' ;
CSV_QUOTE_CHAR : 'csv_quote_char' ;
CSV_FILE_EXTENSION : 'csv_file_extension' ;
CSV_GENERATE_IDS : 'csv_generate_ids' ;
ID_COLUMN_NAME : 'id_column_name' ;
VARCHAR_LENGTH : 'varchar_length' ;
START_IDS_AT : 'start_ids_at' ;
IMPORT_AS_THEORY : 'import_as_theory' ;
JDBC_DEFAULT_CLASS : 'jdbc_default_class' ;
JDBC_DEFAULT_STRING : 'jdbc_default_string' ;
DONT_VERIFY_FOR_UNSAFE : 'dont_verify_is_appropriate_for_prover_unsafe' ;
PROVER : 'prover' ;
PROGRAM_ALLOW_NONTERM_UNSAFE : 'program_allow_nontermination_unsafe' ;
COMPLETION_PRECEDENCE : 'completion_precedence' ;
COMPLETION_SORT : 'completion_sort' ;
COMPLETION_COMPOSE : 'completion_compose' ;
COMPLETION_FILTER_SUBSUMED : 'completion_filter_subsumed' ;
COMPLETION_SYNTACTIC_AC : 'completion_syntactic_ac' ;
QUERY_COMPOSE_USE_INCOMPLETE : 'query_compose_use_incomplete' ;
GUI_MAX_TABLE_SIZE : 'gui_max_table_size' ;
GUI_MAX_GRAPH_SIZE : 'gui_max_graph_size' ;